summaryrefslogtreecommitdiff
path: root/gtk2_ardour/midi_time_axis.cc
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2019-07-14 18:39:50 +0200
committerRobin Gareus <robin@gareus.org>2019-07-14 18:49:30 +0200
commit53c677e08fffb04897de0a9bb7d9ee0f65ede3f2 (patch)
treede9d4fef4ea7d58a723ba141964086176f4c09ff /gtk2_ardour/midi_time_axis.cc
parent18958af3d8d9fcda926aee4707da1102a4e2303e (diff)
Remember MIDI-track note-range -- #7773
Previously only manual changes of the note-range using the scroomer. The NoteRangeChanged() was ignored for implicit changes (e.g. while recording, step-entry) and automatic-fit that didn't involve a drag event.
Diffstat (limited to 'gtk2_ardour/midi_time_axis.cc')
-rw-r--r--gtk2_ardour/midi_time_axis.cc29
1 files changed, 9 insertions, 20 deletions
diff --git a/gtk2_ardour/midi_time_axis.cc b/gtk2_ardour/midi_time_axis.cc
index e6ad8ec096..0eb6a73001 100644
--- a/gtk2_ardour/midi_time_axis.cc
+++ b/gtk2_ardour/midi_time_axis.cc
@@ -158,6 +158,8 @@ MidiTimeAxisView::set_route (boost::shared_ptr<Route> rt)
subplugin_menu.set_name ("ArdourContextMenu");
+ _note_range_changed_connection.disconnect();
+
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()),
@@ -202,13 +204,6 @@ MidiTimeAxisView::set_route (boost::shared_ptr<Route> rt)
_piano_roll_header->ToggleNoteSelection.connect (
sigc::mem_fun (*this, &MidiTimeAxisView::toggle_note_selection));
- /* Update StreamView during scroomer drags.*/
-
- _range_scroomer->DragStarting.connect (
- sigc::mem_fun (*this, &MidiTimeAxisView::start_scroomer_update));
- _range_scroomer->DragFinishing.connect (
- sigc::mem_fun (*this, &MidiTimeAxisView::stop_scroomer_update));
-
/* Put the scroomer and the keyboard in a VBox with a padding
label so that they can be reduced in height for stacked-view
tracks.
@@ -231,6 +226,13 @@ MidiTimeAxisView::set_route (boost::shared_ptr<Route> rt)
time_axis_hbox.pack_end(*v, false, false, 0);
midi_scroomer_size_group->add_widget (*v);
+ /* callback from StreamView scroomer drags, as well as
+ * automatic changes of note-range (e.g. at rec-stop).
+ * This callback is used to save the note-range-min/max
+ * GUI Object property
+ */
+ _note_range_changed_connection = midi_view()->NoteRangeChanged.connect (
+ sigc::mem_fun (*this, &MidiTimeAxisView::note_range_changed));
/* ask for notifications of any new RegionViews */
_view->RegionViewAdded.connect (
@@ -382,19 +384,6 @@ MidiTimeAxisView::setup_midnam_patches ()
}
void
-MidiTimeAxisView::start_scroomer_update ()
-{
- _note_range_changed_connection.disconnect();
- _note_range_changed_connection = midi_view()->NoteRangeChanged.connect (
- sigc::mem_fun (*this, &MidiTimeAxisView::note_range_changed));
-}
-void
-MidiTimeAxisView::stop_scroomer_update ()
-{
- _note_range_changed_connection.disconnect();
-}
-
-void
MidiTimeAxisView::update_patch_selector ()
{
typedef MIDI::Name::MidiPatchManager PatchManager;