From a47fac7638dc69051ff4778e08dfccef539195bb Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Sun, 3 May 2020 20:48:06 +0200 Subject: Fix MIDNAM model (MMA > Generic) fallback --- gtk2_ardour/midi_time_axis.cc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'gtk2_ardour/midi_time_axis.cc') diff --git a/gtk2_ardour/midi_time_axis.cc b/gtk2_ardour/midi_time_axis.cc index 395ce6d012..f6a936a836 100644 --- a/gtk2_ardour/midi_time_axis.cc +++ b/gtk2_ardour/midi_time_axis.cc @@ -481,7 +481,6 @@ MidiTimeAxisView::model_changed (const std::string& m) set_gui_property (X_("midnam-model-name"), model); } else { remove_gui_property (X_("midnam-model-name")); - model = ""; } /* set new mode */ @@ -490,7 +489,9 @@ MidiTimeAxisView::model_changed (const std::string& m) if (find (device_modes.begin(), device_modes.end(), current_mode) == device_modes.end()) { if (device_modes.size() > 0) { mode = device_modes.front(); - custom_device_mode_changed (device_modes.front()); + if (save_model) { + custom_device_mode_changed (device_modes.front()); + } } else { mode = ""; } @@ -542,6 +543,11 @@ MidiTimeAxisView::custom_device_mode_changed(const std::string& mode) const std::string model = gui_property (X_("midnam-model-name")); set_gui_property (X_("midnam-custom-device-mode"), mode); _midnam_custom_device_mode_selector.set_text (mode); + if (model.empty () && !mode.empty ()) { + /* model.empty () && model.empty () -> plugin provided + * otherwise at least a model must be set. */ + return; + } /* inform the backend, route owned instrument info */ _route->instrument_info().set_external_instrument (model, mode); } -- cgit v1.2.3