void PlaybackControlsWidget::setIconForRadio( const RadioStation& station ) { QString url = station.url(); if ( url.startsWith("lastfm://user") ) { if ( url.contains( "/friends" ) || url.contains( "/neighbours" ) || url.startsWith( "lastfm://users") ) ui->icon->setPixmap( QPixmap( ":/control_bar_radio_friends.png" ) ); if ( url.contains( "/library" ) || url.contains( "/personal") ) ui->icon->setPixmap( QPixmap( ":/control_bar_radio_library.png" ) ); else if ( url.contains( "/mix" ) ) ui->icon->setPixmap( QPixmap( ":/control_bar_radio_mix.png" ) ); else if ( url.contains( "/recommended" ) ) ui->icon->setPixmap( QPixmap( ":/control_bar_radio_rec.png" ) ); } else if ( url.startsWith("lastfm://artist") ) ui->icon->setPixmap( QPixmap( ":/control_bar_radio_artist.png" ) ); else if ( url.startsWith("lastfm://tag") || url.startsWith( "lastfm://globaltags" ) ) ui->icon->setPixmap( QPixmap( ":/control_bar_radio_tag.png" ) ); else ui->icon->setPixmap( QPixmap( ":/control_bar_radio_library.png" ) ); }
void RadioTuner::retune( const RadioStation& station ) { d->m_playlist.clear(); d->m_retuneStation = station; qDebug() << station.url(); }
Tuner::Tuner( const RadioStation& station ) : m_retry_counter( 0 ) { WsReply* reply = WsRequestBuilder( "radio.tune" ) .add( "station", station.url() ) .post(); connect( reply, SIGNAL(finished( WsReply* )), SLOT(onTuneReturn( WsReply* )) ); }
RadioTuner::RadioTuner( const RadioStation& station ) : m_retry_counter( 0 ) { QMap<QString, QString> map; map["method"] = "radio.tune"; map["station"] = station.url(); QNetworkReply* reply = ws::post(map); connect( reply, SIGNAL(finished()), SLOT(onTuneReturn()) ); }
RadioTuner::RadioTuner( const RadioStation& station ) :d( new RadioTunerPrivate( this, station ) ) { qDebug() << station.url(); //Empty RadioStation implies that the radio //should tune to the previous station. if( station.url().isEmpty() ) { d->fetchFiveMoreTracks(); } else { QMap<QString, QString> map; map["method"] = "radio.tune"; map["station"] = station.url(); map["additional_info"] = "1"; connect( ws::post(map), SIGNAL(finished()), SLOT(onTuneReturn()) ); } }