From 5f27382b882557c52a99e2924e875b5b43d6a7d4 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Thu, 19 Mar 2020 16:03:28 +0100 Subject: Remove Audio+MIDI track, and consolidate route creation methods Audio+MIDI tracks were just MIDI tracks with an additional audio input, and do not directly allow use of vocoders (an instrument is loaded by default). For pitch-correction or similar use-cases one would prefer an audio-track (main data) with MIDI only being used as control-input. Ardour 5/6 pin-connections and side-chain offer a much nicer workflow for this setup. Alternatively one can get those tracks-types by manually adding an input port to an existing track, and creating a custom template. --- gtk2_ardour/ardour_ui.cc | 92 ++++++++++++++---------------------------------- 1 file changed, 26 insertions(+), 66 deletions(-) (limited to 'gtk2_ardour/ardour_ui.cc') diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc index b9bca8c988..6f9c544db4 100644 --- a/gtk2_ardour/ardour_ui.cc +++ b/gtk2_ardour/ardour_ui.cc @@ -1382,9 +1382,8 @@ ARDOUR_UI::update_wall_clock () } void -ARDOUR_UI::session_add_mixed_track ( - const ChanCount& input, - const ChanCount& output, +ARDOUR_UI::session_add_midi_route ( + bool disk, RouteGroup* route_group, uint32_t how_many, const string& name_template, @@ -1393,53 +1392,38 @@ ARDOUR_UI::session_add_mixed_track ( Plugin::PresetRecord* pset, ARDOUR::PresentationInfo::order_t order) { - assert (_session); + if (_session == 0) { + warning << _("You cannot add a track without a session already loaded.") << endmsg; + return; + } if (Profile->get_mixbus ()) { strict_io = true; } try { - list > tracks; - tracks = _session->new_midi_track (input, output, strict_io, instrument, pset, route_group, how_many, name_template, order, ARDOUR::Normal); + if (disk) { - 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; - } - } + ChanCount one_midi_channel; + one_midi_channel.set (DataType::MIDI, 1); - catch (...) { - display_insufficient_ports_message (); - return; - } -} + list > tracks; + tracks = _session->new_midi_track (one_midi_channel, one_midi_channel, strict_io, instrument, pset, route_group, how_many, name_template, order, ARDOUR::Normal); -void -ARDOUR_UI::session_add_midi_bus ( - RouteGroup* route_group, - uint32_t how_many, - const string& name_template, - bool strict_io, - PluginInfoPtr instrument, - Plugin::PresetRecord* pset, - ARDOUR::PresentationInfo::order_t order) -{ - if (_session == 0) { - warning << _("You cannot add a track without a session already loaded.") << endmsg; - return; - } + 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; + } - if (Profile->get_mixbus ()) { - strict_io = true; - } + } else { - 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; - } + 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; + } + + } } catch (...) { display_insufficient_ports_message (); @@ -1447,27 +1431,6 @@ ARDOUR_UI::session_add_midi_bus ( } } -void -ARDOUR_UI::session_add_midi_route ( - bool disk, - RouteGroup* route_group, - uint32_t how_many, - const string& name_template, - bool strict_io, - PluginInfoPtr instrument, - Plugin::PresetRecord* pset, - ARDOUR::PresentationInfo::order_t order) -{ - ChanCount one_midi_channel; - one_midi_channel.set (DataType::MIDI, 1); - - if (disk) { - session_add_mixed_track (one_midi_channel, one_midi_channel, route_group, how_many, name_template, strict_io, instrument, pset, order); - } else { - session_add_midi_bus (route_group, how_many, name_template, strict_io, instrument, pset, order); - } -} - void ARDOUR_UI::session_add_audio_route ( bool track, @@ -2711,17 +2674,14 @@ ARDOUR_UI::add_route_dialog_response (int r) case AddRouteDialog::AudioTrack: session_add_audio_route (true, input_chan.n_audio(), output_chan.n_audio(), add_route_dialog->mode(), route_group, count, name_template, strict_io, order); break; - case AddRouteDialog::MidiTrack: - session_add_midi_route (true, route_group, count, name_template, strict_io, instrument, 0, order); - break; - case AddRouteDialog::MixedTrack: - session_add_mixed_track (input_chan, output_chan, route_group, count, name_template, strict_io, instrument, 0, order); - break; case AddRouteDialog::AudioBus: session_add_audio_route (false, input_chan.n_audio(), output_chan.n_audio(), ARDOUR::Normal, route_group, count, name_template, strict_io, order); break; + case AddRouteDialog::MidiTrack: + session_add_midi_route (true, route_group, count, name_template, strict_io, instrument, 0, order); + break; case AddRouteDialog::MidiBus: - session_add_midi_bus (route_group, count, name_template, strict_io, instrument, 0, order); + session_add_midi_route (false, route_group, count, name_template, strict_io, instrument, 0, order); break; case AddRouteDialog::VCAMaster: _session->vca_manager().create_vca (count, name_template); -- cgit v1.2.3