1 /***************************************************************************
2 fxsetupimpl.cpp - description
5 copyright : (C) 2003 by voglrobe
6 email : voglrobe@saphir
7 ***************************************************************************/
9 /***************************************************************************
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
16 ***************************************************************************/
19 #include <QStringList>
20 #include <QPushButton>
25 // App specific inlcudes
26 #include "fxsetupimpl.h"
27 // #include "freeverbsetupimpl.h"
28 #include "fxpluginhandler.h"
30 FX_SetupImpl::FX_SetupImpl(QWidget
*parent
, const char *name
,
32 FXPluginHandler
*fxpluginhandler
)
33 : FX_Setup(parent
,name
), m_config(config
), m_fxpluginhandler(fxpluginhandler
)
35 m_fxpluginhandler
->getPlugins(pluginlist
);
41 FX_SetupImpl::~FX_SetupImpl()
45 void FX_SetupImpl::slotAdd()
47 // move effect from Available-List to Active-List
48 int index
= listBox_Available
->currentItem();
51 listBox_Active
->insertItem( listBox_Available
->text(index
), -1 );
52 listBox_Available
->removeItem( index
);
53 pushButton_removeAll
->setEnabled(true);
57 void FX_SetupImpl::slotRemove()
59 // move effect from Active-List to Available-List
60 int index
= listBox_Active
->currentItem();
63 listBox_Available
->insertItem( listBox_Active
->text(index
), -1 );
64 listBox_Active
->removeItem( index
);
66 if (listBox_Active
->count() == 0)
67 pushButton_removeAll
->setEnabled(false);
71 void FX_SetupImpl::slotRemoveAll()
73 kDebug() << "FX_SetupImpl::slotRemoveAll()" << endl
;
75 // move all from Active-List to Available-List
76 for(uint i
=0; i
<listBox_Active
->count(); i
++){
77 listBox_Available
->insertItem( listBox_Active
->text((int)i
) );
79 listBox_Active
->clear();
80 pushButton_removeAll
->setEnabled(false);
84 void FX_SetupImpl::slotReload()
86 kDebug() << "FX_SetupImpl::slotReload()" << endl
;
92 void FX_SetupImpl::slotConfigureEffect(Q3ListBoxItem
*item
)
94 m_fxpluginhandler
->showEffectGUI(item
->text());
98 void FX_SetupImpl::Init(QStringList c_avail
)
100 m_config
->setGroup("Effect Stack Configuration");
101 QStringList conf_active
= m_config
->readEntry("Activated",QStringList());
102 QStringList c_active
;
103 QStringList::Iterator sit
, it
;
105 listBox_Available
->clear();
106 listBox_Active
->clear();
109 pushButton_removeAll
->setEnabled(false);
111 for (sit
=conf_active
.begin(); sit
!=conf_active
.end(); ++sit
){
112 it
= c_avail
.find(*sit
);
113 if ( it
!=c_avail
.end() ){ // active plugin as per config-file in pluginlist found
114 c_active
.append(*sit
); // append to active list
115 c_avail
.remove(*sit
); // remove active plugin from the list of avail plugins
119 if ( !c_active
.isEmpty() ){
120 pushButton_removeAll
->setEnabled(true);
124 for(it
=c_avail
.begin(); it
!=c_avail
.end(); ++it
){
125 listBox_Available
->insertItem( (*it
), -1 );
127 for(it
=c_active
.begin(); it
!=c_active
.end(); ++it
){
128 listBox_Active
->insertItem( (*it
), -1 );
133 void FX_SetupImpl::slotSaveWasClicked()
135 m_config
->setGroup("Effect Stack Configuration");
137 // Read ListBox Available FX
139 for(uint i
=0; i
<listBox_Available
->count(); i
++){
140 slist
.append( listBox_Available
->text( (int)i
) );
143 m_config
->writeEntry("Available", slist
);
145 // Read ListBox Activated FX
147 for(uint i
=0; i
<listBox_Active
->count(); i
++){
148 slist
.append( listBox_Active
->text( (int)i
) );
151 m_config
->writeEntry("Activated", slist
);
156 #include "fxsetupimpl.moc"