uint32_t TimeAxisView::hSmall = 0;
bool TimeAxisView::need_size_info = true;
int const TimeAxisView::_max_order = 512;
+PBD::Signal1<void,TimeAxisView*> TimeAxisView::CatchDeletion;
TimeAxisView::TimeAxisView (ARDOUR::Session* sess, PublicEditor& ed, TimeAxisView* rent, Canvas& /*canvas*/)
: AxisView (sess),
}
_canvas_background = new Group (*ed.get_background_group (), 0.0, 0.0);
_canvas_display = new Group (*ed.get_trackview_group (), 0.0, 0.0);
+ _canvas_display->hide(); // reveal as needed
selection_group = new Group (*_canvas_display);
selection_group->hide();
controls_hbox.show ();
ColorsChanged.connect (sigc::mem_fun (*this, &TimeAxisView::color_handler));
+
+ GhostRegion::CatchDeletion.connect (*this, ui_bind (&TimeAxisView::erase_ghost, this, _1), gui_context());
}
TimeAxisView::~TimeAxisView()
if (canvas_item_visible ((*i)->_canvas_display)) {
++nth;
_effective_height += (*i)->show_at (y + _effective_height, nth, parent);
- }
+ }
}
return _effective_height;
{
using namespace Menu_Helpers;
+ delete display_menu;
+
display_menu = new Menu;
display_menu->set_name ("ArdourContextMenu");
if(gr) {
ghosts.push_back(gr);
- gr->CatchDeletion.connect (*this, ui_bind (&TimeAxisView::erase_ghost, this, _1), gui_context());
}
}
void
-TimeAxisView::remove_ghost (RegionView* rv) {
+TimeAxisView::remove_ghost (RegionView* rv)
+{
rv->remove_ghost_in (*this);
}
void
-TimeAxisView::erase_ghost (GhostRegion* gr) {
- if(in_destructor) {
+TimeAxisView::erase_ghost (GhostRegion* gr)
+{
+ if (in_destructor) {
return;
}
-
- list<GhostRegion*>::iterator i;
-
- for (i = ghosts.begin(); i != ghosts.end(); ++i) {
+
+ for (list<GhostRegion*>::iterator i = ghosts.begin(); i != ghosts.end(); ++i) {
if ((*i) == gr) {
ghosts.erase (i);
break;
return true;
}
+bool
+TimeAxisView::set_visibility (bool yn)
+{
+ if (yn != marked_for_display()) {
+ if (yn) {
+ set_marked_for_display (true);
+ canvas_display()->show();
+ } else {
+ set_marked_for_display (false);
+ hide ();
+ }
+ return true; // things changed
+ }
+
+ return false;
+}