void PlaybackControlsWidget::onPlayClicked() { if (!ui.play->isChecked()) radio->stop(); else radio->play( RadioStation( "" ) ); }
void PlaybackControlsWidget::onPlayClicked( bool checked ) { if ( checked ) { if ( RadioService::instance().state() == Stopped ) RadioService::instance().play( RadioStation( "" ) ); else { RadioService::instance().resume(); } } else { RadioService::instance().pause(); } }
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 ); } } }