peak_controller_effect_control_dialog.cpp 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. /*
  2. * peak_controller_effect_control_dialog.cpp - control dialog for
  3. * PeakControllerEffect
  4. *
  5. * Copyright (c) 2008 Paul Giblock <drfaygo/at/gmail/dot/com>
  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 <QLayout>
  26. #include <QLabel>
  27. #include "peak_controller_effect_control_dialog.h"
  28. #include "peak_controller_effect_controls.h"
  29. #include "Knob.h"
  30. #include "LedCheckbox.h"
  31. #include "embed.h"
  32. PeakControllerEffectControlDialog::PeakControllerEffectControlDialog(
  33. PeakControllerEffectControls * _controls ) :
  34. EffectControlDialog( _controls )
  35. {
  36. setWindowIcon( embed::getIconPixmap( "controller" ) );
  37. setAutoFillBackground( true );
  38. QPalette pal;
  39. pal.setBrush( backgroundRole(), PLUGIN_NAME::getIconPixmap( "artwork" ) );
  40. setPalette( pal );
  41. setFixedSize( 240, 80 );
  42. m_baseKnob = new Knob( knobBright_26, this );
  43. m_baseKnob->setLabel( tr( "BASE" ) );
  44. m_baseKnob->setModel( &_controls->m_baseModel );
  45. m_baseKnob->setHintText( tr( "Base:" ) , "" );
  46. m_amountKnob = new Knob( knobBright_26, this );
  47. m_amountKnob->setLabel( tr( "AMNT" ) );
  48. m_amountKnob->setModel( &_controls->m_amountModel );
  49. m_amountKnob->setHintText( tr( "Modulation amount:" ) , "" );
  50. m_amountMultKnob = new Knob( knobBright_26, this );
  51. m_amountMultKnob->setLabel( tr( "MULT" ) );
  52. m_amountMultKnob->setModel( &_controls->m_amountMultModel );
  53. m_amountMultKnob->setHintText( tr( "Amount multiplicator:" ) , "" );
  54. m_attackKnob = new Knob( knobBright_26, this );
  55. m_attackKnob->setLabel( tr( "ATCK" ) );
  56. m_attackKnob->setModel( &_controls->m_attackModel );
  57. m_attackKnob->setHintText( tr( "Attack:" ) , "" );
  58. m_decayKnob = new Knob( knobBright_26, this );
  59. m_decayKnob->setLabel( tr( "DCAY" ) );
  60. m_decayKnob->setModel( &_controls->m_decayModel );
  61. m_decayKnob->setHintText( tr( "Release:" ) , "" );
  62. m_tresholdKnob = new Knob( knobBright_26, this );
  63. m_tresholdKnob->setLabel( tr( "TRSH" ) );
  64. m_tresholdKnob->setModel( &_controls->m_tresholdModel );
  65. m_tresholdKnob->setHintText( tr( "Treshold:" ) , "" );
  66. m_muteLed = new LedCheckBox( tr( "Mute output" ), this );
  67. m_muteLed->setModel( &_controls->m_muteModel );
  68. m_absLed = new LedCheckBox( tr( "Absolute value" ), this );
  69. m_absLed->setModel( &_controls->m_absModel );
  70. QVBoxLayout * mainLayout = new QVBoxLayout();
  71. QHBoxLayout * knobLayout = new QHBoxLayout();
  72. QHBoxLayout * ledLayout = new QHBoxLayout();
  73. knobLayout->addWidget( m_baseKnob );
  74. knobLayout->addWidget( m_amountKnob );
  75. knobLayout->addWidget( m_amountMultKnob );
  76. knobLayout->addWidget( m_attackKnob );
  77. knobLayout->addWidget( m_decayKnob );
  78. knobLayout->addWidget( m_tresholdKnob );
  79. ledLayout->addWidget( m_muteLed );
  80. ledLayout->addWidget( m_absLed );
  81. mainLayout->setContentsMargins( 3, 10, 0, 0 );
  82. mainLayout->addLayout( knobLayout );
  83. mainLayout->addLayout( ledLayout );
  84. setLayout( mainLayout );
  85. }