BitcrushControls.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. /*
  2. * BitcrushControls.h - A native bitcrusher
  3. *
  4. * Copyright (c) 2014 Vesa Kivimäki <contact/dot/diizy/at/nbl/dot/fi>
  5. * Copyright (c) 2006-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 BITCRUSH_CONTROLS_H
  26. #define BITCRUSH_CONTROLS_H
  27. #include "EffectControls.h"
  28. #include "BitcrushControlDialog.h"
  29. class BitcrushEffect;
  30. class BitcrushControls : public EffectControls
  31. {
  32. Q_OBJECT
  33. public:
  34. BitcrushControls( BitcrushEffect * eff );
  35. virtual ~BitcrushControls();
  36. virtual void saveSettings( QDomDocument & doc, QDomElement & elem );
  37. virtual void loadSettings( const QDomElement & elem );
  38. inline virtual QString nodeName() const
  39. {
  40. return( "bitcrushcontrols" );
  41. }
  42. virtual int controlCount()
  43. {
  44. return( 9 );
  45. }
  46. virtual EffectControlDialog * createView()
  47. {
  48. return( new BitcrushControlDialog( this ) );
  49. }
  50. private slots:
  51. void sampleRateChanged();
  52. private:
  53. BitcrushEffect * m_effect;
  54. FloatModel m_inGain;
  55. FloatModel m_inNoise;
  56. FloatModel m_outGain;
  57. FloatModel m_outClip;
  58. FloatModel m_rate;
  59. FloatModel m_stereoDiff;
  60. FloatModel m_levels;
  61. BoolModel m_rateEnabled;
  62. BoolModel m_depthEnabled;
  63. friend class BitcrushControlDialog;
  64. friend class BitcrushEffect;
  65. };
  66. #endif