Browse Source

Expand MIDI driver and device into inline menu in app::appendMidiMenu().

tags/v2.0.0
Andrew Belt 4 years ago
parent
commit
fb41d3843e
1 changed files with 20 additions and 6 deletions
  1. +20
    -6
      src/app/MidiWidget.cpp

+ 20
- 6
src/app/MidiWidget.cpp View File

@@ -1,4 +1,5 @@
#include <app/MidiWidget.hpp> #include <app/MidiWidget.hpp>
#include <ui/MenuSeparator.hpp>
#include <helpers.hpp> #include <helpers.hpp>




@@ -197,13 +198,26 @@ void MidiWidget::setMidiPort(midi::Port* port) {




void appendMidiMenu(ui::Menu* menu, midi::Port* port) { void appendMidiMenu(ui::Menu* menu, midi::Port* port) {
MidiDriverItem* driverItem = createMenuItem<MidiDriverItem>("MIDI driver", RIGHT_ARROW);
driverItem->port = port;
menu->addChild(driverItem);
menu->addChild(createMenuLabel("MIDI driver"));
appendMidiDriverMenu(menu, port);


MidiDeviceItem* deviceItem = createMenuItem<MidiDeviceItem>("MIDI device", RIGHT_ARROW);
deviceItem->port = port;
menu->addChild(deviceItem);
menu->addChild(new ui::MenuSeparator);
menu->addChild(createMenuLabel("MIDI device"));
appendMidiDeviceMenu(menu, port);

menu->addChild(new ui::MenuSeparator);
// menu->addChild(createMenuLabel("MIDI channel"));
// appendMidiChannelMenu(menu, port);

// Uncomment this to use sub-menus instead of one big menu.

// MidiDriverItem* driverItem = createMenuItem<MidiDriverItem>("MIDI driver", RIGHT_ARROW);
// driverItem->port = port;
// menu->addChild(driverItem);

// MidiDeviceItem* deviceItem = createMenuItem<MidiDeviceItem>("MIDI device", RIGHT_ARROW);
// deviceItem->port = port;
// menu->addChild(deviceItem);


MidiChannelItem* channelItem = createMenuItem<MidiChannelItem>("MIDI channel", RIGHT_ARROW); MidiChannelItem* channelItem = createMenuItem<MidiChannelItem>("MIDI channel", RIGHT_ARROW);
channelItem->port = port; channelItem->port = port;


Loading…
Cancel
Save