dynamics_processor_control_dialog.cpp 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. /*
  2. * dynamics_processor_control_dialog.cpp - control-dialog for dynamics_processor-effect
  3. *
  4. * Copyright (c) 2014 Vesa Kivimäki <contact/dot/diizy/at/nbl/dot/fi>
  5. * Copyright (c) 2006-2008 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 <QLayout>
  26. #include "dynamics_processor_control_dialog.h"
  27. #include "dynamics_processor_controls.h"
  28. #include "embed.h"
  29. #include "Graph.h"
  30. #include "PixmapButton.h"
  31. #include "ToolTip.h"
  32. #include "LedCheckbox.h"
  33. dynProcControlDialog::dynProcControlDialog(
  34. dynProcControls * _controls ) :
  35. EffectControlDialog( _controls )
  36. {
  37. setAutoFillBackground( true );
  38. QPalette pal;
  39. pal.setBrush( backgroundRole(),
  40. PLUGIN_NAME::getIconPixmap( "artwork" ) );
  41. setPalette( pal );
  42. setFixedSize( 224, 319 );
  43. Graph * waveGraph = new Graph( this, Graph::LinearNonCyclicStyle, 204, 205 );
  44. waveGraph -> move( 10, 6 );
  45. waveGraph -> setModel( &_controls -> m_wavegraphModel );
  46. waveGraph -> setAutoFillBackground( true );
  47. pal = QPalette();
  48. pal.setBrush( backgroundRole(),
  49. PLUGIN_NAME::getIconPixmap("wavegraph") );
  50. waveGraph->setPalette( pal );
  51. waveGraph->setGraphColor( QColor( 85, 204, 145 ) );
  52. waveGraph -> setMaximumSize( 204, 205 );
  53. Knob * inputKnob = new Knob( knobBright_26, this);
  54. inputKnob -> setVolumeKnob( true );
  55. inputKnob -> setVolumeRatio( 1.0 );
  56. inputKnob -> move( 26, 223 );
  57. inputKnob->setModel( &_controls->m_inputModel );
  58. inputKnob->setLabel( tr( "INPUT" ) );
  59. inputKnob->setHintText( tr( "Input gain:" ) , "" );
  60. Knob * outputKnob = new Knob( knobBright_26, this );
  61. outputKnob -> setVolumeKnob( true );
  62. outputKnob -> setVolumeRatio( 1.0 );
  63. outputKnob -> move( 76, 223 );
  64. outputKnob->setModel( &_controls->m_outputModel );
  65. outputKnob->setLabel( tr( "OUTPUT" ) );
  66. outputKnob->setHintText( tr( "Output gain:" ) , "" );
  67. Knob * attackKnob = new Knob( knobBright_26, this);
  68. attackKnob -> move( 24, 268 );
  69. attackKnob->setModel( &_controls->m_attackModel );
  70. attackKnob->setLabel( tr( "ATTACK" ) );
  71. attackKnob->setHintText( tr( "Peak attack time:" ) , "ms" );
  72. Knob * releaseKnob = new Knob( knobBright_26, this );
  73. releaseKnob -> move( 74, 268 );
  74. releaseKnob->setModel( &_controls->m_releaseModel );
  75. releaseKnob->setLabel( tr( "RELEASE" ) );
  76. releaseKnob->setHintText( tr( "Peak release time:" ) , "ms" );
  77. //wavegraph control buttons
  78. PixmapButton * resetButton = new PixmapButton( this, tr("Reset wavegraph") );
  79. resetButton -> move( 162, 223 );
  80. resetButton -> resize( 13, 48 );
  81. resetButton -> setActiveGraphic( PLUGIN_NAME::getIconPixmap( "reset_active" ) );
  82. resetButton -> setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "reset_inactive" ) );
  83. ToolTip::add( resetButton, tr( "Reset wavegraph" ) );
  84. PixmapButton * smoothButton = new PixmapButton( this, tr("Smooth wavegraph") );
  85. smoothButton -> move( 162, 239 );
  86. smoothButton -> resize( 13, 48 );
  87. smoothButton -> setActiveGraphic( PLUGIN_NAME::getIconPixmap( "smooth_active" ) );
  88. smoothButton -> setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "smooth_inactive" ) );
  89. ToolTip::add( smoothButton, tr( "Smooth wavegraph" ) );
  90. PixmapButton * addOneButton = new PixmapButton( this, tr("Increase wavegraph amplitude by 1 dB") );
  91. addOneButton -> move( 131, 223 );
  92. addOneButton -> resize( 13, 29 );
  93. addOneButton -> setActiveGraphic( PLUGIN_NAME::getIconPixmap( "add1_active" ) );
  94. addOneButton -> setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "add1_inactive" ) );
  95. ToolTip::add( addOneButton, tr( "Increase wavegraph amplitude by 1 dB" ) );
  96. PixmapButton * subOneButton = new PixmapButton( this, tr("Decrease wavegraph amplitude by 1 dB") );
  97. subOneButton -> move( 131, 239 );
  98. subOneButton -> resize( 13, 29 );
  99. subOneButton -> setActiveGraphic( PLUGIN_NAME::getIconPixmap( "sub1_active" ) );
  100. subOneButton -> setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "sub1_inactive" ) );
  101. ToolTip::add( subOneButton, tr( "Decrease wavegraph amplitude by 1 dB" ) );
  102. //stereomode switches
  103. PixmapButton * smMaxButton = new PixmapButton( this, tr( "Stereo mode: maximum" ) );
  104. smMaxButton -> move( 131, 257 );
  105. smMaxButton -> resize( 78, 17 );
  106. smMaxButton -> setActiveGraphic( PLUGIN_NAME::getIconPixmap( "max_active" ) );
  107. smMaxButton -> setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "max_inactive" ) );
  108. ToolTip::add( smMaxButton, tr( "Process based on the maximum of both stereo channels" ) );
  109. PixmapButton * smAvgButton = new PixmapButton( this, tr( "Stereo mode: average" ) );
  110. smAvgButton -> move( 131, 274 );
  111. smAvgButton -> resize( 78, 16 );
  112. smAvgButton -> setActiveGraphic( PLUGIN_NAME::getIconPixmap( "avg_active" ) );
  113. smAvgButton -> setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "avg_inactive" ) );
  114. ToolTip::add( smAvgButton, tr( "Process based on the average of both stereo channels" ) );
  115. PixmapButton * smUnlButton = new PixmapButton( this, tr( "Stereo mode: unlinked" ) );
  116. smUnlButton -> move( 131, 290 );
  117. smUnlButton -> resize( 78, 17 );
  118. smUnlButton -> setActiveGraphic( PLUGIN_NAME::getIconPixmap( "unl_active" ) );
  119. smUnlButton -> setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "unl_inactive" ) );
  120. ToolTip::add( smUnlButton, tr( "Process each stereo channel independently" ) );
  121. automatableButtonGroup * smGroup = new automatableButtonGroup( this );
  122. smGroup -> addButton( smMaxButton );
  123. smGroup -> addButton( smAvgButton );
  124. smGroup -> addButton( smUnlButton );
  125. smGroup -> setModel( &_controls -> m_stereomodeModel );
  126. connect( resetButton, SIGNAL (clicked () ),
  127. _controls, SLOT ( resetClicked() ) );
  128. connect( smoothButton, SIGNAL (clicked () ),
  129. _controls, SLOT ( smoothClicked() ) );
  130. connect( addOneButton, SIGNAL( clicked() ),
  131. _controls, SLOT( addOneClicked() ) );
  132. connect( subOneButton, SIGNAL( clicked() ),
  133. _controls, SLOT( subOneClicked() ) );
  134. }