CrossoverEQControlDialog.cpp 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. /*
  2. * CrossoverEQControlDialog.cpp - A native 4-band Crossover Equalizer
  3. * good for simulating tonestacks or simple peakless (flat-band) equalization
  4. *
  5. * Copyright (c) 2014 Vesa Kivimäki <contact/dot/diizy/at/nbl/dot/fi>
  6. * Copyright (c) 2006-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
  7. *
  8. * This file is part of LMMS - https://lmms.io
  9. *
  10. * This program is free software; you can redistribute it and/or
  11. * modify it under the terms of the GNU General Public
  12. * License as published by the Free Software Foundation; either
  13. * version 2 of the License, or (at your option) any later version.
  14. *
  15. * This program is distributed in the hope that it will be useful,
  16. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  18. * General Public License for more details.
  19. *
  20. * You should have received a copy of the GNU General Public
  21. * License along with this program (see COPYING); if not, write to the
  22. * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  23. * Boston, MA 02110-1301 USA.
  24. *
  25. */
  26. #include <QLayout>
  27. #include <QLabel>
  28. #include "CrossoverEQControlDialog.h"
  29. #include "CrossoverEQControls.h"
  30. #include "embed.h"
  31. #include "ToolTip.h"
  32. #include "LedCheckbox.h"
  33. #include "Knob.h"
  34. #include "Fader.h"
  35. CrossoverEQControlDialog::CrossoverEQControlDialog( CrossoverEQControls * controls ) :
  36. EffectControlDialog( controls )
  37. {
  38. setAutoFillBackground( true );
  39. QPalette pal;
  40. pal.setBrush( backgroundRole(), PLUGIN_NAME::getIconPixmap( "artwork" ) );
  41. setPalette( pal );
  42. setFixedSize( 167, 178 );
  43. // knobs
  44. Knob * xover12 = new Knob( knobBright_26, this );
  45. xover12->move( 29, 11 );
  46. xover12->setModel( & controls->m_xover12 );
  47. xover12->setLabel( "1/2" );
  48. xover12->setHintText( tr( "Band 1/2 crossover:" ), " Hz" );
  49. Knob * xover23 = new Knob( knobBright_26, this );
  50. xover23->move( 69, 11 );
  51. xover23->setModel( & controls->m_xover23 );
  52. xover23->setLabel( "2/3" );
  53. xover23->setHintText( tr( "Band 2/3 crossover:" ), " Hz" );
  54. Knob * xover34 = new Knob( knobBright_26, this );
  55. xover34->move( 109, 11 );
  56. xover34->setModel( & controls->m_xover34 );
  57. xover34->setLabel( "3/4" );
  58. xover34->setHintText( tr( "Band 3/4 crossover:" ), " Hz" );
  59. m_fader_bg = QPixmap( PLUGIN_NAME::getIconPixmap( "fader_bg" ) );
  60. m_fader_empty = QPixmap( PLUGIN_NAME::getIconPixmap( "fader_empty" ) );
  61. m_fader_knob = QPixmap( PLUGIN_NAME::getIconPixmap( "fader_knob2" ) );
  62. // faders
  63. Fader * gain1 = new Fader( &controls->m_gain1, tr( "Band 1 gain" ), this,
  64. &m_fader_bg, &m_fader_empty, &m_fader_knob );
  65. gain1->move( 7, 56 );
  66. gain1->setDisplayConversion( false );
  67. gain1->setHintText( tr( "Band 1 gain:" ), " dBFS" );
  68. Fader * gain2 = new Fader( &controls->m_gain2, tr( "Band 2 gain" ), this,
  69. &m_fader_bg, &m_fader_empty, &m_fader_knob );
  70. gain2->move( 47, 56 );
  71. gain2->setDisplayConversion( false );
  72. gain2->setHintText( tr( "Band 2 gain:" ), " dBFS" );
  73. Fader * gain3 = new Fader( &controls->m_gain3, tr( "Band 3 gain" ), this,
  74. &m_fader_bg, &m_fader_empty, &m_fader_knob );
  75. gain3->move( 87, 56 );
  76. gain3->setDisplayConversion( false );
  77. gain3->setHintText( tr( "Band 3 gain:" ), " dBFS" );
  78. Fader * gain4 = new Fader( &controls->m_gain4, tr( "Band 4 gain" ), this,
  79. &m_fader_bg, &m_fader_empty, &m_fader_knob );
  80. gain4->move( 127, 56 );
  81. gain4->setDisplayConversion( false );
  82. gain4->setHintText( tr( "Band 4 gain:" ), " dBFS" );
  83. // leds
  84. LedCheckBox * mute1 = new LedCheckBox( "", this, tr( "Band 1 mute" ), LedCheckBox::Green );
  85. mute1->move( 15, 154 );
  86. mute1->setModel( & controls->m_mute1 );
  87. ToolTip::add( mute1, tr( "Mute band 1" ) );
  88. LedCheckBox * mute2 = new LedCheckBox( "", this, tr( "Band 2 mute" ), LedCheckBox::Green );
  89. mute2->move( 55, 154 );
  90. mute2->setModel( & controls->m_mute2 );
  91. ToolTip::add( mute2, tr( "Mute band 2" ) );
  92. LedCheckBox * mute3 = new LedCheckBox( "", this, tr( "Band 3 mute" ), LedCheckBox::Green );
  93. mute3->move( 95, 154 );
  94. mute3->setModel( & controls->m_mute3 );
  95. ToolTip::add( mute3, tr( "Mute band 3" ) );
  96. LedCheckBox * mute4 = new LedCheckBox( "", this, tr( "Band 4 mute" ), LedCheckBox::Green );
  97. mute4->move( 135, 154 );
  98. mute4->setModel( & controls->m_mute4 );
  99. ToolTip::add( mute4, tr( "Mute band 4" ) );
  100. }