AmplifierControls.cpp 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. /*
  2. * AmplifierControls.cpp - controls for amplifier effect
  3. *
  4. * Copyright (c) 2014 Vesa Kivimäki <contact/dot/diizy/at/nbl/dot/fi>
  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. #include <QDomElement>
  26. #include "AmplifierControls.h"
  27. #include "Amplifier.h"
  28. #include "Engine.h"
  29. #include "Song.h"
  30. AmplifierControls::AmplifierControls( AmplifierEffect* effect ) :
  31. EffectControls( effect ),
  32. m_effect( effect ),
  33. m_volumeModel( 100.0f, 0.0f, 200.0f, 0.1f, this, tr( "Volume" ) ),
  34. m_panModel( 0.0f, -100.0f, 100.0f, 0.1f, this, tr( "Panning" ) ),
  35. m_leftModel( 100.0f, 0.0f, 200.0f, 0.1f, this, tr( "Left gain" ) ),
  36. m_rightModel( 100.0f, 0.0f, 200.0f, 0.1f, this, tr( "Right gain" ) )
  37. {
  38. /* connect( &m_volumeModel, SIGNAL( dataChanged() ), this, SLOT( changeControl() ) );
  39. connect( &m_panModel, SIGNAL( dataChanged() ), this, SLOT( changeControl() ) );
  40. connect( &m_leftModel, SIGNAL( dataChanged() ), this, SLOT( changeControl() ) );
  41. connect( &m_rightModel, SIGNAL( dataChanged() ), this, SLOT( changeControl() ) );*/
  42. }
  43. void AmplifierControls::changeControl()
  44. {
  45. // engine::getSong()->setModified();
  46. }
  47. void AmplifierControls::loadSettings( const QDomElement& _this )
  48. {
  49. m_volumeModel.loadSettings( _this, "volume" );
  50. m_panModel.loadSettings( _this, "pan" );
  51. m_leftModel.loadSettings( _this, "left" );
  52. m_rightModel.loadSettings( _this, "right" );
  53. }
  54. void AmplifierControls::saveSettings( QDomDocument& doc, QDomElement& _this )
  55. {
  56. m_volumeModel.saveSettings( doc, _this, "volume" );
  57. m_panModel.saveSettings( doc, _this, "pan" );
  58. m_leftModel.saveSettings( doc, _this, "left" );
  59. m_rightModel.saveSettings( doc, _this, "right" );
  60. }