From 7960e1ddbfd0af2b9e3a538b67a05266cf0429e6 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Fri, 20 Jan 2017 21:47:09 +0100 Subject: GUI follow up for new-MIDI-track API change --- gtk2_ardour/ardour_ui.cc | 31 ++++++++++++------------------- 1 file changed, 12 insertions(+), 19 deletions(-) (limited to 'gtk2_ardour/ardour_ui.cc') diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc index 7f5ceeef1d..3c7f1afde2 100644 --- a/gtk2_ardour/ardour_ui.cc +++ b/gtk2_ardour/ardour_ui.cc @@ -1940,15 +1940,18 @@ ARDOUR_UI::session_add_mixed_track ( Plugin::PresetRecord* pset, ARDOUR::PresentationInfo::order_t order) { - list > tracks; - if (_session == 0) { warning << _("You cannot add a track without a session already loaded.") << endmsg; return; } + if (Profile->get_mixbus ()) { + strict_io = true; + } + try { - tracks = _session->new_midi_track (input, output, instrument, pset, route_group, how_many, name_template, order, ARDOUR::Normal); + list > tracks; + tracks = _session->new_midi_track (input, output, strict_io, instrument, pset, route_group, how_many, name_template, order, ARDOUR::Normal); if (tracks.size() != how_many) { error << string_compose(P_("could not create %1 new mixed track", "could not create %1 new mixed tracks", how_many), how_many) << endmsg; @@ -1959,12 +1962,6 @@ ARDOUR_UI::session_add_mixed_track ( display_insufficient_ports_message (); return; } - - if (strict_io) { - for (list >::iterator i = tracks.begin(); i != tracks.end(); ++i) { - (*i)->set_strict_io (true); - } - } } void @@ -1977,16 +1974,18 @@ ARDOUR_UI::session_add_midi_bus ( Plugin::PresetRecord* pset, ARDOUR::PresentationInfo::order_t order) { - RouteList routes; - if (_session == 0) { warning << _("You cannot add a track without a session already loaded.") << endmsg; return; } - try { + if (Profile->get_mixbus ()) { + strict_io = true; + } - routes = _session->new_midi_route (route_group, how_many, name_template, instrument, pset, PresentationInfo::MidiBus, order); + try { + RouteList routes; + routes = _session->new_midi_route (route_group, how_many, name_template, strict_io, instrument, pset, PresentationInfo::MidiBus, order); 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; } @@ -1996,12 +1995,6 @@ ARDOUR_UI::session_add_midi_bus ( display_insufficient_ports_message (); return; } - - if (strict_io) { - for (RouteList::iterator i = routes.begin(); i != routes.end(); ++i) { - (*i)->set_strict_io (true); - } - } } void -- cgit v1.2.3