Rework Crossover EQ plugin GUI (#7781)
* Switches to SVG assets * Fixes layout issues * Refactors redundant code --------- Co-authored-by: Tres Finocchiaro <tres.finocchiaro@gmail.com>
This commit is contained in:
@@ -1,3 +1,3 @@
|
||||
INCLUDE(BuildPlugin)
|
||||
|
||||
BUILD_PLUGIN(crossovereq CrossoverEQ.cpp CrossoverEQControls.cpp CrossoverEQControlDialog.cpp MOCFILES CrossoverEQControls.h CrossoverEQControlDialog.h EMBEDDED_RESOURCES artwork.png fader_bg.png fader_empty.png fader_knob2.png logo.png)
|
||||
BUILD_PLUGIN(crossovereq CrossoverEQ.cpp CrossoverEQControls.cpp CrossoverEQControlDialog.cpp MOCFILES CrossoverEQControls.h CrossoverEQControlDialog.h EMBEDDED_RESOURCES artwork.svg logo.svg)
|
||||
|
||||
@@ -31,90 +31,89 @@
|
||||
#include "LedCheckBox.h"
|
||||
#include "Knob.h"
|
||||
#include "Fader.h"
|
||||
#include "PixmapButton.h"
|
||||
|
||||
#include <QPixmap>
|
||||
#include <QHBoxLayout>
|
||||
#include <QVBoxLayout>
|
||||
|
||||
|
||||
namespace lmms::gui
|
||||
{
|
||||
|
||||
|
||||
CrossoverEQControlDialog::CrossoverEQControlDialog( CrossoverEQControls * controls ) :
|
||||
EffectControlDialog( controls )
|
||||
CrossoverEQControlDialog::CrossoverEQControlDialog(CrossoverEQControls *controls) :
|
||||
EffectControlDialog(controls)
|
||||
{
|
||||
setAutoFillBackground( true );
|
||||
setAutoFillBackground(true);
|
||||
QPalette pal;
|
||||
pal.setBrush( backgroundRole(), PLUGIN_NAME::getIconPixmap( "artwork" ) );
|
||||
setPalette( pal );
|
||||
setFixedSize( 167, 178 );
|
||||
pal.setBrush(backgroundRole(), PLUGIN_NAME::getIconPixmap("artwork"));
|
||||
setPalette(pal);
|
||||
setFixedSize(167, 218);
|
||||
auto layout = new QVBoxLayout(this);
|
||||
|
||||
auto knobsLayout = new QHBoxLayout();
|
||||
layout->addLayout(knobsLayout);
|
||||
|
||||
const auto makeKnob = [this, knobsLayout](
|
||||
FloatModel *model,
|
||||
const QString &label,
|
||||
const QString &txt_before
|
||||
) {
|
||||
auto k = new Knob(KnobType::Bright26, this);
|
||||
k->setModel(model);
|
||||
k->setLabel(label);
|
||||
k->setHintText(txt_before, "Hz");
|
||||
knobsLayout->addWidget(k, 0, Qt::AlignHCenter);
|
||||
};
|
||||
|
||||
makeKnob(&controls->m_xover12, "1/2", tr("Band 1/2 crossover"));
|
||||
makeKnob(&controls->m_xover23, "2/3", tr("Band 2/3 crossover"));
|
||||
makeKnob(&controls->m_xover34, "3/4", tr("Band 3/4 crossover"));
|
||||
|
||||
// knobs
|
||||
auto xover12 = new Knob(KnobType::Bright26, this);
|
||||
xover12->move( 29, 11 );
|
||||
xover12->setModel( & controls->m_xover12 );
|
||||
xover12->setLabel( "1/2" );
|
||||
xover12->setHintText( tr( "Band 1/2 crossover:" ), " Hz" );
|
||||
auto bandsLayout = new QGridLayout();
|
||||
bandsLayout->setContentsMargins(4, 10, 4, 5);
|
||||
layout->addLayout(bandsLayout);
|
||||
|
||||
auto xover23 = new Knob(KnobType::Bright26, this);
|
||||
xover23->move( 69, 11 );
|
||||
xover23->setModel( & controls->m_xover23 );
|
||||
xover23->setLabel( "2/3" );
|
||||
xover23->setHintText( tr( "Band 2/3 crossover:" ), " Hz" );
|
||||
const auto makeFader = [this, bandsLayout](
|
||||
FloatModel *model,
|
||||
const QString &label,
|
||||
int column
|
||||
) {
|
||||
auto f = new Fader(model, label, this, false);
|
||||
f->setHintText(label, "dBFS");
|
||||
f->setDisplayConversion(false);
|
||||
f->setRenderUnityLine(false);
|
||||
bandsLayout->addWidget(f, 0, column, Qt::AlignHCenter);
|
||||
};
|
||||
|
||||
auto xover34 = new Knob(KnobType::Bright26, this);
|
||||
xover34->move( 109, 11 );
|
||||
xover34->setModel( & controls->m_xover34 );
|
||||
xover34->setLabel( "3/4" );
|
||||
xover34->setHintText( tr( "Band 3/4 crossover:" ), " Hz" );
|
||||
|
||||
QPixmap const fader_knob(PLUGIN_NAME::getIconPixmap("fader_knob2"));
|
||||
|
||||
// faders
|
||||
auto gain1 = new Fader(&controls->m_gain1, tr("Band 1 gain"), this, fader_knob, false);
|
||||
gain1->move( 7, 56 );
|
||||
gain1->setDisplayConversion( false );
|
||||
gain1->setHintText( tr( "Band 1 gain:" ), " dBFS" );
|
||||
gain1->setRenderUnityLine(false);
|
||||
makeFader(&controls->m_gain1, tr("Band 1 gain"), 0);
|
||||
makeFader(&controls->m_gain2, tr("Band 2 gain"), 1);
|
||||
makeFader(&controls->m_gain3, tr("Band 3 gain"), 2);
|
||||
makeFader(&controls->m_gain4, tr("Band 4 gain"), 3);
|
||||
|
||||
auto gain2 = new Fader(&controls->m_gain2, tr("Band 2 gain"), this, fader_knob, false);
|
||||
gain2->move( 47, 56 );
|
||||
gain2->setDisplayConversion( false );
|
||||
gain2->setHintText( tr( "Band 2 gain:" ), " dBFS" );
|
||||
gain2->setRenderUnityLine(false);
|
||||
const auto muteOn = embed::getIconPixmap("mute_active");
|
||||
const auto muteOff = embed::getIconPixmap("mute_inactive");
|
||||
|
||||
auto gain3 = new Fader(&controls->m_gain3, tr("Band 3 gain"), this, fader_knob, false);
|
||||
gain3->move( 87, 56 );
|
||||
gain3->setDisplayConversion( false );
|
||||
gain3->setHintText( tr( "Band 3 gain:" ), " dBFS" );
|
||||
gain3->setRenderUnityLine(false);
|
||||
const auto makeMuteBtn = [this, bandsLayout, muteOn, muteOff](
|
||||
BoolModel *model,
|
||||
const QString &label,
|
||||
int column
|
||||
) {
|
||||
auto b = new PixmapButton(this, label);
|
||||
b->setActiveGraphic(muteOff);
|
||||
b->setInactiveGraphic(muteOn);
|
||||
b->setCheckable(true);
|
||||
b->setModel(model);
|
||||
b->setToolTip(label);
|
||||
bandsLayout->addWidget(b, 1, column, Qt::AlignCenter);
|
||||
};
|
||||
|
||||
auto gain4 = new Fader(&controls->m_gain4, tr("Band 4 gain"), this, fader_knob, false);
|
||||
gain4->move( 127, 56 );
|
||||
gain4->setDisplayConversion( false );
|
||||
gain4->setHintText( tr( "Band 4 gain:" ), " dBFS" );
|
||||
gain4->setRenderUnityLine(false);
|
||||
|
||||
// leds
|
||||
auto mute1 = new LedCheckBox("", this, tr("Band 1 mute"), LedCheckBox::LedColor::Green);
|
||||
mute1->move( 15, 154 );
|
||||
mute1->setModel( & controls->m_mute1 );
|
||||
mute1->setToolTip(tr("Mute band 1"));
|
||||
|
||||
auto mute2 = new LedCheckBox("", this, tr("Band 2 mute"), LedCheckBox::LedColor::Green);
|
||||
mute2->move( 55, 154 );
|
||||
mute2->setModel( & controls->m_mute2 );
|
||||
mute2->setToolTip(tr("Mute band 2"));
|
||||
|
||||
auto mute3 = new LedCheckBox("", this, tr("Band 3 mute"), LedCheckBox::LedColor::Green);
|
||||
mute3->move( 95, 154 );
|
||||
mute3->setModel( & controls->m_mute3 );
|
||||
mute3->setToolTip(tr("Mute band 3"));
|
||||
|
||||
auto mute4 = new LedCheckBox("", this, tr("Band 4 mute"), LedCheckBox::LedColor::Green);
|
||||
mute4->move( 135, 154 );
|
||||
mute4->setModel( & controls->m_mute4 );
|
||||
mute4->setToolTip(tr("Mute band 4"));
|
||||
makeMuteBtn(&controls->m_mute1, tr("Mute band 1"), 0);
|
||||
makeMuteBtn(&controls->m_mute2, tr("Mute band 2"), 1);
|
||||
makeMuteBtn(&controls->m_mute3, tr("Mute band 3"), 2);
|
||||
makeMuteBtn(&controls->m_mute4, tr("Mute band 4"), 3);
|
||||
}
|
||||
|
||||
|
||||
} // namespace lmms::gui
|
||||
} // namespace lmms::gui
|
||||
|
||||
@@ -121,4 +121,4 @@ void CrossoverEQControls::sampleRateChanged()
|
||||
}
|
||||
|
||||
|
||||
} // namespace lmms
|
||||
} // namespace lmms
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 876 B |
18
plugins/CrossoverEQ/artwork.svg
Normal file
18
plugins/CrossoverEQ/artwork.svg
Normal file
@@ -0,0 +1,18 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" width="167" height="218">
|
||||
<defs>
|
||||
<linearGradient id="a">
|
||||
<stop offset="0" stop-color="#08090c"/>
|
||||
<stop offset="1" stop-color="#101116"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="b">
|
||||
<stop offset="0" stop-color="#1a1d21"/>
|
||||
<stop offset="1" stop-color="#2d333a"/>
|
||||
</linearGradient>
|
||||
<linearGradient xlink:href="#a" id="c" x1="0" x2="0" y1="110" y2="0" gradientTransform="scale(1.67 1.98183)" gradientUnits="userSpaceOnUse"/>
|
||||
<linearGradient xlink:href="#b" id="d" x1="-29.25007" x2="-29.25007" y1="118" y2="10" gradientTransform="matrix(4 0 0 1.46296 122.50031 39.87036)" gradientUnits="userSpaceOnUse"/>
|
||||
</defs>
|
||||
<path fill="url(#c)" d="M0 0h167v218.00001H0Z"/>
|
||||
<rect width="156" height="158" x="5.5" y="54.5" fill="url(#d)" stroke="#000" rx="2.065" ry="2.065"/>
|
||||
<path fill="#fff" d="M7.56445 55C6.6888 55 6 55.6888 6 56.56445v1C6 56.6888 6.6888 56 7.56445 56h151.8711C160.3112 56 161 56.6888 161 57.56445v-1C161 55.6888 160.3112 55 159.43555 55Z" opacity=".1"/>
|
||||
<path d="M7.56445 212.00045C6.6888 212.00045 6 211.31165 6 210.436v-1c0 .87565.6888 1.56445 1.56445 1.56445h151.8711c.87565 0 1.56445-.6888 1.56445-1.56445v1c0 .87565-.6888 1.56445-1.56445 1.56445z" opacity=".3"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.3 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 351 B |
Binary file not shown.
|
Before Width: | Height: | Size: 774 B |
3
plugins/CrossoverEQ/logo.svg
Normal file
3
plugins/CrossoverEQ/logo.svg
Normal file
@@ -0,0 +1,3 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" width="48" height="48">
|
||||
<path fill="#fff" d="M7.86719 2C3.95608 2 2 3.95608 2 7.86719V40.1328C2 44.04392 3.95608 46 7.86719 46H40.1328C44.04392 46 46 44.04392 46 40.13281V7.8672C46 3.95608 44.04392 2 40.13281 2H7.8672zM24 9l15 8.4375V35.25l-5.625 2.8125L27.75 35.25v-6.5625l5.625-2.8125V20.25L24 15.5625 14.625 20.25v5.625l5.625 2.8125V35.25l-5.625 2.8125L9 35.25V17.4375L24 9z"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 451 B |
Reference in New Issue
Block a user