EffectChain.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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 LMMS_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. private:
  51. typedef QVector<Effect *> EffectList;
  52. EffectList m_effects;
  53. BoolModel m_enabledModel;
  54. friend class EffectRackView;
  55. signals:
  56. void aboutToClear();
  57. } ;
  58. #endif