diff options
author | Carl Hetherington <carl@carlh.net> | 2011-11-27 13:44:45 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2011-11-27 13:44:45 +0000 |
commit | 1e97a0dcbea847a1581d9eeecbf2c1b4d86c8b19 (patch) | |
tree | 2ae54d2b55ce496349cb225288f56580525d2ee3 /gtk2_ardour/midi_time_axis.cc | |
parent | a33fe692e649e415a227d5840d708419c2d5255a (diff) |
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
Diffstat (limited to 'gtk2_ardour/midi_time_axis.cc')
-rw-r--r-- | gtk2_ardour/midi_time_axis.cc | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/gtk2_ardour/midi_time_axis.cc b/gtk2_ardour/midi_time_axis.cc index e9b9ee3f2d..cbdf2919ae 100644 --- a/gtk2_ardour/midi_time_axis.cc +++ b/gtk2_ardour/midi_time_axis.cc @@ -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)); |