RegionView*
AutomationStreamView::add_region_view_internal (boost::shared_ptr<Region> region, bool wfd, bool /*recording*/)
{
- if ( ! region) {
- cerr << "No region" << endl;
- return NULL;
- }
+ assert (region);
if (wfd) {
boost::shared_ptr<MidiRegion> mr = boost::dynamic_pointer_cast<MidiRegion>(region);
(*i)->enable_display(wfd);
display_region(arv);
- return NULL;
+ return 0;
}
}
void
AutomationStreamView::redisplay_track ()
{
- list<RegionView *>::iterator i, tmp;
-
// Flag region views as invalid and disable drawing
- for (i = region_views.begin(); i != region_views.end(); ++i) {
+ for (list<RegionView*>::iterator i = region_views.begin(); i != region_views.end(); ++i) {
(*i)->set_valid (false);
(*i)->enable_display(false);
}
* For route child (e.g. plugin) automation, pass the child for \a.
* For region automation (e.g. MIDI CC), pass null for \a.
*/
-AutomationTimeAxisView::AutomationTimeAxisView (Session* s, boost::shared_ptr<Route> r,
- boost::shared_ptr<Automatable> a, boost::shared_ptr<AutomationControl> c,
- PublicEditor& e, TimeAxisView& parent, bool show_regions,
- ArdourCanvas::Canvas& canvas, const string & nom, const string & nomparent)
- : AxisView (s),
- TimeAxisView (s, e, &parent, canvas),
- _route (r),
- _control (c),
- _automatable (a),
- _controller(AutomationController::create(a, c->parameter(), c)),
- _base_rect (0),
- _view (show_regions ? new AutomationStreamView(*this) : NULL),
- _name (nom),
- auto_button (X_("")) /* force addition of a label */
+AutomationTimeAxisView::AutomationTimeAxisView (
+ Session* s,
+ boost::shared_ptr<Route> r,
+ boost::shared_ptr<Automatable> a,
+ boost::shared_ptr<AutomationControl> c,
+ PublicEditor& e,
+ TimeAxisView& parent,
+ bool show_regions,
+ ArdourCanvas::Canvas& canvas,
+ const string & nom,
+ const string & nomparent
+ )
+ : AxisView (s)
+ , TimeAxisView (s, e, &parent, canvas)
+ , _route (r)
+ , _control (c)
+ , _automatable (a)
+ , _controller (AutomationController::create (a, c->parameter(), c))
+ , _base_rect (0)
+ , _view (show_regions ? new AutomationStreamView (*this) : 0)
+ , _name (nom)
+ , auto_button (X_("")) /* force addition of a label */
{
if (!have_name_font) {
name_font = get_font_for_style (X_("AutomationTrackName"));
assert(_view);
_view->attach ();
- /* no regions, just a single line for the entire track (e.g. bus gain) */
} else {
- boost::shared_ptr<AutomationLine> line(new AutomationLine (
- ARDOUR::EventTypeMap::instance().to_symbol(_control->parameter()),
- *this,
- *_canvas_display,
- _control->alist()));
+ /* no regions, just a single line for the entire track (e.g. bus gain) */
+
+ boost::shared_ptr<AutomationLine> line (
+ new AutomationLine (
+ ARDOUR::EventTypeMap::instance().to_symbol(_control->parameter()),
+ *this,
+ *_canvas_display,
+ _control->alist()
+ )
+ );
line->set_line_color (ARDOUR_UI::config()->canvasvar_ProcessorAutomationLine.get());
line->queue_reset ();
void
AutomationTimeAxisView::add_automation_event (ArdourCanvas::Item* /*item*/, GdkEvent* /*event*/, framepos_t when, double y)
{
- if (!_line)
+ if (!_line) {
return;
+ }
double x = 0;
void
AutomationTimeAxisView::entered()
{
- if (_line)
+ if (_line) {
_line->track_entered();
+ }
}
void
AutomationTimeAxisView::exited ()
{
- if (_line)
+ if (_line) {
_line->track_exited();
+ }
}
void
boost::shared_ptr<ARDOUR::Route>,
boost::shared_ptr<ARDOUR::Automatable>,
boost::shared_ptr<ARDOUR::AutomationControl>,
+ Evoral::Parameter,
PublicEditor&,
TimeAxisView& parent,
bool show_regions,
}
protected:
- boost::shared_ptr<ARDOUR::Route> _route; ///< Parent route
+ /** parent route *
+ boost::shared_ptr<ARDOUR::Route> _route;
+ /** control; 0 if we are editing region-based automation */
boost::shared_ptr<ARDOUR::AutomationControl> _control; ///< Control
- boost::shared_ptr<ARDOUR::Automatable> _automatable; ///< Control owner, maybe = _route
-
+ /** control owner; may be _route, or 0 if we are editing region-based automation */
+ boost::shared_ptr<ARDOUR::Automatable> _automatable;
+ /** controller owner; 0 if we are editing region-based automation */
boost::shared_ptr<AutomationController> _controller;
ArdourCanvas::SimpleRect* _base_rect;
boost::shared_ptr<AutomationLine> _line;
+
/** AutomationStreamView if we are editing region-based automation (for MIDI), otherwise 0 */
AutomationStreamView* _view;