Set up piano roll and scroomer objects before the MidiTimeAxisView height gets set up, so that their visibility can be initialised correctly. Fixes #4515.

git-svn-id: svn://localhost/ardour2/branches/3.0@10828 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Carl Hetherington 2011-11-27 13:44:45 +00:00
parent a33fe692e6
commit 1e97a0dcbe

View File

@ -124,11 +124,23 @@ MidiTimeAxisView::MidiTimeAxisView (PublicEditor& ed, Session* sess, Canvas& can
void
MidiTimeAxisView::set_route (boost::shared_ptr<Route> rt)
{
_route = rt;
_view = new MidiStreamView (*this);
if (is_track ()) {
_piano_roll_header = new PianoRollHeader(*midi_view());
_range_scroomer = new MidiScroomer(midi_view()->note_range_adjustment);
}
/* This next call will result in our height being set up, so it must come after
the creation of the piano roll / range scroomer as their visibility is set up
when our height is.
*/
RouteTimeAxisView::set_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);
}
@ -150,14 +162,10 @@ MidiTimeAxisView::set_route (boost::shared_ptr<Route> rt)
_route->processors_changed.connect (*this, invalidator (*this), ui_bind (&MidiTimeAxisView::processors_changed, this, _1), gui_context());
if (is_track()) {
_piano_roll_header = new PianoRollHeader(*midi_view());
_piano_roll_header->AddNoteSelection.connect (sigc::mem_fun (*this, &MidiTimeAxisView::add_note_selection));
_piano_roll_header->ExtendNoteSelection.connect (sigc::mem_fun (*this, &MidiTimeAxisView::extend_note_selection));
_piano_roll_header->ToggleNoteSelection.connect (sigc::mem_fun (*this, &MidiTimeAxisView::toggle_note_selection));
_range_scroomer = new MidiScroomer(midi_view()->note_range_adjustment);
/* Suspend updates of the StreamView during scroomer drags to speed things up */
_range_scroomer->DragStarting.connect (sigc::mem_fun (*midi_view(), &MidiStreamView::suspend_updates));
_range_scroomer->DragFinishing.connect (sigc::mem_fun (*midi_view(), &MidiStreamView::resume_updates));