lastfm::Artist lastfm::Track::albumArtist( Corrections corrected ) const { if ( corrected == Corrected && !d->correctedAlbumArtist.isEmpty() ) return Artist( d->correctedAlbumArtist ); return Artist( d->albumArtist ); }
status_t CDDBData::Load() { // This uses the default R5 path BPath path; if (find_directory(B_USER_DIRECTORY, &path, true) != B_OK) return B_ERROR; path.Append("cd"); create_directory(path.Path(), 0755); BString filename(path.Path()); filename << "/" << Artist() << " - " << Album(); if (filename.Compare("Artist") == 0) filename << "." << DiscID(); BEntry entry(filename.String()); if (entry.InitCheck() != B_OK) return entry.InitCheck(); entry_ref ref; entry.GetRef(&ref); return Load(ref); }
std::vector<Artist> Connection::get_artists(){ if(artists.empty()){ std::vector<std::string> ret = execute_and_return("list artist"); for(int i=0; i<ret.size()-1; i++) artists.push_back(Artist(this, ret[i].substr(8).c_str())); } return artists; } // Tested
std::string Song::ToCueString() const { auto oss = std::ostringstream(); oss << "TRACK "<< Number() << " AUDIO" << std::endl << "TITLE \"" << Title() << "\"" << std::endl << "PERFORMER \"" << Artist() << "\"" << std::endl << "INDEX 01 " << Hour()*60 + Minute() << ':' << Second() << ":00"; return oss.str(); }
ArtistList ArtistBrowse::similarArtists() const { int count = similarArtistCount(); ArtistList list; for (int i = 0; i < count; ++i) list << Artist(sp_artistbrowse_similar_artist(handle(), i)); return list; }
ProfileArtistWidget::ProfileArtistWidget( const lastfm::XmlQuery& artist, int maxPlays, QWidget* parent) :QFrame( parent ) { QHBoxLayout* layout = new QHBoxLayout( this ); layout->setContentsMargins( 0, 0, 0, 0 ); layout->setSpacing( 0 ); HttpImageWidget* artistImage = new HttpImageWidget( this ); layout->addWidget( artistImage ); artistImage->setObjectName( "artistImage" ); QRegExp re( "/serve/(\\d*)s?/" ); artistImage->loadUrl( artist["image size=medium"].text().replace( re, "/serve/\\1s/" ), HttpImageWidget::ScaleNone ); artistImage->setHref( artist["url"].text() ); QVBoxLayout* vl = new QVBoxLayout(); vl->setContentsMargins( 0, 0, 0, 0 ); vl->setSpacing( 6 ); layout->addLayout( vl, 1 ); QHBoxLayout * hl = new QHBoxLayout(); hl->setContentsMargins( 0, 0, 0, 0 ); hl->setSpacing( 0 ); unicorn::Label* artistName = new unicorn::Label( this ); artistName->setTextFormat( Qt::RichText ); artistName->setText( unicorn::Label::boldLinkStyle( unicorn::Label::anchor( artist["url"].text(), artist["name"].text() ), Qt::black ) ); hl->addWidget( artistName, 1 ); artistName->setObjectName( "artistName" ); PlayableItemWidget* radio = new PlayableItemWidget( RadioStation::similar( Artist( artist["name"].text() ) ), tr( "%1 Radio" ).arg( artist["name"].text() ) ); hl->addWidget( radio ); radio->setObjectName( "radio" ); vl->addLayout( hl ); int playcount = artist["playcount"].text().toInt(); PlaysLabel* plays = new PlaysLabel( tr( playcount == 1 ? "%L1 play" : "%L1 plays" ).arg( playcount ), playcount, maxPlays, this ); vl->addWidget( plays ); plays->setObjectName( "plays" ); vl->addStretch(); }
status_t CDDBData::Save() { // This uses the default R5 path BPath path; if (find_directory(B_USER_DIRECTORY, &path, true) != B_OK) return B_ERROR; path.Append("cd"); create_directory(path.Path(), 0755); BString filename(path.Path()); filename << "/" << Artist() << " - " << Album(); if (filename.Compare("Artist")==0) filename << "." << DiscID(); return Save(filename.String()); }
int Metadata::compare(const Metadata *other) const { if (m_format == "cast") { int artist_cmp = Artist().toLower().localeAwareCompare( other->Artist().toLower()); if (artist_cmp == 0) return Title().toLower().localeAwareCompare( other->Title().toLower()); return artist_cmp; } else { int track_cmp = Track() - other->Track(); if (track_cmp == 0) return Title().toLower().localeAwareCompare( other->Title().toLower()); return track_cmp; } }
Artist Search::artistAt(int index) const { return isValid() ? Artist(sp_search_artist(handle(), index)) : Artist(); }
Album::~Album() { this->artist=Artist(); }
Artist ArtistBrowse::artist() const { return isValid() ? Artist(sp_artistbrowse_artist(handle())) : Artist(); }
Artist ArtistBrowse::similarArtistAt(int index) const { return isValid() ? Artist(sp_artistbrowse_similar_artist(handle(), index)) : Artist(); }