French translation update
[ardour.git] / gtk2_ardour / editor_canvas.cc
index 13fd6fe8b94b3ec92dc19bfba21c4207016dd157..6f0e26aef65b3ca4a1381a2b4ad725823c328c09 100644 (file)
 #include "keyboard.h"
 #include "editor_cursors.h"
 #include "mouse_cursors.h"
 #include "keyboard.h"
 #include "editor_cursors.h"
 #include "mouse_cursors.h"
+#include "note_base.h"
 #include "ui_config.h"
 #include "verbose_cursor.h"
 
 #include "ui_config.h"
 #include "verbose_cursor.h"
 
-#include "i18n.h"
+#include "pbd/i18n.h"
 
 using namespace std;
 using namespace ARDOUR;
 
 using namespace std;
 using namespace ARDOUR;
@@ -98,18 +99,6 @@ Editor::initialize_canvas ()
 
        _verbose_cursor = new VerboseCursor (this);
 
 
        _verbose_cursor = new VerboseCursor (this);
 
-       /* on the bottom, an image */
-
-       if (Profile->get_sae()) {
-               Image img (::get_icon (X_("saelogo")));
-               // logo_item = new ArdourCanvas::Pixbuf (_track_canvas->root(), 0.0, 0.0, img.get_pixbuf());
-               // logo_item->property_height_in_pixels() = true;
-               // logo_item->property_width_in_pixels() = true;
-               // logo_item->property_height_set() = true;
-               // logo_item->property_width_set() = true;
-               // logo_item->show ();
-       }
-
        /*a group to hold global rects like punch/loop indicators */
        global_rect_group = new ArdourCanvas::Container (hv_scroll_group);
        CANVAS_DEBUG_NAME (global_rect_group, "global rect group");
        /*a group to hold global rects like punch/loop indicators */
        global_rect_group = new ArdourCanvas::Container (hv_scroll_group);
        CANVAS_DEBUG_NAME (global_rect_group, "global rect group");
@@ -128,7 +117,7 @@ Editor::initialize_canvas ()
 
        _trackview_group = new ArdourCanvas::Container (hv_scroll_group);
        CANVAS_DEBUG_NAME (_trackview_group, "Canvas TrackViews");
 
        _trackview_group = new ArdourCanvas::Container (hv_scroll_group);
        CANVAS_DEBUG_NAME (_trackview_group, "Canvas TrackViews");
-       
+
        // used as rubberband rect
        rubberband_rect = new ArdourCanvas::Rectangle (hv_scroll_group, ArdourCanvas::Rect (0.0, 0.0, 0.0, 0.0));
        rubberband_rect->hide();
        // used as rubberband rect
        rubberband_rect = new ArdourCanvas::Rectangle (hv_scroll_group, ArdourCanvas::Rect (0.0, 0.0, 0.0, 0.0));
        rubberband_rect->hide();
@@ -140,7 +129,7 @@ Editor::initialize_canvas ()
         CANVAS_DEBUG_NAME (_drag_motion_group, "Canvas Drag Motion");
 
        /* TIME BAR CANVAS */
         CANVAS_DEBUG_NAME (_drag_motion_group, "Canvas Drag Motion");
 
        /* TIME BAR CANVAS */
-       
+
        _time_markers_group = new ArdourCanvas::Container (h_scroll_group);
        CANVAS_DEBUG_NAME (_time_markers_group, "time bars");
 
        _time_markers_group = new ArdourCanvas::Container (h_scroll_group);
        CANVAS_DEBUG_NAME (_time_markers_group, "time bars");
 
@@ -187,7 +176,7 @@ Editor::initialize_canvas ()
        cd_marker_bar->set_outline_what (ArdourCanvas::Rectangle::BOTTOM);
 
        ARDOUR_UI::instance()->video_timeline = new VideoTimeLine(this, videotl_group, (timebar_height * videotl_bar_height));
        cd_marker_bar->set_outline_what (ArdourCanvas::Rectangle::BOTTOM);
 
        ARDOUR_UI::instance()->video_timeline = new VideoTimeLine(this, videotl_group, (timebar_height * videotl_bar_height));
-       
+
        cd_marker_bar_drag_rect = new ArdourCanvas::Rectangle (cd_marker_group, ArdourCanvas::Rect (0.0, 0.0, 100, timebar_height));
        CANVAS_DEBUG_NAME (cd_marker_bar_drag_rect, "cd marker drag");
        cd_marker_bar_drag_rect->set_outline (false);
        cd_marker_bar_drag_rect = new ArdourCanvas::Rectangle (cd_marker_group, ArdourCanvas::Rect (0.0, 0.0, 100, timebar_height));
        CANVAS_DEBUG_NAME (cd_marker_bar_drag_rect, "cd marker drag");
        cd_marker_bar_drag_rect->set_outline (false);
@@ -227,10 +216,6 @@ Editor::initialize_canvas ()
 
        playhead_cursor = new EditorCursor (*this, &Editor::canvas_playhead_cursor_event);
 
 
        playhead_cursor = new EditorCursor (*this, &Editor::canvas_playhead_cursor_event);
 
-       if (logo_item) {
-               logo_item->lower_to_bottom ();
-       }
-
        _canvas_drop_zone = new ArdourCanvas::Rectangle (hv_scroll_group, ArdourCanvas::Rect (0.0, 0.0, ArdourCanvas::COORD_MAX, 0.0));
        /* this thing is transparent */
        _canvas_drop_zone->set_fill (false);
        _canvas_drop_zone = new ArdourCanvas::Rectangle (hv_scroll_group, ArdourCanvas::Rect (0.0, 0.0, ArdourCanvas::COORD_MAX, 0.0));
        /* this thing is transparent */
        _canvas_drop_zone->set_fill (false);
@@ -329,7 +314,7 @@ Editor::reset_controls_layout_width ()
        edit_controls_vbox.size_request (req);
        w = req.width;
 
        edit_controls_vbox.size_request (req);
        w = req.width;
 
-        if (_group_tabs->is_mapped()) {
+        if (_group_tabs->is_visible()) {
                _group_tabs->size_request (req);
                 w += req.width;
         }
                _group_tabs->size_request (req);
                 w += req.width;
         }
@@ -401,7 +386,7 @@ void
 Editor::drop_paths_part_two (const vector<string>& paths, framepos_t frame, double ypos, bool copy)
 {
        RouteTimeAxisView* tv;
 Editor::drop_paths_part_two (const vector<string>& paths, framepos_t frame, double ypos, bool copy)
 {
        RouteTimeAxisView* tv;
-       
+
        /* MIDI files must always be imported, because we consider them
         * writable. So split paths into two vectors, and follow the import
         * path on the MIDI part.
        /* MIDI files must always be imported, because we consider them
         * writable. So split paths into two vectors, and follow the import
         * path on the MIDI part.
@@ -427,8 +412,8 @@ Editor::drop_paths_part_two (const vector<string>& paths, framepos_t frame, doub
                frame = 0;
                InstrumentSelector is; // instantiation builds instrument-list and sets default.
                do_import (midi_paths, Editing::ImportDistinctFiles, ImportAsTrack, SrcBest, frame, is.selected_instrument());
                frame = 0;
                InstrumentSelector is; // instantiation builds instrument-list and sets default.
                do_import (midi_paths, Editing::ImportDistinctFiles, ImportAsTrack, SrcBest, frame, is.selected_instrument());
-               
-               if (Profile->get_sae() || UIConfiguration::instance().get_only_copy_imported_files() || copy) {
+
+               if (UIConfiguration::instance().get_only_copy_imported_files() || copy) {
                        do_import (audio_paths, Editing::ImportDistinctFiles, Editing::ImportAsTrack, SrcBest, frame);
                } else {
                        do_embed (audio_paths, Editing::ImportDistinctFiles, ImportAsTrack, frame);
                        do_import (audio_paths, Editing::ImportDistinctFiles, Editing::ImportAsTrack, SrcBest, frame);
                } else {
                        do_embed (audio_paths, Editing::ImportDistinctFiles, ImportAsTrack, frame);
@@ -444,7 +429,7 @@ Editor::drop_paths_part_two (const vector<string>& paths, framepos_t frame, doub
 
                        do_import (midi_paths, Editing::ImportSerializeFiles, ImportToTrack, SrcBest, frame);
 
 
                        do_import (midi_paths, Editing::ImportSerializeFiles, ImportToTrack, SrcBest, frame);
 
-                       if (Profile->get_sae() || UIConfiguration::instance().get_only_copy_imported_files() || copy) {
+                       if (UIConfiguration::instance().get_only_copy_imported_files() || copy) {
                                do_import (audio_paths, Editing::ImportSerializeFiles, Editing::ImportToTrack, SrcBest, frame);
                        } else {
                                do_embed (audio_paths, Editing::ImportSerializeFiles, ImportToTrack, frame);
                                do_import (audio_paths, Editing::ImportSerializeFiles, Editing::ImportToTrack, SrcBest, frame);
                        } else {
                                do_embed (audio_paths, Editing::ImportSerializeFiles, ImportToTrack, frame);
@@ -478,7 +463,7 @@ Editor::drop_paths (const RefPtr<Gdk::DragContext>& context,
                snap_to (frame);
 
                bool copy = ((context->get_actions() & (Gdk::ACTION_COPY | Gdk::ACTION_LINK | Gdk::ACTION_MOVE)) == Gdk::ACTION_COPY);
                snap_to (frame);
 
                bool copy = ((context->get_actions() & (Gdk::ACTION_COPY | Gdk::ACTION_LINK | Gdk::ACTION_MOVE)) == Gdk::ACTION_COPY);
-#ifdef GTKOSX
+#ifdef __APPLE__
                /* We are not allowed to call recursive main event loops from within
                   the main event loop with GTK/Quartz. Since import/embed wants
                   to push up a progress dialog, defer all this till we go idle.
                /* We are not allowed to call recursive main event loops from within
                   the main event loop with GTK/Quartz. Since import/embed wants
                   to push up a progress dialog, defer all this till we go idle.
@@ -500,6 +485,12 @@ Editor::drop_paths (const RefPtr<Gdk::DragContext>& context,
 void
 Editor::maybe_autoscroll (bool allow_horiz, bool allow_vert, bool from_headers)
 {
 void
 Editor::maybe_autoscroll (bool allow_horiz, bool allow_vert, bool from_headers)
 {
+       Gtk::Window* toplevel = dynamic_cast<Gtk::Window*>(contents().get_toplevel());
+
+       if (!toplevel) {
+               return;
+       }
+
        if (!UIConfiguration::instance().get_autoscroll_editor () || autoscroll_active ()) {
                return;
        }
        if (!UIConfiguration::instance().get_autoscroll_editor () || autoscroll_active ()) {
                return;
        }
@@ -520,13 +511,13 @@ Editor::maybe_autoscroll (bool allow_horiz, bool allow_vert, bool from_headers)
 
        if (from_headers) {
                alloc = controls_layout.get_allocation ();
 
        if (from_headers) {
                alloc = controls_layout.get_allocation ();
-       } else {        
+       } else {
                alloc = _track_canvas_viewport->get_allocation ();
 
                /* reduce height by the height of the timebars, which happens
                   to correspond to the position of the hv_scroll_group.
                */
                alloc = _track_canvas_viewport->get_allocation ();
 
                /* reduce height by the height of the timebars, which happens
                   to correspond to the position of the hv_scroll_group.
                */
-               
+
                alloc.set_height (alloc.get_height() - hv_scroll_group->position().y);
                alloc.set_y (alloc.get_y() + hv_scroll_group->position().y);
 
                alloc.set_height (alloc.get_height() - hv_scroll_group->position().y);
                alloc.set_y (alloc.get_y() + hv_scroll_group->position().y);
 
@@ -539,25 +530,25 @@ Editor::maybe_autoscroll (bool allow_horiz, bool allow_vert, bool from_headers)
 
                /* the effective width of the autoscroll boundary so
                   that we start scrolling before we hit the edge.
 
                /* the effective width of the autoscroll boundary so
                   that we start scrolling before we hit the edge.
-               
+
                   this helps when the window is slammed up against the
                   right edge of the screen, making it hard to scroll
                   effectively.
                */
                   this helps when the window is slammed up against the
                   right edge of the screen, making it hard to scroll
                   effectively.
                */
-               
+
                if (alloc.get_width() > 20) {
                        alloc.set_width (alloc.get_width() - 20);
                        alloc.set_x (alloc.get_x() + 10);
                }
 
        }
                if (alloc.get_width() > 20) {
                        alloc.set_width (alloc.get_width() - 20);
                        alloc.set_x (alloc.get_x() + 10);
                }
 
        }
