Browse Source

Made MIDI Interface a bit prettier

tags/v0.3.0
Andrew Belt 7 years ago
parent
commit
711bdbae32
2 changed files with 44 additions and 16 deletions
  1. +1
    -1
      src/core/AudioInterface.cpp
  2. +43
    -15
      src/core/MidiInterface.cpp

+ 1
- 1
src/core/AudioInterface.cpp View File

@@ -322,7 +322,7 @@ struct AudioChoice : ChoiceButton {
}
void step() {
std::string name = audioInterface->getDeviceName(audioInterface->deviceId);
text = name.empty() ? "(no device)" : ellipsize(name, 14);
text = ellipsize(name, 24);
}
};



+ 43
- 15
src/core/MidiInterface.cpp View File

@@ -244,7 +244,7 @@ struct MidiChoice : ChoiceButton {
}
void step() {
std::string name = midiInterface->getPortName(midiInterface->portId);
text = name.empty() ? "(no device)" : ellipsize(name, 14);
text = ellipsize(name, 8);
}
};

@@ -287,7 +287,7 @@ struct ChannelChoice : ChoiceButton {
MidiInterfaceWidget::MidiInterfaceWidget() {
MidiInterface *module = new MidiInterface();
setModule(module);
box.size = Vec(15*8, 380);
box.size = Vec(15*6, 380);

{
Panel *panel = new LightPanel();
@@ -317,7 +317,7 @@ MidiInterfaceWidget::MidiInterfaceWidget() {
{
Label *label = new Label();
label->box.pos = Vec(margin, yPos);
label->text = "MIDI channel";
label->text = "Channel";
addChild(label);
yPos += labelHeight + margin;

@@ -329,19 +329,47 @@ MidiInterfaceWidget::MidiInterfaceWidget() {
yPos += channelChoice->box.size.y + margin;
}

yPos += 5;
addOutput(createOutput<PJ3410Port>(Vec(20, yPos), module, MidiInterface::PITCH_OUTPUT));
yPos += 37 + margin;
{
Label *label = new Label();
label->box.pos = Vec(margin, yPos);
label->text = "1V/oct";
addChild(label);
yPos += labelHeight + margin;

addOutput(createOutput<PJ3410Port>(Vec(28, yPos), module, MidiInterface::PITCH_OUTPUT));
yPos += 37 + margin;
}

{
Label *label = new Label();
label->box.pos = Vec(margin, yPos);
label->text = "Gate";
addChild(label);
yPos += labelHeight + margin;

addOutput(createOutput<PJ3410Port>(Vec(28, yPos), module, MidiInterface::GATE_OUTPUT));
yPos += 37 + margin;
}

{
Label *label = new Label();
label->box.pos = Vec(margin, yPos);
label->text = "Mod Wheel";
addChild(label);
yPos += labelHeight + margin;

yPos += 5;
addOutput(createOutput<PJ3410Port>(Vec(20, yPos), module, MidiInterface::GATE_OUTPUT));
yPos += 37 + margin;
addOutput(createOutput<PJ3410Port>(Vec(28, yPos), module, MidiInterface::MOD_OUTPUT));
yPos += 37 + margin;
}

yPos += 5;
addOutput(createOutput<PJ3410Port>(Vec(20, yPos), module, MidiInterface::MOD_OUTPUT));
yPos += 37 + margin;
{
Label *label = new Label();
label->box.pos = Vec(margin, yPos);
label->text = "Pitch Wheel";
addChild(label);
yPos += labelHeight + margin;

yPos += 5;
addOutput(createOutput<PJ3410Port>(Vec(20, yPos), module, MidiInterface::PITCHWHEEL_OUTPUT));
yPos += 37 + margin;
addOutput(createOutput<PJ3410Port>(Vec(28, yPos), module, MidiInterface::PITCHWHEEL_OUTPUT));
yPos += 37 + margin;
}
}

Loading…
Cancel
Save