summaryrefslogtreecommitdiff
path: root/gtk2_ardour/midi_time_axis.cc
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2011-08-14 18:40:57 +0000
committerCarl Hetherington <carl@carlh.net>2011-08-14 18:40:57 +0000
commit25b4913c78cd5a0d44ca594ac604d01da8fdd112 (patch)
treedcb37289f484e4bda96e00f1214b9cc31378b4d3 /gtk2_ardour/midi_time_axis.cc
parentd5a55c48f9027583a0355416e5ef73d6851ff67c (diff)
Save position of MIDI scroomers (#4140).
git-svn-id: svn://localhost/ardour2/branches/3.0@9993 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/midi_time_axis.cc')
-rw-r--r--gtk2_ardour/midi_time_axis.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/gtk2_ardour/midi_time_axis.cc b/gtk2_ardour/midi_time_axis.cc
index 0adb02725f..63f92f71b0 100644
--- a/gtk2_ardour/midi_time_axis.cc
+++ b/gtk2_ardour/midi_time_axis.cc
@@ -127,6 +127,10 @@ MidiTimeAxisView::set_route (boost::shared_ptr<Route> rt)
subplugin_menu.set_name ("ArdourContextMenu");
_view = new MidiStreamView (*this);
+ if (!gui_property ("note-range-min").empty ()) {
+ midi_view()->apply_note_range (atoi (gui_property ("note-range-min").c_str()), atoi (gui_property ("note-range-max").c_str()), true);
+ }
+ midi_view()->NoteRangeChanged.connect (sigc::mem_fun (*this, &MidiTimeAxisView::note_range_changed));
ignore_toggle = false;
@@ -1163,3 +1167,10 @@ MidiTimeAxisView::get_channel_for_add () const
return channel;
}
+
+void
+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 ());
+}