本文整理汇总了C++中XSPFLoader类的典型用法代码示例。如果您正苦于以下问题:C++ XSPFLoader类的具体用法?C++ XSPFLoader怎么用?C++ XSPFLoader使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了XSPFLoader类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: url
void
NewPlaylistWidget::updateSuggestions()
{
QUrl url( QString( "http://ws.audioscrobbler.com/1.0/tag/%1/toptracks.xspf" ).arg( m_tag ) );
XSPFLoader* loader = new XSPFLoader( false );
connect( loader, SIGNAL( ok( Tomahawk::playlist_ptr ) ), SLOT( suggestionsFound() ) );
loader->load( url );
}
开发者ID:pauloppenheim,项目名称:tomahawk,代码行数:10,代码来源:newplaylistwidget.cpp
示例2: f
bool
TomahawkApp::loadUrl( const QString& url )
{
if ( !url.startsWith( "tomahawk://" ) )
{
QFile f( url );
QFileInfo info( f );
if ( info.suffix().toLower() == "xspf" )
{
XSPFLoader* l = new XSPFLoader( true, true, this );
tDebug( LOGINFO ) << "Loading spiff:" << url;
l->load( QUrl::fromUserInput( url ) );
return true;
}
else if ( info.suffix().toLower() == "jspf" )
{
JSPFLoader* l = new JSPFLoader( true, this );
tDebug( LOGINFO ) << "Loading j-spiff:" << url;
l->load( QUrl::fromUserInput( url ) );
return true;
}
else if ( info.suffix().toLower() == "axe" )
{
QFileInfo fi( url );
if ( fi.exists() )
{
tDebug( LOGINFO ) << "Loading AXE from file:" << url;
GlobalActionManager::instance()->installResolverFromFile( fi.absoluteFilePath() );
return true;
}
}
else if ( TomahawkUtils::supportedExtensions().contains( info.suffix().toLower() ) )
{
if ( info.exists() )
{
QString furl = url;
if ( furl.startsWith( "file://" ) )
furl = furl.right( furl.length() - 7 );
AudioEngine::instance()->play( QUrl::fromLocalFile( furl ) );
return true;
}
tDebug() << Q_FUNC_INFO << "Unable to find:" << info.absoluteFilePath();
return false;
}
}
return GlobalActionManager::instance()->openUrl( url );
}
开发者ID:JessicaWhite17,项目名称:tomahawk,代码行数:53,代码来源:TomahawkApp.cpp
示例3: sender
void
NewPlaylistWidget::suggestionsFound()
{
XSPFLoader* loader = qobject_cast<XSPFLoader*>( sender() );
m_queries = loader->entries();
delete m_suggestionsModel;
m_suggestionsModel = new PlaylistModel( ui->suggestionsView );
ui->suggestionsView->setPlaylistModel( m_suggestionsModel );
foreach( const Tomahawk::query_ptr& query, m_queries )
{
m_suggestionsModel->append( query );
}
开发者ID:creichert,项目名称:tomahawk,代码行数:15,代码来源:NewPlaylistWidget.cpp
示例4: tLog
bool
GlobalActionManager::parseTomahawkLink( const QString& urlIn )
{
QString url = urlIn;
if ( urlIn.startsWith( "http://toma.hk" ) )
url.replace( "http://toma.hk/", "tomahawk://" );
if ( url.contains( "tomahawk://" ) )
{
QString cmd = url.mid( 11 );
cmd.replace( "%2B", "%20" );
tLog() << "Parsing tomahawk link command" << cmd;
QString cmdType = cmd.split( "/" ).first();
QUrl u = QUrl::fromEncoded( cmd.toUtf8() );
// for backwards compatibility
if ( cmdType == "load" )
{
if ( u.hasQueryItem( "xspf" ) )
{
QUrl xspf = QUrl::fromUserInput( u.queryItemValue( "xspf" ) );
XSPFLoader* l = new XSPFLoader( true, this );
tDebug() << "Loading spiff:" << xspf.toString();
l->load( xspf );
connect( l, SIGNAL( ok( Tomahawk::playlist_ptr ) ), ViewManager::instance(), SLOT( show( Tomahawk::playlist_ptr ) ) );
return true;
}
else if ( u.hasQueryItem( "jspf" ) )
{
QUrl jspf = QUrl::fromUserInput( u.queryItemValue( "jspf" ) );
JSPFLoader* l = new JSPFLoader( true, this );
tDebug() << "Loading jspiff:" << jspf.toString();
l->load( jspf );
connect( l, SIGNAL( ok( Tomahawk::playlist_ptr ) ), ViewManager::instance(), SLOT( show( Tomahawk::playlist_ptr ) ) );
return true;
}
}
if ( cmdType == "playlist" )
{
return handlePlaylistCommand( u );
}
else if ( cmdType == "collection" )
{
return handleCollectionCommand( u );
}
else if ( cmdType == "queue" )
{
return handleQueueCommand( u );
}
else if ( cmdType == "station" )
{
return handleStationCommand( u );
}
else if ( cmdType == "autoplaylist" )
{
return handleAutoPlaylistCommand( u );
}
else if ( cmdType == "search" )
{
return handleSearchCommand( u );
}
else if ( cmdType == "play" )
{
return handlePlayCommand( u );
}
else if ( cmdType == "bookmark" )
{
return handlePlayCommand( u );
}
else if ( cmdType == "open" )
{
return handleOpenCommand( u );
}
else if ( cmdType == "view" )
{
return handleViewCommand( u );
}
else
{
tLog() << "Tomahawk link not supported, command not known!" << cmdType << u.path();
return false;
}
}
else
{
tLog() << "Not a tomahawk:// link!";
return false;
}
}
开发者ID:mguentner,项目名称:tomahawk,代码行数:94,代码来源:GlobalActionManager.cpp
注:本文中的XSPFLoader类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论