-void
-Editor::set_canvas_cursor ()
-{
- switch (mouse_mode) {
- case MouseRange:
- current_canvas_cursor = _cursors->selector;
- if (_internal_editing) {
- current_canvas_cursor = which_grabber_cursor();
- }
- break;
-
- case MouseObject:
- current_canvas_cursor = which_grabber_cursor();
- break;
-
- case MouseDraw:
- current_canvas_cursor = _cursors->midi_pencil;
- break;
-
- case MouseGain:
- current_canvas_cursor = _cursors->cross_hair;
- break;
-
- case MouseZoom:
- if (Keyboard::the_keyboard().key_is_down (GDK_Control_L)) {
- current_canvas_cursor = _cursors->zoom_out;
- } else {
- current_canvas_cursor = _cursors->zoom_in;
- }
- break;
-
- case MouseTimeFX:
- current_canvas_cursor = _cursors->time_fx; // just use playhead
- break;
-
- case MouseAudition:
- current_canvas_cursor = _cursors->speaker;
- break;
- }
-
- if (!_internal_editing) {
- switch (_join_object_range_state) {
- case JOIN_OBJECT_RANGE_NONE:
- break;
- case JOIN_OBJECT_RANGE_OBJECT:
- current_canvas_cursor = which_grabber_cursor ();
- break;
- case JOIN_OBJECT_RANGE_RANGE:
- current_canvas_cursor = _cursors->selector;
- break;
- }
- }
-
- /* up-down cursor as a cue that automation can be dragged up and down when in join object/range mode */
- if (!_internal_editing && get_smart_mode() ) {
-
- double x, y;
- get_pointer_position (x, y);
-
- if (x >= 0 && y >= 0) {
-
- vector<ArdourCanvas::Item const *> items;
-
- _track_canvas->root()->add_items_at_point (ArdourCanvas::Duple (x,y), items);
-
- // first item will be the upper most
-
- 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)) {
- current_canvas_cursor = _cursors->up_down;
- }
- }
- }
- }
- }
-
- set_canvas_cursor (current_canvas_cursor, true);
-}
-