summaryrefslogtreecommitdiff
path: root/gtk2_ardour/midi_time_axis.cc
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2012-06-02 14:53:34 +0000
committerCarl Hetherington <carl@carlh.net>2012-06-02 14:53:34 +0000
commitdcd6dbf14b795af7b5ad2422c925114a46c0ecf1 (patch)
treebb94921230fef285d77a51927c03682df8268ddd /gtk2_ardour/midi_time_axis.cc
parentfd89d52af5ef353e787cdae621f6474c6251b908 (diff)
Persist track MIDNAM settings via a GUI property. Fix a
couple of crashes with the MIDNAM code. git-svn-id: svn://localhost/ardour2/branches/3.0@12543 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/midi_time_axis.cc')
-rw-r--r--gtk2_ardour/midi_time_axis.cc27
1 files changed, 21 insertions, 6 deletions
diff --git a/gtk2_ardour/midi_time_axis.cc b/gtk2_ardour/midi_time_axis.cc
index 4df22c7c96..7cebb806af 100644
--- a/gtk2_ardour/midi_time_axis.cc
+++ b/gtk2_ardour/midi_time_axis.cc
@@ -199,14 +199,14 @@ MidiTimeAxisView::set_route (boost::shared_ptr<Route> rt)
_model_selector.append_text(m->c_str());
}
+
_model_selector.signal_changed().connect(sigc::mem_fun(*this, &MidiTimeAxisView::model_changed));
_custom_device_mode_selector.signal_changed().connect(
sigc::mem_fun(*this, &MidiTimeAxisView::custom_device_mode_changed));
- // TODO: persist the choice
- // this initializes the comboboxes and sends out the signal
- _model_selector.set_active(0);
+ _model_selector.set_active_text (gui_property (X_("midnam-model-name")));
+ _custom_device_mode_selector.set_active_text (gui_property (X_("midnam-custom-device-mode")));
midi_controls_hbox->pack_start(_channel_selector, true, false);
if (!patch_manager.all_models().empty()) {
@@ -317,12 +317,15 @@ MidiTimeAxisView::model_changed()
}
_custom_device_mode_selector.set_active(0);
+
+ set_gui_property (X_("midnam-model-name"), midi_patch_model ());
}
-void MidiTimeAxisView::custom_device_mode_changed()
+void
+MidiTimeAxisView::custom_device_mode_changed()
{
- _midi_patch_settings_changed.emit(_model_selector.get_active_text(),
- _custom_device_mode_selector.get_active_text());
+ _midi_patch_settings_changed.emit (midi_patch_model (), midi_patch_custom_device_node ());
+ set_gui_property (X_("midnam-custom-device-mode"), midi_patch_custom_device_node ());
}
MidiStreamView*
@@ -1203,3 +1206,15 @@ MidiTimeAxisView::note_range_changed ()
set_gui_property ("note-range-min", (int) midi_view()->lowest_note ());
set_gui_property ("note-range-max", (int) midi_view()->highest_note ());
}
+
+string
+MidiTimeAxisView::midi_patch_model () const
+{
+ return _model_selector.get_active_text ();
+}
+
+string
+MidiTimeAxisView::midi_patch_custom_device_node () const
+{
+ return _custom_device_mode_selector.get_active_text ();
+}