summaryrefslogtreecommitdiff
path: root/gtk2_ardour/midi_time_axis.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2020-02-20 00:26:29 -0700
committerPaul Davis <paul@linuxaudiosystems.com>2020-02-20 00:26:29 -0700
commit4dc74813ef1c52f9b9bdd9bf56bfdc91b11be03b (patch)
tree7ad2e40f3c6f06918a58c78c826b73555b512eb4 /gtk2_ardour/midi_time_axis.cc
parent4b10beec08c9c1d5ba6fd9cdb8c95ff019b00f65 (diff)
avoid setting midnam-model-name in GUI properties when there are no device modes for that model
Diffstat (limited to 'gtk2_ardour/midi_time_axis.cc')
-rw-r--r--gtk2_ardour/midi_time_axis.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/gtk2_ardour/midi_time_axis.cc b/gtk2_ardour/midi_time_axis.cc
index 4daeaf4a2e..8466d1cf2f 100644
--- a/gtk2_ardour/midi_time_axis.cc
+++ b/gtk2_ardour/midi_time_axis.cc
@@ -430,6 +430,9 @@ MidiTimeAxisView::maybe_trigger_model_change ()
setup_midnam_patches ();
}
}
+ } else {
+ /* no plugin provided MIDNAM for this plugin */
+ setup_midnam_patches ();
}
}
@@ -461,10 +464,12 @@ MidiTimeAxisView::model_changed (const std::string& m)
typedef MIDI::Name::MidiPatchManager PatchManager;
PatchManager& patch_manager = PatchManager::instance();
std::string model (m);
+ bool save_model = true;
std::list<std::string> device_modes = patch_manager.custom_device_mode_names_by_model (model);
if (device_modes.empty()) {
+ save_model = false;
model = DEFAULT_MIDNAM_MODEL;
device_modes = patch_manager.custom_device_mode_names_by_model (model);
assert (!device_modes.empty());
@@ -481,7 +486,9 @@ MidiTimeAxisView::model_changed (const std::string& m)
remove_gui_property (X_("midnam-model-name"));
} else {
_midnam_model_selector.set_text(model);
- set_gui_property (X_("midnam-model-name"), model);
+ if (save_model) {
+ set_gui_property (X_("midnam-model-name"), model);
+ }
}
_midnam_custom_device_mode_selector.clear_items();