mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-23 07:06:23 +01:00
remove useless groups from timebar area, clarify scroll group naming in editor
This commit is contained in:
parent
d408fffe4e
commit
3af66ff917
7 changed files with 60 additions and 108 deletions
|
|
@ -455,9 +455,11 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
|
|||
_stepping_axis_view = v;
|
||||
}
|
||||
|
||||
ArdourCanvas::Group* get_trackview_group () const { return _trackview_group; }
|
||||
ArdourCanvas::Group* get_time_bars_group () const;
|
||||
ArdourCanvas::Group* get_track_canvas_group () const;
|
||||
ArdourCanvas::Group* get_trackview_group () const { return _trackview_group; }
|
||||
ArdourCanvas::Group* get_hscroll_group () const { return h_scroll_group; }
|
||||
ArdourCanvas::Group* get_vscroll_group () const { return v_scroll_group; }
|
||||
ArdourCanvas::Group* get_hvscroll_group () const { return hv_scroll_group; }
|
||||
|
||||
ArdourCanvas::GtkCanvasViewport* get_track_canvas () const;
|
||||
|
||||
void override_visible_track_count ();
|
||||
|
|
@ -716,11 +718,15 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
|
|||
Gtk::EventBox& time_bars_event_box;
|
||||
Gtk::EventBox& ruler_label_event_box;
|
||||
|
||||
ArdourCanvas::Group *minsec_group;
|
||||
ArdourCanvas::Pixbuf *logo_item;
|
||||
#if 0
|
||||
/* these will be needed when we have canvas rulers */
|
||||
ArdourCanvas::Group *minsec_group;
|
||||
ArdourCanvas::Group *bbt_group;
|
||||
ArdourCanvas::Group *timecode_group;
|
||||
ArdourCanvas::Group *frame_group;
|
||||
#endif
|
||||
|
||||
ArdourCanvas::Group *tempo_group;
|
||||
ArdourCanvas::Group *meter_group;
|
||||
ArdourCanvas::Group *marker_group;
|
||||
|
|
@ -731,13 +737,6 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
|
|||
/* parent for groups which themselves contain time markers */
|
||||
ArdourCanvas::Group* _time_markers_group;
|
||||
|
||||
ArdourCanvas::Group* meter_bar_group;
|
||||
ArdourCanvas::Group* tempo_bar_group;
|
||||
ArdourCanvas::Group* marker_bar_group;
|
||||
ArdourCanvas::Group* range_marker_bar_group;
|
||||
ArdourCanvas::Group* transport_marker_bar_group;
|
||||
ArdourCanvas::Group* cd_marker_bar_group;
|
||||
|
||||
/* The group containing all other groups that are scrolled vertically
|
||||
and horizontally.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -68,6 +68,8 @@ Editor::initialize_canvas ()
|
|||
_track_canvas = _track_canvas_viewport->canvas ();
|
||||
|
||||
ArdourCanvas::ScrollGroup* hsg;
|
||||
ArdourCanvas::ScrollGroup* hg;
|
||||
ArdourCanvas::ScrollGroup* vg;
|
||||
|
||||
hv_scroll_group = hsg = new ArdourCanvas::ScrollGroup (_track_canvas->root(),
|
||||
ArdourCanvas::ScrollGroup::ScrollSensitivity (ArdourCanvas::ScrollGroup::ScrollsVertically|
|
||||
|
|
@ -75,6 +77,14 @@ Editor::initialize_canvas ()
|
|||
CANVAS_DEBUG_NAME (hv_scroll_group, "canvas hv scroll");
|
||||
_track_canvas->add_scroller (*hsg);
|
||||
|
||||
v_scroll_group = vg = new ArdourCanvas::ScrollGroup (_track_canvas->root(), ArdourCanvas::ScrollGroup::ScrollsVertically);
|
||||
CANVAS_DEBUG_NAME (v_scroll_group, "canvas v scroll");
|
||||
_track_canvas->add_scroller (*vg);
|
||||
|
||||
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);
|
||||
|
||||
_verbose_cursor = new VerboseCursor (this);
|
||||
|
||||
/* on the bottom, an image */
|
||||
|
|
@ -114,43 +124,8 @@ Editor::initialize_canvas ()
|
|||
|
||||
/* TIME BAR CANVAS */
|
||||
|
||||
ArdourCanvas::ScrollGroup* hg;
|
||||
|
||||
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));
|
||||
CANVAS_DEBUG_NAME (meter_bar, "meter Bar");
|
||||
meter_bar->set_outline_what (ArdourCanvas::Rectangle::BOTTOM);
|
||||
|
||||
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));
|
||||
CANVAS_DEBUG_NAME (tempo_bar, "Tempo Bar");
|
||||
tempo_bar->set_outline_what (ArdourCanvas::Rectangle::BOTTOM);
|
||||
|
||||
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));
|
||||
CANVAS_DEBUG_NAME (range_marker_bar, "Range Marker Bar");
|
||||
range_marker_bar->set_outline_what (ArdourCanvas::Rectangle::BOTTOM);
|
||||
|
||||
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));
|
||||
CANVAS_DEBUG_NAME (transport_marker_bar, "transport Marker Bar");
|
||||
transport_marker_bar->set_outline_what (ArdourCanvas::Rectangle::BOTTOM);
|
||||
|
||||
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));
|
||||
CANVAS_DEBUG_NAME (marker_bar, "Marker Bar");
|
||||
marker_bar->set_outline_what (ArdourCanvas::Rectangle::BOTTOM);
|
||||
|
||||
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));
|
||||
CANVAS_DEBUG_NAME (cd_marker_bar, "CD Marker Bar");
|
||||
cd_marker_bar->set_outline_what (ArdourCanvas::Rectangle::BOTTOM);
|
||||
|
||||
_time_markers_group = new ArdourCanvas::Group (h_scroll_group);
|
||||
CANVAS_DEBUG_NAME (_time_markers_group, "time bars");
|
||||
|
||||
cd_marker_group = new ArdourCanvas::Group (_time_markers_group, ArdourCanvas::Duple (0.0, 0.0));
|
||||
CANVAS_DEBUG_NAME (cd_marker_group, "cd marker group");
|
||||
|
|
@ -170,8 +145,32 @@ Editor::initialize_canvas ()
|
|||
meter_group = new ArdourCanvas::Group (_time_markers_group, ArdourCanvas::Duple (0.0, (timebar_height * 5.0) + 1.0));
|
||||
CANVAS_DEBUG_NAME (meter_group, "meter group");
|
||||
|
||||
ARDOUR_UI::instance()->video_timeline = new VideoTimeLine(this, videotl_group, (timebar_height * videotl_bar_height));
|
||||
meter_bar = new ArdourCanvas::Rectangle (meter_group, ArdourCanvas::Rect (0.0, 0.0, ArdourCanvas::COORD_MAX, timebar_height));
|
||||
CANVAS_DEBUG_NAME (meter_bar, "meter Bar");
|
||||
meter_bar->set_outline_what (ArdourCanvas::Rectangle::BOTTOM);
|
||||
|
||||
tempo_bar = new ArdourCanvas::Rectangle (tempo_group, ArdourCanvas::Rect (0.0, 0.0, ArdourCanvas::COORD_MAX, timebar_height));
|
||||
CANVAS_DEBUG_NAME (tempo_bar, "Tempo Bar");
|
||||
tempo_bar->set_outline_what (ArdourCanvas::Rectangle::BOTTOM);
|
||||
|
||||
range_marker_bar = new ArdourCanvas::Rectangle (range_marker_group, ArdourCanvas::Rect (0.0, 0.0, ArdourCanvas::COORD_MAX, timebar_height));
|
||||
CANVAS_DEBUG_NAME (range_marker_bar, "Range Marker Bar");
|
||||
range_marker_bar->set_outline_what (ArdourCanvas::Rectangle::BOTTOM);
|
||||
|
||||
transport_marker_bar = new ArdourCanvas::Rectangle (transport_marker_group, ArdourCanvas::Rect (0.0, 0.0, ArdourCanvas::COORD_MAX, timebar_height));
|
||||
CANVAS_DEBUG_NAME (transport_marker_bar, "transport Marker Bar");
|
||||
transport_marker_bar->set_outline_what (ArdourCanvas::Rectangle::BOTTOM);
|
||||
|
||||
marker_bar = new ArdourCanvas::Rectangle (marker_group, ArdourCanvas::Rect (0.0, 0.0, ArdourCanvas::COORD_MAX, timebar_height));
|
||||
CANVAS_DEBUG_NAME (marker_bar, "Marker Bar");
|
||||
marker_bar->set_outline_what (ArdourCanvas::Rectangle::BOTTOM);
|
||||
|
||||
cd_marker_bar = new ArdourCanvas::Rectangle (cd_marker_group, ArdourCanvas::Rect (0.0, 0.0, ArdourCanvas::COORD_MAX, timebar_height));
|
||||
CANVAS_DEBUG_NAME (cd_marker_bar, "CD Marker Bar");
|
||||
cd_marker_bar->set_outline_what (ArdourCanvas::Rectangle::BOTTOM);
|
||||
|
||||
ARDOUR_UI::instance()->video_timeline = new VideoTimeLine(this, videotl_group, (timebar_height * videotl_bar_height));
|
||||
|
||||
cd_marker_bar_drag_rect = new ArdourCanvas::Rectangle (cd_marker_group, ArdourCanvas::Rect (0.0, 0.0, 100, timebar_height));
|
||||
CANVAS_DEBUG_NAME (cd_marker_bar_drag_rect, "cd marker drag");
|
||||
cd_marker_bar_drag_rect->set_outline (false);
|
||||
|
|
@ -595,7 +594,6 @@ Editor::autoscroll_canvas ()
|
|||
if (autoscroll_vertical_allowed) {
|
||||
|
||||
const double vertical_pos = vertical_adjustment.get_value();
|
||||
double new_pixel = vertical_pos;
|
||||
const int speed_factor = 20;
|
||||
|
||||
/* vertical */
|
||||
|
|
@ -929,18 +927,6 @@ Editor::clamp_verbose_cursor_y (double y)
|
|||
return y;
|
||||
}
|
||||
|
||||
ArdourCanvas::Group*
|
||||
Editor::get_time_bars_group () const
|
||||
{
|
||||
return h_scroll_group;
|
||||
}
|
||||
|
||||
ArdourCanvas::Group*
|
||||
Editor::get_track_canvas_group() const
|
||||
{
|
||||
return hv_scroll_group;
|
||||
}
|
||||
|
||||
ArdourCanvas::GtkCanvasViewport*
|
||||
Editor::get_track_canvas() const
|
||||
{
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ using namespace Gtk;
|
|||
|
||||
EditorCursor::EditorCursor (Editor& ed, bool (Editor::*callbck)(GdkEvent*,ArdourCanvas::Item*))
|
||||
: _editor (ed)
|
||||
, _track_canvas_item (new ArdourCanvas::Arrow (_editor.get_track_canvas_group()))
|
||||
, _track_canvas_item (new ArdourCanvas::Arrow (_editor.get_hscroll_group()))
|
||||
, _length (1.0)
|
||||
{
|
||||
CANVAS_DEBUG_NAME (_track_canvas_item, "track canvas editor cursor");
|
||||
|
|
|
|||
|
|
@ -320,8 +320,12 @@ Editor::set_canvas_cursor ()
|
|||
if (x >= 0 && y >= 0) {
|
||||
|
||||
vector<ArdourCanvas::Item const *> items;
|
||||
|
||||
/* Note how we choose a specific scroll group to get
|
||||
* items from. This could be problematic.
|
||||
*/
|
||||
|
||||
get_track_canvas_group()->add_items_at_point (ArdourCanvas::Duple (x,y), items);
|
||||
hv_scroll_group->add_items_at_point (ArdourCanvas::Duple (x,y), items);
|
||||
|
||||
// first item will be the upper most
|
||||
|
||||
|
|
|
|||
|
|
@ -664,18 +664,12 @@ Editor::update_ruler_visibility ()
|
|||
if (tbpos != old_unit_pos) {
|
||||
meter_group->move (ArdourCanvas::Duple (0.0, tbpos - old_unit_pos));
|
||||
}
|
||||
old_unit_pos = meter_bar_group->position().y;
|
||||
if (tbgpos != old_unit_pos) {
|
||||
meter_bar_group->move (ArdourCanvas::Duple (0.0, tbgpos - old_unit_pos));
|
||||
}
|
||||
meter_bar_group->show();
|
||||
meter_group->show();
|
||||
meter_label.show();
|
||||
tbpos += timebar_height;
|
||||
tbgpos += timebar_height;
|
||||
visible_timebars++;
|
||||
} else {
|
||||
meter_bar_group->hide();
|
||||
meter_group->hide();
|
||||
meter_label.hide();
|
||||
}
|
||||
|
|
@ -685,18 +679,12 @@ Editor::update_ruler_visibility ()
|
|||
if (tbpos != old_unit_pos) {
|
||||
tempo_group->move (ArdourCanvas::Duple (0.0, tbpos - old_unit_pos));
|
||||
}
|
||||
old_unit_pos = tempo_bar_group->position().y;
|
||||
if (tbgpos != old_unit_pos) {
|
||||
tempo_bar_group->move (ArdourCanvas::Duple (0.0, tbgpos - old_unit_pos));
|
||||
}
|
||||
tempo_bar_group->show();
|
||||
tempo_group->show();
|
||||
tempo_label.show();
|
||||
tbpos += timebar_height;
|
||||
tbgpos += timebar_height;
|
||||
visible_timebars++;
|
||||
} else {
|
||||
tempo_bar_group->hide();
|
||||
tempo_group->hide();
|
||||
tempo_label.hide();
|
||||
}
|
||||
|
|
@ -706,11 +694,6 @@ Editor::update_ruler_visibility ()
|
|||
if (tbpos != old_unit_pos) {
|
||||
range_marker_group->move (ArdourCanvas::Duple (0.0, tbpos - old_unit_pos));
|
||||
}
|
||||
old_unit_pos = range_marker_bar_group->position().y;
|
||||
if (tbgpos != old_unit_pos) {
|
||||
range_marker_bar_group->move (ArdourCanvas::Duple (0.0, tbgpos - old_unit_pos));
|
||||
}
|
||||
range_marker_bar_group->show();
|
||||
range_marker_group->show();
|
||||
range_mark_label.show();
|
||||
|
||||
|
|
@ -718,7 +701,6 @@ Editor::update_ruler_visibility ()
|
|||
tbgpos += timebar_height;
|
||||
visible_timebars++;
|
||||
} else {
|
||||
range_marker_bar_group->hide();
|
||||
range_marker_group->hide();
|
||||
range_mark_label.hide();
|
||||
}
|
||||
|
|
@ -728,18 +710,12 @@ Editor::update_ruler_visibility ()
|
|||
if (tbpos != old_unit_pos) {
|
||||
transport_marker_group->move (ArdourCanvas::Duple (0.0, tbpos - old_unit_pos));
|
||||
}
|
||||
old_unit_pos = transport_marker_bar_group->position().y;
|
||||
if (tbgpos != old_unit_pos) {
|
||||
transport_marker_bar_group->move (ArdourCanvas::Duple (0.0, tbgpos - old_unit_pos));
|
||||
}
|
||||
transport_marker_bar_group->show();
|
||||
transport_marker_group->show();
|
||||
transport_mark_label.show();
|
||||
tbpos += timebar_height;
|
||||
tbgpos += timebar_height;
|
||||
visible_timebars++;
|
||||
} else {
|
||||
transport_marker_bar_group->hide();
|
||||
transport_marker_group->hide();
|
||||
transport_mark_label.hide();
|
||||
}
|
||||
|
|
@ -749,11 +725,6 @@ Editor::update_ruler_visibility ()
|
|||
if (tbpos != old_unit_pos) {
|
||||
cd_marker_group->move (ArdourCanvas::Duple (0.0, tbpos - old_unit_pos));
|
||||
}
|
||||
old_unit_pos = cd_marker_bar_group->position().y;
|
||||
if (tbgpos != old_unit_pos) {
|
||||
cd_marker_bar_group->move (ArdourCanvas::Duple (0.0, tbgpos - old_unit_pos));
|
||||
}
|
||||
cd_marker_bar_group->show();
|
||||
cd_marker_group->show();
|
||||
cd_mark_label.show();
|
||||
tbpos += timebar_height;
|
||||
|
|
@ -762,7 +733,6 @@ Editor::update_ruler_visibility ()
|
|||
// make sure all cd markers show up in their respective places
|
||||
update_cd_marker_display();
|
||||
} else {
|
||||
cd_marker_bar_group->hide();
|
||||
cd_marker_group->hide();
|
||||
cd_mark_label.hide();
|
||||
// make sure all cd markers show up in their respective places
|
||||
|
|
@ -774,18 +744,12 @@ Editor::update_ruler_visibility ()
|
|||
if (tbpos != old_unit_pos) {
|
||||
marker_group->move (ArdourCanvas::Duple (0.0, tbpos - old_unit_pos));
|
||||
}
|
||||
old_unit_pos = marker_bar_group->position().y;
|
||||
if (tbgpos != old_unit_pos) {
|
||||
marker_bar_group->move (ArdourCanvas::Duple (0.0, tbgpos - old_unit_pos));
|
||||
}
|
||||
marker_bar_group->show();
|
||||
marker_group->show();
|
||||
mark_label.show();
|
||||
tbpos += timebar_height;
|
||||
tbgpos += timebar_height;
|
||||
visible_timebars++;
|
||||
} else {
|
||||
marker_bar_group->hide();
|
||||
marker_group->hide();
|
||||
mark_label.hide();
|
||||
}
|
||||
|
|
@ -795,11 +759,6 @@ Editor::update_ruler_visibility ()
|
|||
if (tbpos != old_unit_pos) {
|
||||
videotl_group->move (ArdourCanvas::Duple (0.0, tbpos - old_unit_pos));
|
||||
}
|
||||
old_unit_pos = videotl_group->position().y;
|
||||
if (tbgpos != old_unit_pos) {
|
||||
videotl_group->move (ArdourCanvas::Duple (0.0, tbgpos - old_unit_pos));
|
||||
}
|
||||
videotl_group->show();
|
||||
videotl_group->show();
|
||||
videotl_label.show();
|
||||
tbpos += timebar_height * videotl_bar_height;
|
||||
|
|
@ -807,7 +766,6 @@ Editor::update_ruler_visibility ()
|
|||
visible_timebars+=videotl_bar_height;
|
||||
queue_visual_videotimeline_update();
|
||||
} else {
|
||||
videotl_group->hide();
|
||||
videotl_group->hide();
|
||||
videotl_label.hide();
|
||||
update_video_timeline(true);
|
||||
|
|
@ -816,6 +774,10 @@ Editor::update_ruler_visibility ()
|
|||
ruler_label_vbox.set_size_request (-1, (int)(timebar_height * visible_rulers));
|
||||
time_canvas_vbox.set_size_request (-1,-1);
|
||||
|
||||
std::cerr << "place HV group at " << timebar_height * visible_timebars << std::endl;
|
||||
|
||||
hv_scroll_group->set_y_position (timebar_height * visible_timebars);
|
||||
|
||||
compute_fixed_ruler_scale ();
|
||||
update_fixed_rulers();
|
||||
redisplay_tempo (false);
|
||||
|
|
|
|||
|
|
@ -366,8 +366,9 @@ class PublicEditor : public Gtk::Window, public PBD::StatefulDestructible, publi
|
|||
#endif
|
||||
|
||||
virtual ArdourCanvas::Group* get_trackview_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_hscroll_group () const = 0;
|
||||
virtual ArdourCanvas::Group* get_vscroll_group () const = 0;
|
||||
virtual ArdourCanvas::Group* get_hvscroll_group () const = 0;
|
||||
|
||||
virtual ArdourCanvas::GtkCanvasViewport* get_track_canvas() const = 0;
|
||||
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ VerboseCursor::VerboseCursor (Editor* editor)
|
|||
, _xoffset (0)
|
||||
, _yoffset (0)
|
||||
{
|
||||
_canvas_item = new ArdourCanvas::Text (_editor->get_track_canvas_group());
|
||||
_canvas_item = new ArdourCanvas::Text (_editor->get_hscroll_group());
|
||||
CANVAS_DEBUG_NAME (_canvas_item, "verbose canvas cursor");
|
||||
_canvas_item->set_ignore_events (true);
|
||||
_canvas_item->set_font_description (get_font_for_style (N_("VerboseCanvasCursor")));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue