EffectRackView.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. /*
  2. * EffectRackView.h - view for effectChain-model
  3. *
  4. * Copyright (c) 2006-2007 Danny McRae <khjklujn@netscape.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_RACK_VIEW_H
  26. #define EFFECT_RACK_VIEW_H
  27. #include <QWidget>
  28. #include "EffectChain.h"
  29. #include "ModelView.h"
  30. #include "lmms_basics.h"
  31. class QScrollArea;
  32. class QVBoxLayout;
  33. class EffectView;
  34. class GroupBox;
  35. class EffectRackView : public QWidget, public ModelView
  36. {
  37. Q_OBJECT
  38. public:
  39. EffectRackView( EffectChain* model, QWidget* parent = nullptr );
  40. virtual ~EffectRackView();
  41. static constexpr int DEFAULT_WIDTH = 245;
  42. public slots:
  43. void clearViews();
  44. void moveUp( EffectView* view );
  45. void moveDown( EffectView* view );
  46. void deletePlugin( EffectView* view );
  47. private slots:
  48. virtual void update();
  49. void addEffect();
  50. private:
  51. void modelChanged() override;
  52. inline EffectChain* fxChain()
  53. {
  54. return castModel<EffectChain>();
  55. }
  56. inline const EffectChain* fxChain() const
  57. {
  58. return castModel<EffectChain>();
  59. }
  60. QVector<EffectView *> m_effectViews;
  61. GroupBox* m_effectsGroupBox;
  62. QScrollArea* m_scrollArea;
  63. int m_lastY;
  64. } ;
  65. #endif