mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-07 15:25:01 +01:00
remove timebar canvas and just use a single canvas instead. This is just part one - lots of minor fixes to be done
This commit is contained in:
parent
c9f890bd7c
commit
5696199daf
9 changed files with 27 additions and 62 deletions
|
|
@ -604,12 +604,10 @@ AudioRegionView::reset_fade_in_shape_width (boost::shared_ptr<AudioRegion> ar, f
|
||||||
/* points *MUST* be in anti-clockwise order */
|
/* points *MUST* be in anti-clockwise order */
|
||||||
|
|
||||||
Points points;
|
Points points;
|
||||||
Points::size_type npoints;
|
|
||||||
Points::size_type pi;
|
Points::size_type pi;
|
||||||
boost::shared_ptr<const Evoral::ControlList> list (audio_region()->fade_in());
|
boost::shared_ptr<const Evoral::ControlList> list (audio_region()->fade_in());
|
||||||
Evoral::ControlList::const_iterator x;
|
Evoral::ControlList::const_iterator x;
|
||||||
double length = list->length();
|
double length = list->length();
|
||||||
npoints = list->size();
|
|
||||||
|
|
||||||
points.assign (list->size(), Duple());
|
points.assign (list->size(), Duple());
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -541,10 +541,8 @@ Editor::Editor ()
|
||||||
edit_packer.attach (time_canvas_event_box, 2, 3, 0, 1, FILL|EXPAND, FILL, 0, 0);
|
edit_packer.attach (time_canvas_event_box, 2, 3, 0, 1, FILL|EXPAND, FILL, 0, 0);
|
||||||
/* track controls */
|
/* track controls */
|
||||||
edit_packer.attach (controls_layout, 0, 2, 2, 3, FILL, FILL|EXPAND, 0, 0);
|
edit_packer.attach (controls_layout, 0, 2, 2, 3, FILL, FILL|EXPAND, 0, 0);
|
||||||
/* time bars canvas */
|
|
||||||
edit_packer.attach (*_time_bars_canvas_viewport, 2, 3, 1, 2, FILL, FILL, 0, 0);
|
|
||||||
/* track canvas */
|
/* track canvas */
|
||||||
edit_packer.attach (*_track_canvas_viewport, 2, 3, 2, 3, FILL|EXPAND, FILL|EXPAND, 0, 0);
|
edit_packer.attach (*_track_canvas_viewport, 2, 3, 1, 3, FILL|EXPAND, FILL|EXPAND, 0, 0);
|
||||||
|
|
||||||
bottom_hbox.set_border_width (2);
|
bottom_hbox.set_border_width (2);
|
||||||
bottom_hbox.set_spacing (3);
|
bottom_hbox.set_spacing (3);
|
||||||
|
|
@ -783,7 +781,6 @@ Editor::~Editor()
|
||||||
delete button_bindings;
|
delete button_bindings;
|
||||||
delete _routes;
|
delete _routes;
|
||||||
delete _route_groups;
|
delete _route_groups;
|
||||||
delete _time_bars_canvas_viewport;
|
|
||||||
delete _track_canvas_viewport;
|
delete _track_canvas_viewport;
|
||||||
delete _drags;
|
delete _drags;
|
||||||
}
|
}
|
||||||
|
|
@ -4182,10 +4179,6 @@ Editor::set_samples_per_pixel (framecnt_t spp)
|
||||||
|
|
||||||
ArdourCanvas::GtkCanvasViewport* c;
|
ArdourCanvas::GtkCanvasViewport* c;
|
||||||
|
|
||||||
c = get_time_bars_canvas();
|
|
||||||
if (c) {
|
|
||||||
c->canvas()->zoomed ();
|
|
||||||
}
|
|
||||||
c = get_track_canvas();
|
c = get_track_canvas();
|
||||||
if (c) {
|
if (c) {
|
||||||
c->canvas()->zoomed ();
|
c->canvas()->zoomed ();
|
||||||
|
|
|
||||||
|
|
@ -449,7 +449,6 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
|
||||||
ArdourCanvas::Group* get_trackview_group () const { return _trackview_group; }
|
ArdourCanvas::Group* get_trackview_group () const { return _trackview_group; }
|
||||||
ArdourCanvas::Group* get_time_bars_group () const;
|
ArdourCanvas::Group* get_time_bars_group () const;
|
||||||
ArdourCanvas::Group* get_track_canvas_group () const;
|
ArdourCanvas::Group* get_track_canvas_group () const;
|
||||||
ArdourCanvas::GtkCanvasViewport* get_time_bars_canvas () const;
|
|
||||||
ArdourCanvas::GtkCanvasViewport* get_track_canvas () const;
|
ArdourCanvas::GtkCanvasViewport* get_track_canvas () const;
|
||||||
|
|
||||||
void override_visible_track_count ();
|
void override_visible_track_count ();
|
||||||
|
|
@ -695,9 +694,6 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
|
||||||
ArdourCanvas::GtkCanvas* _track_canvas;
|
ArdourCanvas::GtkCanvas* _track_canvas;
|
||||||
ArdourCanvas::GtkCanvasViewport* _track_canvas_viewport;
|
ArdourCanvas::GtkCanvasViewport* _track_canvas_viewport;
|
||||||
|
|
||||||
ArdourCanvas::GtkCanvas* _time_bars_canvas;
|
|
||||||
ArdourCanvas::GtkCanvasViewport* _time_bars_canvas_viewport;
|
|
||||||
|
|
||||||
bool within_track_canvas;
|
bool within_track_canvas;
|
||||||
|
|
||||||
friend class VerboseCursor;
|
friend class VerboseCursor;
|
||||||
|
|
|
||||||
|
|
@ -114,40 +114,43 @@ Editor::initialize_canvas ()
|
||||||
|
|
||||||
/* TIME BAR CANVAS */
|
/* TIME BAR CANVAS */
|
||||||
|
|
||||||
_time_bars_canvas_viewport = new ArdourCanvas::GtkCanvasViewport (horizontal_adjustment, unused_adjustment);
|
ArdourCanvas::ScrollGroup* hg;
|
||||||
_time_bars_canvas = _time_bars_canvas_viewport->canvas ();
|
|
||||||
|
|
||||||
meter_bar_group = new ArdourCanvas::Group (_time_bars_canvas->root ());
|
h_scroll_group = hg = new ArdourCanvas::ScrollGroup (_track_canvas->root(), ArdourCanvas::ScrollGroup::ScrollsHorizontally);
|
||||||
|
CANVAS_DEBUG_NAME (h_scroll_group, "canvas h scroll");
|
||||||
|
_track_canvas->add_scroller (*hg);
|
||||||
|
|
||||||
|
meter_bar_group = new ArdourCanvas::Group (h_scroll_group);
|
||||||
meter_bar = new ArdourCanvas::Rectangle (meter_bar_group, ArdourCanvas::Rect (0.0, 0.0, ArdourCanvas::COORD_MAX, timebar_height));
|
meter_bar = new ArdourCanvas::Rectangle (meter_bar_group, ArdourCanvas::Rect (0.0, 0.0, ArdourCanvas::COORD_MAX, timebar_height));
|
||||||
CANVAS_DEBUG_NAME (meter_bar, "meter Bar");
|
CANVAS_DEBUG_NAME (meter_bar, "meter Bar");
|
||||||
meter_bar->set_outline_what (ArdourCanvas::Rectangle::BOTTOM);
|
meter_bar->set_outline_what (ArdourCanvas::Rectangle::BOTTOM);
|
||||||
|
|
||||||
tempo_bar_group = new ArdourCanvas::Group (_time_bars_canvas->root ());
|
tempo_bar_group = new ArdourCanvas::Group (h_scroll_group);
|
||||||
tempo_bar = new ArdourCanvas::Rectangle (tempo_bar_group, ArdourCanvas::Rect (0.0, 0.0, ArdourCanvas::COORD_MAX, timebar_height));
|
tempo_bar = new ArdourCanvas::Rectangle (tempo_bar_group, ArdourCanvas::Rect (0.0, 0.0, ArdourCanvas::COORD_MAX, timebar_height));
|
||||||
CANVAS_DEBUG_NAME (tempo_bar, "Tempo Bar");
|
CANVAS_DEBUG_NAME (tempo_bar, "Tempo Bar");
|
||||||
tempo_bar->set_outline_what (ArdourCanvas::Rectangle::BOTTOM);
|
tempo_bar->set_outline_what (ArdourCanvas::Rectangle::BOTTOM);
|
||||||
|
|
||||||
range_marker_bar_group = new ArdourCanvas::Group (_time_bars_canvas->root ());
|
range_marker_bar_group = new ArdourCanvas::Group (h_scroll_group);
|
||||||
range_marker_bar = new ArdourCanvas::Rectangle (range_marker_bar_group, ArdourCanvas::Rect (0.0, 0.0, ArdourCanvas::COORD_MAX, timebar_height));
|
range_marker_bar = new ArdourCanvas::Rectangle (range_marker_bar_group, ArdourCanvas::Rect (0.0, 0.0, ArdourCanvas::COORD_MAX, timebar_height));
|
||||||
CANVAS_DEBUG_NAME (range_marker_bar, "Range Marker Bar");
|
CANVAS_DEBUG_NAME (range_marker_bar, "Range Marker Bar");
|
||||||
range_marker_bar->set_outline_what (ArdourCanvas::Rectangle::BOTTOM);
|
range_marker_bar->set_outline_what (ArdourCanvas::Rectangle::BOTTOM);
|
||||||
|
|
||||||
transport_marker_bar_group = new ArdourCanvas::Group (_time_bars_canvas->root ());
|
transport_marker_bar_group = new ArdourCanvas::Group (h_scroll_group);
|
||||||
transport_marker_bar = new ArdourCanvas::Rectangle (transport_marker_bar_group, ArdourCanvas::Rect (0.0, 0.0, ArdourCanvas::COORD_MAX, timebar_height));
|
transport_marker_bar = new ArdourCanvas::Rectangle (transport_marker_bar_group, ArdourCanvas::Rect (0.0, 0.0, ArdourCanvas::COORD_MAX, timebar_height));
|
||||||
CANVAS_DEBUG_NAME (transport_marker_bar, "transport Marker Bar");
|
CANVAS_DEBUG_NAME (transport_marker_bar, "transport Marker Bar");
|
||||||
transport_marker_bar->set_outline_what (ArdourCanvas::Rectangle::BOTTOM);
|
transport_marker_bar->set_outline_what (ArdourCanvas::Rectangle::BOTTOM);
|
||||||
|
|
||||||
marker_bar_group = new ArdourCanvas::Group (_time_bars_canvas->root ());
|
marker_bar_group = new ArdourCanvas::Group (h_scroll_group);
|
||||||
marker_bar = new ArdourCanvas::Rectangle (marker_bar_group, ArdourCanvas::Rect (0.0, 0.0, ArdourCanvas::COORD_MAX, timebar_height));
|
marker_bar = new ArdourCanvas::Rectangle (marker_bar_group, ArdourCanvas::Rect (0.0, 0.0, ArdourCanvas::COORD_MAX, timebar_height));
|
||||||
CANVAS_DEBUG_NAME (marker_bar, "Marker Bar");
|
CANVAS_DEBUG_NAME (marker_bar, "Marker Bar");
|
||||||
marker_bar->set_outline_what (ArdourCanvas::Rectangle::BOTTOM);
|
marker_bar->set_outline_what (ArdourCanvas::Rectangle::BOTTOM);
|
||||||
|
|
||||||
cd_marker_bar_group = new ArdourCanvas::Group (_time_bars_canvas->root ());
|
cd_marker_bar_group = new ArdourCanvas::Group (h_scroll_group);
|
||||||
cd_marker_bar = new ArdourCanvas::Rectangle (cd_marker_bar_group, ArdourCanvas::Rect (0.0, 0.0, ArdourCanvas::COORD_MAX, timebar_height));
|
cd_marker_bar = new ArdourCanvas::Rectangle (cd_marker_bar_group, ArdourCanvas::Rect (0.0, 0.0, ArdourCanvas::COORD_MAX, timebar_height));
|
||||||
CANVAS_DEBUG_NAME (cd_marker_bar, "CD Marker Bar");
|
CANVAS_DEBUG_NAME (cd_marker_bar, "CD Marker Bar");
|
||||||
cd_marker_bar->set_outline_what (ArdourCanvas::Rectangle::BOTTOM);
|
cd_marker_bar->set_outline_what (ArdourCanvas::Rectangle::BOTTOM);
|
||||||
|
|
||||||
_time_markers_group = new ArdourCanvas::Group (_time_bars_canvas->root());
|
_time_markers_group = new ArdourCanvas::Group (h_scroll_group);
|
||||||
|
|
||||||
cd_marker_group = new ArdourCanvas::Group (_time_markers_group, ArdourCanvas::Duple (0.0, 0.0));
|
cd_marker_group = new ArdourCanvas::Group (_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");
|
||||||
|
|
@ -929,7 +932,7 @@ Editor::clamp_verbose_cursor_y (double y)
|
||||||
ArdourCanvas::Group*
|
ArdourCanvas::Group*
|
||||||
Editor::get_time_bars_group () const
|
Editor::get_time_bars_group () const
|
||||||
{
|
{
|
||||||
return _time_bars_canvas->root();
|
return h_scroll_group;
|
||||||
}
|
}
|
||||||
|
|
||||||
ArdourCanvas::Group*
|
ArdourCanvas::Group*
|
||||||
|
|
@ -938,12 +941,6 @@ Editor::get_track_canvas_group() const
|
||||||
return hv_scroll_group;
|
return hv_scroll_group;
|
||||||
}
|
}
|
||||||
|
|
||||||
ArdourCanvas::GtkCanvasViewport*
|
|
||||||
Editor::get_time_bars_canvas() const
|
|
||||||
{
|
|
||||||
return _time_bars_canvas_viewport;
|
|
||||||
}
|
|
||||||
|
|
||||||
ArdourCanvas::GtkCanvasViewport*
|
ArdourCanvas::GtkCanvasViewport*
|
||||||
Editor::get_track_canvas() const
|
Editor::get_track_canvas() const
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -33,26 +33,20 @@ using namespace Gtk;
|
||||||
|
|
||||||
EditorCursor::EditorCursor (Editor& ed, bool (Editor::*callbck)(GdkEvent*,ArdourCanvas::Item*))
|
EditorCursor::EditorCursor (Editor& ed, bool (Editor::*callbck)(GdkEvent*,ArdourCanvas::Item*))
|
||||||
: _editor (ed)
|
: _editor (ed)
|
||||||
, _time_bars_canvas_item (new ArdourCanvas::Arrow (_editor.get_time_bars_group()))
|
, _track_canvas_item (new ArdourCanvas::Arrow (_editor.get_track_canvas_group()))
|
||||||
, _track_canvas_item (new ArdourCanvas::Line (_editor.get_track_canvas_group()))
|
|
||||||
, _length (1.0)
|
, _length (1.0)
|
||||||
{
|
{
|
||||||
CANVAS_DEBUG_NAME (_time_bars_canvas_item, "timebars editor cursor");
|
|
||||||
CANVAS_DEBUG_NAME (_track_canvas_item, "track canvas editor cursor");
|
CANVAS_DEBUG_NAME (_track_canvas_item, "track canvas editor cursor");
|
||||||
|
|
||||||
_time_bars_canvas_item->set_show_head (0, true);
|
_track_canvas_item->set_show_head (0, true);
|
||||||
_time_bars_canvas_item->set_head_height (0, 9);
|
_track_canvas_item->set_head_height (0, 9);
|
||||||
_time_bars_canvas_item->set_head_width (0, 16);
|
_track_canvas_item->set_head_width (0, 16);
|
||||||
_time_bars_canvas_item->set_head_outward (0, false);
|
_track_canvas_item->set_head_outward (0, false);
|
||||||
_time_bars_canvas_item->set_show_head (1, false); // head only
|
_track_canvas_item->set_show_head (1, false); // head only
|
||||||
|
|
||||||
_time_bars_canvas_item->set_data ("cursor", this);
|
|
||||||
_track_canvas_item->set_data ("cursor", this);
|
_track_canvas_item->set_data ("cursor", this);
|
||||||
|
|
||||||
_time_bars_canvas_item->Event.connect (sigc::bind (sigc::mem_fun (ed, callbck), _time_bars_canvas_item));
|
|
||||||
_track_canvas_item->Event.connect (sigc::bind (sigc::mem_fun (ed, callbck), _track_canvas_item));
|
_track_canvas_item->Event.connect (sigc::bind (sigc::mem_fun (ed, callbck), _track_canvas_item));
|
||||||
|
|
||||||
_time_bars_canvas_item->set_y1 (ArdourCanvas::COORD_MAX);
|
|
||||||
_track_canvas_item->set_y1 (ArdourCanvas::COORD_MAX);
|
_track_canvas_item->set_y1 (ArdourCanvas::COORD_MAX);
|
||||||
|
|
||||||
_current_frame = 1; /* force redraw at 0 */
|
_current_frame = 1; /* force redraw at 0 */
|
||||||
|
|
@ -70,12 +64,8 @@ EditorCursor::set_position (framepos_t frame)
|
||||||
|
|
||||||
double const new_pos = _editor.sample_to_pixel_unrounded (frame);
|
double const new_pos = _editor.sample_to_pixel_unrounded (frame);
|
||||||
|
|
||||||
if (new_pos != _time_bars_canvas_item->x ()) {
|
if (new_pos != _track_canvas_item->x ()) {
|
||||||
_time_bars_canvas_item->set_x (new_pos);
|
_track_canvas_item->set_x (new_pos);
|
||||||
}
|
|
||||||
|
|
||||||
if (new_pos != _track_canvas_item->x0 ()) {
|
|
||||||
_track_canvas_item->set_x (new_pos, new_pos);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_current_frame = frame;
|
_current_frame = frame;
|
||||||
|
|
@ -84,20 +74,17 @@ EditorCursor::set_position (framepos_t frame)
|
||||||
void
|
void
|
||||||
EditorCursor::show ()
|
EditorCursor::show ()
|
||||||
{
|
{
|
||||||
_time_bars_canvas_item->show ();
|
|
||||||
_track_canvas_item->show ();
|
_track_canvas_item->show ();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
EditorCursor::hide ()
|
EditorCursor::hide ()
|
||||||
{
|
{
|
||||||
_time_bars_canvas_item->hide ();
|
|
||||||
_track_canvas_item->hide ();
|
_track_canvas_item->hide ();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
EditorCursor::set_color (ArdourCanvas::Color color)
|
EditorCursor::set_color (ArdourCanvas::Color color)
|
||||||
{
|
{
|
||||||
_time_bars_canvas_item->set_color (color);
|
_track_canvas_item->set_color (color);
|
||||||
_track_canvas_item->set_outline_color (color);
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -41,20 +41,15 @@ class EditorCursor {
|
||||||
return _current_frame;
|
return _current_frame;
|
||||||
}
|
}
|
||||||
|
|
||||||
ArdourCanvas::Line& track_canvas_item () {
|
ArdourCanvas::Arrow& track_canvas_item () {
|
||||||
return *_track_canvas_item;
|
return *_track_canvas_item;
|
||||||
}
|
}
|
||||||
|
|
||||||
ArdourCanvas::Arrow& time_bar_canvas_item () {
|
|
||||||
return *_time_bars_canvas_item;
|
|
||||||
}
|
|
||||||
|
|
||||||
PBD::Signal1<void, framepos_t> PositionChanged;
|
PBD::Signal1<void, framepos_t> PositionChanged;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Editor& _editor;
|
Editor& _editor;
|
||||||
ArdourCanvas::Arrow* _time_bars_canvas_item;
|
ArdourCanvas::Arrow* _track_canvas_item;
|
||||||
ArdourCanvas::Line* _track_canvas_item;
|
|
||||||
framepos_t _current_frame;
|
framepos_t _current_frame;
|
||||||
double _length;
|
double _length;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -2472,7 +2472,7 @@ TempoMarkerDrag::aborted (bool moved)
|
||||||
}
|
}
|
||||||
|
|
||||||
CursorDrag::CursorDrag (Editor* e, EditorCursor& c, bool s)
|
CursorDrag::CursorDrag (Editor* e, EditorCursor& c, bool s)
|
||||||
: Drag (e, &c.time_bar_canvas_item())
|
: Drag (e, &c.track_canvas_item())
|
||||||
, _cursor (c)
|
, _cursor (c)
|
||||||
, _stop (s)
|
, _stop (s)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -114,7 +114,7 @@ Editor::mouse_frame (framepos_t& where, bool& in_track_canvas) const
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pointer_window != canvas_window && pointer_window != _time_bars_canvas->get_window()) {
|
if (pointer_window != canvas_window) {
|
||||||
in_track_canvas = false;
|
in_track_canvas = false;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -367,7 +367,6 @@ class PublicEditor : public Gtk::Window, public PBD::StatefulDestructible, publi
|
||||||
virtual ArdourCanvas::Group* get_time_bars_group () const = 0;
|
virtual ArdourCanvas::Group* get_time_bars_group () const = 0;
|
||||||
virtual ArdourCanvas::Group* get_track_canvas_group () const = 0;
|
virtual ArdourCanvas::Group* get_track_canvas_group () const = 0;
|
||||||
|
|
||||||
virtual ArdourCanvas::GtkCanvasViewport* get_time_bars_canvas() const = 0;
|
|
||||||
virtual ArdourCanvas::GtkCanvasViewport* get_track_canvas() const = 0;
|
virtual ArdourCanvas::GtkCanvasViewport* get_track_canvas() const = 0;
|
||||||
|
|
||||||
virtual TimeAxisView* axis_view_from_route (boost::shared_ptr<ARDOUR::Route>) const = 0;
|
virtual TimeAxisView* axis_view_from_route (boost::shared_ptr<ARDOUR::Route>) const = 0;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue