13
0

Revert my rev. 7140 and fix it better.

git-svn-id: svn://localhost/ardour2/branches/3.0@7145 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Carl Hetherington 2010-05-23 02:42:37 +00:00
parent 5779060c7f
commit 88f13bbe33
5 changed files with 26 additions and 20 deletions

View File

@ -119,16 +119,16 @@ AudioStreamView::create_region_view (boost::shared_ptr<Region> r, bool wait_for_
case NonLayered: case NonLayered:
case Normal: case Normal:
if (recording) { if (recording) {
region_view = new AudioRegionView (canvas_group, _trackview, region, region_view = new AudioRegionView (_canvas_group, _trackview, region,
_samples_per_unit, region_color, recording, TimeAxisViewItem::Visibility( _samples_per_unit, region_color, recording, TimeAxisViewItem::Visibility(
TimeAxisViewItem::ShowFrame | TimeAxisViewItem::HideFrameRight)); TimeAxisViewItem::ShowFrame | TimeAxisViewItem::HideFrameRight));
} else { } else {
region_view = new AudioRegionView (canvas_group, _trackview, region, region_view = new AudioRegionView (_canvas_group, _trackview, region,
_samples_per_unit, region_color); _samples_per_unit, region_color);
} }
break; break;
case Destructive: case Destructive:
region_view = new TapeAudioRegionView (canvas_group, _trackview, region, region_view = new TapeAudioRegionView (_canvas_group, _trackview, region,
_samples_per_unit, region_color); _samples_per_unit, region_color);
break; break;
default: default:
@ -516,7 +516,7 @@ AudioStreamView::setup_rec_box ()
break; break;
} }
ArdourCanvas::SimpleRect * rec_rect = new Gnome::Canvas::SimpleRect (*canvas_group); ArdourCanvas::SimpleRect * rec_rect = new Gnome::Canvas::SimpleRect (*_canvas_group);
rec_rect->property_x1() = xstart; rec_rect->property_x1() = xstart;
rec_rect->property_y1() = 1.0; rec_rect->property_y1() = 1.0;
rec_rect->property_x2() = xend; rec_rect->property_x2() = xend;

View File

@ -110,7 +110,7 @@ AutomationStreamView::add_region_view_internal (boost::shared_ptr<Region> region
} }
} }
region_view = new AutomationRegionView (canvas_group, _automation_view, region, region_view = new AutomationRegionView (_canvas_group, _automation_view, region,
_controller->controllable()->parameter(), list, _controller->controllable()->parameter(), list,
_samples_per_unit, region_color); _samples_per_unit, region_color);

View File

@ -71,12 +71,12 @@ MidiStreamView::MidiStreamView (MidiTimeAxisView& tv)
} }
/* use a group dedicated to MIDI underlays. Audio underlays are not in this group. */ /* use a group dedicated to MIDI underlays. Audio underlays are not in this group. */
midi_underlay_group = new ArdourCanvas::Group (*canvas_group); midi_underlay_group = new ArdourCanvas::Group (*_canvas_group);
midi_underlay_group->lower_to_bottom(); midi_underlay_group->lower_to_bottom();
/* put the note lines in the timeaxisview's group, so it /* put the note lines in the timeaxisview's group, so it
can be put below ghost regions from MIDI underlays*/ can be put below ghost regions from MIDI underlays*/
_note_lines = new ArdourCanvas::LineSet(*canvas_group, ArdourCanvas::LineSet::Horizontal); _note_lines = new ArdourCanvas::LineSet(*_canvas_group, ArdourCanvas::LineSet::Horizontal);
_note_lines->property_x1() = 0; _note_lines->property_x1() = 0;
_note_lines->property_y1() = 0; _note_lines->property_y1() = 0;
@ -137,7 +137,7 @@ MidiStreamView::create_region_view (boost::shared_ptr<Region> r, bool /*wfd*/, b
return 0; return 0;
} }
RegionView* region_view = new MidiRegionView (canvas_group, _trackview, region, RegionView* region_view = new MidiRegionView (_canvas_group, _trackview, region,
_samples_per_unit, region_color); _samples_per_unit, region_color);
region_view->init (region_color, false); region_view->init (region_color, false);
@ -444,7 +444,7 @@ MidiStreamView::setup_rec_box ()
xend = xstart; xend = xstart;
fill_color = ARDOUR_UI::config()->canvasvar_RecordingRect.get(); fill_color = ARDOUR_UI::config()->canvasvar_RecordingRect.get();
ArdourCanvas::SimpleRect * rec_rect = new Gnome::Canvas::SimpleRect (*canvas_group); ArdourCanvas::SimpleRect * rec_rect = new Gnome::Canvas::SimpleRect (*_canvas_group);
rec_rect->property_x1() = xstart; rec_rect->property_x1() = xstart;
rec_rect->property_y1() = 1.0; rec_rect->property_y1() = 1.0;
rec_rect->property_x2() = xend; rec_rect->property_x2() = xend;

