summaryrefslogtreecommitdiff
path: root/gtk2_ardour
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2020-05-03 20:48:06 +0200
committerRobin Gareus <robin@gareus.org>2020-05-03 20:48:06 +0200
commita47fac7638dc69051ff4778e08dfccef539195bb (patch)
treea7bbeac4a7be2e434f0cf997a7ff6aae656fa43c /gtk2_ardour
parent27f26f5cfd19d581979c463cc0bacb5bfbdda9d8 (diff)
Fix MIDNAM model (MMA > Generic) fallback
Diffstat (limited to 'gtk2_ardour')
-rw-r--r--gtk2_ardour/midi_time_axis.cc10
1 files changed, 8 insertions, 2 deletions
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);
}