Help developing the Equalizer - new developer
Fabian Korak
fabiank22 at yahoo.de
Wed Jul 4 20:19:11 UTC 2007
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.
First I added a new entry to the amarok.kcfg:
<entry key="Adaptable Equalizer" type="Bool">
<label>Makes the Equalizer adapt</label>
<whatsthis>When enabled, the Equalizer adapts to the genre currently
played</whatsthis>
<default>false</default>
</entry>
Then I make a new checkbox for the equalizer-window into equalizersetup.cpp:
m_groupBoxSliders2 = new QGroupBox( vbox );
vboxLayout->addWidget( m_groupBoxSliders2 );
m_groupBoxSliders2->setTitle( i18n("Adaptable Equalizer") );
m_groupBoxSliders2->setCheckable( true );
m_groupBoxSliders2->setChecked( AmarokConfig::adaptableEqualizer() );
connect( m_groupBoxSliders2, SIGNAL( toggled( bool ) ), SLOT(
setAdaptableEqualizer() ) );
QVBoxLayout *v2 = new QVBoxLayout( m_groupBoxSliders2 );
QWidget* slidersLayoutWidget2 = new QWidget( m_groupBoxSliders2 );
v2->addWidget( slidersLayoutWidget2 );
slidersLayoutWidget2->setSizePolicy(QSizePolicy::Expanding,
QSizePolicy::Expanding);
QGridLayout* slidersGridLayout2 = new QGridLayout( slidersLayoutWidget2 );
slidersGridLayout2->setSpacing( KDialog::spacingHint() );
Then I declare two new methods:
//Slot
void EqualizerSetup::setAdaptableEqualizer()
{
adaptableEqualizer();
}
void EqualizerSetup::adaptableEqualizer():EngineObserver()
{
EngineObserver *observer = new EngineObserver();
EngineSubject::attach( EngineObserver *observer );
QString MetaBundle::exactText( int column, bool ensureCached );
if (column = m_presets[title]) {
setPreset(column);
} else {
setPreset(i18n("Zero"));
}
}
And declare this all within the header-file:
private slots:
void setAdaptableEqualizer();
private:
void adaptableEqualizer();
QGroupBox* m_groupBoxSliders2;
Witch gives me the following errors:
/home/schueler/kde/src/multimedia/amarok/src/equalizersetup.cpp: In member function void EqualizerSetup::adaptableEqualizer():
/home/schueler/kde/src/multimedia/amarok/src/equalizersetup.cpp:518: error: only constructors take base initializers
/home/schueler/kde/src/multimedia/amarok/src/equalizersetup.cpp:518: error: type EngineObserver is not a direct base of EqualizerSetup
/home/schueler/kde/src/multimedia/amarok/src/equalizersetup.cpp:521: error: expected primary-expression before * token
/home/schueler/kde/src/multimedia/amarok/src/equalizersetup.cpp:522: error: invalid use of qualified-name MetaBundle::exactText
/home/schueler/kde/src/multimedia/amarok/src/equalizersetup.cpp:523: error: column was not declared in this scope
/home/schueler/kde/src/multimedia/amarok/src/equalizersetup.cpp:523: error: title was not declared in this scope
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.
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.
Fabian Korak
---------------------------------
BE A BETTER HEIMWERKER: Jetzt Frage stellen und einen von 44 iPods gewinnen!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/amarok/attachments/20070704/725529be/attachment.html>
More information about the Amarok
mailing list