stereomatrix_controls.cpp 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. /*
  2. * stereomatrix_controls.cpp - controls for stereoMatrix-effect
  3. *
  4. * Copyright (c) 2008 Paul Giblock <drfaygo/at/gmail/dot/com>
  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 "stereomatrix_controls.h"
  26. #include "stereo_matrix.h"
  27. stereoMatrixControls::stereoMatrixControls( stereoMatrixEffect * _eff ) :
  28. EffectControls( _eff ),
  29. m_effect( _eff ),
  30. m_llModel( 1.0f, -1.0f, 1.0f, 0.01f, this, tr( "Left to Left" ) ),
  31. m_lrModel( 0.0f, -1.0f, 1.0f, 0.01f, this, tr( "Left to Right" ) ),
  32. m_rlModel( 0.0f, -1.0f, 1.0f, 0.01f, this, tr( "Right to Left" ) ),
  33. m_rrModel( 1.0f, -1.0f, 1.0f, 0.01f, this, tr( "Right to Right" ) )
  34. {
  35. m_llModel.setCenterValue( 0 );
  36. m_lrModel.setCenterValue( 0 );
  37. m_rlModel.setCenterValue( 0 );
  38. m_rrModel.setCenterValue( 0 );
  39. connect( &m_llModel, SIGNAL( dataChanged() ),
  40. this, SLOT( changeMatrix() ) );
  41. connect( &m_lrModel, SIGNAL( dataChanged() ),
  42. this, SLOT( changeMatrix() ) );
  43. connect( &m_rlModel, SIGNAL( dataChanged() ),
  44. this, SLOT( changeMatrix() ) );
  45. connect( &m_rrModel, SIGNAL( dataChanged() ),
  46. this, SLOT( changeMatrix() ) );
  47. changeMatrix();
  48. }
  49. void stereoMatrixControls::changeMatrix()
  50. {
  51. }
  52. void stereoMatrixControls::loadSettings( const QDomElement & _this )
  53. {
  54. m_llModel.loadSettings( _this, "l-l" );
  55. m_lrModel.loadSettings( _this, "l-r" );
  56. m_rlModel.loadSettings( _this, "r-l" );
  57. m_rrModel.loadSettings( _this, "r-r" );
  58. }
  59. void stereoMatrixControls::saveSettings( QDomDocument & _doc,
  60. QDomElement & _this )
  61. {
  62. m_llModel.saveSettings( _doc, _this, "l-l" );
  63. m_lrModel.saveSettings( _doc, _this, "l-r" );
  64. m_rlModel.saveSettings( _doc, _this, "r-l" );
  65. m_rrModel.saveSettings( _doc, _this, "r-r" );
  66. }