diff options
author | Carl Hetherington <carl@carlh.net> | 2010-09-27 02:04:16 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2010-09-27 02:04:16 +0000 |
commit | 8000b39c8cbfdafbf806e04f9db7f82c81f92cae (patch) | |
tree | 495fbe4e9a3f0a4e7024704758497d34bfafbfa7 /gtk2_ardour/midi_time_axis.cc | |
parent | aad157337c5db676fdb39f5faefbb764f500702a (diff) |
Create MIDI track gain automation tracks as non-region-based. Fix construction of MidiTimeAxisViews to use the same first_idle arrangement as AudioTimeAxisViews to prevent use of partially constructed objects.
git-svn-id: svn://localhost/ardour2/branches/3.0@7847 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/midi_time_axis.cc')
-rw-r--r-- | gtk2_ardour/midi_time_axis.cc | 56 |
1 files changed, 36 insertions, 20 deletions
diff --git a/gtk2_ardour/midi_time_axis.cc b/gtk2_ardour/midi_time_axis.cc index cb667f1048..0238e48d03 100644 --- a/gtk2_ardour/midi_time_axis.cc +++ b/gtk2_ardour/midi_time_axis.cc @@ -164,8 +164,12 @@ MidiTimeAxisView::MidiTimeAxisView (PublicEditor& ed, Session* sess, /* ask for notifications of any new RegionViews */ _view->RegionViewAdded.connect (sigc::mem_fun(*this, &MidiTimeAxisView::region_view_added)); - _view->attach (); - + + if (!_editor.have_idled()) { + /* first idle will do what we need */ + } else { + first_idle (); + } } HBox* midi_controls_hbox = manage(new HBox()); @@ -219,6 +223,14 @@ MidiTimeAxisView::MidiTimeAxisView (PublicEditor& ed, Session* sess, } } +void +MidiTimeAxisView::first_idle () +{ + if (is_track ()) { + _view->attach (); + } +} + MidiTimeAxisView::~MidiTimeAxisView () { delete _piano_roll_header; @@ -807,32 +819,36 @@ MidiTimeAxisView::show_existing_automation () void MidiTimeAxisView::create_automation_child (const Evoral::Parameter& param, bool show) { - /* These controllers are region "automation", so we do not create - * an AutomationList/Line for the track */ - if (param.type() == NullAutomation) { cerr << "WARNING: Attempt to create NullAutomation child, ignoring" << endl; return; } - + AutomationTracks::iterator existing = _automation_tracks.find (param); if (existing != _automation_tracks.end()) { return; } - - boost::shared_ptr<AutomationControl> c = _route->get_control (param); - - assert(c); - - boost::shared_ptr<AutomationTimeAxisView> track(new AutomationTimeAxisView (_session, - _route, boost::shared_ptr<ARDOUR::Automatable>(), c, - _editor, - *this, - true, - parent_canvas, - _route->describe_parameter(param))); - - add_automation_child (param, track, show); + + if (param.type() == GainAutomation) { + create_gain_automation_child (param, show); + } else { + + /* These controllers are region "automation", so we do not create + * an AutomationList/Line for the track */ + + boost::shared_ptr<AutomationControl> c = _route->get_control (param); + assert (c); + + boost::shared_ptr<AutomationTimeAxisView> track(new AutomationTimeAxisView (_session, + _route, boost::shared_ptr<ARDOUR::Automatable>(), c, + _editor, + *this, + true, + parent_canvas, + _route->describe_parameter(param))); + + add_automation_child (param, track, show); + } } |