Ardour  9.0-pre0-582-g084a23a80d
Drag Class Referenceabstract

#include <editor_drag.h>

Inheritance diagram for Drag:
[legend]

Public Member Functions

 Drag (EditingContext &, ArdourCanvas::Item *, Temporal::TimeDomain td, ArdourCanvas::Item const *bounding_item, bool hide_snapped_cursor=true)
 
virtual ~Drag ()
 
void set_manager (DragManager *m)
 
void set_bounding_item (ArdourCanvas::Item const *i)
 
ArdourCanvas::Itemitem () const
 
Temporal::TimeDomain time_domain () const
 
void set_time_domain (Temporal::TimeDomain)
 
void swap_grab (ArdourCanvas::Item *, Gdk::Cursor *, uint32_t)
 
bool motion_handler (GdkEvent *, bool)
 
void abort ()
 
Temporal::timepos_t adjusted_time (Temporal::timepos_t const &, GdkEvent const *, bool snap=true) const
 
Temporal::timepos_t adjusted_current_time (GdkEvent const *, bool snap=true) const
 
bool was_double_click () const
 
void set_double_click (bool yn)
 
void set_grab_button_anyway (GdkEvent *)
 
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)
 
bool preview_video () const
 
std::pair< Temporal::timecnt_t, int > move_threshold () const
 
virtual bool allow_vertical_autoscroll () const
 
virtual bool allow_horizontal_autoscroll () const
 
virtual bool x_movement_matters () const
 
virtual bool y_movement_matters () const
 
virtual bool mid_drag_key_event (GdkEventKey *)
 
bool initially_vertical () const
 
virtual void setup_pointer_offset ()
 
virtual void setup_video_offset ()
 
int grab_button () const
 

Protected Member Functions

double grab_x () const
 
double grab_y () const
 
Temporal::timepos_t pixel_duration_to_time (double x) const
 
Temporal::timepos_t raw_grab_time () const
 
ARDOUR::samplepos_t grab_sample () const
 
Temporal::timepos_t grab_time () const
 
double last_pointer_x () const
 
double last_pointer_y () const
 
ARDOUR::samplepos_t last_pointer_sample () const
 
Temporal::timepos_t last_pointer_time () const
 
Temporal::timecnt_t snap_delta (guint const) const
 
double current_pointer_x () const
 
double current_pointer_y () const
 
void setup_snap_delta (Temporal::timepos_t const &pos)
 
std::shared_ptr< ARDOUR::Regionadd_midi_region (MidiTimeAxisView *, bool commit)
 
void show_verbose_cursor_time (Temporal::timepos_t const &)
 
void show_verbose_cursor_duration (Temporal::timepos_t const &, Temporal::timepos_t const &, double xoffset=0)
 
void show_verbose_cursor_text (std::string const &)
 
void show_view_preview (Temporal::timepos_t const &)
 

Protected Attributes

EditingContextediting_context
 
DragManager_drags
 
ArdourCanvas::Item_item
 our item More...
 
ArdourCanvas::Item const * _bounding_item
 our coordinate reference (normally null) More...
 
Temporal::timecnt_t _pointer_offset
 
Temporal::timecnt_t _video_offset
 
bool _preview_video
 
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...
 
ARDOUR::timepos_t _earliest_time_limit
 time we cannot drag before (defaults to 0, indicating no such limit) More...
 

Private Attributes

bool _trackview_only
 true if pointer y value should always be relative to the top of the trackview group More...
 
bool _hide_snapped_cursor
 set true of Drag::motion does not call set_snapped_cursor_position 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 _bounding_itme is non-null 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...
 
Temporal::timepos_t _raw_grab_time
 unsnapped time that the mouse was at when start_grab was called, or 0 More...
 
Temporal::timepos_t _grab_time
 adjusted_time that the mouse was at when start_grab was called, or 0 More...
 
Temporal::timepos_t _last_pointer_time
 adjusted_time the last time a motion occurred More...
 
Temporal::TimeDomain _time_domain
 
Temporal::timecnt_t _snap_delta
 
bool _constraint_pressed
 if the keyboard indicated constraint modifier was pressed on start_grab() More...
 
int _grab_button
 
Gtkmm2ext::Bindings::DragsBlockBindings binding_blocker
 

Detailed Description

Abstract base class for dragging of things within the editor

Definition at line 153 of file editor_drag.h.

Constructor & Destructor Documentation

◆ Drag()

Drag::Drag ( EditingContext ,
ArdourCanvas::Item ,
Temporal::TimeDomain  td,
ArdourCanvas::Item const *  bounding_item,
bool  hide_snapped_cursor = true 
)

◆ ~Drag()

virtual Drag::~Drag ( )
virtual

Member Function Documentation

◆ abort()

void Drag::abort ( )

◆ aborted()

◆ active()

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

Reimplemented in HitCreateDrag, NoteCreateDrag, and ControlPointDrag.

Definition at line 216 of file editor_drag.h.

◆ add_midi_region()

std::shared_ptr<ARDOUR::Region> Drag::add_midi_region ( MidiTimeAxisView ,
bool  commit 
)
protected

◆ adjusted_current_time()

Temporal::timepos_t Drag::adjusted_current_time ( GdkEvent const *  ,
bool  snap = true 
) const

◆ adjusted_time()

Temporal::timepos_t Drag::adjusted_time ( Temporal::timepos_t const &  ,
GdkEvent const *  ,
bool  snap = true 
) const

◆ allow_horizontal_autoscroll()

virtual bool Drag::allow_horizontal_autoscroll ( ) const
inlinevirtual

Reimplemented in LollipopDrag, MappingTwistDrag, and MappingEndDrag.

Definition at line 233 of file editor_drag.h.

◆ allow_vertical_autoscroll()

◆ current_pointer_x()

double Drag::current_pointer_x ( ) const
protected

◆ current_pointer_y()

double Drag::current_pointer_y ( ) const
protected

◆ end_grab()

virtual bool Drag::end_grab ( GdkEvent )
virtual

Reimplemented in ClipEndDrag, and ClipStartDrag.

◆ finished()

◆ grab_button()

int Drag::grab_button ( ) const
inline

Definition at line 265 of file editor_drag.h.

◆ grab_sample()

ARDOUR::samplepos_t Drag::grab_sample ( ) const
inlineprotected

Definition at line 283 of file editor_drag.h.

◆ grab_time()

Temporal::timepos_t Drag::grab_time ( ) const
inlineprotected

Definition at line 287 of file editor_drag.h.

◆ grab_x()

double Drag::grab_x ( ) const
inlineprotected

Definition at line 269 of file editor_drag.h.

◆ grab_y()

double Drag::grab_y ( ) const
inlineprotected

Definition at line 273 of file editor_drag.h.

◆ initially_vertical()

bool Drag::initially_vertical ( ) const
inline

Definition at line 249 of file editor_drag.h.

◆ item()

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

Definition at line 168 of file editor_drag.h.

◆ last_pointer_sample()

ARDOUR::samplepos_t Drag::last_pointer_sample ( ) const
inlineprotected

Definition at line 299 of file editor_drag.h.

◆ last_pointer_time()

Temporal::timepos_t Drag::last_pointer_time ( ) const
inlineprotected

Definition at line 303 of file editor_drag.h.

◆ last_pointer_x()

double Drag::last_pointer_x ( ) const
inlineprotected

Definition at line 291 of file editor_drag.h.

◆ last_pointer_y()

double Drag::last_pointer_y ( ) const
inlineprotected

Definition at line 295 of file editor_drag.h.

◆ mid_drag_key_event()

virtual bool Drag::mid_drag_key_event ( GdkEventKey )
inlinevirtual

◆ motion()

◆ motion_handler()

bool Drag::motion_handler ( GdkEvent ,
bool   
)

◆ move_threshold()

std::pair<Temporal::timecnt_t,int> Drag::move_threshold ( ) const
inline
Returns
minimum number of samples (in x) and pixels (in y) that should be considered a movement

Definition at line 225 of file editor_drag.h.

◆ pixel_duration_to_time()

Temporal::timepos_t Drag::pixel_duration_to_time ( double  x) const
protected

◆ preview_video()

bool Drag::preview_video ( ) const
inline

Definition at line 220 of file editor_drag.h.

◆ raw_grab_time()

Temporal::timepos_t Drag::raw_grab_time ( ) const
inlineprotected

Definition at line 279 of file editor_drag.h.

◆ set_bounding_item()

void Drag::set_bounding_item ( ArdourCanvas::Item const *  i)
inline

Definition at line 163 of file editor_drag.h.

◆ set_double_click()

void Drag::set_double_click ( bool  yn)
inline

Definition at line 183 of file editor_drag.h.

◆ set_grab_button_anyway()

void Drag::set_grab_button_anyway ( GdkEvent )

◆ set_manager()

void Drag::set_manager ( DragManager m)
inline

Definition at line 159 of file editor_drag.h.

◆ set_time_domain()

void Drag::set_time_domain ( Temporal::TimeDomain  )

◆ setup_pointer_offset()

virtual void Drag::setup_pointer_offset ( )
inlinevirtual

◆ setup_snap_delta()

void Drag::setup_snap_delta ( Temporal::timepos_t const &  pos)
protected

◆ setup_video_offset()

virtual void Drag::setup_video_offset ( )
inlinevirtual

Set up the _video_offset - relative to _current_pointer_time

Reimplemented in MarkerDrag, and RegionDrag.

Definition at line 259 of file editor_drag.h.

◆ show_verbose_cursor_duration()

void Drag::show_verbose_cursor_duration ( Temporal::timepos_t const &  ,
Temporal::timepos_t const &  ,
double  xoffset = 0 
)
protected

◆ show_verbose_cursor_text()

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

◆ show_verbose_cursor_time()

void Drag::show_verbose_cursor_time ( Temporal::timepos_t const &  )
protected

◆ show_view_preview()

void Drag::show_view_preview ( Temporal::timepos_t const &  )
protected

◆ snap_delta()

Temporal::timecnt_t Drag::snap_delta ( guint const  ) const
protected

◆ start_grab()

◆ swap_grab()

void Drag::swap_grab ( ArdourCanvas::Item ,
Gdk::Cursor ,
uint32_t   
)

◆ time_domain()

Temporal::TimeDomain Drag::time_domain ( ) const
inline

Definition at line 172 of file editor_drag.h.

◆ was_double_click()

bool Drag::was_double_click ( ) const
inline

Definition at line 182 of file editor_drag.h.

◆ x_movement_matters()

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

Reimplemented in LollipopDrag, and AutomationRangeDrag.

Definition at line 238 of file editor_drag.h.

◆ y_movement_matters()

virtual bool Drag::y_movement_matters ( ) const
inlinevirtual

Member Data Documentation

◆ _bounding_item

ArdourCanvas::Item const* Drag::_bounding_item
protected

our coordinate reference (normally null)

Definition at line 325 of file editor_drag.h.

◆ _constraint_pressed

bool Drag::_constraint_pressed
private

if the keyboard indicated constraint modifier was pressed on start_grab()

Definition at line 355 of file editor_drag.h.

◆ _drags

DragManager* Drag::_drags
protected

Definition at line 323 of file editor_drag.h.

◆ _earliest_time_limit

ARDOUR::timepos_t Drag::_earliest_time_limit
protected

time we cannot drag before (defaults to 0, indicating no such limit)

Definition at line 333 of file editor_drag.h.

◆ _grab_button

int Drag::_grab_button
private

Definition at line 356 of file editor_drag.h.

◆ _grab_time

Temporal::timepos_t Drag::_grab_time
private

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

Definition at line 347 of file editor_drag.h.

◆ _grab_x

double Drag::_grab_x
private

trackview x of the grab start position

Definition at line 342 of file editor_drag.h.

◆ _grab_y

double Drag::_grab_y
private

y of the grab start position, possibly adjusted if _bounding_itme is non-null

Definition at line 343 of file editor_drag.h.

◆ _hide_snapped_cursor

bool Drag::_hide_snapped_cursor
private

set true of Drag::motion does not call set_snapped_cursor_position

Definition at line 337 of file editor_drag.h.

◆ _initially_vertical

bool Drag::_initially_vertical
private

true if after move threshold is passed we appear to be moving vertically; undefined before that

Definition at line 340 of file editor_drag.h.

◆ _item

ArdourCanvas::Item* Drag::_item
protected

our item

Definition at line 324 of file editor_drag.h.

◆ _last_pointer_time

Temporal::timepos_t Drag::_last_pointer_time
private

adjusted_time the last time a motion occurred

Definition at line 348 of file editor_drag.h.

◆ _last_pointer_x

double Drag::_last_pointer_x
private

trackview x of the pointer last time a motion occurred

Definition at line 344 of file editor_drag.h.

◆ _last_pointer_y

double Drag::_last_pointer_y
private

trackview y of the pointer last time a motion occurred

Definition at line 345 of file editor_drag.h.

◆ _move_threshold_passed

bool Drag::_move_threshold_passed
private

true if the move threshold has been passed, otherwise false

Definition at line 338 of file editor_drag.h.

◆ _pointer_offset

Temporal::timecnt_t Drag::_pointer_offset
protected

Offset from the mouse's position for the drag to the start of the thing that is being dragged

Definition at line 327 of file editor_drag.h.

◆ _preview_video

bool Drag::_preview_video
protected

Definition at line 329 of file editor_drag.h.

◆ _raw_grab_time

Temporal::timepos_t Drag::_raw_grab_time
private

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

Definition at line 346 of file editor_drag.h.

◆ _snap_delta

Temporal::timecnt_t Drag::_snap_delta
private

Definition at line 354 of file editor_drag.h.

◆ _starting_point_passed

bool Drag::_starting_point_passed
private

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

Definition at line 339 of file editor_drag.h.

◆ _time_domain

Temporal::TimeDomain Drag::_time_domain
private

Definition at line 349 of file editor_drag.h.

◆ _trackview_only

bool Drag::_trackview_only
private

true if pointer y value should always be relative to the top of the trackview group

Definition at line 336 of file editor_drag.h.

◆ _video_offset

Temporal::timecnt_t Drag::_video_offset
protected

Definition at line 328 of file editor_drag.h.

◆ _was_double_click

bool Drag::_was_double_click
private

true if drag initiated by a double click event

Definition at line 341 of file editor_drag.h.

◆ _was_rolling

bool Drag::_was_rolling
protected

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

Definition at line 332 of file editor_drag.h.

◆ _x_constrained

bool Drag::_x_constrained
protected

true if x motion is constrained, otherwise false

Definition at line 330 of file editor_drag.h.

◆ _y_constrained

bool Drag::_y_constrained
protected

true if y motion is constrained, otherwise false

Definition at line 331 of file editor_drag.h.

◆ binding_blocker

Gtkmm2ext::Bindings::DragsBlockBindings Drag::binding_blocker
private

Definition at line 358 of file editor_drag.h.

◆ editing_context

EditingContext& Drag::editing_context
protected

Definition at line 322 of file editor_drag.h.


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