ReverbSCControls.cpp 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. /*
  2. * ReverbSCControls.cpp - controls for ReverbSC
  3. *
  4. * Copyright (c) 2017 Paul Batchelor
  5. *
  6. * This file is part of LMMS - https://lmms.io
  7. *
  8. * This program is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU General Public
  10. * License as published by the Free Software Foundation; either
  11. * version 2 of the License, or (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  16. * General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public
  19. * License along with this program (see COPYING); if not, write to the
  20. * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  21. * Boston, MA 02110-1301 USA.
  22. *
  23. */
  24. #include <QDomElement>
  25. #include "ReverbSCControls.h"
  26. #include "ReverbSC.h"
  27. #include "Engine.h"
  28. #include "Song.h"
  29. ReverbSCControls::ReverbSCControls( ReverbSCEffect* effect ) :
  30. EffectControls( effect ),
  31. m_effect( effect ),
  32. m_inputGainModel( 0.0f, -60.0f, 15, 0.1f, this, tr( "Input gain" ) ),
  33. m_sizeModel( 0.89f, 0.0f, 1.0f, 0.01f, this, tr( "Size" ) ),
  34. m_colorModel( 10000.0f, 100.0f, 15000.0f, 0.1f, this, tr( "Color" ) ),
  35. m_outputGainModel( 0.0f, -60.0f, 15, 0.1f, this, tr( "Output gain" ) )
  36. {
  37. connect( Engine::mixer(), SIGNAL( sampleRateChanged() ), this, SLOT( changeSampleRate() ));
  38. }
  39. void ReverbSCControls::changeControl()
  40. {
  41. }
  42. void ReverbSCControls::loadSettings( const QDomElement& _this )
  43. {
  44. m_inputGainModel.loadSettings( _this, "input_gain" );
  45. m_sizeModel.loadSettings( _this, "size" );
  46. m_colorModel.loadSettings( _this, "color" );
  47. m_outputGainModel.loadSettings( _this, "output_gain" );
  48. }
  49. void ReverbSCControls::saveSettings( QDomDocument& doc, QDomElement& _this )
  50. {
  51. m_inputGainModel.saveSettings( doc, _this, "input_gain" );
  52. m_sizeModel.saveSettings( doc, _this, "size" );
  53. m_colorModel.saveSettings( doc, _this, "color" );
  54. m_outputGainModel.saveSettings( doc, _this, "output_gain" );
  55. }
  56. void ReverbSCControls::changeSampleRate()
  57. {
  58. m_effect->changeSampleRate();
  59. }