defuze.me
Client
|
Represent a track file with his tags, album cover and more. More...
#include <audiotrack.hpp>
Signals | |
void | removed (Library::AudioTrack *) |
Public Member Functions | |
AudioTrack (const QString &path, Source *source) | |
const QString & | getTitle () const |
const QString & | getArtist () const |
const QString & | getAlbumArtist () const |
const QString & | getAlbum () const |
const QString & | getGenre () const |
const QString & | getPath () const |
const QString | getAbsolutePath () const |
Returns the absolute file path (using source path + relative path) | |
int | getUid () const |
Unique track identifier. | |
int | getYear () const |
int | getTrack () const |
Get track number inside album. | |
int | getDuration () const |
Duration is in seconds. | |
const QVariant | getAttribute (const QString &name) const |
Fetch custom attribute by name. | |
Source * | getSource () const |
void | setSource (Source *source) |
void | setTitle (const QString &title) |
void | setArtist (const QString &artist) |
void | setAlbumArtist (const QString &albumArtist) |
void | setAlbum (const QString &album) |
void | setGenre (const QString &genre) |
void | setPath (const QString &path) |
void | setUid (int uid) |
void | setYear (int year) |
void | setTrack (int track) |
void | setDuration (int duration) |
void | setAttribute (const QString &name, const QVariant &value) |
bool | newRecord () const |
true if the track IS NOT currently saved in the library (going to be added) | |
bool | valid () const |
true if the track IS saved in the library | |
void | save () |
Save or update the track to library. | |
void | remove () |
Remove from library. | |
const QImage & | getAlbumArt () const |
Get the original album cover image (as stored) | |
const QPixmap & | getAlbumArtAtSize (int size) |
Generate, cache and serve a scaled version of the cover image. | |
const QImage & | getArtistArt () const |
Get the artist image. | |
const QPixmap & | getArtistArtAtSize (int size) |
Generate, cache and serve a scaled version of the artist image. | |
Static Public Member Functions | |
static AudioTrack * | getTrack (int id) |
Fetch & cache audiotracks. | |
static bool | isLoaded (int id) |
Check cache for audiotrack. | |
static void | loadAndCall (int id, QObject *obj, const char *slot) |
Asynchronously load the given track and call back the given slot after. | |
static const QMap< int, AudioTrack * > & | getTracksMap () |
Represent a track file with his tags, album cover and more.
AudioTrack must be fetched using the factory method: getTrack(int id)
Definition at line 34 of file audiotrack.hpp.