mixboard UI cleanup

portability/boost
zetaPRIME 2019-06-30 16:39:10 -04:00
parent b5f5aaf282
commit a052134503
1 changed files with 11 additions and 33 deletions

View File

@ -152,36 +152,18 @@ void MixBoard::onGadgetCreated() {
auto c = obj->inputPortContainer->childItems();
auto count = sections.size();
for (size_t i = 0; i < count; i++) {
auto ln = new LayoutGadget(l);
constexpr qreal spc = 7;
auto ln = (new LayoutGadget(l))->setMetrics(3);
auto tl = new LayoutGadget(ln, true);
auto mute = new ToggleGadget(tl);
mute->color = {255, 0, 0};
mute->text = "Mute";
mute->bind(sections[i].mute);
tl->addSpacer();
auto solo = new ToggleGadget(tl);
solo->color = {191, 191, 0};
solo->text = "Solo";
solo->bind(sections[i].solo);
auto tl = (new LayoutGadget(ln, true))->setMetrics(-1, spc);
/*auto mute = */(new ToggleGadget(tl))->bind(sections[i].mute)->setColor({255, 0, 0})->setToolTip("Mute", {-1, 0});
/*auto solo = */(new ToggleGadget(tl))->bind(sections[i].solo)->setColor({191, 191, 0})->setToolTip("Solo", {-1, 0});
auto gain = new KnobGadget(ln);
gain->setLabel("Gain");
gain->fText = [](double d) { return QString("%1dB").arg(d); };
gain->min = -60;
gain->max = 6;
gain->step = .1;
gain->bind(sections[i].gain);
auto end = new LayoutGadget(ln, true);
auto bIns = new ButtonGadget(end);
if (count > 1) end->addSpacer();
auto bDel = new ButtonGadget(end);
bIns->setSize(16, 16);
bDel->setSize(16, 16);
bIns->text = "+";
bDel->text = "-";
/*auto gain = */(new KnobGadget(ln))->bind(sections[i].gain)->setRange(-60, 6, .1)->setLabel("Gain")->setTextFunc([](double d) { return QString("%1dB").arg(d); });
auto end = (new LayoutGadget(ln, true))->setMetrics(-1, spc);
auto bIns = (new ButtonGadget(end))->setSize(16, 16)->setText("+");
auto bDel = (new ButtonGadget(end))->setSize(16, 16)->setText("-");
QObject::connect(bIns, &ButtonGadget::clicked, [this, i] { insertSection(static_cast<uint8_t>(i)); });
QObject::connect(bDel, &ButtonGadget::clicked, [this, i] { removeSection(static_cast<uint8_t>(i)); });
@ -192,10 +174,6 @@ void MixBoard::onGadgetCreated() {
auto lc = l->childItems();
for (auto i = 0; i < static_cast<int>(count); i++) c[i]->setY(lc[i]->y() + lc[i]->boundingRect().center().y());
auto btn = new ButtonGadget(l);
btn->text = "+";
btn->setSize(16, 16);
QObject::connect(btn, &ButtonGadget::clicked, [this, count] {
insertSection(static_cast<uint8_t>(count));
});
auto btn = (new ButtonGadget(l))->setSize(16, 16)->setText("+");
QObject::connect(btn, &ButtonGadget::clicked, [this, count] { insertSection(static_cast<uint8_t>(count)); });
}