Lv2Effect.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /*
  2. * Lv2Effect.h - implementation of LV2 effect
  3. *
  4. * Copyright (c) 2018-2020 Johannes Lorenz <jlsf2013$users.sourceforge.net, $=@>
  5. *
  6. * This file is part of LMMS - https://lmms.io
  7. *
  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.
  12. *
  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.
  17. *
  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.
  22. *
  23. */
  24. #ifndef LV2_EFFECT_H
  25. #define LV2_EFFECT_H
  26. #include "Effect.h"
  27. #include "Lv2FxControls.h"
  28. class Lv2Effect : public Effect
  29. {
  30. Q_OBJECT
  31. public:
  32. /*
  33. initialization
  34. */
  35. Lv2Effect(Model* parent, const Descriptor::SubPluginFeatures::Key* _key);
  36. //! Must be checked after ctor or reload
  37. bool isValid() const { return m_controls.isValid(); }
  38. bool processAudioBuffer( sampleFrame* buf, const fpp_t frames ) override;
  39. EffectControls* controls() override { return &m_controls; }
  40. Lv2FxControls* lv2Controls() { return &m_controls; }
  41. const Lv2FxControls* lv2Controls() const { return &m_controls; }
  42. private:
  43. Lv2FxControls m_controls;
  44. std::vector<sampleFrame> m_tmpOutputSmps;
  45. };
  46. #endif // LMMS_HAVE_LV2