/*
- Copyright (C) 2000 Paul Davis
+ Copyright (C) 2000 Paul Davis
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
using namespace std;
using namespace Gtk;
using namespace Gdk;
-using namespace sigc;
+using namespace sigc;
using namespace ARDOUR;
using namespace PBD;
using namespace Editing;
bool TimeAxisView::need_size_info = true;
int const TimeAxisView::_max_order = 512;
-TimeAxisView::TimeAxisView (ARDOUR::Session& sess, PublicEditor& ed, TimeAxisViewPtr rent, Canvas& canvas)
- : AxisView (sess),
+TimeAxisView::TimeAxisView (ARDOUR::Session& sess, PublicEditor& ed, TimeAxisView* rent, Canvas& /*canvas*/)
+ : AxisView (sess),
controls_table (2, 8),
_y_position (0),
_editor (ed),
name_hbox.show ();
+ controls_table.set_size_request (200);
controls_table.set_border_width (2);
controls_table.set_row_spacings (0);
controls_table.set_col_spacings (0);
TimeAxisView::selection_click (GdkEventButton* ev)
{
Selection::Operation op = Keyboard::selection_type (ev->state);
- _editor.set_selected_track (shared_from_this (), op, false);
+ _editor.set_selected_track (*this, op, false);
}
void
/* if its hidden, it cannot be selected */
- _editor.get_selection().remove (shared_from_this ());
+ _editor.get_selection().remove (this);
Hiding ();
}
return true;
/* Shift+Tab Keys Pressed. Note that for Shift+Tab, GDK actually
- * generates a different ev->keyval, rather than setting
+ * generates a different ev->keyval, rather than setting
* ev->state.
*/
case GDK_ISO_Left_Tab:
case GDK_Tab:
name_entry_changed ();
- allviews = _editor.get_valid_views (TimeAxisViewPtr ());
+ allviews = _editor.get_valid_views (0);
if (allviews != 0) {
- i = find (allviews->begin(), allviews->end(), shared_from_this ());
+ i = find (allviews->begin(), allviews->end(), this);
if (ev->keyval == GDK_Tab) {
if (i != allviews->end()) {
do {
break;
}
-#ifdef TIMEOUT_NAME_EDIT
+#ifdef TIMEOUT_NAME_EDIT
/* adapt the timeout to reflect the user's typing speed */
guint32 name_entry_timeout;
}
bool
-TimeAxisView::name_entry_focus_in (GdkEventFocus* ev)
+TimeAxisView::name_entry_focus_in (GdkEventFocus*)
{
name_entry.select_region (0, -1);
name_entry.set_name ("EditorActiveTrackNameDisplay");
}
bool
-TimeAxisView::name_entry_focus_out (GdkEventFocus* ev)
+TimeAxisView::name_entry_focus_out (GdkEventFocus*)
{
/* clean up */
{
Selection& s (_editor.get_selection ());
- if (!s.selected (shared_from_this ())) {
- _editor.set_selected_track (shared_from_this (), Selection::Set);
+ if (!s.selected (this)) {
+ _editor.set_selected_track (*this, Selection::Set);
}
}
}
conditionally_add_to_selection ();
- display_menu->popup (1, when);
+ display_menu->popup (1, when);
}
gint
rect->rect->signal_event().connect (bind (mem_fun (_editor, &PublicEditor::canvas_selection_rect_event), rect->rect, rect));
rect->start_trim->signal_event().connect (bind (mem_fun (_editor, &PublicEditor::canvas_selection_start_trim_event), rect->rect, rect));
rect->end_trim->signal_event().connect (bind (mem_fun (_editor, &PublicEditor::canvas_selection_end_trim_event), rect->rect, rect));
- }
+ }
rect = free_selection_rects.front();
rect->id = id;
return rect;
}
+struct null_deleter { void operator()(void const *) const {} };
+
bool
-TimeAxisView::is_child (TimeAxisViewPtr tav)
+TimeAxisView::is_child (TimeAxisView* tav)
{
- return find (children.begin(), children.end(), tav) != children.end();
+ return find (children.begin(), children.end(), boost::shared_ptr<TimeAxisView>(tav, null_deleter())) != children.end();
}
void
}
void
-TimeAxisView::get_selectables (nframes_t start, nframes_t end, double top, double bot, list<Selectable*>& result)
+TimeAxisView::get_selectables (nframes_t /*start*/, nframes_t /*end*/, double /*top*/, double /*bot*/, list<Selectable*>& /*result*/)
{
return;
}
void
-TimeAxisView::get_inverted_selectables (Selection& sel, list<Selectable*>& result)
+TimeAxisView::get_inverted_selectables (Selection& /*sel*/, list<Selectable*>& /*result*/)
{
return;
}
void
TimeAxisView::add_ghost (RegionView* rv)
{
- GhostRegion* gr = rv->add_ghost (shared_from_this ());
+ GhostRegion* gr = rv->add_ghost (*this);
if(gr) {
ghosts.push_back(gr);
}
void
-TimeAxisView::remove_ghost (RegionView* rv)
-{
- rv->remove_ghost_in (shared_from_this ());
+TimeAxisView::remove_ghost (RegionView* rv) {
+ rv->remove_ghost_in (*this);
}
void
*/
double mybot = _y_position + current_height();
-
- return ((_y_position <= bot && _y_position >= top) ||
- ((mybot <= bot) && (top < mybot)) ||
+
+ return ((_y_position <= bot && _y_position >= top) ||
+ ((mybot <= bot) && (top < mybot)) ||
(mybot >= bot && _y_position < top));
-}
+}
void
-TimeAxisView::set_parent (TimeAxisViewPtr p)
+TimeAxisView::set_parent (TimeAxisView& p)
{
- parent = p;
+ parent = &p;
}
bool
return _has_state;
}
-TimeAxisViewPtr
+TimeAxisView*
TimeAxisView::get_parent_with_state ()
{
- if (parent == 0 || parent->has_state()) {
+ if (parent == 0) {
+ return 0;
+ }
+
+ if (parent->has_state()) {
return parent;
}
}
int
-TimeAxisView::set_state (const XMLNode& node)
+TimeAxisView::set_state (const XMLNode& node, int /*version*/)
{
const XMLProperty *prop;
} else if ((prop = node.property ("height")) != 0) {
set_height (atoi (prop->value()));
-
+
} else {
set_height (hNormal);
(*i)->set_height ((*i)->height);
}
}
-
+
void
TimeAxisView::compute_controls_size_info ()
{
}
one_row_table.attach (*buttons[0], 6, 7, 0, 1, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND, 0, 0);
-
+
one_row_table.show_all ();
Gtk::Requisition req(one_row_table.size_request ());
two_row_table.show_all ();
req = two_row_table.size_request ();
- // height required to show all normal buttons
+ // height required to show all normal buttons
hNormal = /*req.height*/ 48 + extra_height;
- // these heights are all just larger than normal. no more
+ // these heights are all just larger than normal. no more
// elements are visible (yet).
hLarger = hNormal + 50;
* Layer index is the layer number if the TimeAxisView is valid and is in stacked
* region display mode, otherwise 0.
*/
-std::pair<TimeAxisViewPtr, layer_t>
+std::pair<TimeAxisView*, layer_t>
TimeAxisView::covers_y_position (double y)
{
if (hidden()) {
- return std::make_pair (TimeAxisViewPtr (), 0);
+ return std::make_pair ( (TimeAxisView *) 0, 0);
}
if (_y_position <= y && y < (_y_position + height)) {
l = view()->layers() - 1;
}
}
-
- return std::make_pair (shared_from_this (), l);
+
+ return std::make_pair (this, l);
}
for (Children::const_iterator i = children.begin(); i != children.end(); ++i) {
- std::pair<TimeAxisViewPtr, int> const r = (*i)->covers_y_position (y);
+ std::pair<TimeAxisView*, int> const r = (*i)->covers_y_position (y);
if (r.first) {
return r;
}
}
- return std::make_pair (TimeAxisViewPtr (), 0);
+ return std::make_pair ( (TimeAxisView *) 0, 0);
}
void
}
bool
-TimeAxisView::resizer_button_release (GdkEventButton* ev)
+TimeAxisView::resizer_button_release (GdkEventButton*)
{
_resize_drag_start = -1;
return true;
}
int32_t const delta = (int32_t) floor (ev->y_root - _resize_drag_start);
- _editor.add_to_idle_resize (shared_from_this (), delta);
+ _editor.add_to_idle_resize (this, delta);
_resize_drag_start = ev->y_root;
return true;
win->get_geometry (x, y, w, h, d);
/* handle/line #1 */
-
+
win->draw_line (dark, 0, 0, w - 2, 0);
win->draw_point (dark, 0, 1);
win->draw_line (light, 1, 1, w - 1, 1);
return true;
}
-TimeAxisViewPtr
-TimeAxisView::find_time_axis (TimeAxisView* v)
-{
- Children::iterator i = children.begin ();
- while (i != children.end() && i->get() != v) {
- ++i;
- }
-
- if (i == children.end()) {
- return TimeAxisViewPtr ();
- }
-
- return *i;
-}