MultitapEchoControlDialog.cpp 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. /*
  2. * MultitapEchoControlDialog.cpp - a multitap echo delay plugin
  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 <QLayout>
  26. #include "MultitapEchoControlDialog.h"
  27. #include "MultitapEchoControls.h"
  28. #include "embed.h"
  29. #include "Graph.h"
  30. #include "PixmapButton.h"
  31. #include "ToolTip.h"
  32. #include "LedCheckbox.h"
  33. #include "Knob.h"
  34. #include "TempoSyncKnob.h"
  35. #include "LcdSpinBox.h"
  36. MultitapEchoControlDialog::MultitapEchoControlDialog( MultitapEchoControls * controls ) :
  37. EffectControlDialog( controls )
  38. {
  39. setAutoFillBackground( true );
  40. QPalette pal;
  41. pal.setBrush( backgroundRole(), PLUGIN_NAME::getIconPixmap( "artwork" ) );
  42. setPalette( pal );
  43. setFixedSize( 245, 300 );
  44. // graph widgets
  45. Graph * ampGraph = new Graph( this, Graph::BarStyle, 204, 105 );
  46. Graph * lpGraph = new Graph( this, Graph::BarStyle, 204, 105 );
  47. ampGraph->move( 30, 10 );
  48. lpGraph->move( 30, 125 );
  49. ampGraph->setModel( & controls->m_ampGraph );
  50. lpGraph->setModel( & controls->m_lpGraph );
  51. pal = QPalette();
  52. pal.setBrush( backgroundRole(), PLUGIN_NAME::getIconPixmap("graph_bg") );
  53. ampGraph->setAutoFillBackground( true );
  54. ampGraph->setPalette( pal );
  55. ampGraph->setGraphColor( QColor( 11, 213, 86) );
  56. ampGraph -> setMaximumSize( 204, 105 );
  57. lpGraph->setAutoFillBackground( true );
  58. lpGraph->setPalette( pal );
  59. lpGraph->setGraphColor( QColor( 0, 200, 187) );
  60. lpGraph -> setMaximumSize( 204, 105 );
  61. // steps spinbox
  62. LcdSpinBox * steps = new LcdSpinBox( 2, this, "Steps" );
  63. steps->move( 20, 245 );
  64. steps->setModel( & controls->m_steps );
  65. // knobs
  66. TempoSyncKnob * stepLength = new TempoSyncKnob( knobBright_26, this );
  67. stepLength->move( 100, 245 );
  68. stepLength->setModel( & controls->m_stepLength );
  69. stepLength->setLabel( tr( "Length" ) );
  70. stepLength->setHintText( tr( "Step length:" ) , " ms" );
  71. Knob * dryGain = new Knob( knobBright_26, this );
  72. dryGain->move( 150, 245 );
  73. dryGain->setModel( & controls->m_dryGain );
  74. dryGain->setLabel( tr( "Dry" ) );
  75. dryGain->setHintText( tr( "Dry gain:" ) , " dBFS" );
  76. Knob * stages = new Knob( knobBright_26, this );
  77. stages->move( 200, 245 );
  78. stages->setModel( & controls->m_stages );
  79. stages->setLabel( tr( "Stages" ) );
  80. stages->setHintText( tr( "Low-pass stages:" ) , "x" );
  81. // switch led
  82. LedCheckBox * swapInputs = new LedCheckBox( "Swap inputs", this, tr( "Swap inputs" ), LedCheckBox::Green );
  83. swapInputs->move( 20, 275 );
  84. swapInputs->setModel( & controls->m_swapInputs );
  85. ToolTip::add( swapInputs, tr( "Swap left and right input channels for reflections" ) );
  86. }