mirror of
https://github.com/LMMS/lmms.git
synced 2026-05-18 11:45:04 -04:00
Rewrite Amplifier plugin code (#6989)
* rewrite amplifier plugin style * pomelo * oroblanco * grapefruit * calamlamondin
This commit is contained in:
@@ -23,53 +23,38 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include "AmplifierControlDialog.h"
|
||||
#include "AmplifierControls.h"
|
||||
#include "embed.h"
|
||||
#include "Knob.h"
|
||||
|
||||
|
||||
namespace lmms::gui
|
||||
{
|
||||
|
||||
|
||||
AmplifierControlDialog::AmplifierControlDialog( AmplifierControls* controls ) :
|
||||
EffectControlDialog( controls )
|
||||
AmplifierControlDialog::AmplifierControlDialog(AmplifierControls* controls) :
|
||||
EffectControlDialog(controls)
|
||||
{
|
||||
setAutoFillBackground( true );
|
||||
setAutoFillBackground(true);
|
||||
QPalette pal;
|
||||
pal.setBrush( backgroundRole(), PLUGIN_NAME::getIconPixmap( "artwork" ) );
|
||||
setPalette( pal );
|
||||
setFixedSize( 100, 110 );
|
||||
pal.setBrush(backgroundRole(), PLUGIN_NAME::getIconPixmap("artwork"));
|
||||
setPalette(pal);
|
||||
setFixedSize(100, 110);
|
||||
|
||||
auto makeKnob = [this](int x, int y, const QString& label, const QString& hintText, const QString& unit, FloatModel* model, bool isVolume)
|
||||
{
|
||||
Knob* newKnob = new Knob(KnobType::Bright26, this);
|
||||
newKnob->move(x, y);
|
||||
newKnob->setModel(model);
|
||||
newKnob->setLabel(label);
|
||||
newKnob->setHintText(hintText, unit);
|
||||
newKnob->setVolumeKnob(isVolume);
|
||||
return newKnob;
|
||||
};
|
||||
|
||||
auto volumeKnob = new Knob(KnobType::Bright26, this);
|
||||
volumeKnob -> move( 16, 10 );
|
||||
volumeKnob -> setVolumeKnob( true );
|
||||
volumeKnob->setModel( &controls->m_volumeModel );
|
||||
volumeKnob->setLabel( tr( "VOL" ) );
|
||||
volumeKnob->setHintText( tr( "Volume:" ) , "%" );
|
||||
|
||||
auto panKnob = new Knob(KnobType::Bright26, this);
|
||||
panKnob -> move( 57, 10 );
|
||||
panKnob->setModel( &controls->m_panModel );
|
||||
panKnob->setLabel( tr( "PAN" ) );
|
||||
panKnob->setHintText( tr( "Panning:" ) , "" );
|
||||
|
||||
auto leftKnob = new Knob(KnobType::Bright26, this);
|
||||
leftKnob -> move( 16, 65 );
|
||||
leftKnob -> setVolumeKnob( true );
|
||||
leftKnob->setModel( &controls->m_leftModel );
|
||||
leftKnob->setLabel( tr( "LEFT" ) );
|
||||
leftKnob->setHintText( tr( "Left gain:" ) , "%" );
|
||||
|
||||
auto rightKnob = new Knob(KnobType::Bright26, this);
|
||||
rightKnob -> move( 57, 65 );
|
||||
rightKnob -> setVolumeKnob( true );
|
||||
rightKnob->setModel( &controls->m_rightModel );
|
||||
rightKnob->setLabel( tr( "RIGHT" ) );
|
||||
rightKnob->setHintText( tr( "Right gain:" ) , "%" );
|
||||
makeKnob(16, 10, tr("VOL"), tr("Volume:"), "%", &controls->m_volumeModel, true);
|
||||
makeKnob(57, 10, tr("PAN"), tr("Panning:"), "%", &controls->m_panModel, false);
|
||||
makeKnob(16, 65, tr("LEFT"), tr("Left gain:"), "%", &controls->m_leftModel, true);
|
||||
makeKnob(57, 65, tr("RIGHT"), tr("Right gain:"), "%", &controls->m_rightModel, true);
|
||||
}
|
||||
|
||||
|
||||
} // namespace lmms::gui
|
||||
} // namespace lmms::gui
|
||||
|
||||
Reference in New Issue
Block a user