LadspaEffect.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. /*
  2. * LadspaEffect.h - class for handling LADSPA effect plugins
  3. *
  4. * Copyright (c) 2006-2008 Danny McRae <khjklujn/at/users.sourceforge.net>
  5. * Copyright (c) 2009 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 _LADSPA_EFFECT_H
  26. #define _LADSPA_EFFECT_H
  27. #include <QMutex>
  28. #include "Effect.h"
  29. #include "LadspaBase.h"
  30. #include "LadspaControls.h"
  31. typedef QVector<port_desc_t *> multi_proc_t;
  32. class LadspaEffect : public Effect
  33. {
  34. Q_OBJECT
  35. public:
  36. LadspaEffect( Model * _parent,
  37. const Descriptor::SubPluginFeatures::Key * _key );
  38. virtual ~LadspaEffect();
  39. virtual bool processAudioBuffer( sampleFrame * _buf,
  40. const fpp_t _frames );
  41. void setControl( int _control, LADSPA_Data _data );
  42. virtual EffectControls * controls()
  43. {
  44. return m_controls;
  45. }
  46. inline const multi_proc_t & getPortControls()
  47. {
  48. return m_portControls;
  49. }
  50. private slots:
  51. void changeSampleRate();
  52. private:
  53. void pluginInstantiation();
  54. void pluginDestruction();
  55. static sample_rate_t maxSamplerate( const QString & _name );
  56. QMutex m_pluginMutex;
  57. LadspaControls * m_controls;
  58. sample_rate_t m_maxSampleRate;
  59. ladspa_key_t m_key;
  60. int m_portCount;
  61. bool m_inPlaceBroken;
  62. const LADSPA_Descriptor * m_descriptor;
  63. QVector<LADSPA_Handle> m_handles;
  64. QVector<multi_proc_t> m_ports;
  65. multi_proc_t m_portControls;
  66. } ;
  67. #endif