waveshaper_controls.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. /*
  2. * waveshaper_controls.h - controls for waveshaper-effect
  3. *
  4. * Copyright (c) 2014 Vesa Kivimäki <contact/dot/diizy/at/nbl/dot/fi>
  5. * Copyright (c) 2008 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 WAVESHAPER_CONTROLS_H
  26. #define WAVESHAPER_CONTROLS_H
  27. #include "EffectControls.h"
  28. #include "waveshaper_control_dialog.h"
  29. #include "Knob.h"
  30. #include "Graph.h"
  31. class waveShaperEffect;
  32. class waveShaperControls : public EffectControls
  33. {
  34. Q_OBJECT
  35. public:
  36. waveShaperControls( waveShaperEffect * _eff );
  37. virtual ~waveShaperControls()
  38. {
  39. }
  40. virtual void saveSettings( QDomDocument & _doc, QDomElement & _parent );
  41. virtual void loadSettings( const QDomElement & _this );
  42. inline virtual QString nodeName() const
  43. {
  44. return( "waveshapercontrols" );
  45. }
  46. virtual void setDefaultShape();
  47. virtual int controlCount()
  48. {
  49. return( 4 );
  50. }
  51. virtual EffectControlDialog * createView()
  52. {
  53. return( new waveShaperControlDialog( this ) );
  54. }
  55. private slots:
  56. void samplesChanged( int, int );
  57. void resetClicked();
  58. void smoothClicked();
  59. void addOneClicked();
  60. void subOneClicked();
  61. private:
  62. waveShaperEffect * m_effect;
  63. FloatModel m_inputModel;
  64. FloatModel m_outputModel;
  65. graphModel m_wavegraphModel;
  66. BoolModel m_clipModel;
  67. friend class waveShaperControlDialog;
  68. friend class waveShaperEffect;
  69. } ;
  70. #endif