13
0

Make record region slightly better in stacked regions mode.

git-svn-id: svn://localhost/ardour2/branches/3.0@4367 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Carl Hetherington 2009-01-01 17:45:09 +00:00
parent d39b425a6a
commit d1d75380b9
3 changed files with 18 additions and 6 deletions

View File

@ -155,6 +155,7 @@ AudioStreamView::add_region_view_internal (boost::shared_ptr<Region> r, bool wai
region_view->init (region_color, wait_for_waves);
region_view->set_amplitude_above_axis(_amplitude_above_axis);
region_view->set_height (child_height ());
region_views.push_front (region_view);
/* if its the special single-sample length that we use for rec-regions, make it
@ -534,7 +535,6 @@ AudioStreamView::setup_rec_box ()
(RegionFactory::create (sources, start, 1 , "", 0, (Region::Flag)(Region::DefaultFlags | Region::DoNotSaveState), false)));
assert(region);
region->set_position (_trackview.session().transport_frame(), this);
rec_regions.push_back (make_pair(region, (RegionView*)0));
}
@ -569,7 +569,7 @@ AudioStreamView::setup_rec_box ()
rec_rect->property_x1() = xstart;
rec_rect->property_y1() = 1.0;
rec_rect->property_x2() = xend;
rec_rect->property_y2() = (double) _trackview.current_height() - 1;
rec_rect->property_y2() = child_height ();
rec_rect->property_outline_color_rgba() = ARDOUR_UI::config()->canvasvar_TimeAxisFrame.get();
rec_rect->property_outline_what() = 0x1 | 0x2 | 0x4 | 0x8;
rec_rect->property_fill_color_rgba() = fill_color;

View File

@ -424,24 +424,35 @@ StreamView::get_inverted_selectables (Selection& sel, list<Selectable*>& results
}
}
/** @return height of a child region view, depending on stacked / overlaid mode */
double
StreamView::child_height () const
{
if (layer_display == Stacked) {
return height / layers;
}
return height;
}
void
StreamView::update_contents_height ()
{
canvas_rect->property_y2() = height;
const double lh = height / layers;
const double h = child_height ();
for (RegionViewList::iterator i = region_views.begin(); i != region_views.end(); ++i) {
switch (layer_display) {
case Overlaid:
(*i)->set_y (0);
(*i)->set_height (height);
break;
case Stacked:
(*i)->set_y (height - ((*i)->region()->layer() + 1) * lh);
(*i)->set_height (lh);
(*i)->set_y (height - ((*i)->region()->layer() + 1) * h);
break;
}
(*i)->set_height (h);
}
for (vector<RecBoxInfo>::iterator i = rec_rects.begin(); i != rec_rects.end(); ++i) {

View File

@ -126,6 +126,7 @@ protected:
virtual void playlist_modified (boost::shared_ptr<ARDOUR::Diskstream>);
virtual void color_handler () = 0;
double child_height () const;
RouteTimeAxisView& _trackview;
bool owns_canvas_group;