コード例 #1
0
void
PlaybackControlsWidget::onPlayClicked()
{
	if (!ui.play->isChecked())
		radio->stop();
    else
        radio->play( RadioStation( "" ) );
}
コード例 #2
0
void
PlaybackControlsWidget::onPlayClicked( bool checked )
{
    if ( checked )
    {
        if ( RadioService::instance().state() == Stopped )
            RadioService::instance().play( RadioStation( "" ) );
        else
        {
            RadioService::instance().resume();
        }
    }
    else
    {
        RadioService::instance().pause();
    }
}
コード例 #3
0
void
RadioWidget::onGotRecentStations()
{
    lastfm::XmlQuery lfm;

    if ( lfm.parse( qobject_cast<QNetworkReply*>(sender()) ) )
    {
        foreach ( const lastfm::XmlQuery& station, lfm["recentstations"].children("station") )
        {
            QString stationUrl = station["url"].text();

            if ( !stationUrl.startsWith( "lastfm://user/" + User().name() ) )
            {
                PlayableItemWidget* item = new PlayableItemWidget( RadioStation( stationUrl ), station["name"].text() );
                item->setObjectName( "station" );
                ui->recentStations->layout()->addWidget( item );
            }
        }
    }