Miam-Player  0.8.0
A nice music player
FileHelper Class Reference

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 {
  UNKNOWN = -1, APE = 0, ASF = 1, FLAC = 2,
  MP4 = 4, MPC = 5, MP3 = 6, OGG = 7
}
 
enum  ExtensionType { Standard = 0x1, GameMusicEmu = 0x2, All = Standard | GameMusicEmu }
 
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
 
CoverextractCover ()
 
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 (ExtensionType et=Standard, bool withPrefix=false)
 

Detailed Description

The FileHelper class is used to extract various but relevant fields in all types of tags (MP3, Flac, etc).

Author
Matthieu Bachelier

Member Enumeration Documentation

Enumerator
UNKNOWN 
APE 
ASF 
FLAC 
MP4 
MPC 
MP3 
OGG 
Enumerator
Standard 
GameMusicEmu 
All 
Enumerator
Field_AbsPath 
Field_Album 
Field_Artist 
Field_ArtistAlbum 
Field_Comment 
Field_Cover 
Field_Disc 
Field_FileName 
Field_Genre 
Field_Title 
Field_Track 
Field_Year 
Enumerator
Artist 

Constructor & Destructor Documentation

FileHelper::FileHelper ( const QMediaContent &  track)
FileHelper::FileHelper ( const QString &  filePath)
FileHelper::~FileHelper ( )
virtual

Member Function Documentation

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.

TagLib::File* FileHelper::file ( )
inline
QFileInfo FileHelper::fileInfo ( ) const
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.

std::string FileHelper::keyToStdString ( Field  f)
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.

const QStringList FileHelper::suffixes ( ExtensionType  et = Standard,
bool  withPrefix = false 
)
static
QString FileHelper::title ( ) const
QString FileHelper::trackNumber ( ) const
QString FileHelper::year ( ) const

The documentation for this class was generated from the following files: