ardour
|
#include <editor_drag.h>
Public Member Functions | |
Drag (Editor *, ArdourCanvas::Item *, bool trackview_only=true) | |
virtual | ~Drag () |
void | set_manager (DragManager *m) |
ArdourCanvas::Item * | item () const |
void | swap_grab (ArdourCanvas::Item *, Gdk::Cursor *, uint32_t) |
bool | motion_handler (GdkEvent *, bool) |
void | abort () |
ARDOUR::framepos_t | adjusted_frame (ARDOUR::framepos_t, GdkEvent const *, bool snap=true) const |
ARDOUR::framepos_t | adjusted_current_frame (GdkEvent const *, bool snap=true) const |
bool | was_double_click () const |
void | set_double_click (bool yn) |
virtual void | start_grab (GdkEvent *e, Gdk::Cursor *c=0) |
virtual bool | end_grab (GdkEvent *) |
virtual void | motion (GdkEvent *e, bool f)=0 |
virtual void | finished (GdkEvent *e, bool m)=0 |
virtual void | aborted (bool m)=0 |
virtual bool | active (Editing::MouseMode m) |
virtual std::pair < ARDOUR::framecnt_t, int > | move_threshold () const |
virtual bool | allow_vertical_autoscroll () const |
virtual bool | x_movement_matters () const |
virtual bool | y_movement_matters () const |
bool | initially_vertical () const |
virtual void | setup_pointer_frame_offset () |
Protected Member Functions | |
double | grab_x () const |
double | grab_y () const |
ARDOUR::framepos_t | raw_grab_frame () const |
ARDOUR::framepos_t | grab_frame () const |
double | last_pointer_x () const |
double | last_pointer_y () const |
double | last_pointer_frame () const |
double | current_pointer_x () const |
double | current_pointer_y () const |
boost::shared_ptr< ARDOUR::Region > | add_midi_region (MidiTimeAxisView *) |
void | show_verbose_cursor_time (framepos_t) |
void | show_verbose_cursor_duration (framepos_t, framepos_t, double xoffset=0) |
void | show_verbose_cursor_text (std::string const &) |
Protected Attributes | |
Editor * | _editor |
our editor More... | |
DragManager * | _drags |
ArdourCanvas::Item * | _item |
our item More... | |
ARDOUR::framecnt_t | _pointer_frame_offset |
bool | _x_constrained |
true if x motion is constrained, otherwise false More... | |
bool | _y_constrained |
true if y motion is constrained, otherwise false More... | |
bool | _was_rolling |
true if the session was rolling before the drag started, otherwise false More... | |
Private Attributes | |
bool | _trackview_only |
true if pointer y value should always be relative to the top of the trackview group More... | |
bool | _move_threshold_passed |
true if the move threshold has been passed, otherwise false More... | |
bool | _starting_point_passed |
true if we called move () with first_move flag, otherwise false More... | |
bool | _initially_vertical |
true if after move threshold is passed we appear to be moving vertically; undefined before that More... | |
bool | _was_double_click |
true if drag initiated by a double click event More... | |
double | _grab_x |
trackview x of the grab start position More... | |
double | _grab_y |
y of the grab start position, possibly adjusted if _trackview_only is true More... | |
double | _last_pointer_x |
trackview x of the pointer last time a motion occurred More... | |
double | _last_pointer_y |
trackview y of the pointer last time a motion occurred More... | |
ARDOUR::framepos_t | _raw_grab_frame |
unsnapped frame that the mouse was at when start_grab was called, or 0 More... | |
ARDOUR::framepos_t | _grab_frame |
adjusted_frame that the mouse was at when start_grab was called, or 0 More... | |
ARDOUR::framepos_t | _last_pointer_frame |
adjusted_frame the last time a motion occurred More... | |
CursorContext::Handle | _cursor_ctx |
cursor change context More... | |
Abstract base class for dragging of things within the editor
Definition at line 104 of file editor_drag.h.
Drag::Drag | ( | Editor * | e, |
ArdourCanvas::Item * | i, | ||
bool | trackview_only = true |
||
) |
Definition at line 217 of file editor_drag.cc.
|
inlinevirtual |
Definition at line 108 of file editor_drag.h.
void Drag::abort | ( | ) |
Call to abort a drag. Ungrabs item and calls subclass's aborted ()
Definition at line 428 of file editor_drag.cc.
|
pure virtual |
Called to abort a drag and return things to how they were before it started.
m | true if some movement occurred, otherwise false. |
Implemented in CrossfadeEdgeDrag, AutomationRangeDrag, MouseZoomDrag, RangeMarkerBarDrag, SelectionDrag, ScrubDrag, TimeFXDrag, RubberbandSelectDrag, FeatureLineDrag, LineDrag, ControlPointDrag, MarkerDrag, FadeOutDrag, FadeInDrag, CursorDrag, TempoMarkerDrag, MeterMarkerDrag, TrimDrag, VideoTimeLineDrag, PatchChangeDrag, NoteCreateDrag, NoteDrag, NoteResizeDrag, RegionCreateDrag, RegionCutDrag, RegionRippleDrag, RegionSpliceDrag, RegionInsertDrag, RegionMoveDrag, and RegionMotionDrag.
|
inlinevirtual |
m | Mouse mode. |
Reimplemented in ControlPointDrag, and NoteCreateDrag.
Definition at line 158 of file editor_drag.h.
|
protected |
Definition at line 462 of file editor_drag.cc.
framepos_t Drag::adjusted_current_frame | ( | GdkEvent const * | event, |
bool | snap = true |
||
) | const |
Definition at line 341 of file editor_drag.cc.
framepos_t Drag::adjusted_frame | ( | ARDOUR::framepos_t | f, |
GdkEvent const * | event, | ||
bool | snap = true |
||
) | const |
Definition at line 325 of file editor_drag.cc.
|
inlinevirtual |
Reimplemented in RangeMarkerBarDrag, MarkerDrag, CursorDrag, TempoMarkerDrag, MeterMarkerDrag, and VideoTimeLineDrag.
Definition at line 167 of file editor_drag.h.
|
protected |
Definition at line 347 of file editor_drag.cc.
|
protected |
Definition at line 353 of file editor_drag.cc.
|
virtual |
Call to end a drag `successfully'. Ungrabs item and calls subclass' finished() method.
event | GDK event, or 0. |
Definition at line 310 of file editor_drag.cc.
|
pure virtual |
Called when a drag has finished.
e | Event describing the finish. |
m | true if some movement occurred, otherwise false. |
Implemented in CrossfadeEdgeDrag, AutomationRangeDrag, MouseZoomDrag, RangeMarkerBarDrag, SelectionDrag, ScrubDrag, TimeFXDrag, RubberbandSelectDrag, FeatureLineDrag, LineDrag, ControlPointDrag, MarkerDrag, FadeOutDrag, FadeInDrag, CursorDrag, TempoMarkerDrag, MeterMarkerDrag, TrimDrag, VideoTimeLineDrag, PatchChangeDrag, NoteCreateDrag, NoteDrag, NoteResizeDrag, RegionCreateDrag, RegionCutDrag, RegionRippleDrag, RegionSpliceDrag, RegionInsertDrag, RegionMoveDrag, and RegionMotionDrag.
|
inlineprotected |
Definition at line 204 of file editor_drag.h.
|
inlineprotected |
Definition at line 192 of file editor_drag.h.
|
inlineprotected |
Definition at line 196 of file editor_drag.h.
|
inline |
Definition at line 181 of file editor_drag.h.
|
inline |
Definition at line 115 of file editor_drag.h.
|
inlineprotected |
Definition at line 216 of file editor_drag.h.
|
inlineprotected |
Definition at line 208 of file editor_drag.h.
|
inlineprotected |
Definition at line 212 of file editor_drag.h.
|
pure virtual |
Called when a drag motion has occurred.
e | Event describing the motion. |
f | true if this is the first movement, otherwise false. |
Implemented in CrossfadeEdgeDrag, AutomationRangeDrag, MouseZoomDrag, RangeMarkerBarDrag, SelectionDrag, ScrubDrag, TimeFXDrag, RubberbandSelectDrag, FeatureLineDrag, LineDrag, ControlPointDrag, MarkerDrag, FadeOutDrag, FadeInDrag, CursorDrag, TempoMarkerDrag, MeterMarkerDrag, TrimDrag, VideoTimeLineDrag, PatchChangeDrag, NoteCreateDrag, NoteDrag, NoteResizeDrag, RegionCreateDrag, RegionCutDrag, RegionRippleDrag, RegionSpliceDrag, RegionMoveDrag, and RegionMotionDrag.
bool Drag::motion_handler | ( | GdkEvent * | event, |
bool | from_autoscroll | ||
) |
Definition at line 363 of file editor_drag.cc.
|
inlinevirtual |
Reimplemented in CrossfadeEdgeDrag, MouseZoomDrag, RubberbandSelectDrag, and RegionMoveDrag.
Definition at line 163 of file editor_drag.h.
|
inlineprotected |
Definition at line 200 of file editor_drag.h.
|
inline |
Definition at line 127 of file editor_drag.h.
|
inline |
Definition at line 110 of file editor_drag.h.
|
inlinevirtual |
Set up the _pointer_frame_offset
Reimplemented in SelectionDrag, MarkerDrag, FadeOutDrag, FadeInDrag, TempoMarkerDrag, MeterMarkerDrag, TrimDrag, PatchChangeDrag, and RegionMoveDrag.
Definition at line 186 of file editor_drag.h.
|
protected |
Definition at line 448 of file editor_drag.cc.
|
protected |
Definition at line 455 of file editor_drag.cc.
|
protected |
Definition at line 441 of file editor_drag.cc.
|
virtual |
Called to start a grab of an item.
e | Event that caused the grab to start. |
c | Cursor to use, or 0. |
Reimplemented in CrossfadeEdgeDrag, AutomationRangeDrag, MouseZoomDrag, RangeMarkerBarDrag, SelectionDrag, ScrubDrag, TimeFXDrag, RubberbandSelectDrag, FeatureLineDrag, LineDrag, ControlPointDrag, MarkerDrag, FadeOutDrag, FadeInDrag, CursorDrag, TempoMarkerDrag, MeterMarkerDrag, TrimDrag, VideoTimeLineDrag, NoteCreateDrag, NoteDrag, NoteResizeDrag, and RegionMotionDrag.
Definition at line 249 of file editor_drag.cc.
void Drag::swap_grab | ( | ArdourCanvas::Item * | new_item, |
Gdk::Cursor * | cursor, | ||
uint32_t | |||
) |
Definition at line 234 of file editor_drag.cc.
|
inline |
Definition at line 126 of file editor_drag.h.
|
inlinevirtual |
Reimplemented in AutomationRangeDrag.
Definition at line 172 of file editor_drag.h.
|
inlinevirtual |
Reimplemented in CrossfadeEdgeDrag, RangeMarkerBarDrag, MarkerDrag, FadeOutDrag, FadeInDrag, CursorDrag, TempoMarkerDrag, MeterMarkerDrag, TrimDrag, VideoTimeLineDrag, PatchChangeDrag, and NoteCreateDrag.
Definition at line 177 of file editor_drag.h.
|
private |
cursor change context
Definition at line 251 of file editor_drag.h.
|
protected |
Definition at line 230 of file editor_drag.h.
|
protected |
our editor
Definition at line 229 of file editor_drag.h.
|
private |
adjusted_frame that the mouse was at when start_grab was called, or 0
Definition at line 249 of file editor_drag.h.
|
private |
trackview x of the grab start position
Definition at line 244 of file editor_drag.h.
|
private |
y of the grab start position, possibly adjusted if _trackview_only is true
Definition at line 245 of file editor_drag.h.
|
private |
true if after move threshold is passed we appear to be moving vertically; undefined before that
Definition at line 242 of file editor_drag.h.
|
protected |
our item
Definition at line 231 of file editor_drag.h.
|
private |
adjusted_frame the last time a motion occurred
Definition at line 250 of file editor_drag.h.
|
private |
trackview x of the pointer last time a motion occurred
Definition at line 246 of file editor_drag.h.
|
private |
trackview y of the pointer last time a motion occurred
Definition at line 247 of file editor_drag.h.
|
private |
true if the move threshold has been passed, otherwise false
Definition at line 240 of file editor_drag.h.
|
protected |
Offset from the mouse's position for the drag to the start of the thing that is being dragged
Definition at line 233 of file editor_drag.h.
|
private |
unsnapped frame that the mouse was at when start_grab was called, or 0
Definition at line 248 of file editor_drag.h.
|
private |
true if we called move () with first_move flag, otherwise false
Definition at line 241 of file editor_drag.h.
|
private |
true if pointer y value should always be relative to the top of the trackview group
Definition at line 239 of file editor_drag.h.
|
private |
true if drag initiated by a double click event
Definition at line 243 of file editor_drag.h.
|
protected |
true if the session was rolling before the drag started, otherwise false
Definition at line 236 of file editor_drag.h.
|
protected |
true if x motion is constrained, otherwise false
Definition at line 234 of file editor_drag.h.
|
protected |
true if y motion is constrained, otherwise false
Definition at line 235 of file editor_drag.h.