mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-16 03:36:32 +01:00
more canvas refactoring.
Remove Canvas::Layout, use Canvas::Container for the same purpose, move child-rendering into Item::render_children() so that it could theoretically be used by any derived type.
This commit is contained in:
parent
f0933bf005
commit
6a5d805b38
60 changed files with 250 additions and 325 deletions
|
|
@ -75,7 +75,7 @@ using namespace ArdourCanvas;
|
||||||
static const int32_t sync_mark_width = 9;
|
static const int32_t sync_mark_width = 9;
|
||||||
static double const handle_size = 10; /* height of fade handles */
|
static double const handle_size = 10; /* height of fade handles */
|
||||||
|
|
||||||
AudioRegionView::AudioRegionView (ArdourCanvas::Layout *parent, RouteTimeAxisView &tv, boost::shared_ptr<AudioRegion> r, double spu,
|
AudioRegionView::AudioRegionView (ArdourCanvas::Container *parent, RouteTimeAxisView &tv, boost::shared_ptr<AudioRegion> r, double spu,
|
||||||
uint32_t basic_color)
|
uint32_t basic_color)
|
||||||
: RegionView (parent, tv, r, spu, basic_color)
|
: RegionView (parent, tv, r, spu, basic_color)
|
||||||
, sync_mark(0)
|
, sync_mark(0)
|
||||||
|
|
@ -96,7 +96,7 @@ AudioRegionView::AudioRegionView (ArdourCanvas::Layout *parent, RouteTimeAxisVie
|
||||||
Config->ParameterChanged.connect (*this, invalidator (*this), boost::bind (&AudioRegionView::parameter_changed, this, _1), gui_context());
|
Config->ParameterChanged.connect (*this, invalidator (*this), boost::bind (&AudioRegionView::parameter_changed, this, _1), gui_context());
|
||||||
}
|
}
|
||||||
|
|
||||||
AudioRegionView::AudioRegionView (ArdourCanvas::Layout *parent, RouteTimeAxisView &tv, boost::shared_ptr<AudioRegion> r, double spu,
|
AudioRegionView::AudioRegionView (ArdourCanvas::Container *parent, RouteTimeAxisView &tv, boost::shared_ptr<AudioRegion> r, double spu,
|
||||||
uint32_t basic_color, bool recording, TimeAxisViewItem::Visibility visibility)
|
uint32_t basic_color, bool recording, TimeAxisViewItem::Visibility visibility)
|
||||||
: RegionView (parent, tv, r, spu, basic_color, recording, visibility)
|
: RegionView (parent, tv, r, spu, basic_color, recording, visibility)
|
||||||
, sync_mark(0)
|
, sync_mark(0)
|
||||||
|
|
|
||||||
|
|
@ -51,13 +51,13 @@ class RouteTimeAxisView;
|
||||||
class AudioRegionView : public RegionView
|
class AudioRegionView : public RegionView
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
AudioRegionView (ArdourCanvas::Layout *,
|
AudioRegionView (ArdourCanvas::Container *,
|
||||||
RouteTimeAxisView&,
|
RouteTimeAxisView&,
|
||||||
boost::shared_ptr<ARDOUR::AudioRegion>,
|
boost::shared_ptr<ARDOUR::AudioRegion>,
|
||||||
double initial_samples_per_pixel,
|
double initial_samples_per_pixel,
|
||||||
uint32_t base_color);
|
uint32_t base_color);
|
||||||
|
|
||||||
AudioRegionView (ArdourCanvas::Layout *,
|
AudioRegionView (ArdourCanvas::Container *,
|
||||||
RouteTimeAxisView&,
|
RouteTimeAxisView&,
|
||||||
boost::shared_ptr<ARDOUR::AudioRegion>,
|
boost::shared_ptr<ARDOUR::AudioRegion>,
|
||||||
double samples_per_pixel,
|
double samples_per_pixel,
|
||||||
|
|
|
||||||
|
|
@ -99,7 +99,7 @@ AutomationLine::AutomationLine (const string& name, TimeAxisView& tv, ArdourCanv
|
||||||
terminal_points_can_slide = true;
|
terminal_points_can_slide = true;
|
||||||
_height = 0;
|
_height = 0;
|
||||||
|
|
||||||
group = new ArdourCanvas::Layout (&parent);
|
group = new ArdourCanvas::Container (&parent);
|
||||||
CANVAS_DEBUG_NAME (group, "region gain envelope group");
|
CANVAS_DEBUG_NAME (group, "region gain envelope group");
|
||||||
|
|
||||||
line = new ArdourCanvas::PolyLine (group);
|
line = new ArdourCanvas::PolyLine (group);
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@
|
||||||
#include "ardour/types.h"
|
#include "ardour/types.h"
|
||||||
|
|
||||||
#include "canvas/types.h"
|
#include "canvas/types.h"
|
||||||
#include "canvas/layout.h"
|
#include "canvas/container.h"
|
||||||
#include "canvas/poly_line.h"
|
#include "canvas/poly_line.h"
|
||||||
|
|
||||||
class AutomationLine;
|
class AutomationLine;
|
||||||
|
|
@ -105,7 +105,7 @@ public:
|
||||||
|
|
||||||
TimeAxisView& trackview;
|
TimeAxisView& trackview;
|
||||||
|
|
||||||
ArdourCanvas::Layout& canvas_group() const { return *group; }
|
ArdourCanvas::Container& canvas_group() const { return *group; }
|
||||||
ArdourCanvas::Item& parent_group() const { return _parent_group; }
|
ArdourCanvas::Item& parent_group() const { return _parent_group; }
|
||||||
ArdourCanvas::Item& grab_item() const { return *line; }
|
ArdourCanvas::Item& grab_item() const { return *line; }
|
||||||
|
|
||||||
|
|
@ -174,7 +174,7 @@ protected:
|
||||||
bool did_push;
|
bool did_push;
|
||||||
|
|
||||||
ArdourCanvas::Item& _parent_group;
|
ArdourCanvas::Item& _parent_group;
|
||||||
ArdourCanvas::Layout* group;
|
ArdourCanvas::Container* group;
|
||||||
ArdourCanvas::PolyLine* line; /* line */
|
ArdourCanvas::PolyLine* line; /* line */
|
||||||
ArdourCanvas::Points line_points; /* coordinates for canvas line */
|
ArdourCanvas::Points line_points; /* coordinates for canvas line */
|
||||||
std::vector<ControlPoint*> control_points; /* visible control points */
|
std::vector<ControlPoint*> control_points; /* visible control points */
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@
|
||||||
|
|
||||||
#include "i18n.h"
|
#include "i18n.h"
|
||||||
|
|
||||||
AutomationRegionView::AutomationRegionView (ArdourCanvas::Layout* parent,
|
AutomationRegionView::AutomationRegionView (ArdourCanvas::Container* parent,
|
||||||
AutomationTimeAxisView& time_axis,
|
AutomationTimeAxisView& time_axis,
|
||||||
boost::shared_ptr<ARDOUR::Region> region,
|
boost::shared_ptr<ARDOUR::Region> region,
|
||||||
const Evoral::Parameter& param,
|
const Evoral::Parameter& param,
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ class TimeAxisView;
|
||||||
class AutomationRegionView : public RegionView
|
class AutomationRegionView : public RegionView
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
AutomationRegionView(ArdourCanvas::Layout*,
|
AutomationRegionView(ArdourCanvas::Container*,
|
||||||
AutomationTimeAxisView&,
|
AutomationTimeAxisView&,
|
||||||
boost::shared_ptr<ARDOUR::Region>,
|
boost::shared_ptr<ARDOUR::Region>,
|
||||||
const Evoral::Parameter& parameter,
|
const Evoral::Parameter& parameter,
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ namespace ArdourCanvas {
|
||||||
class CrossfadeView : public TimeAxisViewItem
|
class CrossfadeView : public TimeAxisViewItem
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CrossfadeView (ArdourCanvas::Layout*,
|
CrossfadeView (ArdourCanvas::Container*,
|
||||||
RouteTimeAxisView&,
|
RouteTimeAxisView&,
|
||||||
boost::shared_ptr<ARDOUR::Crossfade>,
|
boost::shared_ptr<ARDOUR::Crossfade>,
|
||||||
double initial_samples_per_pixel,
|
double initial_samples_per_pixel,
|
||||||
|
|
|
||||||
|
|
@ -451,7 +451,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
|
||||||
_stepping_axis_view = v;
|
_stepping_axis_view = v;
|
||||||
}
|
}
|
||||||
|
|
||||||
ArdourCanvas::Layout* get_trackview_group () const { return _trackview_group; }
|
ArdourCanvas::Container* get_trackview_group () const { return _trackview_group; }
|
||||||
ArdourCanvas::ScrollGroup* get_hscroll_group () const { return h_scroll_group; }
|
ArdourCanvas::ScrollGroup* get_hscroll_group () const { return h_scroll_group; }
|
||||||
ArdourCanvas::ScrollGroup* get_vscroll_group () const { return v_scroll_group; }
|
ArdourCanvas::ScrollGroup* get_vscroll_group () const { return v_scroll_group; }
|
||||||
ArdourCanvas::ScrollGroup* get_hvscroll_group () const { return hv_scroll_group; }
|
ArdourCanvas::ScrollGroup* get_hvscroll_group () const { return hv_scroll_group; }
|
||||||
|
|
@ -560,7 +560,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
|
||||||
void refresh_location_display ();
|
void refresh_location_display ();
|
||||||
void refresh_location_display_internal (ARDOUR::Locations::LocationList&);
|
void refresh_location_display_internal (ARDOUR::Locations::LocationList&);
|
||||||
void add_new_location (ARDOUR::Location *);
|
void add_new_location (ARDOUR::Location *);
|
||||||
ArdourCanvas::Layout* add_new_location_internal (ARDOUR::Location *);
|
ArdourCanvas::Container* add_new_location_internal (ARDOUR::Location *);
|
||||||
void location_gone (ARDOUR::Location *);
|
void location_gone (ARDOUR::Location *);
|
||||||
void remove_marker (ArdourCanvas::Item&, GdkEvent*);
|
void remove_marker (ArdourCanvas::Item&, GdkEvent*);
|
||||||
gint really_remove_marker (ARDOUR::Location* loc);
|
gint really_remove_marker (ARDOUR::Location* loc);
|
||||||
|
|
@ -606,7 +606,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
|
||||||
LocationMarkerMap location_markers;
|
LocationMarkerMap location_markers;
|
||||||
|
|
||||||
void update_marker_labels ();
|
void update_marker_labels ();
|
||||||
void update_marker_labels (ArdourCanvas::Layout *);
|
void update_marker_labels (ArdourCanvas::Container *);
|
||||||
void check_marker_label (Marker *);
|
void check_marker_label (Marker *);
|
||||||
|
|
||||||
/** A set of lists of Markers that are in each of the canvas groups
|
/** A set of lists of Markers that are in each of the canvas groups
|
||||||
|
|
@ -615,7 +615,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
|
||||||
* a marker has moved we can decide whether we need to update the labels
|
* a marker has moved we can decide whether we need to update the labels
|
||||||
* for all markers or for just a few.
|
* for all markers or for just a few.
|
||||||
*/
|
*/
|
||||||
std::map<ArdourCanvas::Layout *, std::list<Marker *> > _sorted_marker_lists;
|
std::map<ArdourCanvas::Container *, std::list<Marker *> > _sorted_marker_lists;
|
||||||
void remove_sorted_marker (Marker *);
|
void remove_sorted_marker (Marker *);
|
||||||
|
|
||||||
void hide_marker (ArdourCanvas::Item*, GdkEvent*);
|
void hide_marker (ArdourCanvas::Item*, GdkEvent*);
|
||||||
|
|
@ -729,21 +729,21 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
|
||||||
ArdourCanvas::Pixbuf *logo_item;
|
ArdourCanvas::Pixbuf *logo_item;
|
||||||
#if 0
|
#if 0
|
||||||
/* these will be needed when we have canvas rulers */
|
/* these will be needed when we have canvas rulers */
|
||||||
ArdourCanvas::Layout *minsec_group;
|
ArdourCanvas::Container *minsec_group;
|
||||||
ArdourCanvas::Layout *bbt_group;
|
ArdourCanvas::Container *bbt_group;
|
||||||
ArdourCanvas::Layout *timecode_group;
|
ArdourCanvas::Container *timecode_group;
|
||||||
ArdourCanvas::Layout *frame_group;
|
ArdourCanvas::Container *frame_group;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
ArdourCanvas::Layout *tempo_group;
|
ArdourCanvas::Container *tempo_group;
|
||||||
ArdourCanvas::Layout *meter_group;
|
ArdourCanvas::Container *meter_group;
|
||||||
ArdourCanvas::Layout *marker_group;
|
ArdourCanvas::Container *marker_group;
|
||||||
ArdourCanvas::Layout *range_marker_group;
|
ArdourCanvas::Container *range_marker_group;
|
||||||
ArdourCanvas::Layout *transport_marker_group;
|
ArdourCanvas::Container *transport_marker_group;
|
||||||
ArdourCanvas::Layout* cd_marker_group;
|
ArdourCanvas::Container* cd_marker_group;
|
||||||
|
|
||||||
/* parent for groups which themselves contain time markers */
|
/* parent for groups which themselves contain time markers */
|
||||||
ArdourCanvas::Layout* _time_markers_group;
|
ArdourCanvas::Container* _time_markers_group;
|
||||||
|
|
||||||
/* The group containing all other groups that are scrolled vertically
|
/* The group containing all other groups that are scrolled vertically
|
||||||
and horizontally.
|
and horizontally.
|
||||||
|
|
@ -759,12 +759,12 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
|
||||||
ArdourCanvas::ScrollGroup* h_scroll_group;
|
ArdourCanvas::ScrollGroup* h_scroll_group;
|
||||||
|
|
||||||
/* The group containing all trackviews. */
|
/* The group containing all trackviews. */
|
||||||
ArdourCanvas::Layout* _trackview_group;
|
ArdourCanvas::Container* _trackview_group;
|
||||||
|
|
||||||
/* The group holding things (mostly regions) while dragging so they
|
/* The group holding things (mostly regions) while dragging so they
|
||||||
* are on top of everything else
|
* are on top of everything else
|
||||||
*/
|
*/
|
||||||
ArdourCanvas::Layout* _drag_motion_group;
|
ArdourCanvas::Container* _drag_motion_group;
|
||||||
|
|
||||||
/* a rect that sits at the bottom of all tracks to act as a drag-no-drop/clickable
|
/* a rect that sits at the bottom of all tracks to act as a drag-no-drop/clickable
|
||||||
* target area.
|
* target area.
|
||||||
|
|
@ -898,7 +898,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
|
||||||
|
|
||||||
/* videtimline related actions */
|
/* videtimline related actions */
|
||||||
Gtk::Label videotl_label;
|
Gtk::Label videotl_label;
|
||||||
ArdourCanvas::Layout* videotl_group;
|
ArdourCanvas::Container* videotl_group;
|
||||||
Glib::RefPtr<Gtk::ToggleAction> ruler_video_action;
|
Glib::RefPtr<Gtk::ToggleAction> ruler_video_action;
|
||||||
Glib::RefPtr<Gtk::ToggleAction> xjadeo_proc_action;
|
Glib::RefPtr<Gtk::ToggleAction> xjadeo_proc_action;
|
||||||
Glib::RefPtr<Gtk::ToggleAction> xjadeo_ontop_action;
|
Glib::RefPtr<Gtk::ToggleAction> xjadeo_ontop_action;
|
||||||
|
|
@ -1478,8 +1478,8 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
|
||||||
|
|
||||||
TempoLines* tempo_lines;
|
TempoLines* tempo_lines;
|
||||||
|
|
||||||
ArdourCanvas::Layout* global_rect_group;
|
ArdourCanvas::Container* global_rect_group;
|
||||||
ArdourCanvas::Layout* time_line_group;
|
ArdourCanvas::Container* time_line_group;
|
||||||
|
|
||||||
void hide_measures ();
|
void hide_measures ();
|
||||||
void draw_measures (ARDOUR::TempoMap::BBTPointList::const_iterator& begin,
|
void draw_measures (ARDOUR::TempoMap::BBTPointList::const_iterator& begin,
|
||||||
|
|
|
||||||
|
|
@ -101,7 +101,7 @@ Editor::initialize_canvas ()
|
||||||
}
|
}
|
||||||
|
|
||||||
/*a group to hold global rects like punch/loop indicators */
|
/*a group to hold global rects like punch/loop indicators */
|
||||||
global_rect_group = new ArdourCanvas::Layout (hv_scroll_group);
|
global_rect_group = new ArdourCanvas::Container (hv_scroll_group);
|
||||||
CANVAS_DEBUG_NAME (global_rect_group, "global rect group");
|
CANVAS_DEBUG_NAME (global_rect_group, "global rect group");
|
||||||
|
|
||||||
transport_loop_range_rect = new ArdourCanvas::Rectangle (global_rect_group, ArdourCanvas::Rect (0.0, 0.0, 0.0, ArdourCanvas::COORD_MAX));
|
transport_loop_range_rect = new ArdourCanvas::Rectangle (global_rect_group, ArdourCanvas::Rect (0.0, 0.0, 0.0, ArdourCanvas::COORD_MAX));
|
||||||
|
|
@ -113,10 +113,10 @@ Editor::initialize_canvas ()
|
||||||
transport_punch_range_rect->hide();
|
transport_punch_range_rect->hide();
|
||||||
|
|
||||||
/*a group to hold time (measure) lines */
|
/*a group to hold time (measure) lines */
|
||||||
time_line_group = new ArdourCanvas::Layout (hv_scroll_group);
|
time_line_group = new ArdourCanvas::Container (hv_scroll_group);
|
||||||
CANVAS_DEBUG_NAME (time_line_group, "time line group");
|
CANVAS_DEBUG_NAME (time_line_group, "time line group");
|
||||||
|
|
||||||
_trackview_group = new ArdourCanvas::Layout (hv_scroll_group);
|
_trackview_group = new ArdourCanvas::Container (hv_scroll_group);
|
||||||
CANVAS_DEBUG_NAME (_trackview_group, "Canvas TrackViews");
|
CANVAS_DEBUG_NAME (_trackview_group, "Canvas TrackViews");
|
||||||
|
|
||||||
// used to show zoom mode active zooming
|
// used to show zoom mode active zooming
|
||||||
|
|
@ -131,30 +131,30 @@ Editor::initialize_canvas ()
|
||||||
/* a group to hold stuff while it gets dragged around. Must be the
|
/* a group to hold stuff while it gets dragged around. Must be the
|
||||||
* uppermost (last) group with hv_scroll_group as a parent
|
* uppermost (last) group with hv_scroll_group as a parent
|
||||||
*/
|
*/
|
||||||
_drag_motion_group = new ArdourCanvas::Layout (hv_scroll_group);
|
_drag_motion_group = new ArdourCanvas::Container (hv_scroll_group);
|
||||||
CANVAS_DEBUG_NAME (_drag_motion_group, "Canvas Drag Motion");
|
CANVAS_DEBUG_NAME (_drag_motion_group, "Canvas Drag Motion");
|
||||||
|
|
||||||
/* TIME BAR CANVAS */
|
/* TIME BAR CANVAS */
|
||||||
|
|
||||||
_time_markers_group = new ArdourCanvas::Layout (h_scroll_group);
|
_time_markers_group = new ArdourCanvas::Container (h_scroll_group);
|
||||||
CANVAS_DEBUG_NAME (_time_markers_group, "time bars");
|
CANVAS_DEBUG_NAME (_time_markers_group, "time bars");
|
||||||
|
|
||||||
cd_marker_group = new ArdourCanvas::Layout (_time_markers_group, ArdourCanvas::Duple (0.0, 0.0));
|
cd_marker_group = new ArdourCanvas::Container (_time_markers_group, ArdourCanvas::Duple (0.0, 0.0));
|
||||||
CANVAS_DEBUG_NAME (cd_marker_group, "cd marker group");
|
CANVAS_DEBUG_NAME (cd_marker_group, "cd marker group");
|
||||||
/* the vide is temporarily placed a the same location as the
|
/* the vide is temporarily placed a the same location as the
|
||||||
cd_marker_group, but is moved later.
|
cd_marker_group, but is moved later.
|
||||||
*/
|
*/
|
||||||
videotl_group = new ArdourCanvas::Layout (_time_markers_group, ArdourCanvas::Duple(0.0, 0.0));
|
videotl_group = new ArdourCanvas::Container (_time_markers_group, ArdourCanvas::Duple(0.0, 0.0));
|
||||||
CANVAS_DEBUG_NAME (videotl_group, "videotl group");
|
CANVAS_DEBUG_NAME (videotl_group, "videotl group");
|
||||||
marker_group = new ArdourCanvas::Layout (_time_markers_group, ArdourCanvas::Duple (0.0, timebar_height + 1.0));
|
marker_group = new ArdourCanvas::Container (_time_markers_group, ArdourCanvas::Duple (0.0, timebar_height + 1.0));
|
||||||
CANVAS_DEBUG_NAME (marker_group, "marker group");
|
CANVAS_DEBUG_NAME (marker_group, "marker group");
|
||||||
transport_marker_group = new ArdourCanvas::Layout (_time_markers_group, ArdourCanvas::Duple (0.0, (timebar_height * 2.0) + 1.0));
|
transport_marker_group = new ArdourCanvas::Container (_time_markers_group, ArdourCanvas::Duple (0.0, (timebar_height * 2.0) + 1.0));
|
||||||
CANVAS_DEBUG_NAME (transport_marker_group, "transport marker group");
|
CANVAS_DEBUG_NAME (transport_marker_group, "transport marker group");
|
||||||
range_marker_group = new ArdourCanvas::Layout (_time_markers_group, ArdourCanvas::Duple (0.0, (timebar_height * 3.0) + 1.0));
|
range_marker_group = new ArdourCanvas::Container (_time_markers_group, ArdourCanvas::Duple (0.0, (timebar_height * 3.0) + 1.0));
|
||||||
CANVAS_DEBUG_NAME (range_marker_group, "range marker group");
|
CANVAS_DEBUG_NAME (range_marker_group, "range marker group");
|
||||||
tempo_group = new ArdourCanvas::Layout (_time_markers_group, ArdourCanvas::Duple (0.0, (timebar_height * 4.0) + 1.0));
|
tempo_group = new ArdourCanvas::Container (_time_markers_group, ArdourCanvas::Duple (0.0, (timebar_height * 4.0) + 1.0));
|
||||||
CANVAS_DEBUG_NAME (tempo_group, "tempo group");
|
CANVAS_DEBUG_NAME (tempo_group, "tempo group");
|
||||||
meter_group = new ArdourCanvas::Layout (_time_markers_group, ArdourCanvas::Duple (0.0, (timebar_height * 5.0) + 1.0));
|
meter_group = new ArdourCanvas::Container (_time_markers_group, ArdourCanvas::Duple (0.0, (timebar_height * 5.0) + 1.0));
|
||||||
CANVAS_DEBUG_NAME (meter_group, "meter group");
|
CANVAS_DEBUG_NAME (meter_group, "meter group");
|
||||||
|
|
||||||
meter_bar = new ArdourCanvas::Rectangle (meter_group, ArdourCanvas::Rect (0.0, 0.0, ArdourCanvas::COORD_MAX, timebar_height));
|
meter_bar = new ArdourCanvas::Rectangle (meter_group, ArdourCanvas::Rect (0.0, 0.0, ArdourCanvas::COORD_MAX, timebar_height));
|
||||||
|
|
|
||||||
|
|
@ -64,7 +64,7 @@ Editor::add_new_location (Location *location)
|
||||||
{
|
{
|
||||||
ENSURE_GUI_THREAD (*this, &Editor::add_new_location, location);
|
ENSURE_GUI_THREAD (*this, &Editor::add_new_location, location);
|
||||||
|
|
||||||
ArdourCanvas::Layout* group = add_new_location_internal (location);
|
ArdourCanvas::Container* group = add_new_location_internal (location);
|
||||||
|
|
||||||
/* Do a full update of the markers in this group */
|
/* Do a full update of the markers in this group */
|
||||||
update_marker_labels (group);
|
update_marker_labels (group);
|
||||||
|
|
@ -82,14 +82,14 @@ Editor::add_new_location (Location *location)
|
||||||
* the caller must call update_marker_labels () after calling this.
|
* the caller must call update_marker_labels () after calling this.
|
||||||
* @return canvas group that the location's marker was added to.
|
* @return canvas group that the location's marker was added to.
|
||||||
*/
|
*/
|
||||||
ArdourCanvas::Layout*
|
ArdourCanvas::Container*
|
||||||
Editor::add_new_location_internal (Location* location)
|
Editor::add_new_location_internal (Location* location)
|
||||||
{
|
{
|
||||||
LocationMarkers *lam = new LocationMarkers;
|
LocationMarkers *lam = new LocationMarkers;
|
||||||
uint32_t color;
|
uint32_t color;
|
||||||
|
|
||||||
/* make a note here of which group this marker ends up in */
|
/* make a note here of which group this marker ends up in */
|
||||||
ArdourCanvas::Layout* group = 0;
|
ArdourCanvas::Container* group = 0;
|
||||||
|
|
||||||
if (location->is_cd_marker()) {
|
if (location->is_cd_marker()) {
|
||||||
color = location_cd_marker_color;
|
color = location_cd_marker_color;
|
||||||
|
|
@ -311,14 +311,14 @@ struct MarkerComparator {
|
||||||
void
|
void
|
||||||
Editor::update_marker_labels ()
|
Editor::update_marker_labels ()
|
||||||
{
|
{
|
||||||
for (std::map<ArdourCanvas::Layout *, std::list<Marker *> >::iterator i = _sorted_marker_lists.begin(); i != _sorted_marker_lists.end(); ++i) {
|
for (std::map<ArdourCanvas::Container *, std::list<Marker *> >::iterator i = _sorted_marker_lists.begin(); i != _sorted_marker_lists.end(); ++i) {
|
||||||
update_marker_labels (i->first);
|
update_marker_labels (i->first);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Look at all markers in a group and update label widths */
|
/** Look at all markers in a group and update label widths */
|
||||||
void
|
void
|
||||||
Editor::update_marker_labels (ArdourCanvas::Layout* group)
|
Editor::update_marker_labels (ArdourCanvas::Container* group)
|
||||||
{
|
{
|
||||||
list<Marker*>& sorted = _sorted_marker_lists[group];
|
list<Marker*>& sorted = _sorted_marker_lists[group];
|
||||||
|
|
||||||
|
|
@ -1576,7 +1576,7 @@ Editor::toggle_marker_lines ()
|
||||||
void
|
void
|
||||||
Editor::remove_sorted_marker (Marker* m)
|
Editor::remove_sorted_marker (Marker* m)
|
||||||
{
|
{
|
||||||
for (std::map<ArdourCanvas::Layout *, std::list<Marker *> >::iterator i = _sorted_marker_lists.begin(); i != _sorted_marker_lists.end(); ++i) {
|
for (std::map<ArdourCanvas::Container *, std::list<Marker *> >::iterator i = _sorted_marker_lists.begin(); i != _sorted_marker_lists.end(); ++i) {
|
||||||
i->second.remove (m);
|
i->second.remove (m);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@
|
||||||
|
|
||||||
#include <gtk/gtkaction.h>
|
#include <gtk/gtkaction.h>
|
||||||
|
|
||||||
#include "canvas/layout.h"
|
#include "canvas/container.h"
|
||||||
#include "canvas/canvas.h"
|
#include "canvas/canvas.h"
|
||||||
#include "canvas/ruler.h"
|
#include "canvas/ruler.h"
|
||||||
#include "canvas/debug.h"
|
#include "canvas/debug.h"
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "evoral/Note.hpp"
|
#include "evoral/Note.hpp"
|
||||||
#include "canvas/layout.h"
|
#include "canvas/container.h"
|
||||||
#include "canvas/rectangle.h"
|
#include "canvas/rectangle.h"
|
||||||
#include "canvas/wave_view.h"
|
#include "canvas/wave_view.h"
|
||||||
#include "canvas/debug.h"
|
#include "canvas/debug.h"
|
||||||
|
|
@ -38,11 +38,11 @@ using namespace ARDOUR;
|
||||||
|
|
||||||
PBD::Signal1<void,GhostRegion*> GhostRegion::CatchDeletion;
|
PBD::Signal1<void,GhostRegion*> GhostRegion::CatchDeletion;
|
||||||
|
|
||||||
GhostRegion::GhostRegion (ArdourCanvas::Layout* parent, TimeAxisView& tv, TimeAxisView& source_tv, double initial_pos)
|
GhostRegion::GhostRegion (ArdourCanvas::Container* parent, TimeAxisView& tv, TimeAxisView& source_tv, double initial_pos)
|
||||||
: trackview (tv)
|
: trackview (tv)
|
||||||
, source_trackview (source_tv)
|
, source_trackview (source_tv)
|
||||||
{
|
{
|
||||||
group = new ArdourCanvas::Layout (parent);
|
group = new ArdourCanvas::Container (parent);
|
||||||
CANVAS_DEBUG_NAME (group, "ghost region");
|
CANVAS_DEBUG_NAME (group, "ghost region");
|
||||||
group->set_position (ArdourCanvas::Duple (initial_pos, 0));
|
group->set_position (ArdourCanvas::Duple (initial_pos, 0));
|
||||||
|
|
||||||
|
|
@ -191,7 +191,7 @@ MidiGhostRegion::~MidiGhostRegion()
|
||||||
clear_events ();
|
clear_events ();
|
||||||
}
|
}
|
||||||
|
|
||||||
MidiGhostRegion::GhostEvent::GhostEvent (NoteBase* e, ArdourCanvas::Layout* g)
|
MidiGhostRegion::GhostEvent::GhostEvent (NoteBase* e, ArdourCanvas::Container* g)
|
||||||
: event (e)
|
: event (e)
|
||||||
{
|
{
|
||||||
rect = new ArdourCanvas::Rectangle (g, ArdourCanvas::Rect (e->x0(), e->y0(), e->x1(), e->y1()));
|
rect = new ArdourCanvas::Rectangle (g, ArdourCanvas::Rect (e->x0(), e->y0(), e->x1(), e->y1()));
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ class TimeAxisView;
|
||||||
class GhostRegion : public sigc::trackable
|
class GhostRegion : public sigc::trackable
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
GhostRegion(ArdourCanvas::Layout* parent, TimeAxisView& tv, TimeAxisView& source_tv, double initial_unit_pos);
|
GhostRegion(ArdourCanvas::Container* parent, TimeAxisView& tv, TimeAxisView& source_tv, double initial_unit_pos);
|
||||||
virtual ~GhostRegion();
|
virtual ~GhostRegion();
|
||||||
|
|
||||||
virtual void set_samples_per_pixel (double) = 0;
|
virtual void set_samples_per_pixel (double) = 0;
|
||||||
|
|
@ -52,7 +52,7 @@ public:
|
||||||
TimeAxisView& trackview;
|
TimeAxisView& trackview;
|
||||||
/** TimeAxisView that we are a ghost for */
|
/** TimeAxisView that we are a ghost for */
|
||||||
TimeAxisView& source_trackview;
|
TimeAxisView& source_trackview;
|
||||||
ArdourCanvas::Layout* group;
|
ArdourCanvas::Container* group;
|
||||||
ArdourCanvas::Rectangle* base_rect;
|
ArdourCanvas::Rectangle* base_rect;
|
||||||
|
|
||||||
static PBD::Signal1<void,GhostRegion*> CatchDeletion;
|
static PBD::Signal1<void,GhostRegion*> CatchDeletion;
|
||||||
|
|
@ -73,7 +73,7 @@ class MidiGhostRegion : public GhostRegion {
|
||||||
public:
|
public:
|
||||||
class GhostEvent : public sigc::trackable {
|
class GhostEvent : public sigc::trackable {
|
||||||
public:
|
public:
|
||||||
GhostEvent(::NoteBase *, ArdourCanvas::Layout *);
|
GhostEvent(::NoteBase *, ArdourCanvas::Container *);
|
||||||
virtual ~GhostEvent ();
|
virtual ~GhostEvent ();
|
||||||
|
|
||||||
NoteBase* event;
|
NoteBase* event;
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@
|
||||||
#include "ardour/tempo.h"
|
#include "ardour/tempo.h"
|
||||||
|
|
||||||
#include "canvas/rectangle.h"
|
#include "canvas/rectangle.h"
|
||||||
#include "canvas/layout.h"
|
#include "canvas/container.h"
|
||||||
#include "canvas/line.h"
|
#include "canvas/line.h"
|
||||||
#include "canvas/polygon.h"
|
#include "canvas/polygon.h"
|
||||||
#include "canvas/text.h"
|
#include "canvas/text.h"
|
||||||
|
|
@ -53,7 +53,7 @@ PBD::Signal1<void,Marker*> Marker::CatchDeletion;
|
||||||
|
|
||||||
static const double marker_height = 13.0;
|
static const double marker_height = 13.0;
|
||||||
|
|
||||||
Marker::Marker (PublicEditor& ed, ArdourCanvas::Layout& parent, guint32 rgba, const string& annotation,
|
Marker::Marker (PublicEditor& ed, ArdourCanvas::Container& parent, guint32 rgba, const string& annotation,
|
||||||
Type type, framepos_t frame, bool handle_events)
|
Type type, framepos_t frame, bool handle_events)
|
||||||
|
|
||||||
: editor (ed)
|
: editor (ed)
|
||||||
|
|
@ -242,7 +242,7 @@ Marker::Marker (PublicEditor& ed, ArdourCanvas::Layout& parent, guint32 rgba, co
|
||||||
unit_position = editor.sample_to_pixel (frame);
|
unit_position = editor.sample_to_pixel (frame);
|
||||||
unit_position -= _shift;
|
unit_position -= _shift;
|
||||||
|
|
||||||
group = new ArdourCanvas::Layout (&parent, ArdourCanvas::Duple (unit_position, 0));
|
group = new ArdourCanvas::Container (&parent, ArdourCanvas::Duple (unit_position, 0));
|
||||||
#ifdef CANVAS_DEBUG
|
#ifdef CANVAS_DEBUG
|
||||||
group->name = string_compose ("Marker::group for %1", annotation);
|
group->name = string_compose ("Marker::group for %1", annotation);
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -302,7 +302,7 @@ Marker::~Marker ()
|
||||||
delete _track_canvas_line;
|
delete _track_canvas_line;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Marker::reparent(ArdourCanvas::Layout & parent)
|
void Marker::reparent(ArdourCanvas::Container & parent)
|
||||||
{
|
{
|
||||||
group->reparent (&parent);
|
group->reparent (&parent);
|
||||||
_parent = &parent;
|
_parent = &parent;
|
||||||
|
|
@ -501,7 +501,7 @@ Marker::set_right_label_limit (double p)
|
||||||
|
|
||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
|
|
||||||
TempoMarker::TempoMarker (PublicEditor& editor, ArdourCanvas::Layout& parent, guint32 rgba, const string& text,
|
TempoMarker::TempoMarker (PublicEditor& editor, ArdourCanvas::Container& parent, guint32 rgba, const string& text,
|
||||||
ARDOUR::TempoSection& temp)
|
ARDOUR::TempoSection& temp)
|
||||||
: Marker (editor, parent, rgba, text, Tempo, 0, false),
|
: Marker (editor, parent, rgba, text, Tempo, 0, false),
|
||||||
_tempo (temp)
|
_tempo (temp)
|
||||||
|
|
@ -516,7 +516,7 @@ TempoMarker::~TempoMarker ()
|
||||||
|
|
||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
|
|
||||||
MeterMarker::MeterMarker (PublicEditor& editor, ArdourCanvas::Layout& parent, guint32 rgba, const string& text,
|
MeterMarker::MeterMarker (PublicEditor& editor, ArdourCanvas::Container& parent, guint32 rgba, const string& text,
|
||||||
ARDOUR::MeterSection& m)
|
ARDOUR::MeterSection& m)
|
||||||
: Marker (editor, parent, rgba, text, Meter, 0, false),
|
: Marker (editor, parent, rgba, text, Meter, 0, false),
|
||||||
_meter (m)
|
_meter (m)
|
||||||
|
|
|
||||||
|
|
@ -56,7 +56,7 @@ class Marker : public sigc::trackable
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
Marker (PublicEditor& editor, ArdourCanvas::Layout &, guint32 rgba, const std::string& text, Type,
|
Marker (PublicEditor& editor, ArdourCanvas::Container &, guint32 rgba, const std::string& text, Type,
|
||||||
framepos_t frame = 0, bool handle_events = true);
|
framepos_t frame = 0, bool handle_events = true);
|
||||||
|
|
||||||
virtual ~Marker ();
|
virtual ~Marker ();
|
||||||
|
|
@ -76,8 +76,8 @@ class Marker : public sigc::trackable
|
||||||
|
|
||||||
framepos_t position() const { return frame_position; }
|
framepos_t position() const { return frame_position; }
|
||||||
|
|
||||||
ArdourCanvas::Layout * get_parent() { return _parent; }
|
ArdourCanvas::Container * get_parent() { return _parent; }
|
||||||
void reparent (ArdourCanvas::Layout & parent);
|
void reparent (ArdourCanvas::Container & parent);
|
||||||
|
|
||||||
void hide ();
|
void hide ();
|
||||||
void show ();
|
void show ();
|
||||||
|
|
@ -98,8 +98,8 @@ class Marker : public sigc::trackable
|
||||||
|
|
||||||
Pango::FontDescription name_font;
|
Pango::FontDescription name_font;
|
||||||
|
|
||||||
ArdourCanvas::Layout* _parent;
|
ArdourCanvas::Container* _parent;
|
||||||
ArdourCanvas::Layout *group;
|
ArdourCanvas::Container *group;
|
||||||
ArdourCanvas::Polygon *mark;
|
ArdourCanvas::Polygon *mark;
|
||||||
ArdourCanvas::Text *_name_item;
|
ArdourCanvas::Text *_name_item;
|
||||||
ArdourCanvas::Points *points;
|
ArdourCanvas::Points *points;
|
||||||
|
|
@ -134,7 +134,7 @@ private:
|
||||||
class TempoMarker : public Marker
|
class TempoMarker : public Marker
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
TempoMarker (PublicEditor& editor, ArdourCanvas::Layout &, guint32 rgba, const std::string& text, ARDOUR::TempoSection&);
|
TempoMarker (PublicEditor& editor, ArdourCanvas::Container &, guint32 rgba, const std::string& text, ARDOUR::TempoSection&);
|
||||||
~TempoMarker ();
|
~TempoMarker ();
|
||||||
|
|
||||||
ARDOUR::TempoSection& tempo() const { return _tempo; }
|
ARDOUR::TempoSection& tempo() const { return _tempo; }
|
||||||
|
|
@ -146,7 +146,7 @@ class TempoMarker : public Marker
|
||||||
class MeterMarker : public Marker
|
class MeterMarker : public Marker
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
MeterMarker (PublicEditor& editor, ArdourCanvas::Layout &, guint32 rgba, const std::string& text, ARDOUR::MeterSection&);
|
MeterMarker (PublicEditor& editor, ArdourCanvas::Container &, guint32 rgba, const std::string& text, ARDOUR::MeterSection&);
|
||||||
~MeterMarker ();
|
~MeterMarker ();
|
||||||
|
|
||||||
ARDOUR::MeterSection& meter() const { return _meter; }
|
ARDOUR::MeterSection& meter() const { return _meter; }
|
||||||
|
|
|
||||||
|
|
@ -88,13 +88,13 @@ PBD::Signal1<void, MidiRegionView *> MidiRegionView::SelectionCleared;
|
||||||
|
|
||||||
#define MIDI_BP_ZERO ((Config->get_first_midi_bank_is_zero())?0:1)
|
#define MIDI_BP_ZERO ((Config->get_first_midi_bank_is_zero())?0:1)
|
||||||
|
|
||||||
MidiRegionView::MidiRegionView (ArdourCanvas::Layout *parent, RouteTimeAxisView &tv,
|
MidiRegionView::MidiRegionView (ArdourCanvas::Container *parent, RouteTimeAxisView &tv,
|
||||||
boost::shared_ptr<MidiRegion> r, double spu, uint32_t basic_color)
|
boost::shared_ptr<MidiRegion> r, double spu, uint32_t basic_color)
|
||||||
: RegionView (parent, tv, r, spu, basic_color)
|
: RegionView (parent, tv, r, spu, basic_color)
|
||||||
, _current_range_min(0)
|
, _current_range_min(0)
|
||||||
, _current_range_max(0)
|
, _current_range_max(0)
|
||||||
, _active_notes(0)
|
, _active_notes(0)
|
||||||
, _note_group (new ArdourCanvas::Layout (group))
|
, _note_group (new ArdourCanvas::Container (group))
|
||||||
, _note_diff_command (0)
|
, _note_diff_command (0)
|
||||||
, _ghost_note(0)
|
, _ghost_note(0)
|
||||||
, _step_edit_cursor (0)
|
, _step_edit_cursor (0)
|
||||||
|
|
@ -124,14 +124,14 @@ MidiRegionView::MidiRegionView (ArdourCanvas::Layout *parent, RouteTimeAxisView
|
||||||
SelectionCleared.connect (_selection_cleared_connection, invalidator (*this), boost::bind (&MidiRegionView::selection_cleared, this, _1), gui_context ());
|
SelectionCleared.connect (_selection_cleared_connection, invalidator (*this), boost::bind (&MidiRegionView::selection_cleared, this, _1), gui_context ());
|
||||||
}
|
}
|
||||||
|
|
||||||
MidiRegionView::MidiRegionView (ArdourCanvas::Layout *parent, RouteTimeAxisView &tv,
|
MidiRegionView::MidiRegionView (ArdourCanvas::Container *parent, RouteTimeAxisView &tv,
|
||||||
boost::shared_ptr<MidiRegion> r, double spu, uint32_t basic_color,
|
boost::shared_ptr<MidiRegion> r, double spu, uint32_t basic_color,
|
||||||
TimeAxisViewItem::Visibility visibility)
|
TimeAxisViewItem::Visibility visibility)
|
||||||
: RegionView (parent, tv, r, spu, basic_color, false, visibility)
|
: RegionView (parent, tv, r, spu, basic_color, false, visibility)
|
||||||
, _current_range_min(0)
|
, _current_range_min(0)
|
||||||
, _current_range_max(0)
|
, _current_range_max(0)
|
||||||
, _active_notes(0)
|
, _active_notes(0)
|
||||||
, _note_group (new ArdourCanvas::Layout (parent))
|
, _note_group (new ArdourCanvas::Container (parent))
|
||||||
, _note_diff_command (0)
|
, _note_diff_command (0)
|
||||||
, _ghost_note(0)
|
, _ghost_note(0)
|
||||||
, _step_edit_cursor (0)
|
, _step_edit_cursor (0)
|
||||||
|
|
@ -177,7 +177,7 @@ MidiRegionView::MidiRegionView (const MidiRegionView& other)
|
||||||
, _current_range_min(0)
|
, _current_range_min(0)
|
||||||
, _current_range_max(0)
|
, _current_range_max(0)
|
||||||
, _active_notes(0)
|
, _active_notes(0)
|
||||||
, _note_group (new ArdourCanvas::Layout (get_canvas_group()))
|
, _note_group (new ArdourCanvas::Container (get_canvas_group()))
|
||||||
, _note_diff_command (0)
|
, _note_diff_command (0)
|
||||||
, _ghost_note(0)
|
, _ghost_note(0)
|
||||||
, _step_edit_cursor (0)
|
, _step_edit_cursor (0)
|
||||||
|
|
@ -205,7 +205,7 @@ MidiRegionView::MidiRegionView (const MidiRegionView& other, boost::shared_ptr<M
|
||||||
, _current_range_min(0)
|
, _current_range_min(0)
|
||||||
, _current_range_max(0)
|
, _current_range_max(0)
|
||||||
, _active_notes(0)
|
, _active_notes(0)
|
||||||
, _note_group (new ArdourCanvas::Layout (get_canvas_group()))
|
, _note_group (new ArdourCanvas::Container (get_canvas_group()))
|
||||||
, _note_diff_command (0)
|
, _note_diff_command (0)
|
||||||
, _ghost_note(0)
|
, _ghost_note(0)
|
||||||
, _step_edit_cursor (0)
|
, _step_edit_cursor (0)
|
||||||
|
|
@ -3610,7 +3610,7 @@ void
|
||||||
MidiRegionView::show_step_edit_cursor (Evoral::MusicalTime pos)
|
MidiRegionView::show_step_edit_cursor (Evoral::MusicalTime pos)
|
||||||
{
|
{
|
||||||
if (_step_edit_cursor == 0) {
|
if (_step_edit_cursor == 0) {
|
||||||
ArdourCanvas::Layout* const group = (ArdourCanvas::Layout*)get_canvas_group();
|
ArdourCanvas::Item* const group = get_canvas_group();
|
||||||
|
|
||||||
_step_edit_cursor = new ArdourCanvas::Rectangle (group);
|
_step_edit_cursor = new ArdourCanvas::Rectangle (group);
|
||||||
_step_edit_cursor->set_y0 (0);
|
_step_edit_cursor->set_y0 (0);
|
||||||
|
|
@ -3725,7 +3725,7 @@ MidiRegionView::trim_front_starting ()
|
||||||
/* Reparent the note group to the region view's parent, so that it doesn't change
|
/* Reparent the note group to the region view's parent, so that it doesn't change
|
||||||
when the region view is trimmed.
|
when the region view is trimmed.
|
||||||
*/
|
*/
|
||||||
_temporary_note_group = new ArdourCanvas::Layout (group->parent ());
|
_temporary_note_group = new ArdourCanvas::Container (group->parent ());
|
||||||
_temporary_note_group->move (group->position ());
|
_temporary_note_group->move (group->position ());
|
||||||
_note_group->reparent (_temporary_note_group);
|
_note_group->reparent (_temporary_note_group);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -67,7 +67,7 @@ public:
|
||||||
typedef Evoral::Note<Evoral::MusicalTime> NoteType;
|
typedef Evoral::Note<Evoral::MusicalTime> NoteType;
|
||||||
typedef Evoral::Sequence<Evoral::MusicalTime>::Notes Notes;
|
typedef Evoral::Sequence<Evoral::MusicalTime>::Notes Notes;
|
||||||
|
|
||||||
MidiRegionView (ArdourCanvas::Layout *,
|
MidiRegionView (ArdourCanvas::Container *,
|
||||||
RouteTimeAxisView&,
|
RouteTimeAxisView&,
|
||||||
boost::shared_ptr<ARDOUR::MidiRegion>,
|
boost::shared_ptr<ARDOUR::MidiRegion>,
|
||||||
double initial_samples_per_pixel,
|
double initial_samples_per_pixel,
|
||||||
|
|
@ -309,7 +309,7 @@ protected:
|
||||||
/** Allows derived types to specify their visibility requirements
|
/** Allows derived types to specify their visibility requirements
|
||||||
* to the TimeAxisViewItem parent class.
|
* to the TimeAxisViewItem parent class.
|
||||||
*/
|
*/
|
||||||
MidiRegionView (ArdourCanvas::Layout *,
|
MidiRegionView (ArdourCanvas::Container *,
|
||||||
RouteTimeAxisView&,
|
RouteTimeAxisView&,
|
||||||
boost::shared_ptr<ARDOUR::MidiRegion>,
|
boost::shared_ptr<ARDOUR::MidiRegion>,
|
||||||
double samples_per_pixel,
|
double samples_per_pixel,
|
||||||
|
|
@ -387,7 +387,7 @@ private:
|
||||||
PatchChanges _patch_changes;
|
PatchChanges _patch_changes;
|
||||||
SysExes _sys_exes;
|
SysExes _sys_exes;
|
||||||
Note** _active_notes;
|
Note** _active_notes;
|
||||||
ArdourCanvas::Layout* _note_group;
|
ArdourCanvas::Container* _note_group;
|
||||||
ARDOUR::MidiModel::NoteDiffCommand* _note_diff_command;
|
ARDOUR::MidiModel::NoteDiffCommand* _note_diff_command;
|
||||||
Note* _ghost_note;
|
Note* _ghost_note;
|
||||||
double _last_ghost_x;
|
double _last_ghost_x;
|
||||||
|
|
@ -401,7 +401,7 @@ private:
|
||||||
/** A group used to temporarily reparent _note_group to during start trims, so
|
/** A group used to temporarily reparent _note_group to during start trims, so
|
||||||
* that the notes don't move with the parent region view.
|
* that the notes don't move with the parent region view.
|
||||||
*/
|
*/
|
||||||
ArdourCanvas::Layout* _temporary_note_group;
|
ArdourCanvas::Container* _temporary_note_group;
|
||||||
|
|
||||||
MouseState _mouse_state;
|
MouseState _mouse_state;
|
||||||
int _pressed_button;
|
int _pressed_button;
|
||||||
|
|
|
||||||
|
|
@ -68,7 +68,7 @@ MidiStreamView::MidiStreamView (MidiTimeAxisView& tv)
|
||||||
, _updates_suspended (false)
|
, _updates_suspended (false)
|
||||||
{
|
{
|
||||||
/* 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::Layout (_canvas_group);
|
midi_underlay_group = new ArdourCanvas::Container (_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
|
||||||
|
|
|
||||||
|
|
@ -68,7 +68,7 @@ class MidiStreamView : public StreamView
|
||||||
};
|
};
|
||||||
|
|
||||||
Gtk::Adjustment note_range_adjustment;
|
Gtk::Adjustment note_range_adjustment;
|
||||||
ArdourCanvas::Layout* midi_underlay_group;
|
ArdourCanvas::Container* midi_underlay_group;
|
||||||
|
|
||||||
void set_note_range(VisibleNoteRange r);
|
void set_note_range(VisibleNoteRange r);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -91,9 +91,9 @@ Mixer_UI::Mixer_UI ()
|
||||||
, _monitor_section (0)
|
, _monitor_section (0)
|
||||||
, _strip_width (Config->get_default_narrow_ms() ? Narrow : Wide)
|
, _strip_width (Config->get_default_narrow_ms() ? Narrow : Wide)
|
||||||
, ignore_reorder (false)
|
, ignore_reorder (false)
|
||||||
, _following_editor_selection (false)
|
|
||||||
, _in_group_rebuild_or_clear (false)
|
, _in_group_rebuild_or_clear (false)
|
||||||
, _route_deletion_in_progress (false)
|
, _route_deletion_in_progress (false)
|
||||||
|
, _following_editor_selection (false)
|
||||||
, _maximised (false)
|
, _maximised (false)
|
||||||
{
|
{
|
||||||
/* allow this window to become the key focus window */
|
/* allow this window to become the key focus window */
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@
|
||||||
#include "midi_util.h"
|
#include "midi_util.h"
|
||||||
|
|
||||||
namespace ArdourCanvas {
|
namespace ArdourCanvas {
|
||||||
class Layout;
|
class Container;
|
||||||
}
|
}
|
||||||
|
|
||||||
class Note : public NoteBase
|
class Note : public NoteBase
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,7 @@ namespace Gtk {
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace Pango {
|
namespace Pango {
|
||||||
class Layout;
|
class Container;
|
||||||
}
|
}
|
||||||
|
|
||||||
class Panner2dWindow;
|
class Panner2dWindow;
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,7 @@ using namespace std;
|
||||||
*/
|
*/
|
||||||
PatchChange::PatchChange(
|
PatchChange::PatchChange(
|
||||||
MidiRegionView& region,
|
MidiRegionView& region,
|
||||||
ArdourCanvas::Layout* parent,
|
ArdourCanvas::Container* parent,
|
||||||
const string& text,
|
const string& text,
|
||||||
double height,
|
double height,
|
||||||
double x,
|
double x,
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ class PatchChange
|
||||||
public:
|
public:
|
||||||
PatchChange(
|
PatchChange(
|
||||||
MidiRegionView& region,
|
MidiRegionView& region,
|
||||||
ArdourCanvas::Layout* parent,
|
ArdourCanvas::Container* parent,
|
||||||
const string& text,
|
const string& text,
|
||||||
double height,
|
double height,
|
||||||
double x,
|
double x,
|
||||||
|
|
|
||||||
|
|
@ -365,7 +365,7 @@ class PublicEditor : public Gtk::Window, public PBD::StatefulDestructible, publi
|
||||||
virtual Gtk::HBox& get_status_bar_packer() = 0;
|
virtual Gtk::HBox& get_status_bar_packer() = 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
virtual ArdourCanvas::Layout* get_trackview_group () const = 0;
|
virtual ArdourCanvas::Container* get_trackview_group () const = 0;
|
||||||
virtual ArdourCanvas::ScrollGroup* get_hscroll_group () const = 0;
|
virtual ArdourCanvas::ScrollGroup* get_hscroll_group () const = 0;
|
||||||
virtual ArdourCanvas::ScrollGroup* get_vscroll_group () const = 0;
|
virtual ArdourCanvas::ScrollGroup* get_vscroll_group () const = 0;
|
||||||
virtual ArdourCanvas::ScrollGroup* get_hvscroll_group () const = 0;
|
virtual ArdourCanvas::ScrollGroup* get_hvscroll_group () const = 0;
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@ using namespace std;
|
||||||
using namespace ARDOUR;
|
using namespace ARDOUR;
|
||||||
using namespace PBD;
|
using namespace PBD;
|
||||||
|
|
||||||
AudioRegionGainLine::AudioRegionGainLine (const string & name, AudioRegionView& r, ArdourCanvas::Layout& parent, boost::shared_ptr<AutomationList> l)
|
AudioRegionGainLine::AudioRegionGainLine (const string & name, AudioRegionView& r, ArdourCanvas::Container& parent, boost::shared_ptr<AutomationList> l)
|
||||||
: AutomationLine (name, r.get_time_axis_view(), parent, l)
|
: AutomationLine (name, r.get_time_axis_view(), parent, l)
|
||||||
, rv (r)
|
, rv (r)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ class AudioRegionView;
|
||||||
class AudioRegionGainLine : public AutomationLine
|
class AudioRegionGainLine : public AutomationLine
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
AudioRegionGainLine (const std::string & name, AudioRegionView&, ArdourCanvas::Layout& parent, boost::shared_ptr<ARDOUR::AutomationList>);
|
AudioRegionGainLine (const std::string & name, AudioRegionView&, ArdourCanvas::Container& parent, boost::shared_ptr<ARDOUR::AutomationList>);
|
||||||
|
|
||||||
void start_drag_single (ControlPoint*, double, float);
|
void start_drag_single (ControlPoint*, double, float);
|
||||||
void end_drag (bool with_push, uint32_t final_index);
|
void end_drag (bool with_push, uint32_t final_index);
|
||||||
|
|
|
||||||
|
|
@ -63,7 +63,7 @@ static const int32_t sync_mark_width = 9;
|
||||||
|
|
||||||
PBD::Signal1<void,RegionView*> RegionView::RegionViewGoingAway;
|
PBD::Signal1<void,RegionView*> RegionView::RegionViewGoingAway;
|
||||||
|
|
||||||
RegionView::RegionView (ArdourCanvas::Layout* parent,
|
RegionView::RegionView (ArdourCanvas::Container* parent,
|
||||||
TimeAxisView& tv,
|
TimeAxisView& tv,
|
||||||
boost::shared_ptr<ARDOUR::Region> r,
|
boost::shared_ptr<ARDOUR::Region> r,
|
||||||
double spu,
|
double spu,
|
||||||
|
|
@ -128,7 +128,7 @@ RegionView::RegionView (const RegionView& other, boost::shared_ptr<Region> other
|
||||||
GhostRegion::CatchDeletion.connect (*this, invalidator (*this), boost::bind (&RegionView::remove_ghost, this, _1), gui_context());
|
GhostRegion::CatchDeletion.connect (*this, invalidator (*this), boost::bind (&RegionView::remove_ghost, this, _1), gui_context());
|
||||||
}
|
}
|
||||||
|
|
||||||
RegionView::RegionView (ArdourCanvas::Layout* parent,
|
RegionView::RegionView (ArdourCanvas::Container* parent,
|
||||||
TimeAxisView& tv,
|
TimeAxisView& tv,
|
||||||
boost::shared_ptr<ARDOUR::Region> r,
|
boost::shared_ptr<ARDOUR::Region> r,
|
||||||
double spu,
|
double spu,
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,7 @@ namespace ArdourCanvas {
|
||||||
class RegionView : public TimeAxisViewItem
|
class RegionView : public TimeAxisViewItem
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
RegionView (ArdourCanvas::Layout* parent,
|
RegionView (ArdourCanvas::Container* parent,
|
||||||
TimeAxisView& time_view,
|
TimeAxisView& time_view,
|
||||||
boost::shared_ptr<ARDOUR::Region> region,
|
boost::shared_ptr<ARDOUR::Region> region,
|
||||||
double samples_per_pixel,
|
double samples_per_pixel,
|
||||||
|
|
@ -128,7 +128,7 @@ class RegionView : public TimeAxisViewItem
|
||||||
/** Allows derived types to specify their visibility requirements
|
/** Allows derived types to specify their visibility requirements
|
||||||
* to the TimeAxisViewItem parent class
|
* to the TimeAxisViewItem parent class
|
||||||
*/
|
*/
|
||||||
RegionView (ArdourCanvas::Layout *,
|
RegionView (ArdourCanvas::Container *,
|
||||||
TimeAxisView&,
|
TimeAxisView&,
|
||||||
boost::shared_ptr<ARDOUR::Region>,
|
boost::shared_ptr<ARDOUR::Region>,
|
||||||
double samples_per_pixel,
|
double samples_per_pixel,
|
||||||
|
|
|
||||||
|
|
@ -52,9 +52,9 @@ using namespace ARDOUR;
|
||||||
using namespace PBD;
|
using namespace PBD;
|
||||||
using namespace Editing;
|
using namespace Editing;
|
||||||
|
|
||||||
StreamView::StreamView (RouteTimeAxisView& tv, ArdourCanvas::Layout* canvas_group)
|
StreamView::StreamView (RouteTimeAxisView& tv, ArdourCanvas::Container* canvas_group)
|
||||||
: _trackview (tv)
|
: _trackview (tv)
|
||||||
, _canvas_group (canvas_group ? canvas_group : new ArdourCanvas::Layout (_trackview.canvas_display()))
|
, _canvas_group (canvas_group ? canvas_group : new ArdourCanvas::Container (_trackview.canvas_display()))
|
||||||
, _samples_per_pixel (_trackview.editor().get_current_zoom ())
|
, _samples_per_pixel (_trackview.editor().get_current_zoom ())
|
||||||
, rec_updating(false)
|
, rec_updating(false)
|
||||||
, rec_active(false)
|
, rec_active(false)
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ namespace ARDOUR {
|
||||||
|
|
||||||
namespace ArdourCanvas {
|
namespace ArdourCanvas {
|
||||||
class Rectangle;
|
class Rectangle;
|
||||||
class Layout;
|
class Container;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct RecBoxInfo {
|
struct RecBoxInfo {
|
||||||
|
|
@ -82,7 +82,7 @@ public:
|
||||||
void set_layer_display (LayerDisplay);
|
void set_layer_display (LayerDisplay);
|
||||||
LayerDisplay layer_display () const { return _layer_display; }
|
LayerDisplay layer_display () const { return _layer_display; }
|
||||||
|
|
||||||
ArdourCanvas::Layout* canvas_item() { return _canvas_group; }
|
ArdourCanvas::Container* canvas_item() { return _canvas_group; }
|
||||||
|
|
||||||
enum ColorTarget {
|
enum ColorTarget {
|
||||||
RegionColor,
|
RegionColor,
|
||||||
|
|
@ -128,7 +128,7 @@ public:
|
||||||
sigc::signal<void> ContentsHeightChanged;
|
sigc::signal<void> ContentsHeightChanged;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
StreamView (RouteTimeAxisView&, ArdourCanvas::Layout* canvas_group = 0);
|
StreamView (RouteTimeAxisView&, ArdourCanvas::Container* canvas_group = 0);
|
||||||
|
|
||||||
void transport_changed();
|
void transport_changed();
|
||||||
void transport_looped();
|
void transport_looped();
|
||||||
|
|
@ -151,7 +151,7 @@ protected:
|
||||||
virtual void color_handler () = 0;
|
virtual void color_handler () = 0;
|
||||||
|
|
||||||
RouteTimeAxisView& _trackview;
|
RouteTimeAxisView& _trackview;
|
||||||
ArdourCanvas::Layout* _canvas_group;
|
ArdourCanvas::Container* _canvas_group;
|
||||||
ArdourCanvas::Rectangle* canvas_rect; /* frame around the whole thing */
|
ArdourCanvas::Rectangle* canvas_rect; /* frame around the whole thing */
|
||||||
|
|
||||||
typedef std::list<RegionView* > RegionViewList;
|
typedef std::list<RegionView* > RegionViewList;
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ using namespace std;
|
||||||
|
|
||||||
SysEx::SysEx (
|
SysEx::SysEx (
|
||||||
MidiRegionView& region,
|
MidiRegionView& region,
|
||||||
ArdourCanvas::Layout* parent,
|
ArdourCanvas::Container* parent,
|
||||||
string& text,
|
string& text,
|
||||||
double height,
|
double height,
|
||||||
double x,
|
double x,
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ class SysEx
|
||||||
public:
|
public:
|
||||||
SysEx (
|
SysEx (
|
||||||
MidiRegionView& region,
|
MidiRegionView& region,
|
||||||
ArdourCanvas::Layout* parent,
|
ArdourCanvas::Container* parent,
|
||||||
std::string& text,
|
std::string& text,
|
||||||
double height,
|
double height,
|
||||||
double x,
|
double x,
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,7 @@ const TimeAxisViewItem::Visibility TapeAudioRegionView::default_tape_visibility
|
||||||
TimeAxisViewItem::HideFrameRight |
|
TimeAxisViewItem::HideFrameRight |
|
||||||
TimeAxisViewItem::FullWidthNameHighlight);
|
TimeAxisViewItem::FullWidthNameHighlight);
|
||||||
|
|
||||||
TapeAudioRegionView::TapeAudioRegionView (ArdourCanvas::Layout *parent, RouteTimeAxisView &tv,
|
TapeAudioRegionView::TapeAudioRegionView (ArdourCanvas::Container *parent, RouteTimeAxisView &tv,
|
||||||
boost::shared_ptr<AudioRegion> r,
|
boost::shared_ptr<AudioRegion> r,
|
||||||
double spu,
|
double spu,
|
||||||
uint32_t basic_color)
|
uint32_t basic_color)
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@
|
||||||
class TapeAudioRegionView : public AudioRegionView
|
class TapeAudioRegionView : public AudioRegionView
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
TapeAudioRegionView (ArdourCanvas::Layout *,
|
TapeAudioRegionView (ArdourCanvas::Container *,
|
||||||
RouteTimeAxisView&,
|
RouteTimeAxisView&,
|
||||||
boost::shared_ptr<ARDOUR::AudioRegion>,
|
boost::shared_ptr<ARDOUR::AudioRegion>,
|
||||||
double initial_samples_per_pixel,
|
double initial_samples_per_pixel,
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
TempoLines::TempoLines (ArdourCanvas::Layout* group, double)
|
TempoLines::TempoLines (ArdourCanvas::Container* group, double)
|
||||||
: lines (group, ArdourCanvas::LineSet::Vertical)
|
: lines (group, ArdourCanvas::LineSet::Vertical)
|
||||||
{
|
{
|
||||||
lines.set_extent (ArdourCanvas::COORD_MAX);
|
lines.set_extent (ArdourCanvas::COORD_MAX);
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@
|
||||||
|
|
||||||
class TempoLines {
|
class TempoLines {
|
||||||
public:
|
public:
|
||||||
TempoLines (ArdourCanvas::Layout* group, double screen_height);
|
TempoLines (ArdourCanvas::Container* group, double screen_height);
|
||||||
|
|
||||||
void tempo_map_changed();
|
void tempo_map_changed();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -97,16 +97,16 @@ TimeAxisView::TimeAxisView (ARDOUR::Session* sess, PublicEditor& ed, TimeAxisVie
|
||||||
compute_heights ();
|
compute_heights ();
|
||||||
}
|
}
|
||||||
|
|
||||||
_canvas_display = new ArdourCanvas::Layout (ed.get_trackview_group (), ArdourCanvas::Duple (0.0, 0.0));
|
_canvas_display = new ArdourCanvas::Container (ed.get_trackview_group (), ArdourCanvas::Duple (0.0, 0.0));
|
||||||
CANVAS_DEBUG_NAME (_canvas_display, "main for TAV");
|
CANVAS_DEBUG_NAME (_canvas_display, "main for TAV");
|
||||||
_canvas_display->hide(); // reveal as needed
|
_canvas_display->hide(); // reveal as needed
|
||||||
|
|
||||||
selection_group = new ArdourCanvas::Layout (_canvas_display);
|
selection_group = new ArdourCanvas::Container (_canvas_display);
|
||||||
CANVAS_DEBUG_NAME (selection_group, "selection for TAV");
|
CANVAS_DEBUG_NAME (selection_group, "selection for TAV");
|
||||||
selection_group->set_data (X_("timeselection"), (void *) 1);
|
selection_group->set_data (X_("timeselection"), (void *) 1);
|
||||||
selection_group->hide();
|
selection_group->hide();
|
||||||
|
|
||||||
_ghost_group = new ArdourCanvas::Layout (_canvas_display);
|
_ghost_group = new ArdourCanvas::Container (_canvas_display);
|
||||||
CANVAS_DEBUG_NAME (_ghost_group, "ghost for TAV");
|
CANVAS_DEBUG_NAME (_ghost_group, "ghost for TAV");
|
||||||
_ghost_group->lower_to_bottom();
|
_ghost_group->lower_to_bottom();
|
||||||
_ghost_group->show();
|
_ghost_group->show();
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,7 @@ namespace Gtk {
|
||||||
|
|
||||||
namespace ArdourCanvas {
|
namespace ArdourCanvas {
|
||||||
class Canvas;
|
class Canvas;
|
||||||
class Layout;
|
class Container;
|
||||||
class Item;
|
class Item;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -104,8 +104,8 @@ class TimeAxisView : public virtual AxisView
|
||||||
virtual void enter_internal_edit_mode () {}
|
virtual void enter_internal_edit_mode () {}
|
||||||
virtual void leave_internal_edit_mode () {}
|
virtual void leave_internal_edit_mode () {}
|
||||||
|
|
||||||
ArdourCanvas::Layout* canvas_display () { return _canvas_display; }
|
ArdourCanvas::Container* canvas_display () { return _canvas_display; }
|
||||||
ArdourCanvas::Layout* ghost_group () { return _ghost_group; }
|
ArdourCanvas::Container* ghost_group () { return _ghost_group; }
|
||||||
|
|
||||||
/** @return effective height (taking children into account) in canvas units, or
|
/** @return effective height (taking children into account) in canvas units, or
|
||||||
0 if this TimeAxisView has not yet been shown */
|
0 if this TimeAxisView has not yet been shown */
|
||||||
|
|
@ -212,15 +212,15 @@ class TimeAxisView : public virtual AxisView
|
||||||
std::string controls_base_selected_name;
|
std::string controls_base_selected_name;
|
||||||
Gtk::Menu* display_menu; /* The standard LHS Track control popup-menus */
|
Gtk::Menu* display_menu; /* The standard LHS Track control popup-menus */
|
||||||
TimeAxisView* parent;
|
TimeAxisView* parent;
|
||||||
ArdourCanvas::Layout* selection_group;
|
ArdourCanvas::Container* selection_group;
|
||||||
ArdourCanvas::Layout* _ghost_group;
|
ArdourCanvas::Container* _ghost_group;
|
||||||
std::list<GhostRegion*> ghosts;
|
std::list<GhostRegion*> ghosts;
|
||||||
std::list<SelectionRect*> free_selection_rects;
|
std::list<SelectionRect*> free_selection_rects;
|
||||||
std::list<SelectionRect*> used_selection_rects;
|
std::list<SelectionRect*> used_selection_rects;
|
||||||
bool _hidden;
|
bool _hidden;
|
||||||
bool in_destructor;
|
bool in_destructor;
|
||||||
Gtk::Menu* _size_menu;
|
Gtk::Menu* _size_menu;
|
||||||
ArdourCanvas::Layout* _canvas_display;
|
ArdourCanvas::Container* _canvas_display;
|
||||||
double _y_position;
|
double _y_position;
|
||||||
PublicEditor& _editor;
|
PublicEditor& _editor;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@
|
||||||
#include "gtkmm2ext/utils.h"
|
#include "gtkmm2ext/utils.h"
|
||||||
#include "gtkmm2ext/gui_thread.h"
|
#include "gtkmm2ext/gui_thread.h"
|
||||||
|
|
||||||
#include "canvas/layout.h"
|
#include "canvas/container.h"
|
||||||
#include "canvas/rectangle.h"
|
#include "canvas/rectangle.h"
|
||||||
#include "canvas/debug.h"
|
#include "canvas/debug.h"
|
||||||
#include "canvas/text.h"
|
#include "canvas/text.h"
|
||||||
|
|
@ -162,7 +162,7 @@ TimeAxisViewItem::init (ArdourCanvas::Item* parent, double fpp, uint32_t base_co
|
||||||
framepos_t start, framepos_t duration, Visibility vis,
|
framepos_t start, framepos_t duration, Visibility vis,
|
||||||
bool wide, bool high)
|
bool wide, bool high)
|
||||||
{
|
{
|
||||||
group = new ArdourCanvas::Layout (parent);
|
group = new ArdourCanvas::Container (parent);
|
||||||
CANVAS_DEBUG_NAME (group, string_compose ("TAVI group for %1", get_item_name()));
|
CANVAS_DEBUG_NAME (group, string_compose ("TAVI group for %1", get_item_name()));
|
||||||
group->Event.connect (sigc::mem_fun (*this, &TimeAxisViewItem::canvas_group_event));
|
group->Event.connect (sigc::mem_fun (*this, &TimeAxisViewItem::canvas_group_event));
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ namespace ArdourCanvas {
|
||||||
class Pixbuf;
|
class Pixbuf;
|
||||||
class Rectangle;
|
class Rectangle;
|
||||||
class Item;
|
class Item;
|
||||||
class Layout;
|
class Container;
|
||||||
class Text;
|
class Text;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -240,7 +240,7 @@ class TimeAxisViewItem : public Selectable, public PBD::ScopedConnectionList
|
||||||
bool high_enough_for_name;
|
bool high_enough_for_name;
|
||||||
bool rect_visible;
|
bool rect_visible;
|
||||||
|
|
||||||
ArdourCanvas::Layout* group;
|
ArdourCanvas::Container* group;
|
||||||
ArdourCanvas::Rectangle* vestigial_frame;
|
ArdourCanvas::Rectangle* vestigial_frame;
|
||||||
ArdourCanvas::Rectangle* frame;
|
ArdourCanvas::Rectangle* frame;
|
||||||
ArdourCanvas::Text* name_text;
|
ArdourCanvas::Text* name_text;
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@
|
||||||
#include "video_image_frame.h"
|
#include "video_image_frame.h"
|
||||||
#include "public_editor.h"
|
#include "public_editor.h"
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
#include "canvas/layout.h"
|
#include "canvas/container.h"
|
||||||
#include "utils_videotl.h"
|
#include "utils_videotl.h"
|
||||||
|
|
||||||
#include <gtkmm2ext/utils.h>
|
#include <gtkmm2ext/utils.h>
|
||||||
|
|
@ -43,7 +43,7 @@ static void freedata_cb (uint8_t *d, void* /*arg*/) {
|
||||||
free (d);
|
free (d);
|
||||||
}
|
}
|
||||||
|
|
||||||
VideoImageFrame::VideoImageFrame (PublicEditor& ed, ArdourCanvas::Layout& parent, int w, int h, std::string vsurl, std::string vfn)
|
VideoImageFrame::VideoImageFrame (PublicEditor& ed, ArdourCanvas::Container& parent, int w, int h, std::string vsurl, std::string vfn)
|
||||||
: editor (ed)
|
: editor (ed)
|
||||||
, _parent(&parent)
|
, _parent(&parent)
|
||||||
, clip_width(w)
|
, clip_width(w)
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@
|
||||||
#include "ardour/ardour.h"
|
#include "ardour/ardour.h"
|
||||||
#include "pbd/signals.h"
|
#include "pbd/signals.h"
|
||||||
|
|
||||||
#include "canvas/layout.h"
|
#include "canvas/container.h"
|
||||||
#include "canvas/pixbuf.h"
|
#include "canvas/pixbuf.h"
|
||||||
#include "canvas/image.h"
|
#include "canvas/image.h"
|
||||||
|
|
||||||
|
|
@ -49,7 +49,7 @@ class PublicEditor;
|
||||||
class VideoImageFrame : public sigc::trackable
|
class VideoImageFrame : public sigc::trackable
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
VideoImageFrame (PublicEditor&, ArdourCanvas::Layout&, int, int, std::string, std::string);
|
VideoImageFrame (PublicEditor&, ArdourCanvas::Container&, int, int, std::string, std::string);
|
||||||
virtual ~VideoImageFrame ();
|
virtual ~VideoImageFrame ();
|
||||||
|
|
||||||
void set_position (framepos_t);
|
void set_position (framepos_t);
|
||||||
|
|
@ -69,7 +69,7 @@ class VideoImageFrame : public sigc::trackable
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
PublicEditor& editor;
|
PublicEditor& editor;
|
||||||
ArdourCanvas::Layout *_parent;
|
ArdourCanvas::Container *_parent;
|
||||||
ArdourCanvas::Image *image;
|
ArdourCanvas::Image *image;
|
||||||
boost::shared_ptr<ArdourCanvas::Image::Data> img;
|
boost::shared_ptr<ArdourCanvas::Image::Data> img;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@ using namespace PBD;
|
||||||
using namespace Timecode;
|
using namespace Timecode;
|
||||||
using namespace VideoUtils;
|
using namespace VideoUtils;
|
||||||
|
|
||||||
VideoTimeLine::VideoTimeLine (PublicEditor *ed, ArdourCanvas::Layout *vbg, int initial_height)
|
VideoTimeLine::VideoTimeLine (PublicEditor *ed, ArdourCanvas::Container *vbg, int initial_height)
|
||||||
: editor (ed)
|
: editor (ed)
|
||||||
, videotl_group(vbg)
|
, videotl_group(vbg)
|
||||||
, bar_height(initial_height)
|
, bar_height(initial_height)
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@
|
||||||
#include "video_image_frame.h"
|
#include "video_image_frame.h"
|
||||||
#include "video_monitor.h"
|
#include "video_monitor.h"
|
||||||
#include "pbd/signals.h"
|
#include "pbd/signals.h"
|
||||||
#include "canvas/layout.h"
|
#include "canvas/container.h"
|
||||||
|
|
||||||
namespace ARDOUR {
|
namespace ARDOUR {
|
||||||
class Session;
|
class Session;
|
||||||
|
|
@ -55,7 +55,7 @@ class PublicEditor;
|
||||||
class VideoTimeLine : public sigc::trackable, public ARDOUR::SessionHandlePtr, public PBD::ScopedConnectionList, public PBD::StatefulDestructible
|
class VideoTimeLine : public sigc::trackable, public ARDOUR::SessionHandlePtr, public PBD::ScopedConnectionList, public PBD::StatefulDestructible
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
VideoTimeLine (PublicEditor*, ArdourCanvas::Layout*, int);
|
VideoTimeLine (PublicEditor*, ArdourCanvas::Container*, int);
|
||||||
virtual ~VideoTimeLine ();
|
virtual ~VideoTimeLine ();
|
||||||
|
|
||||||
void set_session (ARDOUR::Session *s);
|
void set_session (ARDOUR::Session *s);
|
||||||
|
|
@ -102,7 +102,7 @@ class VideoTimeLine : public sigc::trackable, public ARDOUR::SessionHandlePtr, p
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
PublicEditor *editor;
|
PublicEditor *editor;
|
||||||
ArdourCanvas::Layout *videotl_group;
|
ArdourCanvas::Container *videotl_group;
|
||||||
int bar_height;
|
int bar_height;
|
||||||
|
|
||||||
std::string _xjadeo_bin;
|
std::string _xjadeo_bin;
|
||||||
|
|
|
||||||
|
|
@ -35,13 +35,13 @@ using namespace ArdourCanvas;
|
||||||
* @param parent Parent canvas group.
|
* @param parent Parent canvas group.
|
||||||
*/
|
*/
|
||||||
Arrow::Arrow (Canvas* c)
|
Arrow::Arrow (Canvas* c)
|
||||||
: Layout (c)
|
: Container (c)
|
||||||
{
|
{
|
||||||
setup ();
|
setup ();
|
||||||
}
|
}
|
||||||
|
|
||||||
Arrow::Arrow (Item* parent)
|
Arrow::Arrow (Item* parent)
|
||||||
: Layout (parent)
|
: Container (parent)
|
||||||
{
|
{
|
||||||
setup ();
|
setup ();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@
|
||||||
#define __CANVAS_ARROW_H__
|
#define __CANVAS_ARROW_H__
|
||||||
|
|
||||||
#include "canvas/visibility.h"
|
#include "canvas/visibility.h"
|
||||||
#include "canvas/layout.h"
|
#include "canvas/container.h"
|
||||||
|
|
||||||
namespace ArdourCanvas {
|
namespace ArdourCanvas {
|
||||||
|
|
||||||
|
|
@ -45,7 +45,7 @@ class Polygon;
|
||||||
* to draw lines at any angle.
|
* to draw lines at any angle.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class LIBCANVAS_API Arrow : public Layout
|
class LIBCANVAS_API Arrow : public Container
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Arrow (Canvas*);
|
Arrow (Canvas*);
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ namespace ArdourCanvas
|
||||||
*
|
*
|
||||||
* Imagined examples of containers:
|
* Imagined examples of containers:
|
||||||
*
|
*
|
||||||
* Layout: renders each child at the child's self-determined position
|
* Container: renders each child at the child's self-determined position
|
||||||
* Box: renders each child along an axis (vertical or horizontal)
|
* Box: renders each child along an axis (vertical or horizontal)
|
||||||
* Table/Grid: renders each child within a two-dimensional grid
|
* Table/Grid: renders each child within a two-dimensional grid
|
||||||
*
|
*
|
||||||
|
|
@ -47,8 +47,12 @@ public:
|
||||||
* in all containers (the union of the children's bounding boxes).
|
* in all containers (the union of the children's bounding boxes).
|
||||||
* It can be overriden as necessary.
|
* It can be overriden as necessary.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void compute_bounding_box () const;
|
void compute_bounding_box () const;
|
||||||
|
|
||||||
|
/** The render() method is likely to be identical in all containers
|
||||||
|
* (just call Item::render_children()). It can be overridden as necessary.
|
||||||
|
*/
|
||||||
|
void render (Rect const & area, Cairo::RefPtr<Cairo::Context> context) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@
|
||||||
|
|
||||||
#include "canvas/visibility.h"
|
#include "canvas/visibility.h"
|
||||||
#include "canvas/types.h"
|
#include "canvas/types.h"
|
||||||
#include "canvas/layout.h"
|
#include "canvas/container.h"
|
||||||
|
|
||||||
namespace ArdourCanvas {
|
namespace ArdourCanvas {
|
||||||
|
|
||||||
|
|
@ -27,7 +27,7 @@ class Text;
|
||||||
class Line;
|
class Line;
|
||||||
class Rectangle;
|
class Rectangle;
|
||||||
|
|
||||||
class LIBCANVAS_API Flag : public Layout
|
class LIBCANVAS_API Flag : public Container
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Flag (Canvas *, Distance, Color, Color, Duple);
|
Flag (Canvas *, Distance, Color, Color, Duple);
|
||||||
|
|
|
||||||
|
|
@ -283,6 +283,7 @@ protected:
|
||||||
std::list<Item*> _items;
|
std::list<Item*> _items;
|
||||||
|
|
||||||
void add_child_bounding_boxes() const;
|
void add_child_bounding_boxes() const;
|
||||||
|
void render_children (Rect const & area, Cairo::RefPtr<Cairo::Context> context) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void init ();
|
void init ();
|
||||||
|
|
|
||||||
|
|
@ -1,43 +0,0 @@
|
||||||
/*
|
|
||||||
Copyright (C) 2011-2014 Paul Davis
|
|
||||||
Original Author: Carl Hetherington <cth@carlh.net>
|
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation; either version 2 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program; if not, write to the Free Software
|
|
||||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef __CANVAS_LAYOUT_H__
|
|
||||||
#define __CANVAS_LAYOUT_H__
|
|
||||||
|
|
||||||
#include "canvas/container.h"
|
|
||||||
|
|
||||||
namespace ArdourCanvas
|
|
||||||
{
|
|
||||||
|
|
||||||
/** a Layout is a container item that renders all of its children at fixed
|
|
||||||
* positions which they control.
|
|
||||||
*/
|
|
||||||
class LIBCANVAS_API Layout : public Container
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
Layout (Canvas *);
|
|
||||||
Layout (Item *);
|
|
||||||
Layout (Item*, Duple const & position);
|
|
||||||
|
|
||||||
void render (Rect const & area, Cairo::RefPtr<Cairo::Context> context) const;
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
@ -21,11 +21,11 @@
|
||||||
#define __CANVAS_ROOT_GROUP_H__
|
#define __CANVAS_ROOT_GROUP_H__
|
||||||
|
|
||||||
#include "canvas/visibility.h"
|
#include "canvas/visibility.h"
|
||||||
#include "canvas/layout.h"
|
#include "canvas/container.h"
|
||||||
|
|
||||||
namespace ArdourCanvas {
|
namespace ArdourCanvas {
|
||||||
|
|
||||||
class LIBCANVAS_API Root : public Layout
|
class LIBCANVAS_API Root : public Container
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
friend class Canvas;
|
friend class Canvas;
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@
|
||||||
#ifndef __CANVAS_SCROLL_GROUP_H__
|
#ifndef __CANVAS_SCROLL_GROUP_H__
|
||||||
#define __CANVAS_SCROLL_GROUP_H__
|
#define __CANVAS_SCROLL_GROUP_H__
|
||||||
|
|
||||||
#include "canvas/layout.h"
|
#include "canvas/container.h"
|
||||||
|
|
||||||
namespace ArdourCanvas {
|
namespace ArdourCanvas {
|
||||||
|
|
||||||
|
|
@ -27,7 +27,7 @@ namespace ArdourCanvas {
|
||||||
* its children in a way that reflects the most recent
|
* its children in a way that reflects the most recent
|
||||||
* call to its scroll_to() method.
|
* call to its scroll_to() method.
|
||||||
*/
|
*/
|
||||||
class LIBCANVAS_API ScrollGroup : public Layout
|
class LIBCANVAS_API ScrollGroup : public Container
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
enum ScrollSensitivity {
|
enum ScrollSensitivity {
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,12 @@ Container::Container (Item* parent, Duple const & p)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
Container::render (Rect const & area, Cairo::RefPtr<Cairo::Context> context) const
|
||||||
|
{
|
||||||
|
Item::render_children (area, context);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
Container::compute_bounding_box () const
|
Container::compute_bounding_box () const
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ using namespace std;
|
||||||
using namespace ArdourCanvas;
|
using namespace ArdourCanvas;
|
||||||
|
|
||||||
Flag::Flag (Canvas* canvas, Distance height, Color outline_color, Color fill_color, Duple position)
|
Flag::Flag (Canvas* canvas, Distance height, Color outline_color, Color fill_color, Duple position)
|
||||||
: Layout (canvas)
|
: Container (canvas)
|
||||||
, _outline_color (outline_color)
|
, _outline_color (outline_color)
|
||||||
, _fill_color (fill_color)
|
, _fill_color (fill_color)
|
||||||
{
|
{
|
||||||
|
|
@ -34,7 +34,7 @@ Flag::Flag (Canvas* canvas, Distance height, Color outline_color, Color fill_col
|
||||||
}
|
}
|
||||||
|
|
||||||
Flag::Flag (Item* parent, Distance height, Color outline_color, Color fill_color, Duple position)
|
Flag::Flag (Item* parent, Distance height, Color outline_color, Color fill_color, Duple position)
|
||||||
: Layout (parent)
|
: Container (parent)
|
||||||
, _outline_color (outline_color)
|
, _outline_color (outline_color)
|
||||||
, _fill_color (fill_color)
|
, _fill_color (fill_color)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -673,6 +673,96 @@ Item::covers (Duple const & point) const
|
||||||
|
|
||||||
/* nesting/grouping API */
|
/* nesting/grouping API */
|
||||||
|
|
||||||
|
void
|
||||||
|
Item::render_children (Rect const & area, Cairo::RefPtr<Cairo::Context> context) const
|
||||||
|
{
|
||||||
|
if (_items.empty()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
ensure_lut ();
|
||||||
|
std::vector<Item*> items = _lut->get (area);
|
||||||
|
|
||||||
|
#ifdef CANVAS_DEBUG
|
||||||
|
if (DEBUG_ENABLED(PBD::DEBUG::CanvasRender)) {
|
||||||
|
cerr << string_compose ("%1%7 %2 @ %7 render %5 @ %6 %3 items out of %4\n",
|
||||||
|
_canvas->render_indent(), (name.empty() ? string ("[unnamed]") : name), items.size(), _items.size(), area, _position, this,
|
||||||
|
whatami());
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
++render_depth;
|
||||||
|
|
||||||
|
for (std::vector<Item*>::const_iterator i = items.begin(); i != items.end(); ++i) {
|
||||||
|
|
||||||
|
if (!(*i)->visible ()) {
|
||||||
|
#ifdef CANVAS_DEBUG
|
||||||
|
if (DEBUG_ENABLED(PBD::DEBUG::CanvasRender)) {
|
||||||
|
cerr << _canvas->render_indent() << "Item " << (*i)->whatami() << " [" << (*i)->name << "] invisible - skipped\n";
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
boost::optional<Rect> item_bbox = (*i)->bounding_box ();
|
||||||
|
|
||||||
|
if (!item_bbox) {
|
||||||
|
#ifdef CANVAS_DEBUG
|
||||||
|
if (DEBUG_ENABLED(PBD::DEBUG::CanvasRender)) {
|
||||||
|
cerr << _canvas->render_indent() << "Item " << (*i)->whatami() << " [" << (*i)->name << "] empty - skipped\n";
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
Rect item = (*i)->item_to_window (item_bbox.get());
|
||||||
|
boost::optional<Rect> d = item.intersection (area);
|
||||||
|
|
||||||
|
if (d) {
|
||||||
|
Rect draw = d.get();
|
||||||
|
if (draw.width() && draw.height()) {
|
||||||
|
#ifdef CANVAS_DEBUG
|
||||||
|
if (DEBUG_ENABLED(PBD::DEBUG::CanvasRender)) {
|
||||||
|
if (dynamic_cast<Container*>(*i) == 0) {
|
||||||
|
cerr << _canvas->render_indent() << "render "
|
||||||
|
<< ' '
|
||||||
|
<< (*i)
|
||||||
|
<< ' '
|
||||||
|
<< (*i)->whatami()
|
||||||
|
<< ' '
|
||||||
|
<< (*i)->name
|
||||||
|
<< " item "
|
||||||
|
<< item_bbox.get()
|
||||||
|
<< " window = "
|
||||||
|
<< item
|
||||||
|
<< " intersect = "
|
||||||
|
<< draw
|
||||||
|
<< " @ "
|
||||||
|
<< _position
|
||||||
|
<< endl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
(*i)->render (area, context);
|
||||||
|
++render_count;
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
#ifdef CANVAS_DEBUG
|
||||||
|
if (DEBUG_ENABLED(PBD::DEBUG::CanvasRender)) {
|
||||||
|
cerr << string_compose ("%1skip render of %2 %3, no intersection between %4 and %5\n", _canvas->render_indent(), (*i)->whatami(),
|
||||||
|
(*i)->name, item, area);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
--render_depth;
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
Item::add_child_bounding_boxes() const
|
Item::add_child_bounding_boxes() const
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,132 +0,0 @@
|
||||||
/*
|
|
||||||
Copyright (C) 2011-2014 Paul Davis
|
|
||||||
Author: Carl Hetherington <cth@carlh.net>
|
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation; either version 2 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program; if not, write to the Free Software
|
|
||||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "pbd/compose.h"
|
|
||||||
|
|
||||||
#include "canvas/canvas.h"
|
|
||||||
#include "canvas/debug.h"
|
|
||||||
#include "canvas/layout.h"
|
|
||||||
|
|
||||||
using namespace std;
|
|
||||||
using namespace PBD;
|
|
||||||
using namespace ArdourCanvas;
|
|
||||||
|
|
||||||
Layout::Layout (Canvas* canvas)
|
|
||||||
: Container (canvas)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
Layout::Layout (Item* parent)
|
|
||||||
: Container (parent)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
Layout::Layout (Item* parent, Duple const & p)
|
|
||||||
: Container (parent, p)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/** @param area Area to draw in window coordinates.
|
|
||||||
* @param context Context, set up with its origin at this layout's position.
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
Layout::render (Rect const & area, Cairo::RefPtr<Cairo::Context> context) const
|
|
||||||
{
|
|
||||||
ensure_lut ();
|
|
||||||
std::vector<Item*> items = _lut->get (area);
|
|
||||||
|
|
||||||
#ifdef CANVAS_DEBUG
|
|
||||||
if (DEBUG_ENABLED(PBD::DEBUG::CanvasRender)) {
|
|
||||||
cerr << string_compose ("%1GROUP %2 @ %7 render %5 @ %6 %3 items out of %4\n",
|
|
||||||
_canvas->render_indent(), (name.empty() ? string ("[unnamed]") : name), items.size(), _items.size(), area, _position, this);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
++render_depth;
|
|
||||||
|
|
||||||
for (std::vector<Item*>::const_iterator i = items.begin(); i != items.end(); ++i) {
|
|
||||||
|
|
||||||
if (!(*i)->visible ()) {
|
|
||||||
#ifdef CANVAS_DEBUG
|
|
||||||
if (DEBUG_ENABLED(PBD::DEBUG::CanvasRender)) {
|
|
||||||
cerr << _canvas->render_indent() << "Item " << (*i)->whatami() << " [" << (*i)->name << "] invisible - skipped\n";
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
boost::optional<Rect> item_bbox = (*i)->bounding_box ();
|
|
||||||
|
|
||||||
if (!item_bbox) {
|
|
||||||
#ifdef CANVAS_DEBUG
|
|
||||||
if (DEBUG_ENABLED(PBD::DEBUG::CanvasRender)) {
|
|
||||||
cerr << _canvas->render_indent() << "Item " << (*i)->whatami() << " [" << (*i)->name << "] empty - skipped\n";
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
Rect item = (*i)->item_to_window (item_bbox.get());
|
|
||||||
boost::optional<Rect> d = item.intersection (area);
|
|
||||||
|
|
||||||
if (d) {
|
|
||||||
Rect draw = d.get();
|
|
||||||
if (draw.width() && draw.height()) {
|
|
||||||
#ifdef CANVAS_DEBUG
|
|
||||||
if (DEBUG_ENABLED(PBD::DEBUG::CanvasRender)) {
|
|
||||||
if (dynamic_cast<Container*>(*i) == 0) {
|
|
||||||
cerr << _canvas->render_indent() << "render "
|
|
||||||
<< ' '
|
|
||||||
<< (*i)
|
|
||||||
<< ' '
|
|
||||||
<< (*i)->whatami()
|
|
||||||
<< ' '
|
|
||||||
<< (*i)->name
|
|
||||||
<< " item "
|
|
||||||
<< item_bbox.get()
|
|
||||||
<< " window = "
|
|
||||||
<< item
|
|
||||||
<< " intersect = "
|
|
||||||
<< draw
|
|
||||||
<< " @ "
|
|
||||||
<< _position
|
|
||||||
<< endl;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
(*i)->render (area, context);
|
|
||||||
++render_count;
|
|
||||||
}
|
|
||||||
|
|
||||||
} else {
|
|
||||||
|
|
||||||
#ifdef CANVAS_DEBUG
|
|
||||||
if (DEBUG_ENABLED(PBD::DEBUG::CanvasRender)) {
|
|
||||||
cerr << string_compose ("%1skip render of %2 %3, no intersection between %4 and %5\n", _canvas->render_indent(), (*i)->whatami(),
|
|
||||||
(*i)->name, item, area);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
--render_depth;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -24,7 +24,7 @@ using namespace std;
|
||||||
using namespace ArdourCanvas;
|
using namespace ArdourCanvas;
|
||||||
|
|
||||||
Root::Root (Canvas* canvas)
|
Root::Root (Canvas* canvas)
|
||||||
: Layout (canvas)
|
: Container (canvas)
|
||||||
{
|
{
|
||||||
#ifdef CANVAS_DEBUG
|
#ifdef CANVAS_DEBUG
|
||||||
name = "ROOT";
|
name = "ROOT";
|
||||||
|
|
@ -34,7 +34,7 @@ Root::Root (Canvas* canvas)
|
||||||
void
|
void
|
||||||
Root::compute_bounding_box () const
|
Root::compute_bounding_box () const
|
||||||
{
|
{
|
||||||
Layout::compute_bounding_box ();
|
Container::compute_bounding_box ();
|
||||||
|
|
||||||
if (_bounding_box) {
|
if (_bounding_box) {
|
||||||
Rect r (_bounding_box.get());
|
Rect r (_bounding_box.get());
|
||||||
|
|
|
||||||
|
|
@ -28,13 +28,13 @@ using namespace std;
|
||||||
using namespace ArdourCanvas;
|
using namespace ArdourCanvas;
|
||||||
|
|
||||||
ScrollGroup::ScrollGroup (Canvas* c, ScrollSensitivity s)
|
ScrollGroup::ScrollGroup (Canvas* c, ScrollSensitivity s)
|
||||||
: Layout (c)
|
: Container (c)
|
||||||
, _scroll_sensitivity (s)
|
, _scroll_sensitivity (s)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
ScrollGroup::ScrollGroup (Item* parent, ScrollSensitivity s)
|
ScrollGroup::ScrollGroup (Item* parent, ScrollSensitivity s)
|
||||||
: Layout (parent)
|
: Container (parent)
|
||||||
, _scroll_sensitivity (s)
|
, _scroll_sensitivity (s)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
@ -61,7 +61,7 @@ ScrollGroup::render (Rect const & area, Cairo::RefPtr<Cairo::Context> context) c
|
||||||
context->rectangle (self.x0, self.y0, self.width(), self.height());
|
context->rectangle (self.x0, self.y0, self.width(), self.height());
|
||||||
context->clip ();
|
context->clip ();
|
||||||
|
|
||||||
Layout::render (area, context);
|
Container::render (area, context);
|
||||||
|
|
||||||
context->restore ();
|
context->restore ();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,6 @@ canvas_sources = [
|
||||||
'fill.cc',
|
'fill.cc',
|
||||||
'flag.cc',
|
'flag.cc',
|
||||||
'image.cc',
|
'image.cc',
|
||||||
'layout.cc',
|
|
||||||
'line.cc',
|
'line.cc',
|
||||||
'line_set.cc',
|
'line_set.cc',
|
||||||
'lookup_table.cc',
|
'lookup_table.cc',
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue