Updated SWH plugins and added missing hermes_filter plugin
[lmms/mlankhorst.git] / include / FxMixer.h
blob2a6bd84e0210cadaf8dfccb68c66b13a2b77b0c7
1 /*
2 * FxMixer.h - effect-mixer for LMMS
4 * Copyright (c) 2008-2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
6 * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public
10 * License as published by the Free Software Foundation; either
11 * version 2 of the License, or (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
18 * You should have received a copy of the GNU General Public
19 * License along with this program (see COPYING); if not, write to the
20 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21 * Boston, MA 02110-1301 USA.
25 #ifndef _FX_MIXER_H
26 #define _FX_MIXER_H
28 #include "Model.h"
29 #include "mixer.h"
30 #include "EffectChain.h"
31 #include "JournallingObject.h"
34 const int NumFxChannels = 64;
37 struct FxChannel
39 FxChannel( Model * _parent );
40 ~FxChannel();
42 EffectChain m_fxChain;
43 bool m_used;
44 bool m_stillRunning;
45 float m_peakLeft;
46 float m_peakRight;
47 sampleFrame * m_buffer;
48 BoolModel m_muteModel;
49 FloatModel m_volumeModel;
50 QString m_name;
51 QMutex m_lock;
53 } ;
57 class FxMixer : public JournallingObject, public Model
59 public:
60 FxMixer();
61 virtual ~FxMixer();
63 void mixToChannel( const sampleFrame * _buf, fx_ch_t _ch );
64 void processChannel( fx_ch_t _ch, sampleFrame * _buf = NULL );
66 void prepareMasterMix();
67 void masterMix( sampleFrame * _buf );
70 void clear();
72 virtual void saveSettings( QDomDocument & _doc, QDomElement & _parent );
73 virtual void loadSettings( const QDomElement & _this );
75 virtual QString nodeName() const
77 return "fxmixer";
80 FxChannel * effectChannel( int _ch )
82 if( _ch >= 0 && _ch <= NumFxChannels )
84 return m_fxChannels[_ch];
86 return NULL;
90 private:
91 FxChannel * m_fxChannels[NumFxChannels+1]; // +1 = master
94 friend class mixerWorkerThread;
95 friend class FxMixerView;
97 } ;
100 #endif