summaryrefslogtreecommitdiffstats
path: root/ksayit/src/effectstack.cpp
blob: cdea2f575a64230cbd04526bec85f6594416b40e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
//
// C++ Implementation: effectstack
//
// Description: 
//
//
// Author: Robert Vogl <voglrobe@lapislazuli>, (C) 2004
//
// Copyright: See COPYING file that comes with this distribution
//
//

// TQt includes
#include <tqstringlist.h>

// KDE includes
#include <kdebug.h>

// App specific includes
#include "effectstack.h"
#include "fxpluginhandler.h"

EffectStack::EffectStack(FXPluginHandler *pluginhandler, TDEConfig *config)
    : 
     dispatcher(), server(),
     m_pluginhandler(pluginhandler),
     m_config(config)
{
}


EffectStack::~EffectStack()
{
}

bool EffectStack::loadEffects()
{
    kdDebug(100200) << "EffectStack::loadEffects()" << endl;
    
    TQStringList c_active;
    TQStringList::Iterator fx_it;
  
    // create filterstack
    FX_Stack = server.server().outstack();
    
    m_config->setGroup("Effect Stack Configuration");
    c_active = m_config->readListEntry("Activated");
    for(fx_it=c_active.begin(); fx_it!=c_active.end(); ++fx_it){
        
        m_pluginhandler->activateEffect(*fx_it, &server, &FX_Stack);
        
    }
    return true;
}


bool EffectStack::unloadEffects()
{
    kdDebug(100200) << "EffectStack::unloadEffects()" << endl;
    // remove all effects    
    m_pluginhandler->deactivateEffects(&FX_Stack);
    
    return true;
}