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" ) );
}
示例#2
0
void
RadioTuner::retune( const RadioStation& station )
{
    d->m_playlist.clear();
    d->m_retuneStation = station;

    qDebug() << station.url();
}
示例#3
0
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* )) );
}
示例#4
0
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()) );
}
示例#5
0
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()) );
    }
}