VstEffectControls.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. /*
  2. * VstEffectControls.h - controls for VST effect plugins
  3. *
  4. * Copyright (c) 2008-2011 Tobias Doerffel <tobydox/at/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 _VST_EFFECT_CONTROLS_H
  25. #define _VST_EFFECT_CONTROLS_H
  26. #include "EffectControls.h"
  27. #include "VstEffectControlDialog.h"
  28. #include <QMenu>
  29. #include "embed.h"
  30. #include <QPushButton>
  31. #include <QMdiSubWindow>
  32. #include <QScrollArea>
  33. #include "CustomTextKnob.h"
  34. #include <QLayout>
  35. #include <QPainter>
  36. #include <QObject>
  37. class VstEffect;
  38. class VstEffectControls : public EffectControls
  39. {
  40. Q_OBJECT
  41. public:
  42. VstEffectControls( VstEffect * _eff );
  43. virtual ~VstEffectControls();
  44. virtual void saveSettings( QDomDocument & _doc, QDomElement & _parent );
  45. virtual void loadSettings( const QDomElement & _this );
  46. inline virtual QString nodeName() const
  47. {
  48. return "vsteffectcontrols";
  49. }
  50. virtual int controlCount();
  51. virtual EffectControlDialog * createView();
  52. protected slots:
  53. void updateMenu( void );
  54. void managePlugin( void );
  55. void openPreset( void );
  56. void savePreset( void );
  57. void rollPreset( void );
  58. void rolrPreset( void );
  59. void selPreset( void );
  60. void setParameter( Model * action );
  61. protected:
  62. virtual void paintEvent( QPaintEvent * _pe );
  63. private:
  64. VstEffect * m_effect;
  65. QPushButton * m_selPresetButton;
  66. QMdiSubWindow * m_subWindow;
  67. QScrollArea * m_scrollArea;
  68. FloatModel ** knobFModel;
  69. int paramCount;
  70. QObject * ctrHandle;
  71. int lastPosInMenu;
  72. // QLabel * m_presetLabel;
  73. friend class VstEffectControlDialog;
  74. friend class manageVSTEffectView;
  75. bool m_vstGuiVisible;
  76. } ;
  77. class manageVSTEffectView : public QObject
  78. {
  79. Q_OBJECT
  80. public:
  81. manageVSTEffectView( VstEffect * _eff, VstEffectControls * m_vi );
  82. virtual ~manageVSTEffectView();
  83. protected slots:
  84. void syncPlugin( void );
  85. void displayAutomatedOnly( void );
  86. void setParameter( Model * action );
  87. void syncParameterText();
  88. void closeWindow();
  89. private:
  90. // static QPixmap * s_artwork;
  91. VstEffectControls * m_vi2;
  92. VstEffect * m_effect;
  93. QWidget *widget;
  94. QGridLayout * l;
  95. QPushButton * m_syncButton;
  96. QPushButton * m_displayAutomatedOnly;
  97. QPushButton * m_closeButton;
  98. CustomTextKnob ** vstKnobs;
  99. } ;
  100. #endif