diff options
author | Robin Gareus <robin@gareus.org> | 2016-03-16 04:41:19 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2016-03-16 04:41:19 +0100 |
commit | e7181c0cc49094d56eb1b9c320a1dc3bb34e50cd (patch) | |
tree | 11b6105ea45b25349c1a40020e53fbc703ba6677 /gtk2_ardour/ardour_ui.cc | |
parent | c07bca3a628aa118f444e1a3d6cf1aec9eb81c76 (diff) |
Midi Busses? why yes!
Diffstat (limited to 'gtk2_ardour/ardour_ui.cc')
-rw-r--r-- | gtk2_ardour/ardour_ui.cc | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc index a01f2edaed..e1bcd06b7c 100644 --- a/gtk2_ardour/ardour_ui.cc +++ b/gtk2_ardour/ardour_ui.cc @@ -1806,6 +1806,31 @@ restart with more ports."), PROGRAM_NAME)); } } +void +ARDOUR_UI::session_add_midi_bus (RouteGroup* route_group, uint32_t how_many, const string& name_template, PluginInfoPtr instrument) +{ + + if (_session == 0) { + warning << _("You cannot add a track without a session already loaded.") << endmsg; + return; + } + + try { + RouteList routes = _session->new_midi_route (route_group, how_many, name_template, instrument); + if (routes.size() != how_many) { + error << string_compose(P_("could not create %1 new Midi Bus", "could not create %1 new Midi Busses", how_many), how_many) << endmsg; + } + + } + catch (...) { + MessageDialog msg (_main_window, + string_compose (_("There are insufficient ports available\n\ +to create a new track or bus.\n\ +You should save %1, exit and\n\ +restart with more ports."), PROGRAM_NAME)); + msg.run (); + } +} void ARDOUR_UI::session_add_midi_route (bool disk, RouteGroup* route_group, uint32_t how_many, const string& name_template, PluginInfoPtr instrument) @@ -1815,6 +1840,8 @@ ARDOUR_UI::session_add_midi_route (bool disk, RouteGroup* route_group, uint32_t if (disk) { session_add_mixed_track (one_midi_channel, one_midi_channel, route_group, how_many, name_template, instrument); + } else { + session_add_midi_bus (route_group, how_many, name_template, instrument); } } @@ -3939,6 +3966,9 @@ ARDOUR_UI::add_route (Gtk::Window* /* ignored */) case AddRouteDialog::AudioBus: session_add_audio_bus (input_chan.n_audio(), output_chan.n_audio(), route_group, count, name_template); break; + case AddRouteDialog::MidiBus: + session_add_midi_bus (route_group, count, name_template, instrument); + break; } } |