![]() |
Sayonara Player
|
The CoverLocation class. More...
#include <CoverLocation.h>
Public Member Functions | |
Location () | |
Default constructor. Creates an invalid Location with the Sayonara logo as cover. | |
Location (const Location &cl) | |
Location & | operator= (const Location &cl) |
bool | isValid () const |
returns if the current location is a valid or a standard constructed location More... | |
QString | hashPath () const |
Returns the standard cover path in the .Sayonara directory. More... | |
QString | identifer () const |
This identifier may be used in order to check how the cover algorithm determined the locations. More... | |
QList< Fetcher::Url > | searchUrls () const |
Retrieve the urls where a new cover can be searched. More... | |
bool | hasSearchUrls () const |
Check for existing search urls. More... | |
QString | searchTerm () const |
Search term for a free search. As a human you would type that search term into your browser. More... | |
void | setSearchTerm (const QString &searchTerm) |
Set a new search term. More... | |
void | setSearchTerm (const QString &searchTerm, const QString &coverFetcherIdentifier) |
Set a new search term for a specific cover fetcher Cover fetcher strings can be found in the Cover::Fetcher::Base implementations by calling Cover::Fetcher::Base::identifier() More... | |
void | setSearchUrls (const QList< Fetcher::Url > &urls) |
Set urls where to look for Covers in the internet. More... | |
void | enableFreetextSearch (bool b) |
When enabling freetext search you specify the search string yourself and it is not generated automatically as usually. Usually, search APIs of a provider have special reserved fields for albums and artist which are populated automatically by Sayonara. More... | |
QString | toString () const |
to_string More... | |
QString | hash () const |
Every combination of album and artist will result in a specific hash. You can find those hashes in the database, for example. More... | |
bool | hasAudioFileSource () const |
Indicates if it is possible to fetch the cover directly from the audio file. If you call this method very often for albums this may end up in poor performance. More... | |
QString | audioFileSource () const |
Returns the path to the music file where a cover is stored. You can extract the cover by using Tagging::Covers::extract_cover. More... | |
QString | audioFileTarget () const |
When retrieving the audio_file_source, and you want to save it afterwards, store it at the place returned by this method. So Cover::Lookup will find it. Also see hash() More... | |
QString | localPathDir () const |
Calculates the directory where the cover is located. More... | |
QStringList | localPathHints () const |
Get the paths audio file where a cover is stored in the same directory. More... | |
QString | localPath () const |
Get the path which is nearest to the audio files. Repair/Create a link in the Sayonara cover directory This method does I/O work so handle with care. More... | |
QString | preferredPath () const |
Use this to retrieve a filepath where a copy of the cover is stored. More... | |
QString | alternativePath () const |
Static Public Member Functions | |
static Location | coverLocation (const QString &albumName, const QString &artistName) |
creates CoverLocation by taking the md5 sum between albumName and artistName More... | |
static Location | coverLocation (const QString &albumName, const QStringList &artists) |
overloaded. Picks major artist out of artists and calls coverLocation(const QString& albumName, const QString& artistName) More... | |
static Location | xcoverLocation (const Album &album) |
overloaded. Calls coverLocation(const QString& albumName, const QStringList& artists) More... | |
static Location | coverLocation (const QString &artist) |
Creates cover token of the form artist_<md5sum of artist> More... | |
static Location | coverLocationRadio (const QString &radioStation) |
static Location | coverLocation (const Artist &artist) |
overloaded. extracts artist name and calls coverLocation(const QString& artist) More... | |
static Location | coverLocation (const MetaData &md) |
overloaded. if MetaData::albumId < 0 calls coverLocation(const QString& albumName, const QString& artistName) else extract Album from database and calls coverLocation(const Album& album) More... | |
static Location | coverLocation (const MetaData &md, bool checkForCoverart) |
static Location | coverLocation (const QList< QUrl > &urls, const QString &token) |
fetch a cover from a specific url More... | |
static QString | invalidPath () |
static Location | invalidLocation () |
returns an invalid location More... | |
The CoverLocation class.
QString Cover::Location::audioFileSource | ( | ) | const |
Returns the path to the music file where a cover is stored. You can extract the cover by using Tagging::Covers::extract_cover.
QString Cover::Location::audioFileTarget | ( | ) | const |
When retrieving the audio_file_source, and you want to save it afterwards, store it at the place returned by this method. So Cover::Lookup will find it. Also see hash()
overloaded. extracts artist name and calls coverLocation(const QString& artist)
artist | Artist object |
overloaded. if MetaData::albumId < 0 calls coverLocation(const QString& albumName, const QString& artistName) else extract Album from database and calls coverLocation(const Album& album)
Metadata | object |
|
static |
fetch a cover from a specific url
url | url, the cover has to be fetched from |
targetPath | path where the found image has to be saved |
|
static |
|
static |
overloaded. Picks major artist out of artists and calls coverLocation(const QString& albumName, const QString& artistName)
albumName | Album name |
artists | List of artists |
|
static |
Creates cover token of the form artist_<md5sum of artist>
artist | Artist name |
void Cover::Location::enableFreetextSearch | ( | bool | b | ) |
When enabling freetext search you specify the search string yourself and it is not generated automatically as usually. Usually, search APIs of a provider have special reserved fields for albums and artist which are populated automatically by Sayonara.
b |
bool Cover::Location::hasAudioFileSource | ( | ) | const |
Indicates if it is possible to fetch the cover directly from the audio file. If you call this method very often for albums this may end up in poor performance.
QString Cover::Location::hash | ( | ) | const |
Every combination of album and artist will result in a specific hash. You can find those hashes in the database, for example.
QString Cover::Location::hashPath | ( | ) | const |
Returns the standard cover path in the .Sayonara directory.
bool Cover::Location::hasSearchUrls | ( | ) | const |
Check for existing search urls.
QString Cover::Location::identifer | ( | ) | const |
This identifier may be used in order to check how the cover algorithm determined the locations.
|
static |
returns an invalid location
bool Cover::Location::isValid | ( | ) | const |
returns if the current location is a valid or a standard constructed location
QString Cover::Location::localPath | ( | ) | const |
Get the path which is nearest to the audio files.
Repair/Create a link in the Sayonara cover directory This method does I/O work so handle with care.
QString Cover::Location::localPathDir | ( | ) | const |
Calculates the directory where the cover is located.
QStringList Cover::Location::localPathHints | ( | ) | const |
Get the paths audio file where a cover is stored in the same directory.
QString Cover::Location::preferredPath | ( | ) | const |
Use this to retrieve a filepath where a copy of the cover is stored.
QString Cover::Location::searchTerm | ( | ) | const |
Search term for a free search. As a human you would type that search term into your browser.
QList<Fetcher::Url> Cover::Location::searchUrls | ( | ) | const |
Retrieve the urls where a new cover can be searched.
void Cover::Location::setSearchTerm | ( | const QString & | searchTerm | ) |
Set a new search term.
search_term |
void Cover::Location::setSearchTerm | ( | const QString & | searchTerm, |
const QString & | coverFetcherIdentifier | ||
) |
Set a new search term for a specific cover fetcher Cover fetcher strings can be found in the Cover::Fetcher::Base implementations by calling Cover::Fetcher::Base::identifier()
search_term | A searchterm suitable for the specific Cover::Fetcher::Base. For example "Master of puppets Metallica" |
cover_fetcher_identifier |
void Cover::Location::setSearchUrls | ( | const QList< Fetcher::Url > & | urls | ) |
Set urls where to look for Covers in the internet.
urls |
QString Cover::Location::toString | ( | ) | const |
to_string
overloaded. Calls coverLocation(const QString& albumName, const QStringList& artists)
album |