EffectChain.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. /*
  2. * EffectChain.h - class for processing and effects chain
  3. *
  4. * Copyright (c) 2006-2008 Danny McRae <khjklujn/at/users.sourceforge.net>
  5. * Copyright (c) 2008-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
  6. *
  7. * This file is part of LMMS - https://lmms.io
  8. *
  9. * This program is free software; you can redistribute it and/or
  10. * modify it under the terms of the GNU General Public
  11. * License as published by the Free Software Foundation; either
  12. * version 2 of the License, or (at your option) any later version.
  13. *
  14. * This program is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  17. * General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU General Public
  20. * License along with this program (see COPYING); if not, write to the
  21. * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  22. * Boston, MA 02110-1301 USA.
  23. *
  24. */
  25. #ifndef EFFECT_CHAIN_H
  26. #define EFFECT_CHAIN_H
  27. #include "Model.h"
  28. #include "SerializingObject.h"
  29. #include "AutomatableModel.h"
  30. class Effect;
  31. class EXPORT EffectChain : public Model, public SerializingObject
  32. {
  33. Q_OBJECT
  34. public:
  35. EffectChain( Model * _parent );
  36. virtual ~EffectChain();
  37. virtual void saveSettings( QDomDocument & _doc, QDomElement & _parent );
  38. virtual void loadSettings( const QDomElement & _this );
  39. inline virtual QString nodeName() const
  40. {
  41. return "fxchain";
  42. }
  43. void appendEffect( Effect * _effect );
  44. void removeEffect( Effect * _effect );
  45. void moveDown( Effect * _effect );
  46. void moveUp( Effect * _effect );
  47. bool processAudioBuffer( sampleFrame * _buf, const fpp_t _frames, bool hasInputNoise );
  48. void startRunning();
  49. void clear();
  50. void setEnabled( bool _on )
  51. {
  52. m_enabledModel.setValue( _on );
  53. }
  54. private:
  55. typedef QVector<Effect *> EffectList;
  56. EffectList m_effects;
  57. BoolModel m_enabledModel;
  58. friend class EffectRackView;
  59. signals:
  60. void aboutToClear();
  61. } ;
  62. #endif