<span style="font-family: monospace;">Ok I'm trying to add a feature to amarok, concerning the equalizer. I'm trying to get the equalizer-preset to change according to the genre of a song everytime the song changes. But I'm having problems with the engine(calling my method every time the song changes) and the data(getting the name of the genre and comparing it to the existing presets.<br><br>First I added a new entry to the amarok.kcfg:<br><br> <entry key="Adaptable Equalizer" type="Bool"><br> <label>Makes the Equalizer adapt</label><br> <whatsthis>When enabled, the Equalizer adapts to the genre currently<br> played</whatsthis><br> <default>false</default><br> </entry><br><br>Then I make a new checkbox for the equalizer-window into
equalizersetup.cpp:<br><br><br> m_groupBoxSliders2 = new QGroupBox( vbox );<br> vboxLayout->addWidget( m_groupBoxSliders2 );<br> m_groupBoxSliders2->setTitle( i18n("Adaptable Equalizer") );<br> m_groupBoxSliders2->setCheckable( true );<br> m_groupBoxSliders2->setChecked( AmarokConfig::adaptableEqualizer() );<br> connect( m_groupBoxSliders2, SIGNAL( toggled( bool ) ), SLOT(<br> setAdaptableEqualizer() ) );<br> QVBoxLayout *v2 = new QVBoxLayout( m_groupBoxSliders2 );<br> <br> QWidget* slidersLayoutWidget2 = new QWidget( m_groupBoxSliders2 );<br> v2->addWidget( slidersLayoutWidget2 );<br> slidersLayoutWidget2->setSizePolicy(QSizePolicy::Expanding,<br>
QSizePolicy::Expanding);<br> QGridLayout* slidersGridLayout2 = new QGridLayout( slidersLayoutWidget2 );<br> slidersGridLayout2->setSpacing( KDialog::spacingHint() );<br><br>Then I declare two new methods:<br><br>//Slot<br>void EqualizerSetup::setAdaptableEqualizer()<br>{<br> adaptableEqualizer();<br>}<br><br>void EqualizerSetup::adaptableEqualizer():EngineObserver()<br>{<br> EngineObserver *observer = new EngineObserver();<br> EngineSubject::attach( EngineObserver *observer );<br> QString MetaBundle::exactText( int column, bool ensureCached );<br> if (column = m_presets[title]) {<br> setPreset(column);<br> } else {<br> setPreset(i18n("Zero"));<br> }<br>}<br><br>And declare this all within the
header-file:<br><br>private slots:<br> void setAdaptableEqualizer();<br><br>private:<br> void adaptableEqualizer();<br> QGroupBox* m_groupBoxSliders2;<br><br>Witch gives me the following errors:<br><br>/home/schueler/kde/src/multimedia/amarok/src/equalizersetup.cpp: In member function ‘void EqualizerSetup::adaptableEqualizer()’:<br>/home/schueler/kde/src/multimedia/amarok/src/equalizersetup.cpp:518: error: only constructors take base initializers<br>/home/schueler/kde/src/multimedia/amarok/src/equalizersetup.cpp:518: error: type ‘EngineObserver’ is not a direct base of ‘EqualizerSetup’<br>/home/schueler/kde/src/multimedia/amarok/src/equalizersetup.cpp:521: error: expected primary-expression before ‘*’
token<br>/home/schueler/kde/src/multimedia/amarok/src/equalizersetup.cpp:522: error: invalid use of qualified-name ‘MetaBundle::exactText’<br>/home/schueler/kde/src/multimedia/amarok/src/equalizersetup.cpp:523: error: ‘column’ was not declared in this scope<br>/home/schueler/kde/src/multimedia/amarok/src/equalizersetup.cpp:523: error: ‘title’ was not declared in this scope<br><br>I don't really understand the error with the EngineObserver, since I do this as stated in "engineobserver.h". The invalid use of MetaBundle:exactText is clearly not the way to go, but I didn't really understood how to use the enum in "MetaBundle.h". Also I don't know about title since this is used just a few lines before in "EqualizerSetup::presetChanged" in a similar way.<br>I really tried to debug this, but I'm clearly not the best dev(I just started developing KDE recently), so I would appreciate the help. If I get this to work I'm making a patch so everyone could benefit from
it.<br><br>Fabian Korak<br></span> <p>
<hr size=1> <a href="http://de.rd.yahoo.com/evt=48734/*http://de.promotions.yahoo.com/clever/be-a-better/heimwerker.html" target=_new
><b>BE A BETTER HEIMWERKER:</b> Jetzt Frage stellen und einen von 44 iPods gewinnen!</a>