本文整理汇总了C++中lastfm::Track类的典型用法代码示例。如果您正苦于以下问题:C++ Track类的具体用法?C++ Track怎么用?C++ Track使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Track类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: foreach
bool
ScrobbleService::isDirExcluded( const lastfm::Track& track )
{
if ( track.source() == lastfm::Track::LastFmRadio )
return false;
QString pathToTest = track.url().toLocalFile();
#ifdef Q_OS_WIN
pathToTest = pathToTest.toLower();
#endif
if ( pathToTest.isEmpty() )
return false;
unicorn::UserSettings us;
QStringList exculsionDirs = us.value( "ExclusionDirs" ).toStringList();
foreach ( QString bannedPath, exculsionDirs )
{
bannedPath = QDir( bannedPath ).absolutePath();
#ifdef Q_OS_WIN
bannedPath = bannedPath.toLower();
#endif
qDebug() << pathToTest << bannedPath;
// Try and match start of given path with banned dir
if ( pathToTest.startsWith( bannedPath ) )
{
// Found, this path is from a banned dir
return true;
}
}
示例2: printCorrected
void
ScrobblerAdapter::announceTrackCorrections( const lastfm::Track &track )
{
static const lastfm::Track::Corrections orig = lastfm::Track::Original;
static const lastfm::Track::Corrections correct = lastfm::Track::Corrected;
QString trackName = i18nc( "%1 is artist, %2 is title", "%1 - %2",
track.artist().name(), track.title() );
QStringList lines;
lines << i18n( "Last.fm suggests that some tags of track <b>%1</b> should be "
"corrected:", trackName );
QString line;
line = printCorrected( Meta::valTitle, track.title( orig ), track.title( correct ) );
if( !line.isEmpty() )
lines << line;
line = printCorrected( Meta::valAlbum, track.album( orig ), track.album( correct ) );
if( !line.isEmpty() )
lines << line;
line = printCorrected( Meta::valArtist, track.artist( orig ), track.artist( correct ) );
if( !line.isEmpty() )
lines << line;
line = printCorrected( Meta::valAlbumArtist, track.albumArtist( orig ), track.albumArtist( correct ) );
if( !line.isEmpty() )
lines << line;
Amarok::Components::logger()->longMessage( lines.join( "<br>" ) );
}
示例3: UserSettings
bool
ScrobbleService::scrobblableTrack( const lastfm::Track& track ) const
{
return unicorn::UserSettings().value( "scrobblingOn", true ).toBool()
&& track.extra( "playerId" ) != "spt"
&& !track.artist().isNull()
&& ( unicorn::UserSettings().value( "podcasts", true ).toBool() || !track.isPodcast() )
&& !track.isVideo();
}
示例4: InitFromLastFM
void Song::InitFromLastFM(const lastfm::Track& track) {
d->valid_ = true;
d->filetype_ = Type_Stream;
d->title_ = track.title();
d->album_ = track.album();
d->artist_ = track.artist();
d->track_ = track.trackNumber();
set_length_nanosec(track.duration() * kNsecPerSec);
}
示例5: mt
void
TrackWidget::update( const lastfm::Track& track )
{
// we're getting an update from a track fetched from user.getRecentTracks
MutableTrack mt( m_track );
mt.setScrobbleStatus( Track::Submitted ); // it's definitely been scrobbled
mt.setLoved( track.isLoved() ); // make sure the love state is consistent with Last.fm
}
示例6: onTrackSpooled
void MainWindow::onTrackSpooled(const lastfm::Track& track)
{
setWindowTitle(m_radio.station().rql());
ui->trackProgress->setMinimum(0);
ui->trackProgress->setMaximum(track.duration());
ui->album->setText(track.album());
ui->artist->setText(track.artist());
ui->title->setText(track.title());
m_trackGetInfoReply = track.getInfo();
connect(m_trackGetInfoReply, SIGNAL(finished()), SLOT(onGetInfoFinished()));
// send the now playing and cache the track so it can be submitted later
m_scrobSocket->start(track);
}
示例7: EmitTrack
void LastFmRadioStation::EmitTrack (const lastfm::Track& track)
{
qDebug () << Q_FUNC_INFO << track.url ();
const Media::AudioInfo info =
{
track.artist (),
track.album (),
track.title (),
QStringList (),
static_cast<qint32> (track.duration () / 1000),
0,
static_cast<qint32> (track.trackNumber ()),
QVariantMap ()
};
emit gotNewStream (track.url (), info);
}
示例8: disconnect
void
TrackWidget::setTrack( lastfm::Track& track )
{
disconnect( m_track.signalProxy(), 0, this, 0 );
m_track = track;
connect( m_track.signalProxy(), SIGNAL(loveToggled(bool)), SLOT(onLoveToggled(bool)) );
connect( m_track.signalProxy(), SIGNAL(scrobbleStatusChanged(short)), SLOT(onScrobbleStatusChanged()));
connect( m_track.signalProxy(), SIGNAL(corrected(QString)), SLOT(onCorrected(QString)));
m_movie->stop();
ui->equaliser->hide();
setTrackDetails();
ui->albumArt->setPixmap( QPixmap( ":/meta_album_no_art.png" ) );
ui->albumArt->setHref( track.www() );
m_triedFetchAlbumArt = false;
fetchAlbumArt();
}
示例9: qHash
uint qHash(const lastfm::Track& track) {
return qHash(track.title()) ^
qHash(track.artist().name()) ^
qHash(track.album().title());
}