Sayonara Player
Public Types | Public Slots | Signals | Public Member Functions | List of all members
Tagging::Editor Class Reference

The TagEdit class Metadata has to be added using the set_metadata(const MetaDataList&) method. Use update_track(int idx, const MetaData& md) to stage the changes you made to the track. commit() starts the thread and writes changes to HDD and the database. When finished the finished() signal is emitted. More...

#include <Editor.h>

Inheritance diagram for Tagging::Editor:

Public Types

enum  FailReason {
  FileNotWriteable =1,
  FileNotFound,
  TagLibError
}
 

Public Slots

void commit ()
 Commits changes to db.
 

Signals

void sigStarted ()
 
void sigFinished ()
 
void sigProgress (int)
 
void sigMetadataReceived (const MetaDataList &tracks)
 

Public Member Functions

 Editor (QObject *parent=nullptr)
 
 Editor (const MetaDataList &tracks, QObject *parent=nullptr)
 
void undo (int idx)
 undo changes for a specific track More...
 
void undoAll ()
 undo changes for all tracks
 
MetaData metadata (int idx) const
 get the (changed) metadata for a specific index More...
 
MetaDataList metadata () const
 get all (changed) metadata More...
 
bool applyRegularExpression (const QString &regex, int idx)
 
void addGenre (int idx, const Genre &genre)
 Add a genre to all (changed) metdata. More...
 
void deleteGenre (int idx, const Genre &genre)
 
void renameGenre (int idx, const Genre &genre, const Genre &new_genre)
 
int count () const
 gets the number of tracks More...
 
bool hasChanges () const
 indicates if there are pending changes
 
void updateTrack (int idx, const MetaData &md)
 writes changes to (changed) metadata for a specific track More...
 
void updateCover (int idx, const QPixmap &cover)
 update the cover for a specific track. More...
 
bool hasCoverReplacement (int idx) const
 remove_cover for a specific track More...
 
void setMetadata (const MetaDataList &tracks)
 initializes the TagEdit object with a MetaDataList More...
 
bool isCoverSupported (int idx) const
 
bool canLoadEntireAlbum () const
 
void loadEntireAlbum ()
 
QMap< QString, FailReason > failedFiles () const
 

Detailed Description

The TagEdit class Metadata has to be added using the set_metadata(const MetaDataList&) method. Use update_track(int idx, const MetaData& md) to stage the changes you made to the track. commit() starts the thread and writes changes to HDD and the database. When finished the finished() signal is emitted.

Member Function Documentation

◆ addGenre()

void Tagging::Editor::addGenre ( int  idx,
const Genre genre 
)

Add a genre to all (changed) metdata.

Parameters
genrethe genre name

◆ count()

int Tagging::Editor::count ( ) const

gets the number of tracks

Returns
number of tracks

◆ hasCoverReplacement()

bool Tagging::Editor::hasCoverReplacement ( int  idx) const

remove_cover for a specific track

Parameters
idxtrack index

does the user want to replace/add a cover

Parameters
idxtrack index
Returns
false, if no new alternative cover is desired

◆ metadata() [1/2]

MetaDataList Tagging::Editor::metadata ( ) const

get all (changed) metadata

Returns
MetaDataList object

◆ metadata() [2/2]

MetaData Tagging::Editor::metadata ( int  idx) const

get the (changed) metadata for a specific index

Parameters
idxtrack index
Returns
MetaData object

◆ setMetadata()

void Tagging::Editor::setMetadata ( const MetaDataList tracks)

initializes the TagEdit object with a MetaDataList

Parameters
tracksnew MetaDataList

◆ undo()

void Tagging::Editor::undo ( int  idx)

undo changes for a specific track

Parameters
idxtrack index

◆ updateCover()

void Tagging::Editor::updateCover ( int  idx,
const QPixmap &  cover 
)

update the cover for a specific track.

Parameters
idxtrack index
covernew cover image

◆ updateTrack()

void Tagging::Editor::updateTrack ( int  idx,
const MetaData md 
)

writes changes to (changed) metadata for a specific track

Parameters
idxtrack index
mdnew MetaData replacing the old track