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 sig_started ()
 
void sig_finished ()
 
void sig_progress (int)
 
void sig_metadata_received (const MetaDataList &v_md)
 

Public Member Functions

 Editor (QObject *parent=nullptr)
 
 Editor (const MetaDataList &v_md, QObject *parent=nullptr)
 
void undo (int idx)
 undo changes for a specific track More...
 
void undo_all ()
 undo changes for all tracks
 
const MetaDatametadata (int idx) const
 get the (changed) metadata for a specific index More...
 
const MetaDataListmetadata () const
 get all (changed) metadata More...
 
bool apply_regex (const QString &regex, int idx)
 
void add_genre (int idx, const Genre &genre)
 Add a genre to all (changed) metdata. More...
 
void delete_genre (int idx, const Genre &genre)
 
void rename_genre (int idx, const Genre &genre, const Genre &new_genre)
 
int count () const
 gets the number of tracks More...
 
bool has_changes () const
 indicates if there are pending changes
 
void update_track (int idx, const MetaData &md)
 writes changes to (changed) metadata for a specific track More...
 
void update_cover (int idx, const QPixmap &cover)
 update the cover for a specific track. More...
 
bool has_cover_replacement (int idx) const
 remove_cover for a specific track More...
 
void set_metadata (const MetaDataList &v_md)
 initializes the TagEdit object with a MetaDataList More...
 
bool is_cover_supported (int idx) const
 
bool can_load_entire_album () const
 
void load_entire_album ()
 
QMap< QString, FailReason > failed_files () 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

◆ add_genre()

void Tagging::Editor::add_genre ( 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

◆ has_cover_replacement()

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

remove_cover for a specific track

Parameters
idxtrack index does the user want to replace/add a cover
idxtrack index
Returns
false, if no new alternative cover is desired

◆ metadata() [1/2]

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

get the (changed) metadata for a specific index

Parameters
idxtrack index
Returns
MetaData object

◆ metadata() [2/2]

const MetaDataList& Tagging::Editor::metadata ( ) const

get all (changed) metadata

Returns
MetaDataList object

◆ set_metadata()

void Tagging::Editor::set_metadata ( const MetaDataList v_md)

initializes the TagEdit object with a MetaDataList

Parameters
v_mdnew MetaDataList

◆ undo()

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

undo changes for a specific track

Parameters
idxtrack index

◆ update_cover()

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

update the cover for a specific track.

Parameters
idxtrack index
covernew cover image

◆ update_track()

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

writes changes to (changed) metadata for a specific track

Parameters
idxtrack index
mdnew MetaData replacing the old track