-       
+
        scrolling_boundary = ArdourCanvas::Rect (alloc.get_x(), alloc.get_y(), alloc.get_x() + alloc.get_width(), alloc.get_y() + alloc.get_height());
        scrolling_boundary = ArdourCanvas::Rect (alloc.get_x(), alloc.get_y(), alloc.get_x() + alloc.get_width(), alloc.get_y() + alloc.get_height());
-       
+
        int x, y;
        Gdk::ModifierType mask;
 
        int x, y;
        Gdk::ModifierType mask;
 
-       get_window()->get_pointer (x, y, mask);
+       toplevel->get_window()->get_pointer (x, y, mask);
 
        if ((allow_horiz && ((x < scrolling_boundary.x0 && leftmost_frame > 0) || x >= scrolling_boundary.x1)) ||
            (allow_vert && ((y < scrolling_boundary.y0 && vertical_adjustment.get_value() > 0)|| y >= scrolling_boundary.y1))) {
 
        if ((allow_horiz && ((x < scrolling_boundary.x0 && leftmost_frame > 0) || x >= scrolling_boundary.x1)) ||
            (allow_vert && ((y < scrolling_boundary.y0 && vertical_adjustment.get_value() > 0)|| y >= scrolling_boundary.y1))) {
@@ -578,8 +569,13 @@ Editor::autoscroll_canvas ()
        Gdk::ModifierType mask;
        frameoffset_t dx = 0;
        bool no_stop = false;
        Gdk::ModifierType mask;
        frameoffset_t dx = 0;
        bool no_stop = false;
+       Gtk::Window* toplevel = dynamic_cast<Gtk::Window*>(contents().get_toplevel());
+
+       if (!toplevel) {
+               return false;
+       }
 
 
-       get_window()->get_pointer (x, y, mask);
+       toplevel->get_window()->get_pointer (x, y, mask);
 
        VisualChange vc;
        bool vertical_motion = false;
 
        VisualChange vc;
        bool vertical_motion = false;
@@ -607,7 +603,7 @@ Editor::autoscroll_canvas ()
                        no_stop = true;
 
                } else if (x < autoscroll_boundary.x0) {
                        no_stop = true;
 
                } else if (x < autoscroll_boundary.x0) {
-                       
+
                        dx = autoscroll_boundary.x0 - x;
                        dx += 10 + (2 * (autoscroll_cnt/2));
 
                        dx = autoscroll_boundary.x0 - x;
                        dx += 10 + (2 * (autoscroll_cnt/2));
 
@@ -621,7 +617,7 @@ Editor::autoscroll_canvas ()
 
                        no_stop = true;
                }
 
                        no_stop = true;
                }
-               
+
                if (new_frame != leftmost_frame) {
                        vc.time_origin = new_frame;
                        vc.add (VisualChange::TimeOrigin);
                if (new_frame != leftmost_frame) {
                        vc.time_origin = new_frame;
                        vc.add (VisualChange::TimeOrigin);
@@ -629,12 +625,12 @@ Editor::autoscroll_canvas ()
        }
 
        if (autoscroll_vertical_allowed) {
        }
 
        if (autoscroll_vertical_allowed) {
-               
+
                // const double vertical_pos = vertical_adjustment.get_value();
                const int speed_factor = 10;
 
                /* vertical */
                // const double vertical_pos = vertical_adjustment.get_value();
                const int speed_factor = 10;
 
                /* vertical */
-               
+
                if (y < autoscroll_boundary.y0) {
 
                        /* scroll to make higher tracks visible */
                if (y < autoscroll_boundary.y0) {
 
                        /* scroll to make higher tracks visible */
@@ -643,6 +639,7 @@ Editor::autoscroll_canvas ()
                                scroll_up_one_track ();
                                vertical_motion = true;
                        }
                                scroll_up_one_track ();
                                vertical_motion = true;
                        }
+                       no_stop = true;
 
                } else if (y > autoscroll_boundary.y1) {
 
 
                } else if (y > autoscroll_boundary.y1) {
 
@@ -650,9 +647,9 @@ Editor::autoscroll_canvas ()
                                scroll_down_one_track ();
                                vertical_motion = true;
                        }
                                scroll_down_one_track ();
                                vertical_motion = true;
                        }
+                       no_stop = true;
                }
 
                }
 
-               no_stop = true;
        }
 
        if (vc.pending || vertical_motion) {
        }
 
        if (vc.pending || vertical_motion) {
@@ -671,7 +668,7 @@ Editor::autoscroll_canvas ()
 
                ev.type = GDK_MOTION_NOTIFY;
                ev.state = Gdk::BUTTON1_MASK;
 
                ev.type = GDK_MOTION_NOTIFY;
                ev.state = Gdk::BUTTON1_MASK;
-               
+
                /* the motion handler expects events in canvas coordinate space */
 
                /* we asked for the mouse position above (::get_pointer()) via
                /* the motion handler expects events in canvas coordinate space */
 
                /* we asked for the mouse position above (::get_pointer()) via
@@ -682,7 +679,7 @@ Editor::autoscroll_canvas ()
                int cx;
                int cy;
 
                int cx;
                int cy;
 
-               translate_coordinates (*_track_canvas, x, y, cx, cy);
+               toplevel->translate_coordinates (*_track_canvas, x, y, cx, cy);
 
                /* clamp x and y to remain within the autoscroll boundary,
                 * which is defined in window coordinates
 
                /* clamp x and y to remain within the autoscroll boundary,
                 * which is defined in window coordinates
@@ -698,9 +695,10 @@ Editor::autoscroll_canvas ()
                ArdourCanvas::Duple d = _track_canvas->window_to_canvas (ArdourCanvas::Duple (cx, cy));
                ev.x = d.x;
                ev.y = d.y;
                ArdourCanvas::Duple d = _track_canvas->window_to_canvas (ArdourCanvas::Duple (cx, cy));
                ev.x = d.x;
                ev.y = d.y;
+               ev.state = mask;
 
                motion_handler (0, (GdkEvent*) &ev, true);
 
                motion_handler (0, (GdkEvent*) &ev, true);
-               
+
        } else if (no_stop) {
 
                /* not changing visual state but pointer is outside the scrolling boundary
        } else if (no_stop) {
 
                /* not changing visual state but pointer is outside the scrolling boundary
@@ -711,7 +709,7 @@ Editor::autoscroll_canvas ()
 
                ev.type = GDK_MOTION_NOTIFY;
                ev.state = Gdk::BUTTON1_MASK;
 
                ev.type = GDK_MOTION_NOTIFY;
                ev.state = Gdk::BUTTON1_MASK;
-               
+
                /* the motion handler expects events in canvas coordinate space */
 
                /* first convert from Editor window coordinates to canvas
                /* the motion handler expects events in canvas coordinate space */
 
                /* first convert from Editor window coordinates to canvas
@@ -733,14 +731,15 @@ Editor::autoscroll_canvas ()
                }
                y = min (max ((ArdourCanvas::Coord) y, autoscroll_boundary.y0), autoscroll_boundary.y1);
 
                }
                y = min (max ((ArdourCanvas::Coord) y, autoscroll_boundary.y0), autoscroll_boundary.y1);
 
-               translate_coordinates (*_track_canvas_viewport, x, y, cx, cy);
+               toplevel->translate_coordinates (*_track_canvas_viewport, x, y, cx, cy);
 
                ArdourCanvas::Duple d = _track_canvas->window_to_canvas (ArdourCanvas::Duple (cx, cy));
                ev.x = d.x;
                ev.y = d.y;
 
                ArdourCanvas::Duple d = _track_canvas->window_to_canvas (ArdourCanvas::Duple (cx, cy));
                ev.x = d.x;
                ev.y = d.y;
+               ev.state = mask;
 
                motion_handler (0, (GdkEvent*) &ev, true);
 
                motion_handler (0, (GdkEvent*) &ev, true);
-               
+
        } else {
                stop_canvas_autoscroll ();
                return false;
        } else {
                stop_canvas_autoscroll ();
                return false;
@@ -749,7 +748,7 @@ Editor::autoscroll_canvas ()
        autoscroll_cnt++;
 
        return true; /* call me again */
        autoscroll_cnt++;
 
        return true; /* call me again */
-}      
+}
 
 void
 Editor::start_canvas_autoscroll (bool allow_horiz, bool allow_vert, const ArdourCanvas::Rect& boundary)
 
 void
 Editor::start_canvas_autoscroll (bool allow_horiz, bool allow_vert, const ArdourCanvas::Rect& boundary)
@@ -760,7 +759,6 @@ Editor::start_canvas_autoscroll (bool allow_horiz, bool allow_vert, const Ardour
 
        stop_canvas_autoscroll ();
 
 
        stop_canvas_autoscroll ();
 
-       autoscroll_cnt = 0;
        autoscroll_horizontal_allowed = allow_horiz;
        autoscroll_vertical_allowed = allow_vert;
        autoscroll_boundary = boundary;
        autoscroll_horizontal_allowed = allow_horiz;
        autoscroll_vertical_allowed = allow_vert;
        autoscroll_boundary = boundary;
@@ -779,6 +777,7 @@ void
 Editor::stop_canvas_autoscroll ()
 {
        autoscroll_connection.disconnect ();
 Editor::stop_canvas_autoscroll ()
 {
        autoscroll_connection.disconnect ();
+       autoscroll_cnt = 0;
 }
 
 Editor::EnterContext*
 }
 
 Editor::EnterContext*
@@ -895,7 +894,7 @@ Editor::color_handler()
        samples_ruler->set_outline_color (text);
        bbt_ruler->set_fill_color (base);
        bbt_ruler->set_outline_color (text);
        samples_ruler->set_outline_color (text);
        bbt_ruler->set_fill_color (base);
        bbt_ruler->set_outline_color (text);
-       
+
        playhead_cursor->set_color (UIConfiguration::instance().color ("play head"));
 
        meter_bar->set_fill_color (UIConfiguration::instance().color_mod ("meter bar", "marker bar"));
        playhead_cursor->set_color (UIConfiguration::instance().color ("play head"));
 
        meter_bar->set_fill_color (UIConfiguration::instance().color_mod ("meter bar", "marker bar"));
@@ -945,6 +944,8 @@ Editor::color_handler()
 
        refresh_location_display ();
 
 
        refresh_location_display ();
 
+       NoteBase::set_colors ();
+
        /* redraw the whole thing */
        _track_canvas->set_background_color (UIConfiguration::instance().color ("arrange base"));
        _track_canvas->queue_draw ();
        /* redraw the whole thing */
        _track_canvas->set_background_color (UIConfiguration::instance().color ("arrange base"));
        _track_canvas->queue_draw ();
@@ -1082,9 +1083,9 @@ Editor::which_trim_cursor (bool left) const
        }
 
        Trimmable::CanTrim ct = entered_regionview->region()->can_trim ();
        }
 
        Trimmable::CanTrim ct = entered_regionview->region()->can_trim ();
-               
+
        if (left) {
        if (left) {
-               
+
                if (ct & Trimmable::FrontTrimEarlier) {
                        return _cursors->left_side_trim;
                } else {
                if (ct & Trimmable::FrontTrimEarlier) {
                        return _cursors->left_side_trim;
                } else {
@@ -1112,7 +1113,7 @@ Editor::which_mode_cursor () const
        case MouseCut:
                mode_cursor = _cursors->scissors;
                break;
        case MouseCut:
                mode_cursor = _cursors->scissors;
                break;
-                       
+
        case MouseObject:
        case MouseContent:
                /* don't use mode cursor, pick a grabber cursor based on the item */
        case MouseObject:
        case MouseContent:
                /* don't use mode cursor, pick a grabber cursor based on the item */
@@ -1138,20 +1139,20 @@ Editor::which_mode_cursor () const
                get_pointer_position (x, y);
 
                if (x >= 0 && y >= 0) {
                get_pointer_position (x, y);
 
                if (x >= 0 && y >= 0) {
-                       
+
                        vector<ArdourCanvas::Item const *> items;
 
                        /* Note how we choose a specific scroll group to get
                         * items from. This could be problematic.
                         */
                        vector<ArdourCanvas::Item const *> items;
 
                        /* Note how we choose a specific scroll group to get
                         * items from. This could be problematic.
                         */
-                       
+
                        hv_scroll_group->add_items_at_point (ArdourCanvas::Duple (x,y), items);
                        hv_scroll_group->add_items_at_point (ArdourCanvas::Duple (x,y), items);
-                       
+
                        // first item will be the upper most
                        // first item will be the upper most
-                       
+
                        if (!items.empty()) {
                                const ArdourCanvas::Item* i = items.front();
                        if (!items.empty()) {
                                const ArdourCanvas::Item* i = items.front();
-                               
+
                                if (i && i->parent() && i->parent()->get_data (X_("timeselection"))) {
                                        pair<TimeAxisView*, int> tvp = trackview_by_y_position (_last_motion_y);
                                        if (dynamic_cast<AutomationTimeAxisView*> (tvp.first)) {
                                if (i && i->parent() && i->parent()->get_data (X_("timeselection"))) {
                                        pair<TimeAxisView*, int> tvp = trackview_by_y_position (_last_motion_y);
                                        if (dynamic_cast<AutomationTimeAxisView*> (tvp.first)) {
@@ -1200,7 +1201,7 @@ Editor::which_canvas_cursor(ItemType type) const
                        break;
                }
        }
                        break;
                }
        }
-       
+
        if ((mouse_mode == MouseObject || get_smart_mode ()) ||
            mouse_mode == MouseContent) {
 
        if ((mouse_mode == MouseObject || get_smart_mode ()) ||
            mouse_mode == MouseContent) {
 
@@ -1296,7 +1297,7 @@ Editor::which_canvas_cursor(ItemType type) const
                }
 
        } else if (mouse_mode == MouseDraw) {
                }
 
        } else if (mouse_mode == MouseDraw) {
-               
+
                /* ControlPointItem is not really specific to region gain mode
                   but it is the same cursor so don't worry about this for now.
                   The result is that we'll see the fader cursor if we enter
                /* ControlPointItem is not really specific to region gain mode
                   but it is the same cursor so don't worry about this for now.
                   The result is that we'll see the fader cursor if we enter