ardour
Public Member Functions | Protected Member Functions | Protected Attributes | Private Attributes | List of all members
Drag Class Referenceabstract

#include <editor_drag.h>

Inheritance diagram for Drag:
AutomationRangeDrag ControlPointDrag CrossfadeEdgeDrag CursorDrag FeatureLineDrag LineDrag MarkerDrag MeterMarkerDrag MouseZoomDrag NoteCreateDrag NoteDrag NoteResizeDrag PatchChangeDrag RangeMarkerBarDrag RegionCreateDrag RegionCutDrag RegionDrag RubberbandSelectDrag ScrubDrag SelectionDrag TempoMarkerDrag VideoTimeLineDrag

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::Regionadd_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...
 

Detailed Description

Abstract base class for dragging of things within the editor

Definition at line 104 of file editor_drag.h.

Constructor & Destructor Documentation

Drag::Drag ( Editor e,
ArdourCanvas::Item *  i,
bool  trackview_only = true 
)

Definition at line 217 of file editor_drag.cc.

virtual Drag::~Drag ( )
inlinevirtual

Definition at line 108 of file editor_drag.h.

Member Function Documentation

void Drag::abort ( )

Call to abort a drag. Ungrabs item and calls subclass's aborted ()

Definition at line 428 of file editor_drag.cc.

virtual void Drag::aborted ( bool  m)
pure virtual
virtual bool Drag::active ( Editing::MouseMode  m)
inlinevirtual
Parameters
mMouse mode.
Returns
true if this drag should happen in this mouse mode.

Reimplemented in ControlPointDrag, and NoteCreateDrag.

Definition at line 158 of file editor_drag.h.

boost::shared_ptr< Region > Drag::add_midi_region ( MidiTimeAxisView view)
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.

virtual bool Drag::allow_vertical_autoscroll ( ) const
inlinevirtual
double Drag::current_pointer_x ( ) const
protected

Definition at line 347 of file editor_drag.cc.

double Drag::current_pointer_y ( ) const
protected

Definition at line 353 of file editor_drag.cc.

bool Drag::end_grab ( GdkEvent *  event)
virtual

Call to end a drag `successfully'. Ungrabs item and calls subclass' finished() method.

Parameters
eventGDK event, or 0.
Returns
true if some movement occurred, otherwise false.

Definition at line 310 of file editor_drag.cc.

virtual void Drag::finished ( GdkEvent *  e,
bool  m 
)
pure virtual
ARDOUR::framepos_t Drag::grab_frame ( ) const
inlineprotected

Definition at line 204 of file editor_drag.h.

double Drag::grab_x ( ) const
inlineprotected

Definition at line 192 of file editor_drag.h.

double Drag::grab_y ( ) const
inlineprotected

Definition at line 196 of file editor_drag.h.

bool Drag::initially_vertical ( ) const
inline

Definition at line 181 of file editor_drag.h.

ArdourCanvas::Item* Drag::item ( ) const
inline
Returns
the canvas item being dragged

Definition at line 115 of file editor_drag.h.

double Drag::last_pointer_frame ( ) const
inlineprotected

Definition at line 216 of file editor_drag.h.

double Drag::last_pointer_x ( ) const
inlineprotected

Definition at line 208 of file editor_drag.h.

double Drag::last_pointer_y ( ) const
inlineprotected

Definition at line 212 of file editor_drag.h.

virtual void Drag::motion ( GdkEvent *  e,
bool  f 
)
pure virtual
bool Drag::motion_handler ( GdkEvent *  event,
bool  from_autoscroll 
)

Definition at line 363 of file editor_drag.cc.

virtual std::pair<ARDOUR::framecnt_t, int> Drag::move_threshold ( ) const
inlinevirtual
Returns
minimum number of frames (in x) and pixels (in y) that should be considered a movement

Reimplemented in CrossfadeEdgeDrag, MouseZoomDrag, RubberbandSelectDrag, and RegionMoveDrag.

Definition at line 163 of file editor_drag.h.

ARDOUR::framepos_t Drag::raw_grab_frame ( ) const
inlineprotected

Definition at line 200 of file editor_drag.h.

void Drag::set_double_click ( bool  yn)
inline

Definition at line 127 of file editor_drag.h.

void Drag::set_manager ( DragManager m)
inline

Definition at line 110 of file editor_drag.h.

virtual void Drag::setup_pointer_frame_offset ( )
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.

void Drag::show_verbose_cursor_duration ( framepos_t  start,
framepos_t  end,
double  xoffset = 0 
)
protected

Definition at line 448 of file editor_drag.cc.

void Drag::show_verbose_cursor_text ( std::string const &  )
protected

Definition at line 455 of file editor_drag.cc.

void Drag::show_verbose_cursor_time ( framepos_t  frame)
protected

Definition at line 441 of file editor_drag.cc.

void Drag::start_grab ( GdkEvent *  e,
Gdk::Cursor *  c = 0 
)
virtual
void Drag::swap_grab ( ArdourCanvas::Item *  new_item,
Gdk::Cursor *  cursor,
uint32_t   
)

Definition at line 234 of file editor_drag.cc.

bool Drag::was_double_click ( ) const
inline

Definition at line 126 of file editor_drag.h.

virtual bool Drag::x_movement_matters ( ) const
inlinevirtual
Returns
true if x movement matters to this drag

Reimplemented in AutomationRangeDrag.

Definition at line 172 of file editor_drag.h.

virtual bool Drag::y_movement_matters ( ) const
inlinevirtual
Returns
true if y movement matters to this drag

Reimplemented in CrossfadeEdgeDrag, RangeMarkerBarDrag, MarkerDrag, FadeOutDrag, FadeInDrag, CursorDrag, TempoMarkerDrag, MeterMarkerDrag, TrimDrag, VideoTimeLineDrag, PatchChangeDrag, and NoteCreateDrag.

Definition at line 177 of file editor_drag.h.

Member Data Documentation

CursorContext::Handle Drag::_cursor_ctx
private

cursor change context

Definition at line 251 of file editor_drag.h.

DragManager* Drag::_drags
protected

Definition at line 230 of file editor_drag.h.

Editor* Drag::_editor
protected

our editor

Definition at line 229 of file editor_drag.h.

ARDOUR::framepos_t Drag::_grab_frame
private

adjusted_frame that the mouse was at when start_grab was called, or 0

Definition at line 249 of file editor_drag.h.

double Drag::_grab_x
private

trackview x of the grab start position

Definition at line 244 of file editor_drag.h.

double Drag::_grab_y
private

y of the grab start position, possibly adjusted if _trackview_only is true

Definition at line 245 of file editor_drag.h.

bool Drag::_initially_vertical
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.

ArdourCanvas::Item* Drag::_item
protected

our item

Definition at line 231 of file editor_drag.h.

ARDOUR::framepos_t Drag::_last_pointer_frame
private

adjusted_frame the last time a motion occurred

Definition at line 250 of file editor_drag.h.

double Drag::_last_pointer_x
private

trackview x of the pointer last time a motion occurred

Definition at line 246 of file editor_drag.h.

double Drag::_last_pointer_y
private

trackview y of the pointer last time a motion occurred

Definition at line 247 of file editor_drag.h.

bool Drag::_move_threshold_passed
private

true if the move threshold has been passed, otherwise false

Definition at line 240 of file editor_drag.h.

ARDOUR::framecnt_t Drag::_pointer_frame_offset
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.

ARDOUR::framepos_t Drag::_raw_grab_frame
private

unsnapped frame that the mouse was at when start_grab was called, or 0

Definition at line 248 of file editor_drag.h.

bool Drag::_starting_point_passed
private

true if we called move () with first_move flag, otherwise false

Definition at line 241 of file editor_drag.h.

bool Drag::_trackview_only
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.

bool Drag::_was_double_click
private

true if drag initiated by a double click event

Definition at line 243 of file editor_drag.h.

bool Drag::_was_rolling
protected

true if the session was rolling before the drag started, otherwise false

Definition at line 236 of file editor_drag.h.

bool Drag::_x_constrained
protected

true if x motion is constrained, otherwise false

Definition at line 234 of file editor_drag.h.

bool Drag::_y_constrained
protected

true if y motion is constrained, otherwise false

Definition at line 235 of file editor_drag.h.


The documentation for this class was generated from the following files: