![]() |
Miam-Player
0.8.0
A nice music player
|
The FileHelper class is used to extract various but relevant fields in all types of tags (MP3, Flac, etc). More...
#include <filehelper.h>
Public Types | |
enum | Extension { EXT_APE = 0, EXT_ASF = 1, EXT_FLAC = 2, EXT_MP4 = 4, EXT_MPC = 5, EXT_MP3 = 6, EXT_OGG = 7, EXT_UNKNOWN = -1 } |
enum | ExtensionType { ET_Standard = 0x001, ET_GameMusicEmu = 0x002, ET_Playlist = 0x004, ET_All = ET_Standard | ET_GameMusicEmu | ET_Playlist } |
enum | TagKey { Artist } |
enum | Field { Field_AbsPath = 1, Field_Album = 2, Field_Artist = 3, Field_ArtistAlbum = 4, Field_Comment = 5, Field_Cover = 6, Field_Disc = 7, Field_FileName = 8, Field_Genre = 9, Field_Title = 10, Field_Track = 11, Field_Year = 12 } |
Public Member Functions | |
FileHelper (const QMediaContent &track) | |
FileHelper (const QString &filePath) | |
virtual | ~FileHelper () |
QString | artistAlbum () const |
void | setArtistAlbum (const QString &artistAlbum) |
int | discNumber (bool canBeZero=false) const |
Cover * | extractCover () |
bool | insert (Field key, const QVariant &value) |
bool | hasCover () const |
int | rating () const |
void | setCover (Cover *cover) |
void | setDiscNumber (const QString &disc) |
void | setRating (int rating) |
bool | isValid () const |
Facade. More... | |
QString | title () const |
QString | trackNumber () const |
QString | album () const |
QString | length () const |
QString | artist () const |
QString | year () const |
QString | genre () const |
QString | comment () const |
bool | save () |
QFileInfo | fileInfo () const |
TagLib::File * | file () |
Static Public Member Functions | |
static std::string | keyToStdString (Field f) |
static const QStringList | suffixes (FileHelper::ExtensionTypes et=FileHelper::ET_Standard, bool withPrefix=false) |
The FileHelper class is used to extract various but relevant fields in all types of tags (MP3, Flac, etc).
enum FileHelper::Field |
enum FileHelper::TagKey |
|
explicit |
|
explicit |
|
virtual |
QString FileHelper::album | ( | ) | const |
QString FileHelper::artist | ( | ) | const |
QString FileHelper::artistAlbum | ( | ) | const |
Field ArtistAlbum if exists (in a compilation for example).
QString FileHelper::comment | ( | ) | const |
int FileHelper::discNumber | ( | bool | canBeZero = false | ) | const |
Extract field disc number.
Cover * FileHelper::extractCover | ( | ) |
Extract the inner picture if exists.
|
inline |
|
inline |
QString FileHelper::genre | ( | ) | const |
bool FileHelper::hasCover | ( | ) | const |
Check if file has an inner picture.
bool FileHelper::insert | ( | Field | key, |
const QVariant & | value | ||
) |
bool FileHelper::isValid | ( | ) | const |
Facade.
|
static |
QString FileHelper::length | ( | ) | const |
int FileHelper::rating | ( | ) | const |
Convert the existing rating number into a smaller range from 1 to 5.
TODO other types?
bool FileHelper::save | ( | ) |
void FileHelper::setArtistAlbum | ( | const QString & | artistAlbum | ) |
void FileHelper::setCover | ( | Cover * | cover | ) |
Sets the inner picture.
void FileHelper::setDiscNumber | ( | const QString & | disc | ) |
Set or remove any disc number.
void FileHelper::setRating | ( | int | rating | ) |
Set or remove any rating.
|
static |
QString FileHelper::title | ( | ) | const |
QString FileHelper::trackNumber | ( | ) | const |
QString FileHelper::year | ( | ) | const |