mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-04-21 16:31:58 +02:00
move artist description to top-level
This commit is contained in:
parent
5097cbd90e
commit
646bc1d652
@ -137,7 +137,6 @@ Tomahawk::EchonestControl::updateWidgets()
|
||||
|
||||
match->addItem( "Limit To", Echonest::DynamicPlaylist::ArtistType );
|
||||
match->addItem( "Similar To", Echonest::DynamicPlaylist::ArtistRadioType );
|
||||
match->addItem( "Description", Echonest::DynamicPlaylist::ArtistDescriptionType );
|
||||
m_matchString = match->currentText();
|
||||
m_matchData = match->itemData( match->currentIndex() ).toString();
|
||||
|
||||
@ -150,6 +149,23 @@ Tomahawk::EchonestControl::updateWidgets()
|
||||
connect( input, SIGNAL( editingFinished() ), this, SLOT( editingFinished() ) );
|
||||
connect( input, SIGNAL( textEdited( QString ) ), &m_editingTimer, SLOT( stop() ) );
|
||||
|
||||
match->hide();
|
||||
input->hide();
|
||||
m_match = QWeakPointer< QWidget >( match );
|
||||
m_input = QWeakPointer< QWidget >( input );
|
||||
} else if( selectedType() == "Artist Description" ) {
|
||||
m_currentType = Echonest::DynamicPlaylist::Description;
|
||||
|
||||
QLabel* match = new QLabel( tr( "is" ) );
|
||||
QLineEdit* input = new QLineEdit();
|
||||
|
||||
m_matchString = QString();
|
||||
m_matchData = QString::number( (int)Echonest::DynamicPlaylist::ArtistDescriptionType );
|
||||
|
||||
connect( input, SIGNAL( textChanged(QString) ), this, SLOT( updateData() ) );
|
||||
connect( input, SIGNAL( editingFinished() ), this, SLOT( editingFinished() ) );
|
||||
connect( input, SIGNAL( textEdited( QString ) ), &m_editingTimer, SLOT( stop() ) );
|
||||
|
||||
match->hide();
|
||||
input->hide();
|
||||
m_match = QWeakPointer< QWidget >( match );
|
||||
@ -342,18 +358,18 @@ Tomahawk::EchonestControl::updateData()
|
||||
if( combo ) {
|
||||
m_matchString = combo->currentText();
|
||||
m_matchData = combo->itemData( combo->currentIndex() ).toString();
|
||||
|
||||
// EN HACK: artist-description radio needs description= fields not artist= fields
|
||||
if( m_matchData.toInt() == Echonest::DynamicPlaylist::ArtistDescriptionType )
|
||||
m_overrideType = Echonest::DynamicPlaylist::Description;
|
||||
else
|
||||
m_overrideType = -1;
|
||||
}
|
||||
QLineEdit* edit = qobject_cast<QLineEdit*>( m_input.data() );
|
||||
if( edit && !edit->text().isEmpty() ) {
|
||||
m_data.first = m_currentType;
|
||||
m_data.second = edit->text();
|
||||
}
|
||||
} else if( selectedType() == "Artist Description" ) {
|
||||
QLineEdit* edit = qobject_cast<QLineEdit*>( m_input.data() );
|
||||
if( edit && !edit->text().isEmpty() ) {
|
||||
m_data.first = m_currentType;
|
||||
m_data.second = edit->text();
|
||||
}
|
||||
} else if( selectedType() == "Variety" ) {
|
||||
LabeledSlider* s = qobject_cast<LabeledSlider*>( m_input.data() );
|
||||
if( s ) {
|
||||
@ -420,6 +436,10 @@ Tomahawk::EchonestControl::updateWidgetsFromData()
|
||||
QLineEdit* edit = qobject_cast<QLineEdit*>( m_input.data() );
|
||||
if( edit )
|
||||
edit->setText( m_data.second.toString() );
|
||||
} else if( selectedType() == "Artist Description" ) {
|
||||
QLineEdit* edit = qobject_cast<QLineEdit*>( m_input.data() );
|
||||
if( edit )
|
||||
edit->setText( m_data.second.toString() );
|
||||
} else if( selectedType() == "Variety" ) {
|
||||
LabeledSlider* s = qobject_cast<LabeledSlider*>( m_input.data() );
|
||||
if( s )
|
||||
@ -481,8 +501,8 @@ Tomahawk::EchonestControl::calculateSummary()
|
||||
summary = QString( "only by ~%1" ).arg( m_data.second.toString() );
|
||||
else if( static_cast< Echonest::DynamicPlaylist::ArtistTypeEnum >( m_matchData.toInt() ) == Echonest::DynamicPlaylist::ArtistRadioType )
|
||||
summary = QString( "similar to ~%1" ).arg( m_data.second.toString() );
|
||||
else if( static_cast< Echonest::DynamicPlaylist::ArtistTypeEnum >( m_matchData.toInt() ) == Echonest::DynamicPlaylist::ArtistDescriptionType )
|
||||
summary = QString( "like ~%1" ).arg( m_data.second.toString() );
|
||||
} else if( selectedType() == "Artist Description" ) {
|
||||
summary = QString( "with genre ~%1" ).arg( m_data.second.toString() );
|
||||
} else if( selectedType() == "Variety" || selectedType() == "Danceability" || selectedType() == "Artist Hotttnesss" || selectedType() == "Energy" || selectedType() == "Artist Familiarity" || selectedType() == "Song Hotttnesss" ) {
|
||||
QString modifier;
|
||||
qreal sliderVal = m_data.second.toReal();
|
||||
|
@ -40,7 +40,7 @@ EchonestFactory::createControl( const QString& controlType )
|
||||
QStringList
|
||||
EchonestFactory::typeSelectors() const
|
||||
{
|
||||
return QStringList() << "Artist" << "Variety" << "Tempo" << "Duration" << "Loudness"
|
||||
return QStringList() << "Artist" << "Artist Description" << "Variety" << "Tempo" << "Duration" << "Loudness"
|
||||
<< "Danceability" << "Energy" << "Artist Familiarity" << "Artist Hotttnesss" << "Song Hotttnesss"
|
||||
<< "Longitude" << "Latitude" << "Mode" << "Key" << "Sorting";
|
||||
}
|
||||
@ -244,9 +244,9 @@ EchonestGenerator::onlyThisArtistType( Echonest::DynamicPlaylist::ArtistTypeEnum
|
||||
bool some = false;
|
||||
|
||||
foreach( const dyncontrol_ptr& control, m_controls ) {
|
||||
if( control->selectedType() == "Artist" && static_cast<Echonest::DynamicPlaylist::ArtistTypeEnum>( control->match().toInt() ) != type ) {
|
||||
if( control->selectedType() == "Artist" || control->selectedType() == "Artist Description" && static_cast<Echonest::DynamicPlaylist::ArtistTypeEnum>( control->match().toInt() ) != type ) {
|
||||
only = false;
|
||||
} else if( control->selectedType() == "Artist" && static_cast<Echonest::DynamicPlaylist::ArtistTypeEnum>( control->match().toInt() ) == type ) {
|
||||
} else if( control->selectedType() == "Artist" || control->selectedType() == "Artist Description" && static_cast<Echonest::DynamicPlaylist::ArtistTypeEnum>( control->match().toInt() ) == type ) {
|
||||
some = true;
|
||||
}
|
||||
}
|
||||
@ -331,7 +331,7 @@ EchonestGenerator::sentenceSummary()
|
||||
QList< dyncontrol_ptr > artists;
|
||||
dyncontrol_ptr sorting;
|
||||
foreach( const dyncontrol_ptr& control, allcontrols ) {
|
||||
if( control->selectedType() == "Artist" )
|
||||
if( control->selectedType() == "Artist" || control->selectedType() == "Artist Description" )
|
||||
artists << control;
|
||||
else if( control->selectedType() == "Sorting" )
|
||||
sorting = control;
|
||||
|
@ -53,7 +53,7 @@ DynamicSetupWidget::DynamicSetupWidget( const Tomahawk::dynplaylist_ptr& playlis
|
||||
foreach( const QString& type, GeneratorFactory::types() )
|
||||
genCombo->addItem( type );
|
||||
m_generatorCombo = new ReadOrWriteWidget( genCombo, m_playlist->author()->isLocal(), this );
|
||||
m_generatorCombo->setLabel( playlist->generator()->type() );
|
||||
m_generatorCombo->setLabel( playlist->generator()->type().replace( 0, 1, playlist->generator()->type().at( 0 ).toUpper() ) );
|
||||
|
||||
m_layout->addWidget( m_generatorCombo );
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user