mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-07 15:25:01 +01:00
Always show CC region, whether empty or not (ie whether MidiModel contains any events for that CC or not). Can't add events though... yet....
git-svn-id: svn://localhost/ardour2/trunk@2451 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
a7fb6f897f
commit
4cd6ef8b5c
3 changed files with 32 additions and 25 deletions
|
|
@ -30,13 +30,14 @@ AutomationRegionView::AutomationRegionView(ArdourCanvas::Group*
|
||||||
double spu,
|
double spu,
|
||||||
Gdk::Color& basic_color)
|
Gdk::Color& basic_color)
|
||||||
: RegionView(parent, time_axis, region, spu, basic_color)
|
: RegionView(parent, time_axis, region, spu, basic_color)
|
||||||
, _line(list->parameter().to_string(), time_axis, *group, list)
|
|
||||||
{
|
{
|
||||||
_line.set_colors();
|
if (list) {
|
||||||
_line.show();
|
_line = boost::shared_ptr<AutomationLine>(new AutomationLine(
|
||||||
_line.show_all_control_points();
|
list->parameter().to_string(), time_axis, *group, list));
|
||||||
|
_line->set_colors();
|
||||||
//group->raise_to_top ();
|
_line->show();
|
||||||
|
_line->show_all_control_points();
|
||||||
|
}
|
||||||
|
|
||||||
group->signal_event().connect (mem_fun (this, &AutomationRegionView::canvas_event), false);
|
group->signal_event().connect (mem_fun (this, &AutomationRegionView::canvas_event), false);
|
||||||
}
|
}
|
||||||
|
|
@ -77,6 +78,11 @@ AutomationRegionView::canvas_event(GdkEvent* ev)
|
||||||
void
|
void
|
||||||
AutomationRegionView::add_automation_event (GdkEvent* event, nframes_t when, double y)
|
AutomationRegionView::add_automation_event (GdkEvent* event, nframes_t when, double y)
|
||||||
{
|
{
|
||||||
|
if (!_line) {
|
||||||
|
cerr << "ERROR: AutomationRegionView::add_automation_event called without line" << endl;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
double x = 0;
|
double x = 0;
|
||||||
AutomationTimeAxisView* const view = automation_view();
|
AutomationTimeAxisView* const view = automation_view();
|
||||||
|
|
||||||
|
|
@ -89,16 +95,16 @@ AutomationRegionView::add_automation_event (GdkEvent* event, nframes_t when, dou
|
||||||
|
|
||||||
/* map using line */
|
/* map using line */
|
||||||
|
|
||||||
_line.view_to_model_y (y);
|
_line->view_to_model_y (y);
|
||||||
|
|
||||||
view->session().begin_reversible_command (_("add automation event"));
|
view->session().begin_reversible_command (_("add automation event"));
|
||||||
XMLNode& before = _line.the_list()->get_state();
|
XMLNode& before = _line->the_list()->get_state();
|
||||||
|
|
||||||
_line.the_list()->add (when, y);
|
_line->the_list()->add (when, y);
|
||||||
|
|
||||||
XMLNode& after = _line.the_list()->get_state();
|
XMLNode& after = _line->the_list()->get_state();
|
||||||
view->session().commit_reversible_command (new MementoCommand<ARDOUR::AutomationList>(
|
view->session().commit_reversible_command (new MementoCommand<ARDOUR::AutomationList>(
|
||||||
*_line.the_list(), &before, &after));
|
*_line->the_list(), &before, &after));
|
||||||
|
|
||||||
view->session().set_dirty ();
|
view->session().set_dirty ();
|
||||||
}
|
}
|
||||||
|
|
@ -109,7 +115,8 @@ AutomationRegionView::set_y_position_and_height (double y, double h)
|
||||||
{
|
{
|
||||||
RegionView::set_y_position_and_height(y, h - 1);
|
RegionView::set_y_position_and_height(y, h - 1);
|
||||||
|
|
||||||
_line.set_y_position_and_height ((uint32_t)y, (uint32_t) rint (h - NAME_HIGHLIGHT_SIZE));
|
if (_line)
|
||||||
|
_line->set_y_position_and_height ((uint32_t)y, (uint32_t) rint (h - NAME_HIGHLIGHT_SIZE));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
|
|
@ -127,7 +134,8 @@ AutomationRegionView::reset_width_dependent_items (double pixel_width)
|
||||||
{
|
{
|
||||||
RegionView::reset_width_dependent_items(pixel_width);
|
RegionView::reset_width_dependent_items(pixel_width);
|
||||||
|
|
||||||
_line.reset();
|
if (_line)
|
||||||
|
_line->reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -136,20 +144,23 @@ AutomationRegionView::region_resized (ARDOUR::Change what_changed)
|
||||||
{
|
{
|
||||||
RegionView::region_resized(what_changed);
|
RegionView::region_resized(what_changed);
|
||||||
|
|
||||||
_line.reset();
|
if (_line)
|
||||||
|
_line->reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
AutomationRegionView::entered()
|
AutomationRegionView::entered()
|
||||||
{
|
{
|
||||||
_line.track_entered();
|
if (_line)
|
||||||
|
_line->track_entered();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
AutomationRegionView::exited()
|
AutomationRegionView::exited()
|
||||||
{
|
{
|
||||||
_line.track_exited();
|
if (_line)
|
||||||
|
_line->track_exited();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,7 @@ public:
|
||||||
inline AutomationTimeAxisView* automation_view() const
|
inline AutomationTimeAxisView* automation_view() const
|
||||||
{ return dynamic_cast<AutomationTimeAxisView*>(&trackview); }
|
{ return dynamic_cast<AutomationTimeAxisView*>(&trackview); }
|
||||||
|
|
||||||
AutomationLine& line() { return _line; }
|
boost::shared_ptr<AutomationLine> line() { return _line; }
|
||||||
|
|
||||||
// We are a ghost. Meta ghosts? Crazy talk.
|
// We are a ghost. Meta ghosts? Crazy talk.
|
||||||
virtual GhostRegion* add_ghost(AutomationTimeAxisView&) { return NULL; }
|
virtual GhostRegion* add_ghost(AutomationTimeAxisView&) { return NULL; }
|
||||||
|
|
@ -69,7 +69,7 @@ protected:
|
||||||
void exited();
|
void exited();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
AutomationLine _line;
|
boost::shared_ptr<AutomationLine> _line;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* __gtk_ardour_automation_region_view_h__ */
|
#endif /* __gtk_ardour_automation_region_view_h__ */
|
||||||
|
|
|
||||||
|
|
@ -86,13 +86,9 @@ AutomationStreamView::add_region_view_internal (boost::shared_ptr<Region> region
|
||||||
|
|
||||||
const boost::shared_ptr<AutomationControl> control = region->control(_controller->controllable()->parameter());
|
const boost::shared_ptr<AutomationControl> control = region->control(_controller->controllable()->parameter());
|
||||||
|
|
||||||
if ( ! control) {
|
boost::shared_ptr<AutomationList> list;
|
||||||
cerr << "No " << _controller->controllable()->parameter().to_string()
|
if (control)
|
||||||
<< " for " << region->name() << endl;
|
list = control->list();
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
const boost::shared_ptr<AutomationList> list = control->list();
|
|
||||||
|
|
||||||
AutomationRegionView *region_view;
|
AutomationRegionView *region_view;
|
||||||
std::list<RegionView *>::iterator i;
|
std::list<RegionView *>::iterator i;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue