Cleanups and a few comments.
authorCarl Hetherington <carl@carlh.net>
Fri, 2 Jan 2009 00:17:55 +0000 (00:17 +0000)
committerCarl Hetherington <carl@carlh.net>
Fri, 2 Jan 2009 00:17:55 +0000 (00:17 +0000)
git-svn-id: svn://localhost/ardour2/branches/3.0@4374 d708f5d6-7413-0410-9779-e7cbd77b26cf

28 files changed:
gtk2_ardour/audio_region_view.cc
gtk2_ardour/audio_streamview.cc
gtk2_ardour/audio_time_axis.cc
gtk2_ardour/automation_line.cc
gtk2_ardour/automation_region_view.cc
gtk2_ardour/automation_streamview.cc
gtk2_ardour/automation_time_axis.cc
gtk2_ardour/canvas-note-event.cc
gtk2_ardour/canvas-note.cc
gtk2_ardour/crossfade_view.cc
gtk2_ardour/editor.cc
gtk2_ardour/editor_canvas.cc
gtk2_ardour/editor_mouse.cc
gtk2_ardour/editor_ops.cc
gtk2_ardour/editor_route_list.cc
gtk2_ardour/editor_selection.cc
gtk2_ardour/ghostregion.cc
gtk2_ardour/midi_region_view.cc
gtk2_ardour/midi_streamview.cc
gtk2_ardour/midi_time_axis.cc
gtk2_ardour/region_gain_line.cc
gtk2_ardour/region_selection.cc
gtk2_ardour/region_view.cc
gtk2_ardour/route_time_axis.cc
gtk2_ardour/streamview.cc
gtk2_ardour/time_axis_view.cc
gtk2_ardour/time_axis_view.h
gtk2_ardour/time_axis_view_item.cc

index 95a0c6ca00570b14c1ed5c914d1a0d7923d9dda5..2a6bd2e1fe9f259015b5ccb61c10a8c0a42233f3 100644 (file)
@@ -161,7 +161,7 @@ AudioRegionView::init (Gdk::Color& basic_color, bool wfd)
                store_flags ();
        }
 
-       if (trackview.editor.new_regionviews_display_gain()) {
+       if (trackview.editor().new_regionviews_display_gain()) {
                _flags |= EnvelopeVisible;
        }
 
@@ -996,7 +996,7 @@ AudioRegionView::add_gain_point_event (ArdourCanvas::Item *item, GdkEvent *ev)
 
        item->w2i (x, y);
 
-       nframes_t fx = trackview.editor.pixel_to_frame (x);
+       nframes_t fx = trackview.editor().pixel_to_frame (x);
 
        if (fx > _region->length()) {
                return;
index 2824cff68fcdfd3f1c48285c0d9b967fba234fbd..f79955b100b48d7160a0546806e8419cee5535c3 100644 (file)
@@ -65,7 +65,7 @@ AudioStreamView::AudioStreamView (AudioTimeAxisView& tv)
        color_handler ();
        _amplitude_above_axis = 1.0;
 
-       use_rec_regions = tv.editor.show_waveforms_recording ();
+       use_rec_regions = tv.editor().show_waveforms_recording ();
 }
 
 AudioStreamView::~AudioStreamView ()
@@ -189,7 +189,7 @@ AudioStreamView::add_region_view_internal (boost::shared_ptr<Region> r, bool wai
        
        /* follow global waveform setting */
 
-       region_view->set_waveform_visible(_trackview.editor.show_waveforms());
+       region_view->set_waveform_visible(_trackview.editor().show_waveforms());
 
        /* catch regionview going away */
        region->GoingAway.connect (bind (mem_fun (*this, &AudioStreamView::remove_region_view), boost::weak_ptr<Region> (r)));
@@ -331,7 +331,7 @@ AudioStreamView::add_crossfade (boost::shared_ptr<Crossfade> crossfade)
                }
        }
 
-       CrossfadeView *cv = new CrossfadeView (_trackview.canvas_display,
+       CrossfadeView *cv = new CrossfadeView (_trackview.canvas_display (),
                                               _trackview,
                                                crossfade,
                                               _samples_per_unit,
@@ -545,7 +545,7 @@ AudioStreamView::setup_rec_box ()
                        at = _trackview.audio_track(); /* we know what it is already */
                        boost::shared_ptr<AudioDiskstream> ds = at->audio_diskstream();
                        nframes_t frame_pos = ds->current_capture_start ();
-                       gdouble xstart = _trackview.editor.frame_to_pixel (frame_pos);
+                       gdouble xstart = _trackview.editor().frame_to_pixel (frame_pos);
                        gdouble xend;
                        uint32_t fill_color;
 
@@ -720,7 +720,7 @@ AudioStreamView::update_rec_regions ()
 
                                                /* also update rect */
                                                ArdourCanvas::SimpleRect * rect = rec_rects[n].rectangle;
-                                               gdouble xend = _trackview.editor.frame_to_pixel (region->position() + region->length());
+                                               gdouble xend = _trackview.editor().frame_to_pixel (region->position() + region->length());
                                                rect->property_x2() = xend;
                                        }
                                }
index 2c03a451d889cf63d841f9dc0950f3963e56d0f5..9bc12f67113f7c9b36c850f3ffb495d4fb560bb5 100644 (file)
@@ -119,7 +119,7 @@ AudioTimeAxisView::AudioTimeAxisView (PublicEditor& ed, Session& sess, boost::sh
                /* ask for notifications of any new RegionViews */
                _view->RegionViewAdded.connect (mem_fun(*this, &AudioTimeAxisView::region_view_added));
 
-               if (!editor.have_idled()) {
+               if (!_editor.have_idled()) {
                        /* first idle will do what we need */
                } else {
                        first_idle ();
@@ -187,7 +187,7 @@ AudioTimeAxisView::append_extra_display_menu_items ()
        waveform_items.push_back (CheckMenuElem (_("Show waveforms"), mem_fun(*this, &AudioTimeAxisView::toggle_waveforms)));
        waveform_item = static_cast<CheckMenuItem *> (&waveform_items.back());
        ignore_toggle = true;
-       waveform_item->set_active (editor.show_waveforms());
+       waveform_item->set_active (_editor.show_waveforms());
        ignore_toggle = false;
 
        waveform_items.push_back (SeparatorElem());
@@ -334,7 +334,7 @@ AudioTimeAxisView::create_automation_child (const Evoral::Parameter& param, bool
 
                boost::shared_ptr<AutomationTimeAxisView> gain_track(new AutomationTimeAxisView (_session,
                                _route, _route, c,
-                               editor,
+                               _editor,
                                *this,
                                false,
                                parent_canvas,
@@ -382,7 +382,7 @@ AudioTimeAxisView::ensure_pan_views (bool show)
                        boost::shared_ptr<AutomationTimeAxisView> pan_track (
                                new AutomationTimeAxisView (_session,
                                                            _route, _route, pan_control, 
-                                                           editor,
+                                                           _editor,
                                                            *this,
                                                            false,
                                                            parent_canvas,
index bc2c609b032efd725fe569f4d5c0ac331a53ae26..f06cbee510c636336eeb5b1166f4ddf76a78c811 100644 (file)
@@ -207,10 +207,10 @@ AutomationLine::modify_point_y (ControlPoint& cp, double y)
        y = min (1.0, y);
        y = _height - (y * _height);
 
-       double const x = trackview.editor.frame_to_unit ((*cp.model())->when);
+       double const x = trackview.editor().frame_to_unit ((*cp.model())->when);
 
-       trackview.editor.current_session()->begin_reversible_command (_("automation event move"));
-       trackview.editor.current_session()->add_command (new MementoCommand<AutomationList>(*alist.get(), &get_state(), 0));
+       trackview.editor().current_session()->begin_reversible_command (_("automation event move"));
+       trackview.editor().current_session()->add_command (new MementoCommand<AutomationList>(*alist.get(), &get_state(), 0));
 
        cp.move_to (x, y, ControlPoint::Full);
        reset_line_coords (cp);
@@ -225,9 +225,9 @@ AutomationLine::modify_point_y (ControlPoint& cp, double y)
 
        update_pending = false;
 
-       trackview.editor.current_session()->add_command (new MementoCommand<AutomationList>(*alist.get(), 0, &alist->get_state()));
-       trackview.editor.current_session()->commit_reversible_command ();
-       trackview.editor.current_session()->set_dirty ();
+       trackview.editor().current_session()->add_command (new MementoCommand<AutomationList>(*alist.get(), 0, &alist->get_state()));
+       trackview.editor().current_session()->commit_reversible_command ();
+       trackview.editor().current_session()->set_dirty ();
 }
 
 
@@ -256,7 +256,7 @@ AutomationLine::modify_view_point (ControlPoint& cp, double x, double y, bool wi
                   already in frames. it needs to be converted to canvas units.
                */
                
-               x = trackview.editor.frame_to_unit (x);
+               x = trackview.editor().frame_to_unit (x);
 
                /* clamp x position using view coordinates */
 
@@ -309,7 +309,7 @@ AutomationLine::modify_view_point (ControlPoint& cp, double x, double y, bool wi
 
                /* leave the x-coordinate alone */
 
-               x = trackview.editor.frame_to_unit ((*cp.model())->when);
+               x = trackview.editor().frame_to_unit ((*cp.model())->when);
 
        }
 
@@ -381,10 +381,10 @@ AutomationLine::model_representation (ControlPoint& cp, ModelRepresentation& mr)
 
        /* if xval has not changed, set it directly from the model to avoid rounding errors */
 
-       if (mr.xval == trackview.editor.frame_to_unit((*cp.model())->when)) {
+       if (mr.xval == trackview.editor().frame_to_unit((*cp.model())->when)) {
                mr.xval = (nframes_t) (*cp.model())->when;
        } else {
-               mr.xval = trackview.editor.unit_to_frame (mr.xval);
+               mr.xval = trackview.editor().unit_to_frame (mr.xval);
        }
 
        /* virtual call: this will do the right thing
@@ -634,7 +634,7 @@ AutomationLine::determine_visible_control_points (ALPoints& points)
 
        } 
 
-       set_selected_points (trackview.editor.get_selection().points);
+       set_selected_points (trackview.editor().get_selection().points);
 
 }
 
@@ -718,7 +718,7 @@ AutomationLine::invalidate_point (ALPoints& p, uint32_t index)
 void
 AutomationLine::start_drag (ControlPoint* cp, nframes_t x, float fraction) 
 {
-       if (trackview.editor.current_session() == 0) { /* how? */
+       if (trackview.editor().current_session() == 0) { /* how? */
                return;
        }
 
@@ -730,8 +730,8 @@ AutomationLine::start_drag (ControlPoint* cp, nframes_t x, float fraction)
                str = _("automation range drag");
        }
 
-       trackview.editor.current_session()->begin_reversible_command (str);
-       trackview.editor.current_session()->add_command (new MementoCommand<AutomationList>(*alist.get(), &get_state(), 0));
+       trackview.editor().current_session()->begin_reversible_command (str);
+       trackview.editor().current_session()->add_command (new MementoCommand<AutomationList>(*alist.get(), &get_state(), 0));
        
        drag_x = x;
        drag_distance = 0;
@@ -778,7 +778,7 @@ AutomationLine::line_drag (uint32_t i1, uint32_t i2, float fraction, bool with_p
 
        for (uint32_t i = i1 ; i <= i2; i++) {
                cp = nth (i);
-               modify_view_point (*cp, trackview.editor.unit_to_frame (cp->get_x()), ((_height - cp->get_y()) /_height) + ydelta, with_push);
+               modify_view_point (*cp, trackview.editor().unit_to_frame (cp->get_x()), ((_height - cp->get_y()) /_height) + ydelta, with_push);
        }
 
        if (line_points.size() > 1) {
@@ -807,9 +807,9 @@ AutomationLine::end_drag (ControlPoint* cp)
 
        update_pending = false;
 
-       trackview.editor.current_session()->add_command (new MementoCommand<AutomationList>(*alist.get(), 0, &alist->get_state()));
-       trackview.editor.current_session()->commit_reversible_command ();
-       trackview.editor.current_session()->set_dirty ();
+       trackview.editor().current_session()->add_command (new MementoCommand<AutomationList>(*alist.get(), 0, &alist->get_state()));
+       trackview.editor().current_session()->commit_reversible_command ();
+       trackview.editor().current_session()->set_dirty ();
 }
 
 
@@ -891,7 +891,7 @@ AutomationLine::control_points_adjacent (double xval, uint32_t & before, uint32_
 
        /* xval is in frames */
 
-       unit_xval = trackview.editor.frame_to_unit (xval);
+       unit_xval = trackview.editor().frame_to_unit (xval);
 
        for (vector<ControlPoint*>::iterator i = control_points.begin(); i != control_points.end(); ++i) {
                
@@ -952,15 +952,15 @@ AutomationLine::remove_point (ControlPoint& cp)
 
        model_representation (cp, mr);
 
-       trackview.editor.current_session()->begin_reversible_command (_("remove control point"));
+       trackview.editor().current_session()->begin_reversible_command (_("remove control point"));
        XMLNode &before = alist->get_state();
 
        alist->erase (mr.start, mr.end);
 
-       trackview.editor.current_session()->add_command(new MementoCommand<AutomationList>(
+       trackview.editor().current_session()->add_command(new MementoCommand<AutomationList>(
                        *alist.get(), &before, &alist->get_state()));
-       trackview.editor.current_session()->commit_reversible_command ();
-       trackview.editor.current_session()->set_dirty ();
+       trackview.editor().current_session()->commit_reversible_command ();
+       trackview.editor().current_session()->set_dirty ();
 }
 
 void
@@ -1050,8 +1050,8 @@ AutomationLine::set_selected_points (PointSelection& points)
                        
                        double rstart, rend;
                        
-                       rstart = trackview.editor.frame_to_unit ((*r).start);
-                       rend = trackview.editor.frame_to_unit ((*r).end);
+                       rstart = trackview.editor().frame_to_unit ((*r).start);
+                       rend = trackview.editor().frame_to_unit ((*r).end);
                        
                        if ((*i)->get_x() >= rstart && (*i)->get_x() <= rend) {
                                
@@ -1081,7 +1081,7 @@ void AutomationLine::set_colors() {
 void
 AutomationLine::show_selection ()
 {
-       TimeSelection& time (trackview.editor.get_selection().time);
+       TimeSelection& time (trackview.editor().get_selection().time);
 
        for (vector<ControlPoint*>::iterator i = control_points.begin(); i != control_points.end(); ++i) {
                
@@ -1090,8 +1090,8 @@ AutomationLine::show_selection ()
                for (list<AudioRange>::iterator r = time.begin(); r != time.end(); ++r) {
                        double rstart, rend;
                        
-                       rstart = trackview.editor.frame_to_unit ((*r).start);
-                       rend = trackview.editor.frame_to_unit ((*r).end);
+                       rstart = trackview.editor().frame_to_unit ((*r).start);
+                       rend = trackview.editor().frame_to_unit ((*r).end);
                        
                        if ((*i)->get_x() >= rstart && (*i)->get_x() <= rend) {
                                (*i)->set_selected(true);
@@ -1147,7 +1147,7 @@ AutomationLine::reset_callback (const Evoral::ControlList& events)
 void
 AutomationLine::add_model_point (ALPoints& tmp_points, double frame, double yfract)
 {
-       tmp_points.push_back (ALPoint (trackview.editor.frame_to_unit (frame),
+       tmp_points.push_back (ALPoint (trackview.editor().frame_to_unit (frame),
                                       _height - (yfract * _height)));
 }
 
@@ -1169,9 +1169,9 @@ AutomationLine::clear ()
        /* parent must create command */
        XMLNode &before = get_state();
        alist->clear();
-       trackview.editor.current_session()->add_command (new MementoCommand<AutomationLine>(*this, &before, &get_state()));
-       trackview.editor.current_session()->commit_reversible_command ();
-       trackview.editor.current_session()->set_dirty ();
+       trackview.editor().current_session()->add_command (new MementoCommand<AutomationLine>(*this, &before, &get_state()));
+       trackview.editor().current_session()->commit_reversible_command ();
+       trackview.editor().current_session()->set_dirty ();
 }
 
 void
index d8b90e6458a0377d572c88af371cfc9e086e59ca..9efb03c9f9892fb82781a3ac39df87111fcf2f04 100644 (file)
@@ -78,7 +78,7 @@ AutomationRegionView::canvas_event(GdkEvent* ev)
 {
        if (ev->type == GDK_BUTTON_RELEASE) {
 
-               const nframes_t when = trackview.editor.pixel_to_frame((nframes_t)ev->button.x)
+               const nframes_t when = trackview.editor().pixel_to_frame((nframes_t)ev->button.x)
                        - _region->position();
                add_automation_event(ev, when, ev->button.y);
        }
@@ -101,7 +101,7 @@ AutomationRegionView::add_automation_event (GdkEvent* event, nframes_t when, dou
        double x = 0;
        AutomationTimeAxisView* const view = automation_view();
 
-       view->canvas_display->w2i (x, y);
+       view->canvas_display()->w2i (x, y);
 
        /* compute vertical fractional position */
 
index d3419e8bb84ade63922457cc344169c5258780e5..b02d511d07e266df2f48e70e9f559b954ec3f798 100644 (file)
@@ -54,14 +54,14 @@ using namespace Editing;
 
 AutomationStreamView::AutomationStreamView (AutomationTimeAxisView& tv)
        : StreamView (*dynamic_cast<RouteTimeAxisView*>(tv.get_parent()),
-                       new ArdourCanvas::Group(*tv.canvas_display))
+                     new ArdourCanvas::Group(*tv.canvas_display()))
        , _controller(tv.controller())
        , _automation_view(tv)
 {
        //canvas_rect->property_fill_color_rgba() = stream_base_color;
        canvas_rect->property_outline_color_rgba() = RGBA_BLACK;
 
-       use_rec_regions = tv.editor.show_waveforms_recording ();
+       use_rec_regions = tv.editor().show_waveforms_recording ();
 }
 
 AutomationStreamView::~AutomationStreamView ()
index b838931cd1d27ed0c624d8b4dbff3fd228a8ed78..b7ed914926fc098aa7c17d2572bcabf2372d1e96 100644 (file)
@@ -87,7 +87,7 @@ AutomationTimeAxisView::AutomationTimeAxisView (Session& s, boost::shared_ptr<Ro
        ignore_state_request = false;
        first_call_to_set_height = true;
        
-       _base_rect = new SimpleRect(*canvas_display);
+       _base_rect = new SimpleRect(*_canvas_display);
        _base_rect->property_x1() = 0.0;
        _base_rect->property_y1() = 0.0;
        _base_rect->property_x2() = LONG_MAX - 2;
@@ -99,7 +99,7 @@ AutomationTimeAxisView::AutomationTimeAxisView (Session& s, boost::shared_ptr<Ro
        
        _base_rect->set_data ("trackview", this);
 
-       _base_rect->signal_event().connect (bind (mem_fun (editor, &PublicEditor::canvas_automation_track_event),
+       _base_rect->signal_event().connect (bind (mem_fun (_editor, &PublicEditor::canvas_automation_track_event),
                                                 _base_rect, this));
 
        _base_rect->lower_to_bottom();
@@ -214,7 +214,7 @@ AutomationTimeAxisView::AutomationTimeAxisView (Session& s, boost::shared_ptr<Ro
                boost::shared_ptr<AutomationLine> line(new AutomationLine (
                                        ARDOUR::EventTypeMap::instance().to_symbol(_control->parameter()),
                                        *this,
-                                       *canvas_display,
+                                       *_canvas_display,
                                        _control->alist()));
 
                line->set_line_color (ARDOUR_UI::config()->canvasvar_ProcessorAutomationLine.get());
@@ -561,7 +561,7 @@ AutomationTimeAxisView::add_automation_event (ArdourCanvas::Item* item, GdkEvent
 
        double x = 0;
 
-       canvas_display->w2i (x, y);
+       _canvas_display->w2i (x, y);
 
        /* compute vertical fractional position */
 
@@ -601,14 +601,14 @@ AutomationTimeAxisView::cut_copy_clear_one (AutomationLine& line, Selection& sel
        switch (op) {
        case Cut:
                if ((what_we_got = alist->cut (selection.time.front().start, selection.time.front().end)) != 0) {
-                       editor.get_cut_buffer().add (what_we_got);
+                       _editor.get_cut_buffer().add (what_we_got);
                        _session.add_command(new MementoCommand<AutomationList>(*alist.get(), &before, &alist->get_state()));
                        ret = true;
                }
                break;
        case Copy:
                if ((what_we_got = alist->copy (selection.time.front().start, selection.time.front().end)) != 0) {
-                       editor.get_cut_buffer().add (what_we_got);
+                       _editor.get_cut_buffer().add (what_we_got);
                }
                break;
 
@@ -678,14 +678,14 @@ AutomationTimeAxisView::cut_copy_clear_objects_one (AutomationLine& line, PointS
                switch (op) {
                case Cut:
                        if ((what_we_got = alist->cut ((*i).start, (*i).end)) != 0) {
-                               editor.get_cut_buffer().add (what_we_got);
+                               _editor.get_cut_buffer().add (what_we_got);
                                _session.add_command (new MementoCommand<AutomationList>(*alist.get(), new XMLNode (before), &alist->get_state()));
                                ret = true;
                        }
                        break;
                case Copy:
                        if ((what_we_got = alist->copy ((*i).start, (*i).end)) != 0) {
-                               editor.get_cut_buffer().add (what_we_got);
+                               _editor.get_cut_buffer().add (what_we_got);
                        }
                        break;
                        
@@ -757,14 +757,14 @@ AutomationTimeAxisView::get_selectables (nframes_t start, nframes_t end, double
                double botfrac;
 
                /* remember: this is X Window - coordinate space starts in upper left and moves down.
-                  y_position is the "origin" or "top" of the track.
+                  _y_position is the "origin" or "top" of the track.
                */
 
-               double mybot = y_position + height;
+               double mybot = _y_position + height;
 
-               if (y_position >= top && mybot <= bot) {
+               if (_y_position >= top && mybot <= bot) {
 
-                       /* y_position is below top, mybot is above bot, so we're fully
+                       /* _y_position is below top, mybot is above bot, so we're fully
                           covered vertically.
                        */
 
@@ -773,10 +773,10 @@ AutomationTimeAxisView::get_selectables (nframes_t start, nframes_t end, double
 
                } else {
 
-                       /* top and bot are within y_position .. mybot */
+                       /* top and bot are within _y_position .. mybot */
 
-                       topfrac = 1.0 - ((top - y_position) / height);
-                       botfrac = 1.0 - ((bot - y_position) / height);
+                       topfrac = 1.0 - ((top - _y_position) / height);
+                       botfrac = 1.0 - ((bot - _y_position) / height);
                }
 
                if (_line)
@@ -869,7 +869,7 @@ AutomationTimeAxisView::set_state (const XMLNode& node)
                XMLProperty const * shown = node.property ("shown");
                if (shown && shown->value () == "yes") {
                        set_marked_for_display (true);
-                       canvas_display->show (); /* FIXME: necessary? show_at? */
+                       _canvas_display->show (); /* FIXME: necessary? show_at? */
                }
        }
        
index 022787d6b95613b9301767199c879b5ae30f2032..326d50210487170c33988f10e338751b9099b31b 100644 (file)
@@ -222,7 +222,7 @@ CanvasNoteEvent::on_event(GdkEvent* ev)
        bool select_mod;
        uint8_t d_velocity = 10;
        
-       if (_region.get_time_axis_view().editor.current_mouse_mode() != Editing::MouseNote)
+       if (_region.get_time_axis_view().editor().current_mouse_mode() != Editing::MouseNote)
                return false;
 
        switch (ev->type) {
@@ -284,7 +284,7 @@ CanvasNoteEvent::on_event(GdkEvent* ev)
 
                switch (_state) {
                case Pressed: // Drag begin
-                       if (_region.midi_view()->editor.current_midi_edit_mode() == Editing::MidiEditSelect
+                       if (_region.midi_view()->editor().current_midi_edit_mode() == Editing::MidiEditSelect
                                        && _region.mouse_state() != MidiRegionView::SelectTouchDragging
                                        && _region.mouse_state() != MidiRegionView::EraseTouchDragging) {
                                _item->grab(GDK_POINTER_MOTION_MASK | GDK_BUTTON_RELEASE_MASK,
@@ -356,7 +356,7 @@ CanvasNoteEvent::on_event(GdkEvent* ev)
                
                switch (_state) {
                case Pressed: // Clicked
-                       if (_region.midi_view()->editor.current_midi_edit_mode() == Editing::MidiEditSelect) {
+                       if (_region.midi_view()->editor().current_midi_edit_mode() == Editing::MidiEditSelect) {
                                _state = None;
 
                                if (_selected && !select_mod && _region.selection_size() > 1)
@@ -365,7 +365,7 @@ CanvasNoteEvent::on_event(GdkEvent* ev)
                                        _region.note_deselected(this, select_mod);
                                else
                                        _region.note_selected(this, select_mod);
-                       } else if (_region.midi_view()->editor.current_midi_edit_mode() == Editing::MidiEditErase) {
+                       } else if (_region.midi_view()->editor().current_midi_edit_mode() == Editing::MidiEditErase) {
                                _region.start_delta_command();
                                _region.command_remove_note(this);
                                _region.apply_command();
@@ -378,7 +378,7 @@ CanvasNoteEvent::on_event(GdkEvent* ev)
 
                        if (_note)
                                _region.note_dropped(this,
-                                               _region.midi_view()->editor.pixel_to_frame(abs(drag_delta_x))
+                                                    _region.midi_view()->editor().pixel_to_frame(abs(drag_delta_x))
                                                                * ((drag_delta_x < 0.0) ? -1 : 1),
                                                drag_delta_note);
                        return true;
index f505504198d1356d3fc67ead42ed11f11dd1b621..973ab4db6dfef12e5c8f8808701c5f6707e8c2ad 100644 (file)
@@ -15,7 +15,7 @@ CanvasNote::on_event(GdkEvent* ev)
        static double   middle_point, last_x;
        Gdk::Cursor     cursor;
        static NoteEnd  note_end;
-       Editing::MidiEditMode edit_mode = _region.get_trackview().editor.current_midi_edit_mode();
+       Editing::MidiEditMode edit_mode = _region.get_trackview().editor().current_midi_edit_mode();
 
        switch (ev->type) {
        case GDK_BUTTON_PRESS:
index 68dc2ecbe04376524c992e2df2c7dc0fe78a5433..c4a74b8a189cca84a958d1befc80799051324830 100644 (file)
@@ -80,7 +80,7 @@ CrossfadeView::CrossfadeView (ArdourCanvas::Group *parent,
        vestigial_frame->hide();
        show_vestigial = false;
        
-       group->signal_event().connect (bind (mem_fun (tv.editor, &PublicEditor::canvas_crossfade_view_event), group, this));
+       group->signal_event().connect (bind (mem_fun (tv.editor(), &PublicEditor::canvas_crossfade_view_event), group, this));
        
        crossfade_changed (Change (~0));
 
@@ -174,7 +174,7 @@ CrossfadeView::redraw_curves ()
                return;
        }
 
-       npoints = get_time_axis_view().editor.frame_to_pixel (crossfade->length());
+       npoints = get_time_axis_view().editor().frame_to_pixel (crossfade->length());
        // npoints = std::min (gdk_screen_width(), npoints);
 
        if (!_visible || !crossfade->active() || npoints < 3) {
index 0bca31a6b8a96ccfb1afaa0362d2ab9b142fff3c..051eb6dd8adf6f0b36c12d6c46c11621e9a6df82 100644 (file)
@@ -4824,7 +4824,7 @@ Editor::idle_visual_changer ()
 
 struct EditorOrderTimeAxisSorter {
     bool operator() (const TimeAxisView* a, const TimeAxisView* b) const {
-           return a->order < b->order;
+           return a->order () < b->order ();
     }
 };
        
index be004644f901f4b9f413c3e1b96c75e2563d2ef9..62de67cd2214e739fe1da6fceee2e8be92509a12 100644 (file)
@@ -341,9 +341,7 @@ Editor::track_canvas_size_allocated ()
                double height = 0;
 
                for (i = track_views.begin(); i != track_views.end(); ++i) {
-                       if ((*i)->control_parent) {
-                               height += (*i)->effective_height;
-                       }
+                       height += (*i)->effective_height ();
                        (*i)->clip_to_viewport ();
                }
                
@@ -391,7 +389,7 @@ Editor::controls_layout_size_request (Requisition* req)
        for (pos = 0, i = rows.begin(); i != rows.end(); ++i) {
                TimeAxisView *tv = (*i)[route_display_columns.tv];
                if (tv != 0) {
-                       pos += tv->effective_height;
+                       pos += tv->effective_height ();
                        tv->clip_to_viewport ();
                }
        }
index c3a9bce7a8e928918bd654f4502bd698ddc01235..0e101957f288d0648c51ac2c6116f8877b9261d9 100644 (file)
@@ -3658,7 +3658,7 @@ Editor::region_drag_motion_callback (ArdourCanvas::Item* item, GdkEvent* event)
                return;
        }
 
-       original_pointer_order = drag_info.dest_trackview->order;
+       original_pointer_order = drag_info.dest_trackview->order ();
        
        /************************************************************
             Y-Delta Computation
@@ -3670,62 +3670,56 @@ Editor::region_drag_motion_callback (ArdourCanvas::Item* item, GdkEvent* event)
                goto y_axis_done;
        }
 
-       if ((pointer_y_span = (drag_info.dest_trackview->order - tv->order)) != 0) {
+       if ((pointer_y_span = (drag_info.dest_trackview->order() - tv->order())) != 0) {
 
-               int32_t children = 0, numtracks = 0;
+               int32_t children = 0;
                // XXX hard coding track limit, oh my, so very very bad
                bitset <1024> tracks (0x00);
                /* get a bitmask representing the visible tracks */
 
                for (TrackViewList::iterator i = track_views.begin(); i != track_views.end(); ++i) {
-                       TimeAxisView *tracklist_timeview;
-                       tracklist_timeview = (*i);
-                       RouteTimeAxisView* rtv2 = dynamic_cast<RouteTimeAxisView*>(tracklist_timeview);
+                       RouteTimeAxisView* rtv2 = dynamic_cast<RouteTimeAxisView*> (*i);
                        TimeAxisView::Children children_list;
              
                        /* zeroes are audio tracks. ones are other types. */
              
                        if (!rtv2->hidden()) {
                                
-                               if (visible_y_high < rtv2->order) {
-                                       visible_y_high = rtv2->order;
+                               if (visible_y_high < rtv2->order()) {
+                                       visible_y_high = rtv2->order();
                                }
-                               if (visible_y_low > rtv2->order) {
-                                       visible_y_low = rtv2->order;
+                               if (visible_y_low > rtv2->order()) {
+                                       visible_y_low = rtv2->order();
                                }
                
                                if (!rtv2->is_track()) {                                  
-                                       tracks = tracks |= (0x01 << rtv2->order);
+                                       tracks = tracks |= (0x01 << rtv2->order());
                                }
        
-                               height_list[rtv2->order] = (*i)->current_height();
+                               height_list[rtv2->order()] = (*i)->current_height();
                                children = 1;
 
                                if ((children_list = rtv2->get_child_list()).size() > 0) {
                                        for (TimeAxisView::Children::iterator j = children_list.begin(); j != children_list.end(); ++j) { 
-                                               tracks = tracks |= (0x01 << (rtv2->order + children));
-                                               height_list[rtv2->order + children] =  (*j)->current_height();
-                                               numtracks++;
+                                               tracks = tracks |= (0x01 << (rtv2->order() + children));
+                                               height_list[rtv2->order() + children] =  (*j)->current_height();
                                                children++;     
                                        }
                                }
-                               numtracks++;        
                        }
                }
                /* find the actual span according to the canvas */
 
                canvas_pointer_y_span = pointer_y_span;
-               if (drag_info.dest_trackview->order >= tv->order) {
-                       int32_t y;
-                       for (y = tv->order; y < drag_info.dest_trackview->order; y++) {
-                               if (height_list[y] == 0 ) {
+               if (drag_info.dest_trackview->order() >= tv->order()) {
+                       for (int32_t y = tv->order(); y < drag_info.dest_trackview->order(); y++) {
+                               if (height_list[y] == 0) {
                                        canvas_pointer_y_span--;
                                }
                        }
                } else {
-                       int32_t y;
-                       for (y = drag_info.dest_trackview->order;y <= tv->order; y++) {
-                               if (    height_list[y] == 0 ) {
+                       for (int32_t y = drag_info.dest_trackview->order(); y <= tv->order(); y++) {
+                               if (height_list[y] == 0) {
                                        canvas_pointer_y_span++;
                                }
                        }
@@ -3747,25 +3741,25 @@ Editor::region_drag_motion_callback (ArdourCanvas::Item* item, GdkEvent* event)
                        TimeAxisView* tvp2 = trackview_by_y_position (iy1);
                        RouteTimeAxisView* rtv2 = dynamic_cast<RouteTimeAxisView*>(tvp2);
 
-                       if (rtv2->order != original_pointer_order) {    
+                       if (rtv2->order() != original_pointer_order) {  
                                /* this isn't the pointer track */      
 
                                if (canvas_pointer_y_span > 0) {
 
                                        /* moving up the canvas */
-                                       if ((rtv2->order - canvas_pointer_y_span) >= visible_y_low) {
+                                       if ((rtv2->order() - canvas_pointer_y_span) >= visible_y_low) {
        
                                                int32_t visible_tracks = 0;
                                                while (visible_tracks < canvas_pointer_y_span ) {
                                                        visible_tracks++;
                  
-                                                       while (height_list[rtv2->order - (visible_tracks - n)] == 0) {
+                                                       while (height_list[rtv2->order() - (visible_tracks - n)] == 0) {
                                                                /* we're passing through a hidden track */
                                                                n--;
                                                        }                 
                                                }
                 
-                                               if (tracks[rtv2->order - (canvas_pointer_y_span - n)] != 0x00) {                  
+                                               if (tracks[rtv2->order() - (canvas_pointer_y_span - n)] != 0x00) {                
                                                        clamp_y_axis = true;
                                                }
                    
@@ -3777,7 +3771,7 @@ Editor::region_drag_motion_callback (ArdourCanvas::Item* item, GdkEvent* event)
 
                                        /*moving down the canvas*/
 
-                                       if ((rtv2->order - (canvas_pointer_y_span - n)) <= visible_y_high) { // we will overflow
+                                       if ((rtv2->order() - (canvas_pointer_y_span - n)) <= visible_y_high) { // we will overflow
                    
                    
                                                int32_t visible_tracks = 0;
@@ -3785,11 +3779,11 @@ Editor::region_drag_motion_callback (ArdourCanvas::Item* item, GdkEvent* event)
                                                while (visible_tracks > canvas_pointer_y_span ) {
                                                        visible_tracks--;
                      
-                                                       while (height_list[rtv2->order - (visible_tracks - n)] == 0) {             
+                                                       while (height_list[rtv2->order() - (visible_tracks - n)] == 0) {                   
                                                                n++;
                                                        }                
                                                }
-                                               if (  tracks[rtv2->order - ( canvas_pointer_y_span - n)] != 0x00) {
+                                               if (  tracks[rtv2->order() - ( canvas_pointer_y_span - n)] != 0x00) {
                                                        clamp_y_axis = true;
                            
                                                }
@@ -3802,9 +3796,9 @@ Editor::region_drag_motion_callback (ArdourCanvas::Item* item, GdkEvent* event)
                        } else {
                      
                                /* this is the pointer's track */
-                               if ((rtv2->order - pointer_y_span) > visible_y_high) { // we will overflow 
+                               if ((rtv2->order() - pointer_y_span) > visible_y_high) { // we will overflow 
                                        clamp_y_axis = true;
-                               } else if ((rtv2->order - pointer_y_span) < visible_y_low) { // we will underflow
+                               } else if ((rtv2->order() - pointer_y_span) < visible_y_low) { // we will underflow
                                        clamp_y_axis = true;
                                }
                        }             
@@ -4008,7 +4002,7 @@ Editor::region_drag_motion_callback (ArdourCanvas::Item* item, GdkEvent* event)
                                y_delta = 0;
                                int32_t x = 0;
                                for (j = height_list.begin(); j!= height_list.end(); j++) {     
-                                       if (x == canvas_rtv->order) {
+                                       if (x == canvas_rtv->order()) {
                                                /* we found the track the region is on */
                                                if (x != original_pointer_order) {
                                                        /*this isn't from the same track we're dragging from */
index 3634d468a17b9273ba58ef10aed111bdeabe02f3..61ea85568f272d3acc29677bf866fc87cc5d9054 100644 (file)
@@ -5340,11 +5340,11 @@ Editor::ensure_track_visible(TimeAxisView *track)
        if (track->hidden())
                return;
 
-       double current_view_min_y = vertical_adjustment.get_value();
-       double current_view_max_y = vertical_adjustment.get_value() + vertical_adjustment.get_page_size() - canvas_timebars_vsize;
+       double const current_view_min_y = vertical_adjustment.get_value();
+       double const current_view_max_y = vertical_adjustment.get_value() + vertical_adjustment.get_page_size() - canvas_timebars_vsize;
 
-       double track_min_y = track->y_position;
-       double track_max_y = track->y_position + (double)track->effective_height;
+       double const track_min_y = track->y_position ();
+       double const track_max_y = track->y_position () + track->effective_height ();
 
        if (track_min_y >= current_view_min_y &&
             track_max_y <= current_view_max_y) {
@@ -5358,7 +5358,7 @@ Editor::ensure_track_visible(TimeAxisView *track)
                new_value = track_min_y;
        } else {
                // Track is below the current view
-               new_value = track->y_position + (double)track->effective_height + canvas_timebars_vsize - vertical_adjustment.get_page_size();
+               new_value = track->y_position () + track->effective_height() + canvas_timebars_vsize - vertical_adjustment.get_page_size();
        }
 
        vertical_adjustment.set_value(new_value);
@@ -6216,7 +6216,7 @@ Editor::fit_tracks ()
                        continue;
                }
 
-               child_heights += ((*t)->effective_height - (*t)->current_height());
+               child_heights += (*t)->effective_height() - (*t)->current_height();
        }
 
        uint32_t h = (uint32_t) floor ((canvas_height - child_heights - canvas_timebars_vsize)/selection->tracks.size());
@@ -6251,7 +6251,7 @@ Editor::fit_tracks ()
 
                if (is_selected) {
                        (*t)->set_height (h);
-                       first_y_pos = std::min ((*t)->y_position, first_y_pos);
+                       first_y_pos = std::min ((*t)->y_position (), first_y_pos);
                } else {
                        if (prev_was_selected && next_is_selected) {
                                hide_track_in_display (**t);
index 6e368716f71e41459ff1d509ab8549fee0829544..52a1f622438a053b6b9c483da4daecb9815679f4 100644 (file)
@@ -347,6 +347,7 @@ Editor::redisplay_route_list ()
 
                bool visible = (*i)[route_display_columns.visible];
 
+               /* show or hide the TimeAxisView */
                if (visible) {
                        tv->set_marked_for_display (true);
                        position += tv->show_at (position, n, &edit_controls_vbox);
index b4532668df25df380621ab3ae0ac0712890c4124..50979c5ed5dcd83cccd2f0e6bc1830d92edd9d47 100644 (file)
@@ -49,7 +49,7 @@ using namespace Editing;
 struct TrackViewByPositionSorter
 {
     bool operator() (const TimeAxisView* a, const TimeAxisView *b) {
-           return a->y_position < b->y_position;
+           return a->y_position() < b->y_position();
     }
 };
 
index a332283634a716426a93013b113fae143068b154..7b92ab815b14b28ef203c621bca75fcc0dd5f889 100644 (file)
@@ -101,7 +101,7 @@ GhostRegion::is_automation_ghost() {
 }
 
 AudioGhostRegion::AudioGhostRegion(TimeAxisView& tv, TimeAxisView& source_tv, double initial_unit_pos)
-       : GhostRegion(tv.ghost_group, tv, source_tv, initial_unit_pos) {
+       : GhostRegion(tv.ghost_group(), tv, source_tv, initial_unit_pos) {
 }
 
 void
@@ -157,7 +157,7 @@ AudioGhostRegion::set_colors ()
  * no range controller in these tracks. maybe show the whole range.
  */
 MidiGhostRegion::MidiGhostRegion(TimeAxisView& tv, TimeAxisView& source_tv, double initial_unit_pos)
-       : GhostRegion(tv.ghost_group, tv, source_tv, initial_unit_pos)
+       : GhostRegion(tv.ghost_group(), tv, source_tv, initial_unit_pos)
 {
 
        base_rect->lower_to_bottom();
index 85ec3bd90947e9c408803a2a460f93231d5ffca8..c3b38d35e52121fb354ce182e2a8327869d43dd0 100644 (file)
@@ -205,7 +205,7 @@ MidiRegionView::canvas_event(GdkEvent* ev)
 
        static ArdourCanvas::SimpleRect* drag_rect = NULL;
 
-       if (trackview.editor.current_mouse_mode() != MouseNote)
+       if (trackview.editor().current_mouse_mode() != MouseNote)
                return false;
 
        // Mmmm, spaghetti
@@ -214,8 +214,8 @@ MidiRegionView::canvas_event(GdkEvent* ev)
        case GDK_KEY_PRESS:
                if (ev->key.keyval == GDK_Delete && !delete_mod) {
                        delete_mod = true;
-                       original_mode = trackview.editor.current_midi_edit_mode();
-                       trackview.editor.set_midi_edit_mode(MidiEditErase);
+                       original_mode = trackview.editor().current_midi_edit_mode();
+                       trackview.editor().set_midi_edit_mode(MidiEditErase);
                        start_delta_command(_("erase notes"));
                        _mouse_state = EraseTouchDragging;
                        return true;
@@ -235,7 +235,7 @@ MidiRegionView::canvas_event(GdkEvent* ev)
                                apply_command();
                        }
                        if (delete_mod) {
-                               trackview.editor.set_midi_edit_mode(original_mode);
+                               trackview.editor().set_midi_edit_mode(original_mode);
                                _mouse_state = None;
                                delete_mod = false;
                        }
@@ -272,8 +272,8 @@ MidiRegionView::canvas_event(GdkEvent* ev)
                group->w2i(event_x, event_y);
 
                // convert event_x to global frame
-               event_frame = trackview.editor.pixel_to_frame(event_x) + _region->position();
-               trackview.editor.snap_to(event_frame);
+               event_frame = trackview.editor().pixel_to_frame(event_x) + _region->position();
+               trackview.editor().snap_to(event_frame);
                // convert event_frame back to local coordinates relative to position
                event_frame -= _region->position();
 
@@ -281,7 +281,7 @@ MidiRegionView::canvas_event(GdkEvent* ev)
                case Pressed: // Drag start
 
                        // Select drag start
-                       if (_pressed_button == 1 && trackview.editor.current_midi_edit_mode() == MidiEditSelect) {
+                       if (_pressed_button == 1 && trackview.editor().current_midi_edit_mode() == MidiEditSelect) {
                                group->grab(GDK_POINTER_MOTION_MASK | GDK_BUTTON_RELEASE_MASK,
                                                Gdk::Cursor(Gdk::FLEUR), ev->motion.time);
                                last_x = event_x;
@@ -304,7 +304,7 @@ MidiRegionView::canvas_event(GdkEvent* ev)
                                return true;
 
                        // Add note drag start
-                       } else if (trackview.editor.current_midi_edit_mode() == MidiEditPencil) {
+                       } else if (trackview.editor().current_midi_edit_mode() == MidiEditPencil) {
                                group->grab(GDK_POINTER_MOTION_MASK | GDK_BUTTON_RELEASE_MASK,
                                                Gdk::Cursor(Gdk::FLEUR), ev->motion.time);
                                last_x = event_x;
@@ -313,7 +313,7 @@ MidiRegionView::canvas_event(GdkEvent* ev)
                                drag_start_y = event_y;
 
                                drag_rect = new ArdourCanvas::SimpleRect(*group);
-                               drag_rect->property_x1() = trackview.editor.frame_to_pixel(event_frame);
+                               drag_rect->property_x1() = trackview.editor().frame_to_pixel(event_frame);
 
                                drag_rect->property_y1() = midi_stream_view()->note_to_y(midi_stream_view()->y_to_note(event_y));
                                drag_rect->property_x2() = event_x;
@@ -341,7 +341,7 @@ MidiRegionView::canvas_event(GdkEvent* ev)
                        }
 
                        if (_mouse_state == AddDragging)
-                               event_x = trackview.editor.frame_to_pixel(event_frame);
+                               event_x = trackview.editor().frame_to_pixel(event_frame);
 
                        if (drag_rect) {
                                if (event_x > drag_start_x)
@@ -376,7 +376,7 @@ MidiRegionView::canvas_event(GdkEvent* ev)
                event_y = ev->motion.y;
                group->w2i(event_x, event_y);
                group->ungrab(ev->button.time);
-               event_frame = trackview.editor.pixel_to_frame(event_x);
+               event_frame = trackview.editor().pixel_to_frame(event_x);
 
                if (_pressed_button != 1) {
                        return false;
@@ -384,7 +384,7 @@ MidiRegionView::canvas_event(GdkEvent* ev)
                        
                switch (_mouse_state) {
                case Pressed: // Clicked
-                       switch (trackview.editor.current_midi_edit_mode()) {
+                       switch (trackview.editor().current_midi_edit_mode()) {
                        case MidiEditSelect:
                        case MidiEditResize:
                                clear_selection();
@@ -404,7 +404,7 @@ MidiRegionView::canvas_event(GdkEvent* ev)
                        _mouse_state = None;
                        if (drag_rect->property_x2() > drag_rect->property_x1() + 2) {
                                const double x      = drag_rect->property_x1();
-                               const double length = trackview.editor.pixel_to_frame(
+                               const double length = trackview.editor().pixel_to_frame(
                                                        drag_rect->property_x2() - drag_rect->property_x1());
                                        
                                create_note_at(x, drag_rect->property_y1(), length);
@@ -434,7 +434,7 @@ MidiRegionView::create_note_at(double x, double y, double length)
        assert(note >= 0.0);
        assert(note <= 127.0);
 
-       nframes64_t new_note_time = trackview.editor.pixel_to_frame (x);
+       nframes64_t new_note_time = trackview.editor().pixel_to_frame (x);
        assert(new_note_time >= 0);
        new_note_time += _region->start();
 
@@ -773,7 +773,7 @@ MidiRegionView::apply_note_range (uint8_t min, uint8_t max, bool force)
                                                note->property_y1() = y1;
                                                note->property_y2() = y2;
                                        } else if (CanvasHit* hit = dynamic_cast<CanvasHit*>(event)) {
-                                               double x = trackview.editor.frame_to_pixel((nframes64_t)
+                                               double x = trackview.editor().frame_to_pixel((nframes64_t)
                                                                event->note()->time() - _region->start());
                                                const double diamond_size = midi_stream_view()->note_height() / 2.0;
                                                double y = midi_stream_view()->note_to_y(event->note()->note()) 
@@ -864,7 +864,7 @@ MidiRegionView::resolve_note(uint8_t note, double end_time)
                return;
 
        if (_active_notes && _active_notes[note]) {
-               _active_notes[note]->property_x2() = trackview.editor.frame_to_pixel((nframes64_t)end_time);
+               _active_notes[note]->property_x2() = trackview.editor().frame_to_pixel((nframes64_t)end_time);
                _active_notes[note]->property_outline_what() = (guint32) 0xF; // all edges
                _active_notes[note] = NULL;
        }
@@ -882,7 +882,7 @@ MidiRegionView::extend_active_notes()
 
        for (unsigned i=0; i < 128; ++i) {
                if (_active_notes[i]) {
-                       _active_notes[i]->property_x2() = trackview.editor.frame_to_pixel(_region->length());
+                       _active_notes[i]->property_x2() = trackview.editor().frame_to_pixel(_region->length());
                }
        }
 }
@@ -890,7 +890,7 @@ MidiRegionView::extend_active_notes()
 void 
 MidiRegionView::play_midi_note(boost::shared_ptr<Evoral::Note> note)
 {
-       if (!trackview.editor.is_midi_sound_notes_active()) {
+       if (!trackview.editor().is_midi_sound_notes_active()) {
                cerr << "not_active " << endl;
                return;
        }
@@ -942,13 +942,13 @@ MidiRegionView::add_note(const boost::shared_ptr<Evoral::Note> note)
 
        CanvasNoteEvent* event = 0;
        
-       const double x = trackview.editor.frame_to_pixel((nframes64_t)note->time() - _region->start());
+       const double x = trackview.editor().frame_to_pixel((nframes64_t)note->time() - _region->start());
        
        if (midi_view()->note_mode() == Sustained) {
 
                const double y1 = midi_stream_view()->note_to_y(note->note());
                const double note_endpixel = 
-                       trackview.editor.frame_to_pixel((nframes64_t)note->end_time() - _region->start());
+                       trackview.editor().frame_to_pixel((nframes64_t)note->end_time() - _region->start());
                
                CanvasNote* ev_rect = new CanvasNote(*this, *group, note);
                ev_rect->property_x1() = x;
@@ -956,7 +956,7 @@ MidiRegionView::add_note(const boost::shared_ptr<Evoral::Note> note)
                if (note->length() > 0)
                        ev_rect->property_x2() = note_endpixel;
                else
-                       ev_rect->property_x2() = trackview.editor.frame_to_pixel(_region->length());
+                       ev_rect->property_x2() = trackview.editor().frame_to_pixel(_region->length());
                ev_rect->property_y2() = y1 + floor(midi_stream_view()->note_height());
 
                if (note->length() == 0) {
@@ -1030,7 +1030,7 @@ MidiRegionView::add_pgm_change(ControlEvent& program, string displaytext)
                return;
        
        ArdourCanvas::Group* const group = (ArdourCanvas::Group*)get_canvas_group();
-       const double x = trackview.editor.frame_to_pixel((nframes64_t)program.time - _region->start());
+       const double x = trackview.editor().frame_to_pixel((nframes64_t)program.time - _region->start());
        
        double height = midi_stream_view()->contents_height();
        
@@ -1387,7 +1387,7 @@ MidiRegionView::note_dropped(CanvasNoteEvent* ev, double dt, uint8_t dnote)
 nframes64_t
 MidiRegionView::snap_to_frame(double x)
 {
-       PublicEditor &editor = trackview.editor;
+       PublicEditor &editor = trackview.editor();
        // x is region relative
        // convert x to global frame
        nframes64_t frame = editor.pixel_to_frame(x) + _region->position();
@@ -1400,7 +1400,7 @@ MidiRegionView::snap_to_frame(double x)
 nframes64_t
 MidiRegionView::snap_to_frame(nframes64_t x)
 {
-       PublicEditor &editor = trackview.editor;
+       PublicEditor &editor = trackview.editor();
        // x is region relative
        // convert x to global frame
        nframes64_t frame = x + _region->position();
@@ -1413,14 +1413,14 @@ MidiRegionView::snap_to_frame(nframes64_t x)
 double
 MidiRegionView::snap_to_pixel(double x)
 {
-       return (double) trackview.editor.frame_to_pixel(snap_to_frame(x));
+       return (double) trackview.editor().frame_to_pixel(snap_to_frame(x));
 }
 
 double
 MidiRegionView::get_position_pixels()
 {
        nframes64_t region_frame = get_position();
-       return trackview.editor.frame_to_pixel(region_frame);
+       return trackview.editor().frame_to_pixel(region_frame);
 }
 
 void
index 4a5b1eb23273a70aeab5430927e08982d48233c3..4646729c42ee8adebfbbe53330d3ce182fdae1b6 100644 (file)
@@ -67,7 +67,7 @@ MidiStreamView::MidiStreamView (MidiTimeAxisView& tv)
        else
                stream_base_color = ARDOUR_UI::config()->canvasvar_MidiBusBase.get();
 
-       use_rec_regions = tv.editor.show_waveforms_recording ();
+       use_rec_regions = tv.editor().show_waveforms_recording ();
 
        /* use a group dedicated to MIDI underlays. Audio underlays are not in this group. */
        midi_underlay_group = new ArdourCanvas::Group (*canvas_group);
@@ -79,10 +79,10 @@ MidiStreamView::MidiStreamView (MidiTimeAxisView& tv)
 
        _note_lines->property_x1() = 0;
        _note_lines->property_y1() = 0;
-       _note_lines->property_x2() = trackview().editor.frame_to_pixel (max_frames);
+       _note_lines->property_x2() = trackview().editor().frame_to_pixel (max_frames);
        _note_lines->property_y2() = 0;
 
-       _note_lines->signal_event().connect (bind (mem_fun (_trackview.editor, &PublicEditor::canvas_stream_view_event), _note_lines, &_trackview));
+       _note_lines->signal_event().connect (bind (mem_fun (_trackview.editor(), &PublicEditor::canvas_stream_view_event), _note_lines, &_trackview));
        _note_lines->lower_to_bottom();
 
        ColorsChanged.connect(mem_fun(*this, &MidiStreamView::draw_note_lines));
@@ -457,7 +457,7 @@ MidiStreamView::setup_rec_box ()
                        boost::shared_ptr<MidiTrack> mt = _trackview.midi_track(); /* we know what it is already */
                        boost::shared_ptr<MidiDiskstream> ds = mt->midi_diskstream();
                        jack_nframes_t frame_pos = ds->current_capture_start ();
-                       gdouble xstart = _trackview.editor.frame_to_pixel (frame_pos);
+                       gdouble xstart = _trackview.editor().frame_to_pixel (frame_pos);
                        gdouble xend;
                        uint32_t fill_color;
 
@@ -595,7 +595,7 @@ MidiStreamView::update_rec_regions (boost::shared_ptr<MidiModel> data, nframes_t
 
                                                /* also update rect */
                                                ArdourCanvas::SimpleRect * rect = rec_rects[n].rectangle;
-                                               gdouble xend = _trackview.editor.frame_to_pixel (region->position() + region->length());
+                                               gdouble xend = _trackview.editor().frame_to_pixel (region->position() + region->length());
                                                rect->property_x2() = xend;
 
                                                /* draw events */
index 0911b7198eb596dc49a44a11a80676975643e9b4..2f5c80497c8f1168245df12c7e469906e93b0691 100644 (file)
@@ -450,7 +450,7 @@ MidiTimeAxisView::add_cc_track()
 
        {
                AddMidiCCTrackDialog dialog;
-               dialog.set_transient_for(editor);
+               dialog.set_transient_for (_editor);
                response = dialog.run();
                
                if (response == Gtk::RESPONSE_ACCEPT)
@@ -496,7 +496,7 @@ MidiTimeAxisView::create_automation_child (const Evoral::Parameter& param, bool
 
                boost::shared_ptr<AutomationTimeAxisView> track(new AutomationTimeAxisView (_session,
                                _route, boost::shared_ptr<ARDOUR::Automatable>(), c,
-                               editor,
+                               _editor,
                                *this,
                                true,
                                parent_canvas,
index 204148bd7736e73a4f2ac2827b115f0fd816fc07..2528e350fc9279d3589e51c081884d5493d59b09 100644 (file)
@@ -69,7 +69,7 @@ AudioRegionGainLine::remove_point (ControlPoint& cp)
 
        model_representation (cp, mr);
 
-       trackview.editor.current_session()->begin_reversible_command (_("remove control point"));
+       trackview.editor().current_session()->begin_reversible_command (_("remove control point"));
        XMLNode &before = alist->get_state();
 
        if (!rv.audio_region()->envelope_active()) {
@@ -81,9 +81,9 @@ AudioRegionGainLine::remove_point (ControlPoint& cp)
        
        alist->erase (mr.start, mr.end);
 
-       trackview.editor.current_session()->add_command (new MementoCommand<AutomationList>(*alist.get(), &before, &alist->get_state()));
-       trackview.editor.current_session()->commit_reversible_command ();
-       trackview.editor.current_session()->set_dirty ();
+       trackview.editor().current_session()->add_command (new MementoCommand<AutomationList>(*alist.get(), &before, &alist->get_state()));
+       trackview.editor().current_session()->commit_reversible_command ();
+       trackview.editor().current_session()->set_dirty ();
 }
 
 void
index 2e4eaaadcd08a5f82922481aa0685668c1bd4610..d1970138c5dde1e345eda16613b772f4c48f9874 100644 (file)
@@ -268,10 +268,10 @@ struct RegionSortByTrack {
            
            /* really, track and position */
 
-           if (a->get_trackview().order == b->get_trackview().order) {
+           if (a->get_trackview().order() == b->get_trackview().order()) {
                    return a->region()->position() < b->region()->position();
            } else {
-                   return a->get_trackview().order < b->get_trackview().order;
+                   return a->get_trackview().order() < b->get_trackview().order();
            }
     }
 };
index fc0253a27239fec64d48eef342461e192841b402..8ceef8138e1255c66d843de210107c17c9f97cde 100644 (file)
@@ -643,14 +643,14 @@ RegionView::update_coverage_frames (LayerDisplay d)
 
                /* finish off any old rect, if required */
                if (cr && me != new_me) {
-                       cr->property_x2() = trackview.editor.frame_to_pixel (t - position);
+                       cr->property_x2() = trackview.editor().frame_to_pixel (t - position);
                }
 
                /* start off any new rect, if required */
                if (cr == 0 || me != new_me) {
                        cr = new ArdourCanvas::SimpleRect (*group);
                        _coverage_frames.push_back (cr);
-                       cr->property_x1() = trackview.editor.frame_to_pixel (t - position);
+                       cr->property_x1() = trackview.editor().frame_to_pixel (t - position);
                        cr->property_y1() = 1;
                        cr->property_y2() = _height + 1;
                        cr->property_outline_pixels() = 0;
@@ -668,6 +668,6 @@ RegionView::update_coverage_frames (LayerDisplay d)
 
        if (cr) {
                /* finish off the last rectangle */
-               cr->property_x2() = trackview.editor.frame_to_pixel (end - position);
+               cr->property_x2() = trackview.editor().frame_to_pixel (end - position);
        }
 }
index 460213759a04c254806239ece4e1a0715891bd46..616636054224becec850e7df033e4a464bf77534 100644 (file)
@@ -220,7 +220,7 @@ RouteTimeAxisView::RouteTimeAxisView (PublicEditor& ed, Session& sess, boost::sh
                controls_table.attach (playlist_button, 5, 6, 1, 2, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND);
        }
 
-       y_position = -1;
+       _y_position = -1;
 
        _route->mute_changed.connect (mem_fun(*this, &RouteUI::mute_changed));
        _route->solo_changed.connect (mem_fun(*this, &RouteUI::solo_changed));
@@ -241,7 +241,7 @@ RouteTimeAxisView::RouteTimeAxisView (PublicEditor& ed, Session& sess, boost::sh
 
        }
 
-       editor.ZoomChanged.connect (mem_fun(*this, &RouteTimeAxisView::reset_samples_per_unit));
+       _editor.ZoomChanged.connect (mem_fun(*this, &RouteTimeAxisView::reset_samples_per_unit));
        ColorsChanged.connect (mem_fun (*this, &RouteTimeAxisView::color_handler));
 
        gm.get_gain_slider().signal_scroll_event().connect(mem_fun(*this, &RouteTimeAxisView::controls_ebox_scroll), false);
@@ -372,7 +372,7 @@ RouteTimeAxisView::label_view ()
 void
 RouteTimeAxisView::route_name_changed ()
 {
-       editor.route_name_changed (this);
+       _editor.route_name_changed (this);
        label_view ();
 }
 
@@ -716,7 +716,7 @@ RouteTimeAxisView::show_timestretch (nframes_t start, nframes_t end)
 #endif
 
        if (timestretch_rect == 0) {
-               timestretch_rect = new SimpleRect (*canvas_display);
+               timestretch_rect = new SimpleRect (*canvas_display ());
                timestretch_rect->property_x1() =  0.0;
                timestretch_rect->property_y1() =  0.0;
                timestretch_rect->property_x2() =  0.0;
@@ -728,8 +728,8 @@ RouteTimeAxisView::show_timestretch (nframes_t start, nframes_t end)
        timestretch_rect->show ();
        timestretch_rect->raise_to_top ();
 
-       x1 = start / editor.get_current_zoom();
-       x2 = (end - 1) / editor.get_current_zoom();
+       x1 = start / _editor.get_current_zoom();
+       x2 = (end - 1) / _editor.get_current_zoom();
        y2 = current_height() - 2;
        
        timestretch_rect->property_x1() = x1;
@@ -882,7 +882,7 @@ RouteTimeAxisView::select_track_color ()
 void
 RouteTimeAxisView::reset_samples_per_unit ()
 {
-       set_samples_per_unit (editor.get_current_zoom());
+       set_samples_per_unit (_editor.get_current_zoom());
 }
 
 void
@@ -1120,7 +1120,7 @@ RouteTimeAxisView::clear_playlist ()
        if (!pl)
                return;
 
-       editor.clear_playlist (pl);
+       _editor.clear_playlist (pl);
 }
 
 void
@@ -1151,38 +1151,38 @@ RouteTimeAxisView::selection_click (GdkEventButton* ev)
        if (Keyboard::modifier_state_equals (ev->state, (Keyboard::TertiaryModifier|Keyboard::PrimaryModifier))) {
 
                /* special case: select/deselect all tracks */
-               if (editor.get_selection().selected (this)) {
-                       editor.get_selection().clear_tracks ();
+               if (_editor.get_selection().selected (this)) {
+                       _editor.get_selection().clear_tracks ();
                } else {
-                       editor.select_all_tracks ();
+                       _editor.select_all_tracks ();
                }
 
                return;
        } 
 
-       PublicEditor::TrackViewList* tracks = editor.get_valid_views (this, _route->edit_group());
+       PublicEditor::TrackViewList* tracks = _editor.get_valid_views (this, _route->edit_group());
 
        switch (Keyboard::selection_type (ev->state)) {
        case Selection::Toggle:
-               editor.get_selection().toggle (*tracks);
+               _editor.get_selection().toggle (*tracks);
                break;
                
        case Selection::Set:
-               editor.get_selection().set (*tracks);
+               _editor.get_selection().set (*tracks);
                break;
 
        case Selection::Extend:
                if (tracks->size() > 1) {
                        /* add each one, do not "extend" */
-                       editor.get_selection().add (*tracks);
+                       _editor.get_selection().add (*tracks);
                } else {
                        /* extend to the single track */
-                       editor.extend_selection_to_track (*tracks->front());
+                       _editor.extend_selection_to_track (*tracks->front());
                }
                break;
 
        case Selection::Add:
-               editor.get_selection().add (*tracks);
+               _editor.get_selection().add (*tracks);
                break;
        }
 
@@ -1339,7 +1339,7 @@ RouteTimeAxisView::hide_click ()
        // LAME fix for hide_button refresh fix
        hide_button.set_sensitive(false);
        
-       editor.hide_track_in_display (*this);
+       _editor.hide_track_in_display (*this);
        
        hide_button.set_sensitive(true);
 }
@@ -1398,14 +1398,14 @@ RouteTimeAxisView::cut_copy_clear (Selection& selection, CutCopyOp op)
        switch (op) {
        case Cut:
                if ((what_we_got = playlist->cut (time)) != 0) {
-                       editor.get_cut_buffer().add (what_we_got);
+                       _editor.get_cut_buffer().add (what_we_got);
                        _session.add_command( new MementoCommand<Playlist>(*playlist.get(), &before, &playlist->get_state()));
                        ret = true;
                }
                break;
        case Copy:
                if ((what_we_got = playlist->copy (time)) != 0) {
-                       editor.get_cut_buffer().add (what_we_got);
+                       _editor.get_cut_buffer().add (what_we_got);
                }
                break;
 
@@ -1508,18 +1508,18 @@ RouteTimeAxisView::build_playlist_menu (Gtk::Menu * menu)
        playlist_items.push_back (SeparatorElem());
 
        if (!edit_group() || !edit_group()->is_active()) {
-               playlist_items.push_back (MenuElem (_("New"), bind(mem_fun(editor, &PublicEditor::new_playlists), this)));
-               playlist_items.push_back (MenuElem (_("New Copy"), bind(mem_fun(editor, &PublicEditor::copy_playlists), this)));
+               playlist_items.push_back (MenuElem (_("New"), bind(mem_fun(_editor, &PublicEditor::new_playlists), this)));
+               playlist_items.push_back (MenuElem (_("New Copy"), bind(mem_fun(_editor, &PublicEditor::copy_playlists), this)));
 
        } else {
                // Use a label which tells the user what is happening
-               playlist_items.push_back (MenuElem (_("New Take"), bind(mem_fun(editor, &PublicEditor::new_playlists), this)));
-               playlist_items.push_back (MenuElem (_("Copy Take"), bind(mem_fun(editor, &PublicEditor::copy_playlists), this)));
+               playlist_items.push_back (MenuElem (_("New Take"), bind(mem_fun(_editor, &PublicEditor::new_playlists), this)));
+               playlist_items.push_back (MenuElem (_("Copy Take"), bind(mem_fun(_editor, &PublicEditor::copy_playlists), this)));
                
        }
 
        playlist_items.push_back (SeparatorElem());
-       playlist_items.push_back (MenuElem (_("Clear Current"), bind(mem_fun(editor, &PublicEditor::clear_playlists), this)));
+       playlist_items.push_back (MenuElem (_("Clear Current"), bind(mem_fun(_editor, &PublicEditor::clear_playlists), this)));
        playlist_items.push_back (SeparatorElem());
 
        playlist_items.push_back (MenuElem(_("Select from all ..."), mem_fun(*this, &RouteTimeAxisView::show_playlist_selector)));
@@ -1590,7 +1590,7 @@ RouteTimeAxisView::use_playlist (boost::weak_ptr<Playlist> wpl)
 void
 RouteTimeAxisView::show_playlist_selector ()
 {
-       editor.playlist_selector().show_for (this);
+       _editor.playlist_selector().show_for (this);
 }
 
 void
@@ -1642,7 +1642,7 @@ RouteTimeAxisView::toggle_automation_track (Evoral::Parameter param)
        if (showit != node->track->marked_for_display()) {
                if (showit) {
                        node->track->set_marked_for_display (true);
-                       node->track->canvas_display->show();
+                       node->track->canvas_display()->show();
                        node->track->get_state_node()->add_property ("shown", X_("yes"));
                } else {
                        node->track->set_marked_for_display (false);
@@ -1687,7 +1687,7 @@ RouteTimeAxisView::show_all_automation ()
        map<Evoral::Parameter, RouteAutomationNode*>::iterator i;
        for (i = _automation_tracks.begin(); i != _automation_tracks.end(); ++i) {
                i->second->track->set_marked_for_display (true);
-               i->second->track->canvas_display->show();
+               i->second->track->canvas_display()->show();
                i->second->track->get_state_node()->add_property ("shown", X_("yes"));
                i->second->menu_item->set_active(true);
        }
@@ -1723,7 +1723,7 @@ RouteTimeAxisView::show_existing_automation ()
        for (i = _automation_tracks.begin(); i != _automation_tracks.end(); ++i) {
                if (i->second->track->line() && i->second->track->line()->npoints() > 0) {
                        i->second->track->set_marked_for_display (true);
-                       i->second->track->canvas_display->show();
+                       i->second->track->canvas_display()->show();
                        i->second->track->get_state_node()->add_property ("shown", X_("yes"));
                        i->second->menu_item->set_active(true);
                }
@@ -1884,7 +1884,7 @@ RouteTimeAxisView::add_processor_automation_curve (boost::shared_ptr<Processor>
 
        pan->view = boost::shared_ptr<AutomationTimeAxisView>(
                        new AutomationTimeAxisView (_session, _route, processor, control,
-                               editor, *this, false, parent_canvas, name, state_name));
+                               _editor, *this, false, parent_canvas, name, state_name));
 
        pan->view->Hiding.connect (bind (mem_fun(*this, &RouteTimeAxisView::processor_automation_track_hidden), pan, processor));
 
@@ -2082,8 +2082,8 @@ RouteTimeAxisView::processor_menu_item_toggled (RouteTimeAxisView::ProcessorAuto
 
                if (showit) {
                        pan->view->set_marked_for_display (true);
-                       pan->view->canvas_display->show();
-                       pan->view->canvas_background->show();
+                       pan->view->canvas_display()->show();
+                       pan->view->canvas_background()->show();
                } else {
                        rai->processor->mark_automation_visible (pan->what, true);
                        pan->view->set_marked_for_display (false);
@@ -2271,12 +2271,12 @@ RouteTimeAxisView::set_underlay_state()
                }
 
                XMLProperty* prop = child_node->property ("id");
-               if(prop) {
-                       PBD::ID id(prop->value());
+               if (prop) {
+                       PBD::ID id (prop->value());
 
-                       RouteTimeAxisView* v = editor.get_route_view_by_id(id);
+                       RouteTimeAxisView* v = _editor.get_route_view_by_id (id);
 
-                       if(v) {
+                       if (v) {
                                add_underlay(v->view(), false);
                        }
                }
index 692d1a1e57a0c96113862c20921e487eacc5cc41..9831bf742f7c48d30cae4eafec6e5aa79301e487 100644 (file)
@@ -48,12 +48,12 @@ using namespace Editing;
 StreamView::StreamView (RouteTimeAxisView& tv, ArdourCanvas::Group* group)
        : _trackview (tv)
        , owns_canvas_group(group == 0)
-       , _background_group(new ArdourCanvas::Group(*_trackview.canvas_background))
-       , canvas_group(group ? group : new ArdourCanvas::Group(*_trackview.canvas_display))
-       , _samples_per_unit(_trackview.editor.get_current_zoom())
+       , _background_group (new ArdourCanvas::Group (*_trackview.canvas_background()))
+       , canvas_group(group ? group : new ArdourCanvas::Group(*_trackview.canvas_display()))
+       , _samples_per_unit (_trackview.editor().get_current_zoom ())
        , rec_updating(false)
        , rec_active(false)
-       , use_rec_regions(tv.editor.show_waveforms_recording())
+       , use_rec_regions (tv.editor().show_waveforms_recording ())
        , region_color(_trackview.color())
        , stream_base_color(0xFFFFFFFF)
        , layers(1)
@@ -66,7 +66,7 @@ StreamView::StreamView (RouteTimeAxisView& tv, ArdourCanvas::Group* group)
        canvas_rect = new ArdourCanvas::SimpleRect (*_background_group);
        canvas_rect->property_x1() = 0.0;
        canvas_rect->property_y1() = 0.0;
-       canvas_rect->property_x2() = _trackview.editor.get_physical_screen_width();
+       canvas_rect->property_x2() = _trackview.editor().get_physical_screen_width ();
        canvas_rect->property_y2() = (double) tv.current_height();
        canvas_rect->raise(1); // raise above tempo lines
 
@@ -76,7 +76,7 @@ StreamView::StreamView (RouteTimeAxisView& tv, ArdourCanvas::Group* group)
        //canvas_rect->property_outline_what() = (guint32) (0x1|0x2|0x8);  // outline ends and bottom 
        // (Fill/Outline colours set in derived classes)
 
-       canvas_rect->signal_event().connect (bind (mem_fun (_trackview.editor, &PublicEditor::canvas_stream_view_event), canvas_rect, &_trackview));
+       canvas_rect->signal_event().connect (bind (mem_fun (_trackview.editor(), &PublicEditor::canvas_stream_view_event), canvas_rect, &_trackview));
 
        if (_trackview.is_track()) {
                _trackview.track()->DiskstreamChanged.connect (mem_fun (*this, &StreamView::diskstream_changed));
@@ -151,8 +151,8 @@ StreamView::set_samples_per_unit (gdouble spp)
        for (vector<RecBoxInfo>::iterator xi = rec_rects.begin(); xi != rec_rects.end(); ++xi) {
                RecBoxInfo &recbox = (*xi);
                
-               gdouble xstart = _trackview.editor.frame_to_pixel ( recbox.start );
-               gdouble xend = _trackview.editor.frame_to_pixel ( recbox.start + recbox.length );
+               gdouble xstart = _trackview.editor().frame_to_pixel (recbox.start);
+               gdouble xend = _trackview.editor().frame_to_pixel (recbox.start + recbox.length);
 
                recbox.rectangle->property_x1() = xstart;
                recbox.rectangle->property_x2() = xend;
@@ -351,14 +351,14 @@ StreamView::update_rec_box ()
                switch (_trackview.track()->mode()) {
                case Normal:
                        rect.length = at - rect.start;
-                       xstart = _trackview.editor.frame_to_pixel (rect.start);
-                       xend = _trackview.editor.frame_to_pixel (at);
+                       xstart = _trackview.editor().frame_to_pixel (rect.start);
+                       xend = _trackview.editor().frame_to_pixel (at);
                        break;
                        
                case Destructive:
                        rect.length = 2;
-                       xstart = _trackview.editor.frame_to_pixel (_trackview.get_diskstream()->current_capture_start());
-                       xend = _trackview.editor.frame_to_pixel (at);
+                       xstart = _trackview.editor().frame_to_pixel (_trackview.get_diskstream()->current_capture_start());
+                       xend = _trackview.editor().frame_to_pixel (at);
                        break;
                }
                
index 97758765b6558242b606f3c18b38e8084d8a8cfc..2eac4c53eebd3913c752c9bc3b51f330201e3ce2 100644 (file)
 
  TimeAxisView::TimeAxisView (ARDOUR::Session& sess, PublicEditor& ed, TimeAxisView* rent, Canvas& canvas) 
         : AxisView (sess), 
-          editor (ed),
-          y_position(0),
-          order(0),
-          controls_table (2, 8)
+          controls_table (2, 8),
+          _y_position (0),
+          _editor (ed),
+          _order (0)
  {
         if (need_size_info) {
                 compute_controls_size_info ();
                 need_size_info = false;
         }
-        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_background = new Group (*ed.get_background_group (), 0.0, 0.0);
+        _canvas_display = new Group (*ed.get_trackview_group (), 0.0, 0.0);
 
-        selection_group = new Group (*canvas_display);
+        selection_group = new Group (*_canvas_display);
         selection_group->hide();
 
-        ghost_group = new Group (*canvas_display);
-        ghost_group->lower_to_bottom();
-        ghost_group->show();
+        _ghost_group = new Group (*_canvas_display);
+        _ghost_group->lower_to_bottom();
+        _ghost_group->show();
 
         control_parent = 0;
         display_menu = 0;
         _hidden = false;
         in_destructor = false;
         height = 0;
-        effective_height = 0;
+        _effective_height = 0;
         parent = rent;
         _has_state = false;
         last_name_entry_key_press_event = 0;
         name_packing = NamePackingBits (0);
-        resize_drag_start = -1;
+        _resize_drag_start = -1;
 
         /*
           Create the standard LHS Controls
         delete selection_group;
         selection_group = 0;
 
-        delete canvas_background;
-        canvas_background = 0;
+        delete _canvas_background;
+        _canvas_background = 0;
 
-        delete canvas_display;
-        canvas_display = 0;
+        delete _canvas_display;
+        _canvas_display = 0;
 
         delete display_menu;
         display_menu = 0;
  }
 
+/** Display this TimeAxisView as the nth component of the parent box, at y.
+ *
+ * @param y y position.
+ * @param nth index for this TimeAxisView, increased if this view has children.
+ * @param parent parent component.
+ * @return height of this TimeAxisView.
+ */
  guint32
  TimeAxisView::show_at (double y, int& nth, VBox *parent)
  {
                 parent->reorder_child (controls_hbox, nth);
         }
 
-        order = nth;
+        _order = nth;
 
-        if (y_position != y) {
-                canvas_display->property_y () = y;
-                canvas_background->property_y () = y;
+        if (_y_position != y) {
+                _canvas_display->property_y () = y;
+                _canvas_background->property_y () = y;
                 /* silly canvas */
-                canvas_display->move (0.0, 0.0);
-                canvas_background->move (0.0, 0.0);
-                y_position = y;
+                _canvas_display->move (0.0, 0.0);
+                _canvas_background->move (0.0, 0.0);
+                _y_position = y;
 
         }
 
-        canvas_background->raise_to_top ();
-        canvas_display->raise_to_top ();
+        _canvas_background->raise_to_top ();
+        _canvas_display->raise_to_top ();
 
         if (_marked_for_display) {
                 controls_hbox.show ();
                 controls_ebox.show ();
-                canvas_background->show ();
+                _canvas_background->show ();
         }
 
         _hidden = false;
 
-        effective_height = current_height();
+        _effective_height = current_height ();
 
         /* now show children */
 
         for (Children::iterator i = children.begin(); i != children.end(); ++i) {
-                if (canvas_item_visible ((*i)->canvas_display)) {
+                if (canvas_item_visible ((*i)->_canvas_display)) {
                         ++nth;
-                        effective_height += (*i)->show_at (y + effective_height, nth, parent);
+                        _effective_height += (*i)->show_at (y + _effective_height, nth, parent);
                 }
         }
 
-        return effective_height;
+        return _effective_height;
  }
 
  void
  TimeAxisView::clip_to_viewport ()
  {
         if (_marked_for_display) {
-                if (y_position  +  effective_height < editor.get_trackview_group_vertical_offset () || y_position > editor.get_trackview_group_vertical_offset () + canvas_display->get_canvas()->get_height()) {
-                        canvas_background->hide ();
-                        canvas_display->hide ();
+                if (_y_position + _effective_height < _editor.get_trackview_group_vertical_offset () || _y_position > _editor.get_trackview_group_vertical_offset () + _canvas_display->get_canvas()->get_height()) {
+                        _canvas_background->hide ();
+                        _canvas_display->hide ();
                         return;
                 }
-                canvas_background->show();
-                canvas_display->show ();
+                _canvas_background->show ();
+                _canvas_display->show ();
         }
         return;
  }
                         step_height (true);
                         return true;
                 } else if (Keyboard::no_modifiers_active (ev->state)) {
-                        editor.scroll_tracks_up_line();
+                        _editor.scroll_tracks_up_line();
                         return true;
                 }
                 break;
                         step_height (false);
                         return true;
                 } else if (Keyboard::no_modifiers_active (ev->state)) {
-                        editor.scroll_tracks_down_line();
+                        _editor.scroll_tracks_down_line();
                         return true;
                 }
                 break;
  TimeAxisView::selection_click (GdkEventButton* ev)
  {
         Selection::Operation op = Keyboard::selection_type (ev->state);
-        editor.set_selected_track (*this, op, false);
+        _editor.set_selected_track (*this, op, false);
  }
 
  void
                 return;
         }
 
-        canvas_display->hide();
-        canvas_background->hide();
+        _canvas_display->hide ();
+        _canvas_background->hide ();
         controls_frame.hide ();
 
         if (control_parent) {
                 control_parent = 0;
         }
 
-        y_position = -1;
+        _y_position = -1;
         _hidden = true;
 
         /* now hide children */
 
         /* if its hidden, it cannot be selected */
 
-        editor.get_selection().remove (this);
+        _editor.get_selection().remove (this);
 
         Hiding ();
  }
  void
  TimeAxisView::set_heights (uint32_t h)
  {
-        TrackSelection& ts (editor.get_selection().tracks);
+        TrackSelection& ts (_editor.get_selection().tracks);
 
         for (TrackSelection::iterator i = ts.begin(); i != ts.end(); ++i) {
                 (*i)->set_height (h);
 
         if (canvas_item_visible (selection_group)) {
                 /* resize the selection rect */
-                show_selection (editor.get_selection().time);
+                show_selection (_editor.get_selection().time);
         }
 
         reshow_feature_lines ();
         case GDK_ISO_Left_Tab:
         case GDK_Tab:
                 name_entry_changed ();
-                allviews = editor.get_valid_views (0);
+                allviews = _editor.get_valid_views (0);
                 if (allviews != 0) {
                         i = find (allviews->begin(), allviews->end(), this);
                         if (ev->keyval == GDK_Tab) {
  void
  TimeAxisView::conditionally_add_to_selection ()
  {
-        Selection& s (editor.get_selection());
+        Selection& s (_editor.get_selection ());
 
         if (!s.selected (this)) {
-                editor.set_selected_track (*this, Selection::Set);
+                _editor.set_selected_track (*this, Selection::Set);
         }
  }
 
                 controls_vbox.set_name (controls_base_selected_name);
                 /* propagate any existing selection, if the mode is right */
 
-                if (editor.current_mouse_mode() == Editing::MouseRange && !editor.get_selection().time.empty()) {
-                        show_selection (editor.get_selection().time);
+                if (_editor.current_mouse_mode() == Editing::MouseRange && !_editor.get_selection().time.empty()) {
+                        show_selection (_editor.get_selection().time);
                 }
 
         } else {
         list<ArdourCanvas::SimpleLine*>::iterator l;
 
         for (i = analysis_features.begin(), l = feature_lines.begin(); i != analysis_features.end() && l != feature_lines.end(); ++i, ++l) {
-                (*l)->property_x1() = editor.frame_to_pixel (*i);
-                (*l)->property_x2() = editor.frame_to_pixel (*i);
+                (*l)->property_x1() = _editor.frame_to_pixel (*i);
+                (*l)->property_x2() = _editor.frame_to_pixel (*i);
         }
  }
 
 
                 rect = get_selection_rect ((*i).id);
 
-                x1 = editor.frame_to_unit (start);
-                x2 = editor.frame_to_unit (start + cnt - 1);
+                x1 = _editor.frame_to_unit (start);
+                x2 = _editor.frame_to_unit (start + cnt - 1);
                 y2 = current_height();
 
                 rect->rect->property_x1() = x1;
 
                 free_selection_rects.push_front (rect);
 
-                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->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();
@@ -948,11 +955,11 @@ TimeAxisView::touched (double top, double bot)
           y_position is the "origin" or "top" of the track.
         */
 
-       double mybot = y_position + current_height();
+       double mybot = _y_position + current_height();
        
-       return ((y_position <= bot && y_position >= top) || 
+       return ((_y_position <= bot && _y_position >= top) || 
                ((mybot <= bot) && (top < mybot)) || 
-               (mybot >= bot && y_position < top));
+               (mybot >= bot && _y_position < top));
 }              
 
 void
@@ -1184,6 +1191,10 @@ TimeAxisView::color_handler ()
        }
 }
 
+/** Returns a TimeAxisView* if this object covers y, or one of its children does.
+ * If the covering object is a child axis, then the child is returned.
+ * Returns 0 otherwise.
+ */
 TimeAxisView*
 TimeAxisView::covers_y_position (double y)
 {
@@ -1191,7 +1202,7 @@ TimeAxisView::covers_y_position (double y)
                return 0;
        }
 
-       if (y_position <= y && y < (y_position + height)) {
+       if (_y_position <= y && y < (_y_position + height)) {
                return this;
        }
 
@@ -1228,7 +1239,7 @@ void
 TimeAxisView::reshow_feature_lines ()
 {
        while (feature_lines.size()< analysis_features.size()) {
-               ArdourCanvas::SimpleLine* l = new ArdourCanvas::SimpleLine (*canvas_display);
+               ArdourCanvas::SimpleLine* l = new ArdourCanvas::SimpleLine (*_canvas_display);
                l->property_color_rgba() = (guint) ARDOUR_UI::config()->canvasvar_ZeroLine.get();
                feature_lines.push_back (l);
        }
@@ -1243,8 +1254,8 @@ TimeAxisView::reshow_feature_lines ()
        list<ArdourCanvas::SimpleLine*>::iterator l;
 
        for (i = analysis_features.begin(), l = feature_lines.begin(); i != analysis_features.end() && l != feature_lines.end(); ++i, ++l) {
-               (*l)->property_x1() = editor.frame_to_pixel (*i);
-               (*l)->property_x2() = editor.frame_to_pixel (*i);
+               (*l)->property_x1() = _editor.frame_to_pixel (*i);
+               (*l)->property_x2() = _editor.frame_to_pixel (*i);
                (*l)->property_y1() = 0;
                (*l)->property_y2() = current_height();
                (*l)->show ();
@@ -1254,17 +1265,17 @@ TimeAxisView::reshow_feature_lines ()
 bool
 TimeAxisView::resizer_button_press (GdkEventButton* event)
 {
-       resize_drag_start = event->y_root;
-       resize_idle_target = current_height();
-       editor.start_resize_line_ops ();
+       _resize_drag_start = event->y_root;
+       _resize_idle_target = current_height ();
+       _editor.start_resize_line_ops ();
        return true;
 }
 
 bool
 TimeAxisView::resizer_button_release (GdkEventButton* ev)
 {
-       resize_drag_start = -1;
-       editor.end_resize_line_ops ();
+       _resize_drag_start = -1;
+       _editor.end_resize_line_ops ();
        return true;
 }
 
@@ -1277,16 +1288,16 @@ TimeAxisView::idle_resize (uint32_t h)
 bool
 TimeAxisView::resizer_motion (GdkEventMotion* ev)
 {
-       if (resize_drag_start < 0) {
+       if (_resize_drag_start < 0) {
                return true;
        }
 
-       int32_t delta = (int32_t) floor (resize_drag_start - ev->y_root);
+       int32_t const delta = (int32_t) floor (_resize_drag_start - ev->y_root);
 
-       resize_idle_target = std::max (resize_idle_target - delta, (int) hSmall);
-       editor.add_to_idle_resize (this, resize_idle_target);
+       _resize_idle_target = std::max (_resize_idle_target - delta, (int) hSmall);
+       _editor.add_to_idle_resize (this, _resize_idle_target);
        
-       resize_drag_start = ev->y_root;
+       _resize_drag_start = ev->y_root;
 
        return true;
 }
index 8c9576f95178bc6cb18fc63ecfa7a63ad52eee4f..e3fbc885148b0a0f2f0dbe175626c4146fbd2f42 100644 (file)
@@ -91,43 +91,33 @@ class TimeAxisView : public virtual AxisView, public PBD::Stateful
        TimeAxisView(ARDOUR::Session& sess, PublicEditor& ed, TimeAxisView* parent, ArdourCanvas::Canvas& canvas);
        virtual ~TimeAxisView ();
 
-       XMLNode& get_state (void);
+       XMLNode& get_state ();
        int set_state (const XMLNode&);
 
-       /* public data: XXX create accessor/mutators for these ?? */
+       /** @return index of this TimeAxisView within its parent */
+       int order () const { return _order; }
 
-       PublicEditor& editor;
-       
-       uint32_t effective_height;  /* in canvas units */
-       double   y_position;
-       int      order;
-       
-       uint32_t current_height() const { return height; }
+       ArdourCanvas::Group* canvas_display () { return _canvas_display; }
+       ArdourCanvas::Group* canvas_background () { return _canvas_background; }
+       ArdourCanvas::Group* ghost_group () { return _ghost_group; }
 
-       ArdourCanvas::Group   *canvas_background;
-       ArdourCanvas::Group   *canvas_display;
-       Gtk::VBox       *control_parent;
+       /** @return effective height (taking children into account) in canvas units, or
+           0 if this TimeAxisView has not yet been shown */
+       uint32_t effective_height () const { return _effective_height; }
 
-       /* The Standard LHS Controls */
-       Gtk::Frame    controls_frame;
-       Gtk::HBox     controls_hbox;
-       Gtk::EventBox controls_lhs_pad;
-       Gtk::Table    controls_table;
-       Gtk::EventBox controls_ebox;
-       Gtk::VBox     controls_vbox;
-       Gtk::DrawingArea resizer;
-       Gtk::HBox     resizer_box;
-       Gtk::HBox     name_hbox;
-       Gtk::Frame    name_frame;
-       Gtkmm2ext::FocusEntry name_entry;
+       /** @return y position, or -1 if hidden */
+       double y_position () const { return _y_position; }
+
+       /** @return our Editor */
+       PublicEditor& editor () const { return _editor; }
+
+       uint32_t current_height() const { return height; }
 
        bool resizer_button_press (GdkEventButton*);
        bool resizer_button_release (GdkEventButton*);
        bool resizer_motion (GdkEventMotion*);
        bool resizer_expose (GdkEventExpose*);
 
-       double resize_drag_start;
-       int32_t resize_idle_target;
        void idle_resize (uint32_t);
 
        void hide_name_label ();
@@ -135,22 +125,17 @@ class TimeAxisView : public virtual AxisView, public PBD::Stateful
        void show_name_label ();
        void show_name_entry ();
 
-       /** Display this TrackView as the nth component of the parent box, at y.
-        *
-        * @param y 
-        * @param nth
-        * @param parent the parent component
-        * @return the height of this TrackView
-        */
        virtual guint32 show_at (double y, int& nth, Gtk::VBox *parent);
 
        void clip_to_viewport ();
 
        bool touched (double top, double bot);
 
-       /** Hides this TrackView */
+       /** Hide this TrackView */
        virtual void hide ();
-       bool hidden() const { return _hidden; }
+
+       /** @return true if hidden, otherwise false */
+       bool hidden () const { return _hidden; }
 
        virtual void set_selected (bool);
 
@@ -164,12 +149,6 @@ class TimeAxisView : public virtual AxisView, public PBD::Stateful
        virtual void set_height (uint32_t h);
        void reset_height();
 
-       /**
-        * Returns a TimeAxisView* if this object covers y, or one of its children does.
-        *  If the covering object is a child axis, then the child is returned.
-        * Returns 0 otherwise.
-        */
-
        TimeAxisView* covers_y_position (double y);
 
        /**
@@ -213,20 +192,14 @@ class TimeAxisView : public virtual AxisView, public PBD::Stateful
        virtual void get_selectables (nframes_t start, nframes_t end, double top, double bot, list<Selectable*>& results);
        virtual void get_inverted_selectables (Selection&, list<Selectable *>& results);
 
-       ArdourCanvas::Group* ghost_group;
-
        void add_ghost (RegionView*);
        void remove_ghost (RegionView*);
        void erase_ghost (GhostRegion*);
 
-       /* called at load time when first GUI idle occurs. put
-          expensive data loading/redisplay code in here.
-       */
-       
+       /** called at load time when first GUI idle occurs. put
+           expensive data loading/redisplay code in here. */
        virtual void first_idle () {}
 
-       /* state/serialization management */
-
        TimeAxisView* get_parent () { return parent; }
        void set_parent (TimeAxisView& p);
        bool has_state () const;
@@ -238,6 +211,19 @@ class TimeAxisView : public virtual AxisView, public PBD::Stateful
        typedef std::vector<boost::shared_ptr<TimeAxisView> > Children;
 
   protected:
+       /* The Standard LHS Controls */
+       Gtk::Frame    controls_frame;
+       Gtk::HBox     controls_hbox;
+       Gtk::EventBox controls_lhs_pad;
+       Gtk::Table    controls_table;
+       Gtk::EventBox controls_ebox;
+       Gtk::VBox     controls_vbox;
+       Gtk::DrawingArea resizer;
+       Gtk::HBox     resizer_box;
+       Gtk::HBox     name_hbox;
+       Gtk::Frame    name_frame;
+       Gtkmm2ext::FocusEntry name_entry;
+
        uint32_t height;  /* in canvas units */
 
        string controls_base_unselected_name;
@@ -337,13 +323,26 @@ class TimeAxisView : public virtual AxisView, public PBD::Stateful
        void set_heights (uint32_t h);
        void color_handler ();
 
-
        std::list<ArdourCanvas::SimpleLine*> feature_lines;
        ARDOUR::AnalysisFeatureList analysis_features;
        void reshow_feature_lines ();
 
        void conditionally_add_to_selection ();
 
+       ArdourCanvas::Group* _canvas_display;
+       double _y_position;
+       PublicEditor& _editor;
+       
+private:
+
+       ArdourCanvas::Group* _canvas_background;
+       Gtk::VBox* control_parent;
+       int _order;
+       uint32_t _effective_height;
+       double _resize_drag_start;
+       int32_t _resize_idle_target;
+       ArdourCanvas::Group* _ghost_group;
+       
 }; /* class TimeAxisView */
 
 #endif /* __ardour_gtk_time_axis_h__ */
index be8b2ab471434135c32323158bfd42afd1358dcb..8de294deb2fc1995afd8a0268f18f50cfb545c54 100644 (file)
@@ -161,7 +161,7 @@ TimeAxisViewItem::init (const string& it_name, double spu, Gdk::Color& base_colo
                frame = new ArdourCanvas::SimpleRect (*group);
                frame->property_x1() = (double) 0.0;
                frame->property_y1() = (double) 1.0;
-               frame->property_x2() = (double) trackview.editor.frame_to_pixel(duration);
+               frame->property_x2() = (double) trackview.editor().frame_to_pixel(duration);
                frame->property_y2() = (double) trackview.current_height();
                frame->property_outline_pixels() = 1;
                frame->property_outline_what() = 0xF;
@@ -193,10 +193,10 @@ TimeAxisViewItem::init (const string& it_name, double spu, Gdk::Color& base_colo
                name_highlight = new ArdourCanvas::SimpleRect (*group);
                if (visibility & FullWidthNameHighlight) {
                        name_highlight->property_x1() = (double) 0.0;
-                       name_highlight->property_x2() = (double) (trackview.editor.frame_to_pixel(item_duration));
+                       name_highlight->property_x2() = (double) (trackview.editor().frame_to_pixel(item_duration));
                } else {
                        name_highlight->property_x1() = (double) 1.0;
-                       name_highlight->property_x2() = (double) (trackview.editor.frame_to_pixel(item_duration)) - 1;
+                       name_highlight->property_x2() = (double) (trackview.editor().frame_to_pixel(item_duration)) - 1;
                }
                name_highlight->property_y1() = (double) (trackview.current_height() - TimeAxisViewItem::NAME_HIGHLIGHT_SIZE);
                name_highlight->property_y2() = (double) (trackview.current_height() - 1);
@@ -234,8 +234,8 @@ TimeAxisViewItem::init (const string& it_name, double spu, Gdk::Color& base_colo
                frame_handle_start->property_outline_color_rgba() = ARDOUR_UI::config()->canvasvar_FrameHandle.get();
 
                frame_handle_end = new ArdourCanvas::SimpleRect (*group);
-               frame_handle_end->property_x1() = (double) (trackview.editor.frame_to_pixel(get_duration())) - (TimeAxisViewItem::GRAB_HANDLE_LENGTH);
-               frame_handle_end->property_x2() = (double) trackview.editor.frame_to_pixel(get_duration());
+               frame_handle_end->property_x1() = (double) (trackview.editor().frame_to_pixel(get_duration())) - (TimeAxisViewItem::GRAB_HANDLE_LENGTH);
+               frame_handle_end->property_x2() = (double) trackview.editor().frame_to_pixel(get_duration());
                frame_handle_end->property_y1() = (double) 1;
                frame_handle_end->property_y2() = (double) TimeAxisViewItem::GRAB_HANDLE_LENGTH + 1;
                frame_handle_end->property_outline_color_rgba() = ARDOUR_UI::config()->canvasvar_FrameHandle.get();
@@ -339,7 +339,7 @@ TimeAxisViewItem::set_duration (nframes_t dur, void* src)
 
        item_duration = dur;
        
-       reset_width_dependent_items (trackview.editor.frame_to_pixel (dur));
+       reset_width_dependent_items (trackview.editor().frame_to_pixel (dur));
        
        DurationChanged (dur, src) ; /* EMIT_SIGNAL */
        return true;