View File

@ -46,11 +46,12 @@ using namespace ARDOUR;
using namespace PBD; using namespace PBD;
using namespace Editing; using namespace Editing;
StreamView::StreamView (RouteTimeAxisView& tv, ArdourCanvas::Group* group) StreamView::StreamView (RouteTimeAxisView& tv, ArdourCanvas::Group* background_group, ArdourCanvas::Group* canvas_group)
: _trackview (tv) : _trackview (tv)
, owns_canvas_group(group == 0) , owns_background_group (background_group == 0)
, _background_group (new ArdourCanvas::Group (*_trackview.canvas_background())) , owns_canvas_group (canvas_group == 0)
, canvas_group(group ? group : new ArdourCanvas::Group(*_trackview.canvas_display())) , _background_group (background_group ? background_group : new ArdourCanvas::Group (*_trackview.canvas_background()))
, _canvas_group (canvas_group ? canvas_group : new ArdourCanvas::Group(*_trackview.canvas_display()))
, _samples_per_unit (_trackview.editor().get_current_zoom ()) , _samples_per_unit (_trackview.editor().get_current_zoom ())
, rec_updating(false) , rec_updating(false)
, rec_active(false) , rec_active(false)
@ -63,7 +64,7 @@ StreamView::StreamView (RouteTimeAxisView& tv, ArdourCanvas::Group* group)
{ {
/* set_position() will position the group */ /* set_position() will position the group */
canvas_rect = new ArdourCanvas::SimpleRect (*canvas_group); canvas_rect = new ArdourCanvas::SimpleRect (*_background_group);
canvas_rect->property_x1() = 0.0; canvas_rect->property_x1() = 0.0;
canvas_rect->property_y1() = 0.0; canvas_rect->property_y1() = 0.0;
canvas_rect->property_x2() = _trackview.editor().get_physical_screen_width (); canvas_rect->property_x2() = _trackview.editor().get_physical_screen_width ();
@ -94,8 +95,12 @@ StreamView::~StreamView ()
delete canvas_rect; delete canvas_rect;
if (owns_background_group) {
delete _background_group;
}
if (owns_canvas_group) { if (owns_canvas_group) {
delete canvas_group; delete _canvas_group;
} }
} }
@ -110,8 +115,8 @@ StreamView::attach ()
int int
StreamView::set_position (gdouble x, gdouble y) StreamView::set_position (gdouble x, gdouble y)
{ {
canvas_group->property_x() = x; _canvas_group->property_x() = x;
canvas_group->property_y() = y; _canvas_group->property_y() = y;
return 0; return 0;
} }

View File

@ -77,7 +77,7 @@ public:
LayerDisplay layer_display () const { return _layer_display; } LayerDisplay layer_display () const { return _layer_display; }
ArdourCanvas::Group* background_group() { return _background_group; } ArdourCanvas::Group* background_group() { return _background_group; }
ArdourCanvas::Group* canvas_item() { return canvas_group; } ArdourCanvas::Group* canvas_item() { return _canvas_group; }
enum ColorTarget { enum ColorTarget {
RegionColor, RegionColor,
@ -116,7 +116,7 @@ public:
sigc::signal<void> HeightChanged; sigc::signal<void> HeightChanged;
protected: protected:
StreamView (RouteTimeAxisView&, ArdourCanvas::Group* group = NULL); StreamView (RouteTimeAxisView&, ArdourCanvas::Group* background_group = 0, ArdourCanvas::Group* canvas_group = 0);
void transport_changed(); void transport_changed();
void transport_looped(); void transport_looped();
@ -140,9 +140,10 @@ protected:
virtual void color_handler () = 0; virtual void color_handler () = 0;
RouteTimeAxisView& _trackview; RouteTimeAxisView& _trackview;
bool owns_background_group;
bool owns_canvas_group; bool owns_canvas_group;
ArdourCanvas::Group* _background_group; ArdourCanvas::Group* _background_group;
ArdourCanvas::Group* canvas_group; ArdourCanvas::Group* _canvas_group;
ArdourCanvas::SimpleRect* canvas_rect; /* frame around the whole thing */ ArdourCanvas::SimpleRect* canvas_rect; /* frame around the whole thing */
typedef std::list<RegionView* > RegionViewList; typedef std::list<RegionView* > RegionViewList;