本文整理汇总了C++中tomahawk::playlistinterface_ptr::isNull方法的典型用法代码示例。如果您正苦于以下问题:C++ playlistinterface_ptr::isNull方法的具体用法?C++ playlistinterface_ptr::isNull怎么用?C++ playlistinterface_ptr::isNull使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tomahawk::playlistinterface_ptr
的用法示例。
在下文中一共展示了playlistinterface_ptr::isNull方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: QString
QString
MprisPlugin::loopStatus() const
{
Tomahawk::playlistinterface_ptr p = AudioEngine::instance()->playlist();
if ( p.isNull() )
return "None";
PlaylistModes::RepeatMode mode = p->repeatMode();
switch( mode )
{
case PlaylistModes::RepeatOne:
return "Track";
break;
case PlaylistModes::RepeatAll:
return "Playlist";
break;
case PlaylistModes::NoRepeat:
return "None";
break;
default:
return "None";
break;
}
return QString( "None" );
}
示例2: instance
bool
MprisPlugin::canPlay() const
{
// If there is a currently playing track, or if there is a playlist with at least 1 track, you can hit play
Tomahawk::playlistinterface_ptr p = AudioEngine::instance()->playlist();
return AudioEngine::instance()->currentTrack() || ( !p.isNull() && p->trackCount() );
}
示例3: playlistChanged
void
AudioEngine::setPlaylist( Tomahawk::playlistinterface_ptr playlist )
{
if ( m_playlist == playlist )
return;
if ( !m_playlist.isNull() )
{
if ( m_playlist.data() && m_playlist.data()->retryMode() == PlaylistModes::Retry )
disconnect( m_playlist.data(), SIGNAL( nextTrackReady() ) );
m_playlist.data()->reset();
}
if ( playlist.isNull() )
{
m_playlist.clear();
emit playlistChanged( playlist );
return;
}
m_playlist = playlist;
m_stopAfterTrack.clear();
if ( !m_playlist.isNull() && m_playlist.data() && m_playlist.data()->retryMode() == PlaylistModes::Retry )
connect( m_playlist.data(), SIGNAL( nextTrackReady() ), SLOT( onPlaylistNextTrackReady() ) );
emit playlistChanged( playlist );
}
示例4: if
void
AudioEngine::playItem( Tomahawk::playlistinterface_ptr playlist, const Tomahawk::result_ptr& result, const Tomahawk::query_ptr& fromQuery )
{
tDebug( LOGEXTRA ) << Q_FUNC_INFO << ( result.isNull() ? QString() : result->url() );
if ( !m_playlist.isNull() )
m_playlist.data()->reset();
setPlaylist( playlist );
if ( playlist.isNull() && !fromQuery.isNull() )
m_currentTrackPlaylist = playlistinterface_ptr( new SingleTrackPlaylistInterface( fromQuery ) );
else
m_currentTrackPlaylist = playlist;
if ( !result.isNull() )
{
loadTrack( result );
}
else if ( !m_playlist.isNull() && m_playlist.data()->retryMode() == PlaylistModes::Retry )
{
m_waitingOnNewTrack = true;
if ( isStopped() )
emit sendWaitingNotification();
else
stop();
}
}
示例5:
void
MprisPlugin::setShuffle( bool value )
{
Tomahawk::playlistinterface_ptr p = AudioEngine::instance()->playlist();
if ( p.isNull() )
return;
return p->setShuffled( value );
}
示例6: if
void
MprisPlugin::setLoopStatus( const QString& value )
{
Tomahawk::playlistinterface_ptr p = AudioEngine::instance()->playlist();
if ( p.isNull() )
return;
if ( value == "Track" )
p->setRepeatMode( PlaylistModes::RepeatOne );
else if ( value == "Playlist" )
p->setRepeatMode( PlaylistModes::RepeatAll );
else if ( value == "None" )
p->setRepeatMode( PlaylistModes::NoRepeat );
}
示例7: playlistChanged
void
AudioEngine::setPlaylist( Tomahawk::playlistinterface_ptr playlist )
{
if ( m_playlist == playlist )
return;
if ( !m_playlist.isNull() )
{
if ( m_playlist.data() )
{
disconnect( m_playlist.data(), SIGNAL( previousTrackAvailable() ) );
disconnect( m_playlist.data(), SIGNAL( nextTrackAvailable() ) );
}
m_playlist.data()->reset();
}
if ( playlist.isNull() )
{
m_playlist.clear();
emit playlistChanged( playlist );
return;
}
m_playlist = playlist;
m_stopAfterTrack.clear();
if ( !m_playlist.isNull() )
{
connect( m_playlist.data(), SIGNAL( nextTrackAvailable() ), SLOT( onPlaylistNextTrackAvailable() ) );
connect( m_playlist.data(), SIGNAL( previousTrackAvailable() ), SIGNAL( controlStateChanged() ) );
connect( m_playlist.data(), SIGNAL( nextTrackAvailable() ), SIGNAL( controlStateChanged() ) );
}
emit playlistChanged( playlist );
}