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