mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-08 15:54:57 +01:00
Allow region-based automation axes to report whether they
have automation data or not. Should fix #3177. git-svn-id: svn://localhost/ardour2/branches/3.0@7158 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
ef94fbf11c
commit
a57b9cdd99
5 changed files with 29 additions and 1 deletions
|
|
@ -209,3 +209,20 @@ AutomationStreamView::automation_state () const
|
||||||
|
|
||||||
return line->the_list()->automation_state ();
|
return line->the_list()->automation_state ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
AutomationStreamView::has_automation () const
|
||||||
|
{
|
||||||
|
list<RegionView*>::const_iterator i = region_views.begin ();
|
||||||
|
while (i != region_views.end()) {
|
||||||
|
AutomationRegionView* rv = static_cast<AutomationRegionView*> (*i);
|
||||||
|
if (rv->line() && rv->line()->npoints() > 0) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
++i;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -54,6 +54,8 @@ class AutomationStreamView : public StreamView
|
||||||
return (_trackview.current_height() - TimeAxisViewItem::NAME_HIGHLIGHT_SIZE - 2);
|
return (_trackview.current_height() - TimeAxisViewItem::NAME_HIGHLIGHT_SIZE - 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool has_automation () const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void setup_rec_box ();
|
void setup_rec_box ();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -941,3 +941,10 @@ AutomationTimeAxisView::set_visibility (bool yn)
|
||||||
|
|
||||||
return changed;
|
return changed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @return true if this view has any automation data to display */
|
||||||
|
bool
|
||||||
|
AutomationTimeAxisView::has_automation () const
|
||||||
|
{
|
||||||
|
return ( (_line && _line->npoints() > 0) || (_view && _view->has_automation()) );
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -105,6 +105,8 @@ class AutomationTimeAxisView : public TimeAxisView {
|
||||||
return _base_rect;
|
return _base_rect;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool has_automation () const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
boost::shared_ptr<ARDOUR::Route> _route; ///< Parent route
|
boost::shared_ptr<ARDOUR::Route> _route; ///< Parent route
|
||||||
boost::shared_ptr<ARDOUR::AutomationControl> _control; ///< Control
|
boost::shared_ptr<ARDOUR::AutomationControl> _control; ///< Control
|
||||||
|
|
|
||||||
|
|
@ -1676,7 +1676,7 @@ RouteTimeAxisView::show_existing_automation ()
|
||||||
/* Show our automation */
|
/* Show our automation */
|
||||||
|
|
||||||
for (AutomationTracks::iterator i = _automation_tracks.begin(); i != _automation_tracks.end(); ++i) {
|
for (AutomationTracks::iterator i = _automation_tracks.begin(); i != _automation_tracks.end(); ++i) {
|
||||||
if (i->second->line() && i->second->line()->npoints() > 0) {
|
if (i->second->has_automation()) {
|
||||||
i->second->set_marked_for_display (true);
|
i->second->set_marked_for_display (true);
|
||||||
i->second->canvas_display()->show();
|
i->second->canvas_display()->show();
|
||||||
i->second->get_state_node()->add_property ("shown", X_("yes"));
|
i->second->get_state_node()->add_property ("shown", X_("yes"));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue