EffectView.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. /*
  2. * EffectView.h - view-component for an effect
  3. *
  4. * Copyright (c) 2006-2007 Danny McRae <khjklujn/at/users.sourceforge.net>
  5. * Copyright (c) 2007-2010 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_VIEW_H
  26. #define EFFECT_VIEW_H
  27. #include "AutomatableModel.h"
  28. #include "PluginView.h"
  29. #include "Effect.h"
  30. class QGroupBox;
  31. class QLabel;
  32. class QPushButton;
  33. class QMdiSubWindow;
  34. class EffectControlDialog;
  35. class Knob;
  36. class LedCheckBox;
  37. class TempoSyncKnob;
  38. class EffectView : public PluginView
  39. {
  40. Q_OBJECT
  41. public:
  42. EffectView( Effect * _model, QWidget * _parent );
  43. virtual ~EffectView();
  44. inline Effect * effect()
  45. {
  46. return castModel<Effect>();
  47. }
  48. inline const Effect * effect() const
  49. {
  50. return castModel<Effect>();
  51. }
  52. static constexpr int DEFAULT_WIDTH = 215;
  53. public slots:
  54. void editControls();
  55. void moveUp();
  56. void moveDown();
  57. void deletePlugin();
  58. void closeEffects();
  59. signals:
  60. void moveUp( EffectView * _plugin );
  61. void moveDown( EffectView * _plugin );
  62. void deletePlugin( EffectView * _plugin );
  63. protected:
  64. void contextMenuEvent( QContextMenuEvent * _me ) override;
  65. void paintEvent( QPaintEvent * _pe ) override;
  66. void modelChanged() override;
  67. private:
  68. QPixmap m_bg;
  69. LedCheckBox * m_bypass;
  70. Knob * m_wetDry;
  71. TempoSyncKnob * m_autoQuit;
  72. Knob * m_gate;
  73. QMdiSubWindow * m_subWindow;
  74. EffectControlDialog * m_controlView;
  75. } ;
  76. #endif