Sayonara Player
Classes | Public Types | Public Member Functions | List of all members
LastFM::ArtistMatch Class Reference

Classes

struct  ArtistDesc
 

Public Types

enum  Quality : uint8_t {
  Poor = 0,
  Well = 1,
  Very_Good = 2
}
 The Quality enum used to access the bin of interest. See ArtistMatch::get(Quality q)
 

Public Member Functions

 ArtistMatch (const QString &artist_name)
 
 ArtistMatch (const ArtistMatch &other)
 
bool is_valid () const
 checks, if structure is valid. More...
 
bool operator== (const ArtistMatch &am) const
 Compares two ArtistMatch structures. More...
 
ArtistMatchoperator= (const ArtistMatch &other)
 
void add (const ArtistDesc &artist, double match)
 adds an artist string to the corresponding bin More...
 
QMap< ArtistDesc, double > get (Quality q) const
 get bin by quality More...
 
QString get_artist_name () const
 get the corresponding artist name of the ArtistMatch structure More...
 
QString to_string () const
 converts the artist match to string More...
 

Member Function Documentation

◆ add()

void LastFM::ArtistMatch::add ( const ArtistDesc artist,
double  match 
)

adds an artist string to the corresponding bin

Parameters
artistartist string
matchthe match value

◆ get()

QMap<ArtistDesc, double> LastFM::ArtistMatch::get ( Quality  q) const

get bin by quality

Parameters
qquality. See ArtistMatch::Quality
Returns
the desired bin

◆ get_artist_name()

QString LastFM::ArtistMatch::get_artist_name ( ) const

get the corresponding artist name of the ArtistMatch structure

Returns
artist name

◆ is_valid()

bool LastFM::ArtistMatch::is_valid ( ) const

checks, if structure is valid.

Returns
false, if all bins are empty. True else

◆ operator==()

bool LastFM::ArtistMatch::operator== ( const ArtistMatch am) const

Compares two ArtistMatch structures.

Parameters
amthe other ArtistMatch
Returns
true, if the artist string is the same. False else

◆ to_string()

QString LastFM::ArtistMatch::to_string ( ) const

converts the artist match to string

Returns
string representation