EqParameterWidget.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. /*
  2. * eqparameterwidget.cpp - defination of EqParameterWidget class.
  3. *
  4. * Copyright (c) 2014 David French <dave/dot/french3/at/googlemail/dot/com>
  5. * Copyright (c) 2015 Steffen Baranowsky <BaraMGB/at/freenet/dot/de>
  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 EQPARAMETERWIDGET_H
  26. #define EQPARAMETERWIDGET_H
  27. #include <QWidget>
  28. #include "EffectControls.h"
  29. #include "EqCurve.h"
  30. #include "TextFloat.h"
  31. class EqControls;
  32. class EqBand
  33. {
  34. public :
  35. EqBand();
  36. FloatModel *gain;
  37. FloatModel *res;
  38. FloatModel *freq;
  39. BoolModel *active;
  40. BoolModel *hp12;
  41. BoolModel *hp24;
  42. BoolModel *hp48;
  43. BoolModel *lp12;
  44. BoolModel *lp24;
  45. BoolModel *lp48;
  46. QColor color;
  47. int x;
  48. int y;
  49. QString name;
  50. float *peakL;
  51. float *peakR;
  52. };
  53. class EqParameterWidget : public QWidget
  54. {
  55. Q_OBJECT
  56. public:
  57. explicit EqParameterWidget( QWidget *parent = 0, EqControls * controls = 0 );
  58. ~EqParameterWidget();
  59. QList<EqHandle*> *m_handleList;
  60. const int bandCount()
  61. {
  62. return 8;
  63. }
  64. EqBand* getBandModels( int i );
  65. void changeHandle( int i );
  66. private:
  67. float m_pixelsPerUnitWidth;
  68. float m_pixelsPerUnitHeight;
  69. float m_pixelsPerOctave;
  70. float m_scale;
  71. int m_displayWidth, m_displayHeigth;
  72. EqControls *m_controls;
  73. EqBand *m_bands;
  74. EqHandle *m_handle;
  75. EqCurve *m_eqcurve;
  76. private slots:
  77. void updateModels();
  78. void updateHandle();
  79. };
  80. #endif // EQPARAMETERWIDGET_H