mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-10 00:34:59 +01:00
editing refactoring, the drag part
This commit is contained in:
parent
089a9521d5
commit
dee8e920e6
15 changed files with 897 additions and 830 deletions
|
|
@ -18,10 +18,13 @@
|
||||||
|
|
||||||
#include "pbd/error.h"
|
#include "pbd/error.h"
|
||||||
|
|
||||||
|
#include "ardour/rc_configuration.h"
|
||||||
|
|
||||||
#include "gtkmm2ext/bindings.h"
|
#include "gtkmm2ext/bindings.h"
|
||||||
|
|
||||||
#include "actions.h"
|
#include "actions.h"
|
||||||
#include "editing_context.h"
|
#include "editing_context.h"
|
||||||
|
#include "editor_drag.h"
|
||||||
#include "midi_region_view.h"
|
#include "midi_region_view.h"
|
||||||
|
|
||||||
#include "pbd/i18n.h"
|
#include "pbd/i18n.h"
|
||||||
|
|
@ -69,6 +72,8 @@ EditingContext::EditingContext ()
|
||||||
, _draw_length (GridTypeNone)
|
, _draw_length (GridTypeNone)
|
||||||
, _draw_velocity (DRAW_VEL_AUTO)
|
, _draw_velocity (DRAW_VEL_AUTO)
|
||||||
, _draw_channel (DRAW_CHAN_AUTO)
|
, _draw_channel (DRAW_CHAN_AUTO)
|
||||||
|
, _drags (new DragManager (this))
|
||||||
|
, rubberband_rect (0)
|
||||||
{
|
{
|
||||||
grid_type_strings = I18N (_grid_type_strings);
|
grid_type_strings = I18N (_grid_type_strings);
|
||||||
}
|
}
|
||||||
|
|
@ -1041,3 +1046,44 @@ EditingContext::build_draw_midi_menus ()
|
||||||
draw_channel_selector.AddMenuElem (MenuElem (_("Auto"), sigc::bind (sigc::mem_fun(*this, &EditingContext::draw_channel_selection_done), DRAW_CHAN_AUTO)));
|
draw_channel_selector.AddMenuElem (MenuElem (_("Auto"), sigc::bind (sigc::mem_fun(*this, &EditingContext::draw_channel_selection_done), DRAW_CHAN_AUTO)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
EditingContext::drag_active () const
|
||||||
|
{
|
||||||
|
return _drags->active();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
EditingContext::preview_video_drag_active () const
|
||||||
|
{
|
||||||
|
return _drags->preview_video ();
|
||||||
|
}
|
||||||
|
|
||||||
|
Temporal::TimeDomain
|
||||||
|
EditingContext::time_domain () const
|
||||||
|
{
|
||||||
|
if (_session) {
|
||||||
|
return _session->config.get_default_time_domain();
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Probably never reached */
|
||||||
|
|
||||||
|
if (_snap_mode == SnapOff) {
|
||||||
|
return Temporal::AudioTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (_grid_type) {
|
||||||
|
case GridTypeNone:
|
||||||
|
/* fallthrough */
|
||||||
|
case GridTypeMinSec:
|
||||||
|
/* fallthrough */
|
||||||
|
case GridTypeCDFrame:
|
||||||
|
/* fallthrough */
|
||||||
|
case GridTypeTimecode:
|
||||||
|
/* fallthrough */
|
||||||
|
return Temporal::AudioTime;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return Temporal::BeatTime;
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -49,10 +49,13 @@
|
||||||
using ARDOUR::samplepos_t;
|
using ARDOUR::samplepos_t;
|
||||||
using ARDOUR::samplecnt_t;
|
using ARDOUR::samplecnt_t;
|
||||||
|
|
||||||
class VerboseCursor;
|
|
||||||
class MouseCursors;
|
|
||||||
class MidiRegionView;
|
|
||||||
class CursorContext;
|
class CursorContext;
|
||||||
|
class DragManager;
|
||||||
|
class EditorCursor;
|
||||||
|
class MidiRegionView;
|
||||||
|
class MouseCursors;
|
||||||
|
class VerboseCursor;
|
||||||
|
class TrackViewList;
|
||||||
|
|
||||||
class EditingContext : public ARDOUR::SessionHandlePtr
|
class EditingContext : public ARDOUR::SessionHandlePtr
|
||||||
{
|
{
|
||||||
|
|
@ -68,9 +71,40 @@ public:
|
||||||
|
|
||||||
void set_session (ARDOUR::Session*);
|
void set_session (ARDOUR::Session*);
|
||||||
|
|
||||||
|
Temporal::TimeDomain time_domain () const;
|
||||||
|
|
||||||
|
DragManager* drags () const {
|
||||||
|
return _drags;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool drag_active () const;
|
||||||
|
bool preview_video_drag_active () const;
|
||||||
|
|
||||||
|
virtual void select_all_within (Temporal::timepos_t const &, Temporal::timepos_t const &, double, double, TrackViewList const &, Selection::Operation, bool) = 0;
|
||||||
|
|
||||||
|
virtual EditorCursor* playhead_cursor () const = 0;
|
||||||
|
virtual EditorCursor* snapped_cursor () const = 0;
|
||||||
|
|
||||||
|
virtual void maybe_autoscroll (bool, bool, bool from_headers) = 0;
|
||||||
|
virtual void stop_canvas_autoscroll () = 0;
|
||||||
|
virtual bool autoscroll_active() const = 0;
|
||||||
|
|
||||||
virtual void instant_save() = 0;
|
virtual void instant_save() = 0;
|
||||||
virtual void redisplay_grid (bool immediate_redraw) = 0;
|
virtual void redisplay_grid (bool immediate_redraw) = 0;
|
||||||
virtual Temporal::timecnt_t get_nudge_distance (Temporal::timepos_t const & pos, Temporal::timecnt_t& next) = 0;
|
virtual Temporal::timecnt_t get_nudge_distance (Temporal::timepos_t const & pos, Temporal::timecnt_t& next) = 0;
|
||||||
|
|
||||||
|
/** Set whether the editor should follow the playhead.
|
||||||
|
* @param yn true to follow playhead, otherwise false.
|
||||||
|
* @param catch_up true to reset the editor view to show the playhead (if yn == true), otherwise false.
|
||||||
|
*/
|
||||||
|
virtual void set_follow_playhead (bool yn, bool catch_up = true) = 0;
|
||||||
|
|
||||||
|
/** Toggle whether the editor is following the playhead */
|
||||||
|
virtual void toggle_follow_playhead () = 0;
|
||||||
|
|
||||||
|
/** @return true if the editor is following the playhead */
|
||||||
|
virtual bool follow_playhead () const = 0;
|
||||||
|
|
||||||
/** Get the topmost enter context for the given item type.
|
/** Get the topmost enter context for the given item type.
|
||||||
*
|
*
|
||||||
* This is used to change the cursor associated with a given enter context,
|
* This is used to change the cursor associated with a given enter context,
|
||||||
|
|
@ -78,8 +112,13 @@ public:
|
||||||
*/
|
*/
|
||||||
virtual EnterContext* get_enter_context(ItemType type) = 0;
|
virtual EnterContext* get_enter_context(ItemType type) = 0;
|
||||||
|
|
||||||
|
virtual void begin_selection_op_history () = 0;
|
||||||
virtual void begin_reversible_selection_op (std::string cmd_name) = 0;
|
virtual void begin_reversible_selection_op (std::string cmd_name) = 0;
|
||||||
virtual void commit_reversible_selection_op () = 0;
|
virtual void commit_reversible_selection_op () = 0;
|
||||||
|
virtual void abort_reversible_selection_op () = 0;
|
||||||
|
virtual void undo_selection_op () = 0;
|
||||||
|
virtual void redo_selection_op () = 0;
|
||||||
|
|
||||||
virtual void begin_reversible_command (std::string cmd_name) = 0;
|
virtual void begin_reversible_command (std::string cmd_name) = 0;
|
||||||
virtual void begin_reversible_command (GQuark) = 0;
|
virtual void begin_reversible_command (GQuark) = 0;
|
||||||
virtual void abort_reversible_command () = 0;
|
virtual void abort_reversible_command () = 0;
|
||||||
|
|
@ -95,6 +134,16 @@ public:
|
||||||
virtual double time_to_pixel_unrounded (Temporal::timepos_t const & pos) const = 0;
|
virtual double time_to_pixel_unrounded (Temporal::timepos_t const & pos) const = 0;
|
||||||
virtual double duration_to_pixels (Temporal::timecnt_t const & pos) const = 0;
|
virtual double duration_to_pixels (Temporal::timecnt_t const & pos) const = 0;
|
||||||
virtual double duration_to_pixels_unrounded (Temporal::timecnt_t const & pos) const = 0;
|
virtual double duration_to_pixels_unrounded (Temporal::timecnt_t const & pos) const = 0;
|
||||||
|
/** computes the timeline sample (sample) of an event whose coordinates
|
||||||
|
* are in canvas units (pixels, scroll offset included).
|
||||||
|
*/
|
||||||
|
virtual samplepos_t canvas_event_sample (GdkEvent const * event, double* pcx = nullptr, double* pcy = nullptr) const = 0;
|
||||||
|
/** computes the timeline position for an event whose coordinates
|
||||||
|
* are in canvas units (pixels, scroll offset included). The time
|
||||||
|
* domain used by the return value will match ::default_time_domain()
|
||||||
|
* at the time of calling.
|
||||||
|
*/
|
||||||
|
virtual Temporal::timepos_t canvas_event_time (GdkEvent const*, double* px = nullptr, double* py = nullptr) const = 0;
|
||||||
|
|
||||||
virtual Temporal::Beats get_grid_type_as_beats (bool& success, Temporal::timepos_t const & position) = 0;
|
virtual Temporal::Beats get_grid_type_as_beats (bool& success, Temporal::timepos_t const & position) = 0;
|
||||||
virtual Temporal::Beats get_draw_length_as_beats (bool& success, Temporal::timepos_t const & position) = 0;
|
virtual Temporal::Beats get_draw_length_as_beats (bool& success, Temporal::timepos_t const & position) = 0;
|
||||||
|
|
@ -236,6 +285,10 @@ public:
|
||||||
|
|
||||||
void draw_channel_selection_done (int);
|
void draw_channel_selection_done (int);
|
||||||
void draw_channel_chosen (int);
|
void draw_channel_chosen (int);
|
||||||
|
|
||||||
|
DragManager* _drags;
|
||||||
|
|
||||||
|
ArdourCanvas::Rectangle* rubberband_rect;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* __ardour_midi_editing_context_h__ */
|
#endif /* __ardour_midi_editing_context_h__ */
|
||||||
|
|
|
||||||
|
|
@ -338,7 +338,6 @@ Editor::Editor ()
|
||||||
, have_pending_keyboard_selection (false)
|
, have_pending_keyboard_selection (false)
|
||||||
, pending_keyboard_selection_start (0)
|
, pending_keyboard_selection_start (0)
|
||||||
, ignore_gui_changes (false)
|
, ignore_gui_changes (false)
|
||||||
, _drags (new DragManager (this))
|
|
||||||
, lock_dialog (0)
|
, lock_dialog (0)
|
||||||
, last_event_time { 0, 0 }
|
, last_event_time { 0, 0 }
|
||||||
, _dragging_playhead (false)
|
, _dragging_playhead (false)
|
||||||
|
|
@ -380,7 +379,6 @@ Editor::Editor ()
|
||||||
, transport_preroll_rect (0)
|
, transport_preroll_rect (0)
|
||||||
, transport_postroll_rect (0)
|
, transport_postroll_rect (0)
|
||||||
, temp_location (0)
|
, temp_location (0)
|
||||||
, rubberband_rect (0)
|
|
||||||
, _route_groups (0)
|
, _route_groups (0)
|
||||||
, _routes (0)
|
, _routes (0)
|
||||||
, _regions (0)
|
, _regions (0)
|
||||||
|
|
@ -3478,8 +3476,8 @@ Editor::begin_selection_op_history ()
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
Editor::begin_reversible_selection_op (string name)
|
Editor::begin_reversible_selection_op (string name){
|
||||||
{
|
|
||||||
if (_session) {
|
if (_session) {
|
||||||
//cerr << name << endl;
|
//cerr << name << endl;
|
||||||
/* begin/commit pairs can be nested */
|
/* begin/commit pairs can be nested */
|
||||||
|
|
|
||||||
|
|
@ -169,8 +169,6 @@ public:
|
||||||
|
|
||||||
bool pending_locate_request() const { return _pending_locate_request; }
|
bool pending_locate_request() const { return _pending_locate_request; }
|
||||||
|
|
||||||
Temporal::TimeDomain default_time_domain() const;
|
|
||||||
|
|
||||||
samplepos_t leftmost_sample() const { return _leftmost_sample; }
|
samplepos_t leftmost_sample() const { return _leftmost_sample; }
|
||||||
|
|
||||||
samplecnt_t current_page_samples() const {
|
samplecnt_t current_page_samples() const {
|
||||||
|
|
@ -500,6 +498,7 @@ public:
|
||||||
void abort_reversible_selection_op ();
|
void abort_reversible_selection_op ();
|
||||||
void undo_selection_op ();
|
void undo_selection_op ();
|
||||||
void redo_selection_op ();
|
void redo_selection_op ();
|
||||||
|
|
||||||
void begin_reversible_command (std::string cmd_name);
|
void begin_reversible_command (std::string cmd_name);
|
||||||
void begin_reversible_command (GQuark);
|
void begin_reversible_command (GQuark);
|
||||||
void abort_reversible_command ();
|
void abort_reversible_command ();
|
||||||
|
|
@ -509,13 +508,6 @@ public:
|
||||||
return current_mixer_strip;
|
return current_mixer_strip;
|
||||||
}
|
}
|
||||||
|
|
||||||
DragManager* drags () const {
|
|
||||||
return _drags;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool drag_active () const;
|
|
||||||
bool preview_video_drag_active () const;
|
|
||||||
|
|
||||||
void maybe_autoscroll (bool, bool, bool);
|
void maybe_autoscroll (bool, bool, bool);
|
||||||
bool autoscroll_active() const;
|
bool autoscroll_active() const;
|
||||||
|
|
||||||
|
|
@ -1632,8 +1624,6 @@ private:
|
||||||
|
|
||||||
bool ignore_gui_changes;
|
bool ignore_gui_changes;
|
||||||
|
|
||||||
DragManager* _drags;
|
|
||||||
|
|
||||||
void escape ();
|
void escape ();
|
||||||
void lock ();
|
void lock ();
|
||||||
void unlock ();
|
void unlock ();
|
||||||
|
|
@ -2101,8 +2091,6 @@ private:
|
||||||
|
|
||||||
void select_all_within (Temporal::timepos_t const &, Temporal::timepos_t const &, double, double, TrackViewList const &, ARDOUR::SelectionOperation, bool);
|
void select_all_within (Temporal::timepos_t const &, Temporal::timepos_t const &, double, double, TrackViewList const &, ARDOUR::SelectionOperation, bool);
|
||||||
|
|
||||||
ArdourCanvas::Rectangle* rubberband_rect;
|
|
||||||
|
|
||||||
EditorRouteGroups* _route_groups;
|
EditorRouteGroups* _route_groups;
|
||||||
EditorRoutes* _routes;
|
EditorRoutes* _routes;
|
||||||
EditorRegions* _regions;
|
EditorRegions* _regions;
|
||||||
|
|
|
||||||
|
|
@ -599,18 +599,6 @@ Editor::maybe_autoscroll (bool allow_horiz, bool allow_vert, bool from_headers)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
|
||||||
Editor::drag_active () const
|
|
||||||
{
|
|
||||||
return _drags->active();
|
|
||||||
}
|
|
||||||
|
|
||||||
bool
|
|
||||||
Editor::preview_video_drag_active () const
|
|
||||||
{
|
|
||||||
return _drags->preview_video ();
|
|
||||||
}
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
Editor::autoscroll_active () const
|
Editor::autoscroll_active () const
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1210,7 +1210,7 @@ Editor::canvas_section_box_event (GdkEvent *event)
|
||||||
case GDK_BUTTON_PRESS:
|
case GDK_BUTTON_PRESS:
|
||||||
if (!Keyboard::modifier_state_equals (event->button.state, Keyboard::PrimaryModifier)
|
if (!Keyboard::modifier_state_equals (event->button.state, Keyboard::PrimaryModifier)
|
||||||
&& event->button.button == 1) {
|
&& event->button.button == 1) {
|
||||||
_drags->set (new CursorDrag (this, *_playhead_cursor, false), event);
|
_drags->set (new CursorDrag (*this, *_playhead_cursor, false), event);
|
||||||
}
|
}
|
||||||
/*fallthrough*/
|
/*fallthrough*/
|
||||||
case GDK_2BUTTON_PRESS:
|
case GDK_2BUTTON_PRESS:
|
||||||
|
|
@ -1477,7 +1477,7 @@ Editor::drop_regions (const Glib::RefPtr<Gdk::DragContext>& /*context*/,
|
||||||
|
|
||||||
if ((std::dynamic_pointer_cast<AudioRegion> (region_copy) != 0 && dynamic_cast<AudioTimeAxisView*> (rtav) != 0) ||
|
if ((std::dynamic_pointer_cast<AudioRegion> (region_copy) != 0 && dynamic_cast<AudioTimeAxisView*> (rtav) != 0) ||
|
||||||
(std::dynamic_pointer_cast<MidiRegion> (region_copy) != 0 && dynamic_cast<MidiTimeAxisView*> (rtav) != 0)) {
|
(std::dynamic_pointer_cast<MidiRegion> (region_copy) != 0 && dynamic_cast<MidiTimeAxisView*> (rtav) != 0)) {
|
||||||
_drags->set (new RegionInsertDrag (this, region_copy, rtav, timepos_t (pos), drag_time_domain (region_copy.get())), &event);
|
_drags->set (new RegionInsertDrag (*this, region_copy, rtav, timepos_t (pos), drag_time_domain (region_copy.get())), &event);
|
||||||
_drags->end_grab (&event);
|
_drags->end_grab (&event);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load diff
|
|
@ -66,6 +66,7 @@ namespace PBD {
|
||||||
}
|
}
|
||||||
|
|
||||||
class PatchChange;
|
class PatchChange;
|
||||||
|
class EditingContext;
|
||||||
class Editor;
|
class Editor;
|
||||||
class EditorCursor;
|
class EditorCursor;
|
||||||
class TimeAxisView;
|
class TimeAxisView;
|
||||||
|
|
@ -91,7 +92,7 @@ class DragManager
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
DragManager (Editor* e);
|
DragManager (EditingContext* e);
|
||||||
~DragManager ();
|
~DragManager ();
|
||||||
|
|
||||||
bool motion_handler (GdkEvent *, bool);
|
bool motion_handler (GdkEvent *, bool);
|
||||||
|
|
@ -138,7 +139,7 @@ public:
|
||||||
bool preview_video () const;
|
bool preview_video () const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Editor* _editor;
|
EditingContext* _editing_context;
|
||||||
std::list<Drag*> _drags;
|
std::list<Drag*> _drags;
|
||||||
bool _ending; ///< true if end_grab or abort is in progress, otherwise false
|
bool _ending; ///< true if end_grab or abort is in progress, otherwise false
|
||||||
double _current_pointer_x; ///< canvas-coordinate space x of the current pointer
|
double _current_pointer_x; ///< canvas-coordinate space x of the current pointer
|
||||||
|
|
@ -151,7 +152,7 @@ private:
|
||||||
class Drag
|
class Drag
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Drag (Editor *, ArdourCanvas::Item *, Temporal::TimeDomain td, bool trackview_only = true, bool hide_snapped_cursor = true);
|
Drag (EditingContext&, ArdourCanvas::Item *, Temporal::TimeDomain td, bool trackview_only = true, bool hide_snapped_cursor = true);
|
||||||
virtual ~Drag ();
|
virtual ~Drag ();
|
||||||
|
|
||||||
void set_manager (DragManager* m) {
|
void set_manager (DragManager* m) {
|
||||||
|
|
@ -313,7 +314,7 @@ protected:
|
||||||
void show_verbose_cursor_text (std::string const &);
|
void show_verbose_cursor_text (std::string const &);
|
||||||
void show_view_preview (Temporal::timepos_t const &);
|
void show_view_preview (Temporal::timepos_t const &);
|
||||||
|
|
||||||
Editor* _editor; ///< our editor
|
EditingContext& editing_context;
|
||||||
DragManager* _drags;
|
DragManager* _drags;
|
||||||
ArdourCanvas::Item* _item; ///< our item
|
ArdourCanvas::Item* _item; ///< our item
|
||||||
/** Offset from the mouse's position for the drag to the start of the thing that is being dragged */
|
/** Offset from the mouse's position for the drag to the start of the thing that is being dragged */
|
||||||
|
|
@ -352,6 +353,19 @@ private:
|
||||||
Gtkmm2ext::Bindings::DragsBlockBindings binding_blocker;
|
Gtkmm2ext::Bindings::DragsBlockBindings binding_blocker;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/** EditorDrag:
|
||||||
|
*
|
||||||
|
* a base class for Drags that will need access to the full Editor, not just an
|
||||||
|
* Editing Context.
|
||||||
|
*/
|
||||||
|
class EditorDrag : public Drag
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
EditorDrag (Editor&, ArdourCanvas::Item *, Temporal::TimeDomain td, bool trackview_only = true, bool hide_snapped_cursor = true);
|
||||||
|
protected:
|
||||||
|
Editor& _editor;
|
||||||
|
};
|
||||||
|
|
||||||
class RegionDrag;
|
class RegionDrag;
|
||||||
|
|
||||||
/** Container for details about a region being dragged */
|
/** Container for details about a region being dragged */
|
||||||
|
|
@ -379,10 +393,10 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Abstract base class for drags that involve region(s) */
|
/** Abstract base class for drags that involve region(s) */
|
||||||
class RegionDrag : public Drag, public sigc::trackable
|
class RegionDrag : public EditorDrag, public sigc::trackable
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
RegionDrag (Editor *, ArdourCanvas::Item *, RegionView *, std::list<RegionView*> const &, Temporal::TimeDomain, bool hide_snapped_cursor = true);
|
RegionDrag (Editor&, ArdourCanvas::Item *, RegionView *, std::list<RegionView*> const &, Temporal::TimeDomain, bool hide_snapped_cursor = true);
|
||||||
virtual ~RegionDrag () {}
|
virtual ~RegionDrag () {}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
@ -417,7 +431,7 @@ class RegionSlipContentsDrag : public RegionDrag
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
RegionSlipContentsDrag (Editor *, ArdourCanvas::Item *, RegionView *, std::list<RegionView*> const &, Temporal::TimeDomain td);
|
RegionSlipContentsDrag (Editor&, ArdourCanvas::Item *, RegionView *, std::list<RegionView*> const &, Temporal::TimeDomain td);
|
||||||
virtual ~RegionSlipContentsDrag () {}
|
virtual ~RegionSlipContentsDrag () {}
|
||||||
|
|
||||||
virtual void start_grab (GdkEvent *, Gdk::Cursor *);
|
virtual void start_grab (GdkEvent *, Gdk::Cursor *);
|
||||||
|
|
@ -430,7 +444,7 @@ public:
|
||||||
class RegionBrushDrag : public RegionDrag
|
class RegionBrushDrag : public RegionDrag
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
RegionBrushDrag (Editor *, ArdourCanvas::Item *, RegionView *, std::list<RegionView*> const &, Temporal::TimeDomain td);
|
RegionBrushDrag (Editor&, ArdourCanvas::Item *, RegionView *, std::list<RegionView*> const &, Temporal::TimeDomain td);
|
||||||
virtual ~RegionBrushDrag () {}
|
virtual ~RegionBrushDrag () {}
|
||||||
|
|
||||||
virtual void start_grab (GdkEvent *, Gdk::Cursor *);
|
virtual void start_grab (GdkEvent *, Gdk::Cursor *);
|
||||||
|
|
@ -447,7 +461,7 @@ class RegionMotionDrag : public RegionDrag
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
RegionMotionDrag (Editor *, ArdourCanvas::Item *, RegionView *, std::list<RegionView*> const &, Temporal::TimeDomain td);
|
RegionMotionDrag (Editor&, ArdourCanvas::Item *, RegionView *, std::list<RegionView*> const &, Temporal::TimeDomain td);
|
||||||
virtual ~RegionMotionDrag () {}
|
virtual ~RegionMotionDrag () {}
|
||||||
|
|
||||||
virtual void start_grab (GdkEvent *, Gdk::Cursor *);
|
virtual void start_grab (GdkEvent *, Gdk::Cursor *);
|
||||||
|
|
@ -486,7 +500,7 @@ private:
|
||||||
class RegionMoveDrag : public RegionMotionDrag
|
class RegionMoveDrag : public RegionMotionDrag
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
RegionMoveDrag (Editor *, ArdourCanvas::Item *, RegionView *, std::list<RegionView*> const &, bool, Temporal::TimeDomain);
|
RegionMoveDrag (Editor&, ArdourCanvas::Item *, RegionView *, std::list<RegionView*> const &, bool, Temporal::TimeDomain);
|
||||||
virtual ~RegionMoveDrag () {}
|
virtual ~RegionMoveDrag () {}
|
||||||
|
|
||||||
void motion (GdkEvent *, bool);
|
void motion (GdkEvent *, bool);
|
||||||
|
|
@ -546,7 +560,7 @@ private:
|
||||||
class RegionInsertDrag : public RegionMotionDrag
|
class RegionInsertDrag : public RegionMotionDrag
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
RegionInsertDrag (Editor *, std::shared_ptr<ARDOUR::Region>, RouteTimeAxisView*, Temporal::timepos_t const &, Temporal::TimeDomain);
|
RegionInsertDrag (Editor&, std::shared_ptr<ARDOUR::Region>, RouteTimeAxisView*, Temporal::timepos_t const &, Temporal::TimeDomain);
|
||||||
|
|
||||||
void finished (GdkEvent *, bool);
|
void finished (GdkEvent *, bool);
|
||||||
void aborted (bool);
|
void aborted (bool);
|
||||||
|
|
@ -557,25 +571,23 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
/** "Drag" to cut a region (action only on button release) */
|
/** "Drag" to cut a region (action only on button release) */
|
||||||
class RegionCutDrag : public Drag
|
class RegionCutDrag : public EditorDrag
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
RegionCutDrag (Editor*, ArdourCanvas::Item*, samplepos_t);
|
RegionCutDrag (Editor&, ArdourCanvas::Item*, samplepos_t);
|
||||||
~RegionCutDrag ();
|
~RegionCutDrag ();
|
||||||
|
|
||||||
void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
|
void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
|
||||||
void motion (GdkEvent*, bool);
|
void motion (GdkEvent*, bool);
|
||||||
void finished (GdkEvent*, bool);
|
void finished (GdkEvent*, bool);
|
||||||
void aborted (bool);
|
void aborted (bool);
|
||||||
|
|
||||||
private:
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Drags to create regions */
|
/** Drags to create regions */
|
||||||
class RegionCreateDrag : public Drag
|
class RegionCreateDrag : public EditorDrag
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
RegionCreateDrag (Editor *, ArdourCanvas::Item *, TimeAxisView *);
|
RegionCreateDrag (Editor&, ArdourCanvas::Item *, TimeAxisView *);
|
||||||
|
|
||||||
void motion (GdkEvent *, bool);
|
void motion (GdkEvent *, bool);
|
||||||
void finished (GdkEvent *, bool);
|
void finished (GdkEvent *, bool);
|
||||||
|
|
@ -590,7 +602,7 @@ private:
|
||||||
class NoteResizeDrag : public Drag
|
class NoteResizeDrag : public Drag
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
NoteResizeDrag (Editor *, ArdourCanvas::Item *);
|
NoteResizeDrag (EditingContext&, ArdourCanvas::Item *);
|
||||||
|
|
||||||
void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
|
void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
|
||||||
void motion (GdkEvent *, bool);
|
void motion (GdkEvent *, bool);
|
||||||
|
|
@ -613,7 +625,7 @@ private:
|
||||||
class NoteDrag : public Drag
|
class NoteDrag : public Drag
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
NoteDrag (Editor*, ArdourCanvas::Item*);
|
NoteDrag (EditingContext&, ArdourCanvas::Item*);
|
||||||
|
|
||||||
void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
|
void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
|
||||||
void motion (GdkEvent *, bool);
|
void motion (GdkEvent *, bool);
|
||||||
|
|
@ -644,7 +656,7 @@ private:
|
||||||
class NoteCreateDrag : public Drag
|
class NoteCreateDrag : public Drag
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
NoteCreateDrag (Editor *, ArdourCanvas::Item *, MidiRegionView *);
|
NoteCreateDrag (EditingContext&, ArdourCanvas::Item *, MidiRegionView *);
|
||||||
~NoteCreateDrag ();
|
~NoteCreateDrag ();
|
||||||
|
|
||||||
void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
|
void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
|
||||||
|
|
@ -681,7 +693,7 @@ private:
|
||||||
class HitCreateDrag : public Drag
|
class HitCreateDrag : public Drag
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
HitCreateDrag (Editor *, ArdourCanvas::Item *, MidiRegionView *);
|
HitCreateDrag (EditingContext&, ArdourCanvas::Item *, MidiRegionView *);
|
||||||
~HitCreateDrag ();
|
~HitCreateDrag ();
|
||||||
|
|
||||||
void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
|
void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
|
||||||
|
|
@ -715,7 +727,7 @@ private:
|
||||||
class PatchChangeDrag : public Drag
|
class PatchChangeDrag : public Drag
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
PatchChangeDrag (Editor *, PatchChange *, MidiRegionView *);
|
PatchChangeDrag (EditingContext&, PatchChange *, MidiRegionView *);
|
||||||
|
|
||||||
void motion (GdkEvent *, bool);
|
void motion (GdkEvent *, bool);
|
||||||
void finished (GdkEvent *, bool);
|
void finished (GdkEvent *, bool);
|
||||||
|
|
@ -748,10 +760,10 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Drag of video offset */
|
/** Drag of video offset */
|
||||||
class VideoTimeLineDrag : public Drag
|
class VideoTimeLineDrag : public EditorDrag
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
VideoTimeLineDrag (Editor *e, ArdourCanvas::Item *i);
|
VideoTimeLineDrag (Editor&e, ArdourCanvas::Item *i);
|
||||||
|
|
||||||
void motion (GdkEvent *, bool);
|
void motion (GdkEvent *, bool);
|
||||||
void finished (GdkEvent *, bool);
|
void finished (GdkEvent *, bool);
|
||||||
|
|
@ -785,7 +797,7 @@ public:
|
||||||
EndTrim
|
EndTrim
|
||||||
};
|
};
|
||||||
|
|
||||||
TrimDrag (Editor *, ArdourCanvas::Item *, RegionView*, std::list<RegionView*> const &, Temporal::TimeDomain td, bool preserve_fade_anchor = false);
|
TrimDrag (Editor&, ArdourCanvas::Item *, RegionView*, std::list<RegionView*> const &, Temporal::TimeDomain td, bool preserve_fade_anchor = false);
|
||||||
|
|
||||||
void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
|
void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
|
||||||
void motion (GdkEvent *, bool);
|
void motion (GdkEvent *, bool);
|
||||||
|
|
@ -813,10 +825,10 @@ private:
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Meter marker drag */
|
/** Meter marker drag */
|
||||||
class MeterMarkerDrag : public Drag
|
class MeterMarkerDrag : public EditorDrag
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
MeterMarkerDrag (Editor *, ArdourCanvas::Item *, bool);
|
MeterMarkerDrag (Editor&, ArdourCanvas::Item *, bool);
|
||||||
|
|
||||||
void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
|
void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
|
||||||
void motion (GdkEvent *, bool);
|
void motion (GdkEvent *, bool);
|
||||||
|
|
@ -845,10 +857,10 @@ private:
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Tempo curve drag */
|
/** Tempo curve drag */
|
||||||
class TempoCurveDrag : public Drag
|
class TempoCurveDrag : public EditorDrag
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
TempoCurveDrag (Editor*, ArdourCanvas::Item*);
|
TempoCurveDrag (Editor&, ArdourCanvas::Item*);
|
||||||
|
|
||||||
void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
|
void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
|
||||||
void motion (GdkEvent *, bool);
|
void motion (GdkEvent *, bool);
|
||||||
|
|
@ -863,10 +875,10 @@ private:
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Tempo marker drag */
|
/** Tempo marker drag */
|
||||||
class TempoMarkerDrag : public Drag
|
class TempoMarkerDrag : public EditorDrag
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
TempoMarkerDrag (Editor *, ArdourCanvas::Item *);
|
TempoMarkerDrag (Editor&, ArdourCanvas::Item *);
|
||||||
|
|
||||||
void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
|
void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
|
||||||
void motion (GdkEvent *, bool);
|
void motion (GdkEvent *, bool);
|
||||||
|
|
@ -895,10 +907,10 @@ private:
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Tempo marker drag */
|
/** Tempo marker drag */
|
||||||
class BBTMarkerDrag : public Drag
|
class BBTMarkerDrag : public EditorDrag
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
BBTMarkerDrag (Editor *, ArdourCanvas::Item *);
|
BBTMarkerDrag (Editor&, ArdourCanvas::Item *);
|
||||||
|
|
||||||
void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
|
void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
|
||||||
void motion (GdkEvent *, bool);
|
void motion (GdkEvent *, bool);
|
||||||
|
|
@ -923,10 +935,10 @@ private:
|
||||||
XMLNode* _before_state;
|
XMLNode* _before_state;
|
||||||
};
|
};
|
||||||
|
|
||||||
class MappingEndDrag : public Drag
|
class MappingEndDrag : public EditorDrag
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
MappingEndDrag (Editor *, ArdourCanvas::Item *, Temporal::TempoMap::WritableSharedPtr&, Temporal::TempoPoint&, Temporal::TempoPoint& after, XMLNode& before_state);
|
MappingEndDrag (Editor&, ArdourCanvas::Item *, Temporal::TempoMap::WritableSharedPtr&, Temporal::TempoPoint&, Temporal::TempoPoint& after, XMLNode& before_state);
|
||||||
|
|
||||||
void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
|
void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
|
||||||
void motion (GdkEvent *, bool);
|
void motion (GdkEvent *, bool);
|
||||||
|
|
@ -957,10 +969,10 @@ private:
|
||||||
bool _drag_valid;
|
bool _drag_valid;
|
||||||
};
|
};
|
||||||
|
|
||||||
class MappingTwistDrag : public Drag
|
class MappingTwistDrag : public EditorDrag
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
MappingTwistDrag (Editor *, ArdourCanvas::Item *, Temporal::TempoMap::WritableSharedPtr&,
|
MappingTwistDrag (Editor&, ArdourCanvas::Item *, Temporal::TempoMap::WritableSharedPtr&,
|
||||||
Temporal::TempoPoint& prev,
|
Temporal::TempoPoint& prev,
|
||||||
Temporal::TempoPoint& focus,
|
Temporal::TempoPoint& focus,
|
||||||
Temporal::TempoPoint& next,
|
Temporal::TempoPoint& next,
|
||||||
|
|
@ -1004,10 +1016,10 @@ private:
|
||||||
|
|
||||||
|
|
||||||
/** tempo curve twist drag */
|
/** tempo curve twist drag */
|
||||||
class TempoTwistDrag : public Drag
|
class TempoTwistDrag : public EditorDrag
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
TempoTwistDrag (Editor *, ArdourCanvas::Item *);
|
TempoTwistDrag (Editor&, ArdourCanvas::Item *);
|
||||||
|
|
||||||
void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
|
void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
|
||||||
void motion (GdkEvent *, bool);
|
void motion (GdkEvent *, bool);
|
||||||
|
|
@ -1034,10 +1046,10 @@ private:
|
||||||
};
|
};
|
||||||
|
|
||||||
/** tempo curve twist drag */
|
/** tempo curve twist drag */
|
||||||
class TempoEndDrag : public Drag
|
class TempoEndDrag : public EditorDrag
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
TempoEndDrag (Editor *, ArdourCanvas::Item *);
|
TempoEndDrag (Editor&, ArdourCanvas::Item *);
|
||||||
|
|
||||||
void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
|
void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
|
||||||
void motion (GdkEvent *, bool);
|
void motion (GdkEvent *, bool);
|
||||||
|
|
@ -1065,10 +1077,10 @@ private:
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Drag of the playhead cursor */
|
/** Drag of the playhead cursor */
|
||||||
class CursorDrag : public Drag
|
class CursorDrag : public EditorDrag
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CursorDrag (Editor *, EditorCursor&, bool);
|
CursorDrag (Editor&, EditorCursor&, bool);
|
||||||
|
|
||||||
void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
|
void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
|
||||||
void motion (GdkEvent *, bool);
|
void motion (GdkEvent *, bool);
|
||||||
|
|
@ -1101,7 +1113,7 @@ private:
|
||||||
class FadeInDrag : public RegionDrag
|
class FadeInDrag : public RegionDrag
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
FadeInDrag (Editor *, ArdourCanvas::Item *, RegionView *, std::list<RegionView*> const &, Temporal::TimeDomain);
|
FadeInDrag (Editor&, ArdourCanvas::Item *, RegionView *, std::list<RegionView*> const &, Temporal::TimeDomain);
|
||||||
|
|
||||||
void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
|
void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
|
||||||
void motion (GdkEvent *, bool);
|
void motion (GdkEvent *, bool);
|
||||||
|
|
@ -1123,7 +1135,7 @@ public:
|
||||||
class FadeOutDrag : public RegionDrag
|
class FadeOutDrag : public RegionDrag
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
FadeOutDrag (Editor *, ArdourCanvas::Item *, RegionView *, std::list<RegionView*> const &, Temporal::TimeDomain td);
|
FadeOutDrag (Editor&, ArdourCanvas::Item *, RegionView *, std::list<RegionView*> const &, Temporal::TimeDomain td);
|
||||||
|
|
||||||
void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
|
void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
|
||||||
void motion (GdkEvent *, bool);
|
void motion (GdkEvent *, bool);
|
||||||
|
|
@ -1142,10 +1154,10 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Marker drag */
|
/** Marker drag */
|
||||||
class MarkerDrag : public Drag
|
class MarkerDrag : public EditorDrag
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
MarkerDrag (Editor *, ArdourCanvas::Item *);
|
MarkerDrag (Editor&, ArdourCanvas::Item *);
|
||||||
~MarkerDrag ();
|
~MarkerDrag ();
|
||||||
|
|
||||||
void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
|
void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
|
||||||
|
|
@ -1184,10 +1196,10 @@ private:
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Control point drag */
|
/** Control point drag */
|
||||||
class ControlPointDrag : public Drag
|
class ControlPointDrag : public EditorDrag
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ControlPointDrag (Editor *, ArdourCanvas::Item *);
|
ControlPointDrag (Editor&, ArdourCanvas::Item *);
|
||||||
|
|
||||||
void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
|
void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
|
||||||
void motion (GdkEvent *, bool);
|
void motion (GdkEvent *, bool);
|
||||||
|
|
@ -1215,10 +1227,10 @@ private:
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Gain or automation line drag */
|
/** Gain or automation line drag */
|
||||||
class LineDrag : public Drag
|
class LineDrag : public EditorDrag
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
LineDrag (Editor *e, ArdourCanvas::Item *i);
|
LineDrag (Editor&e, ArdourCanvas::Item *i);
|
||||||
~LineDrag ();
|
~LineDrag ();
|
||||||
|
|
||||||
void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
|
void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
|
||||||
|
|
@ -1245,7 +1257,7 @@ private:
|
||||||
class FeatureLineDrag : public Drag
|
class FeatureLineDrag : public Drag
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
FeatureLineDrag (Editor *e, ArdourCanvas::Item *i);
|
FeatureLineDrag (Editor&e, ArdourCanvas::Item *i);
|
||||||
|
|
||||||
void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
|
void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
|
||||||
void motion (GdkEvent *, bool);
|
void motion (GdkEvent *, bool);
|
||||||
|
|
@ -1268,7 +1280,7 @@ private:
|
||||||
class RubberbandSelectDrag : public Drag
|
class RubberbandSelectDrag : public Drag
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
RubberbandSelectDrag (Editor *, ArdourCanvas::Item *);
|
RubberbandSelectDrag (EditingContext&, ArdourCanvas::Item *);
|
||||||
|
|
||||||
void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
|
void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
|
||||||
void motion (GdkEvent *, bool);
|
void motion (GdkEvent *, bool);
|
||||||
|
|
@ -1301,17 +1313,19 @@ public:
|
||||||
class EditorRubberbandSelectDrag : public RubberbandSelectDrag
|
class EditorRubberbandSelectDrag : public RubberbandSelectDrag
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
EditorRubberbandSelectDrag (Editor *, ArdourCanvas::Item *);
|
EditorRubberbandSelectDrag (Editor&, ArdourCanvas::Item *);
|
||||||
|
|
||||||
void select_things (int, Temporal::timepos_t const &, Temporal::timepos_t const &, double, double, bool);
|
void select_things (int, Temporal::timepos_t const &, Temporal::timepos_t const &, double, double, bool);
|
||||||
void deselect_things ();
|
void deselect_things ();
|
||||||
|
private:
|
||||||
|
Editor& editor;
|
||||||
};
|
};
|
||||||
|
|
||||||
/** A RubberbandSelectDrag for selecting MIDI notes */
|
/** A RubberbandSelectDrag for selecting MIDI notes */
|
||||||
class MidiRubberbandSelectDrag : public RubberbandSelectDrag
|
class MidiRubberbandSelectDrag : public RubberbandSelectDrag
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
MidiRubberbandSelectDrag (Editor *, MidiRegionView *);
|
MidiRubberbandSelectDrag (EditingContext&, MidiRegionView *);
|
||||||
|
|
||||||
void select_things (int, Temporal::timepos_t const &, Temporal::timepos_t const &, double, double, bool);
|
void select_things (int, Temporal::timepos_t const &, Temporal::timepos_t const &, double, double, bool);
|
||||||
void deselect_things ();
|
void deselect_things ();
|
||||||
|
|
@ -1324,7 +1338,7 @@ private:
|
||||||
class MidiVerticalSelectDrag : public RubberbandSelectDrag
|
class MidiVerticalSelectDrag : public RubberbandSelectDrag
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
MidiVerticalSelectDrag (Editor *, MidiRegionView *);
|
MidiVerticalSelectDrag (EditingContext&, MidiRegionView *);
|
||||||
|
|
||||||
void select_things (int, Temporal::timepos_t const &, Temporal::timepos_t const &, double, double, bool);
|
void select_things (int, Temporal::timepos_t const &, Temporal::timepos_t const &, double, double, bool);
|
||||||
void deselect_things ();
|
void deselect_things ();
|
||||||
|
|
@ -1337,7 +1351,7 @@ private:
|
||||||
class TimeFXDrag : public RegionDrag
|
class TimeFXDrag : public RegionDrag
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
TimeFXDrag (Editor *, ArdourCanvas::Item *, RegionView *, std::list<RegionView*> const &, Temporal::TimeDomain td);
|
TimeFXDrag (Editor&, ArdourCanvas::Item *, RegionView *, std::list<RegionView*> const &, Temporal::TimeDomain td);
|
||||||
|
|
||||||
void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
|
void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
|
||||||
void motion (GdkEvent *, bool);
|
void motion (GdkEvent *, bool);
|
||||||
|
|
@ -1348,7 +1362,7 @@ private:
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Drag in range select mode */
|
/** Drag in range select mode */
|
||||||
class SelectionDrag : public Drag
|
class SelectionDrag : public EditorDrag
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
enum Operation {
|
enum Operation {
|
||||||
|
|
@ -1359,7 +1373,7 @@ public:
|
||||||
SelectionExtend
|
SelectionExtend
|
||||||
};
|
};
|
||||||
|
|
||||||
SelectionDrag (Editor *, ArdourCanvas::Item *, Operation);
|
SelectionDrag (Editor&, ArdourCanvas::Item *, Operation);
|
||||||
|
|
||||||
void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
|
void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
|
||||||
void motion (GdkEvent *, bool);
|
void motion (GdkEvent *, bool);
|
||||||
|
|
@ -1378,10 +1392,10 @@ private:
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Drag time-selection markers */
|
/** Drag time-selection markers */
|
||||||
class SelectionMarkerDrag : public Drag
|
class SelectionMarkerDrag : public EditorDrag
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
SelectionMarkerDrag (Editor*, ArdourCanvas::Item*);
|
SelectionMarkerDrag (Editor&, ArdourCanvas::Item*);
|
||||||
|
|
||||||
void start_grab (GdkEvent*, Gdk::Cursor* c = 0);
|
void start_grab (GdkEvent*, Gdk::Cursor* c = 0);
|
||||||
void motion (GdkEvent*, bool);
|
void motion (GdkEvent*, bool);
|
||||||
|
|
@ -1395,7 +1409,7 @@ private:
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Range marker drag */
|
/** Range marker drag */
|
||||||
class RangeMarkerBarDrag : public Drag
|
class RangeMarkerBarDrag : public EditorDrag
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
enum Operation {
|
enum Operation {
|
||||||
|
|
@ -1405,7 +1419,7 @@ public:
|
||||||
CreateCDMarker
|
CreateCDMarker
|
||||||
};
|
};
|
||||||
|
|
||||||
RangeMarkerBarDrag (Editor *, ArdourCanvas::Item *, Operation);
|
RangeMarkerBarDrag (Editor&, ArdourCanvas::Item *, Operation);
|
||||||
~RangeMarkerBarDrag ();
|
~RangeMarkerBarDrag ();
|
||||||
|
|
||||||
void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
|
void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
|
||||||
|
|
@ -1430,10 +1444,10 @@ private:
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Drag of rectangle to set zoom */
|
/** Drag of rectangle to set zoom */
|
||||||
class MouseZoomDrag : public Drag
|
class MouseZoomDrag : public EditorDrag
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
MouseZoomDrag (Editor *, ArdourCanvas::Item *);
|
MouseZoomDrag (Editor&, ArdourCanvas::Item *);
|
||||||
|
|
||||||
void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
|
void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
|
||||||
void motion (GdkEvent *, bool);
|
void motion (GdkEvent *, bool);
|
||||||
|
|
@ -1454,8 +1468,8 @@ private:
|
||||||
class AutomationRangeDrag : public Drag
|
class AutomationRangeDrag : public Drag
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
AutomationRangeDrag (Editor *, AutomationTimeAxisView *, float initial_value, std::list<ARDOUR::TimelineRange> const &);
|
AutomationRangeDrag (EditingContext&, AutomationTimeAxisView *, float initial_value, std::list<ARDOUR::TimelineRange> const &);
|
||||||
AutomationRangeDrag (Editor *, std::list<RegionView*> const &, std::list<ARDOUR::TimelineRange> const &, double y_origin, double y_height);
|
AutomationRangeDrag (EditingContext&, std::list<RegionView*> const &, std::list<ARDOUR::TimelineRange> const &, double y_origin, double y_height);
|
||||||
|
|
||||||
void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
|
void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
|
||||||
void motion (GdkEvent *, bool);
|
void motion (GdkEvent *, bool);
|
||||||
|
|
@ -1494,7 +1508,7 @@ private:
|
||||||
class CrossfadeEdgeDrag : public Drag
|
class CrossfadeEdgeDrag : public Drag
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CrossfadeEdgeDrag (Editor*, AudioRegionView*, ArdourCanvas::Item*, bool start);
|
CrossfadeEdgeDrag (Editor&, AudioRegionView*, ArdourCanvas::Item*, bool start);
|
||||||
|
|
||||||
void start_grab (GdkEvent*, Gdk::Cursor* c = 0);
|
void start_grab (GdkEvent*, Gdk::Cursor* c = 0);
|
||||||
void motion (GdkEvent*, bool);
|
void motion (GdkEvent*, bool);
|
||||||
|
|
@ -1517,7 +1531,7 @@ private:
|
||||||
class RegionMarkerDrag : public Drag
|
class RegionMarkerDrag : public Drag
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
RegionMarkerDrag (Editor*, RegionView*, ArdourCanvas::Item*);
|
RegionMarkerDrag (Editor&, RegionView*, ArdourCanvas::Item*);
|
||||||
~RegionMarkerDrag ();
|
~RegionMarkerDrag ();
|
||||||
|
|
||||||
void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
|
void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
|
||||||
|
|
@ -1546,7 +1560,7 @@ class RegionMarkerDrag : public Drag
|
||||||
class LollipopDrag : public Drag
|
class LollipopDrag : public Drag
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
LollipopDrag (Editor*, ArdourCanvas::Item*);
|
LollipopDrag (EditingContext&, ArdourCanvas::Item*);
|
||||||
~LollipopDrag ();
|
~LollipopDrag ();
|
||||||
|
|
||||||
void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
|
void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
|
||||||
|
|
@ -1577,7 +1591,7 @@ template<typename OrderedPointList, typename OrderedPoint>
|
||||||
class FreehandLineDrag : public Drag
|
class FreehandLineDrag : public Drag
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
FreehandLineDrag (Editor*, ArdourCanvas::Item*, ArdourCanvas::Rectangle&, Temporal::TimeDomain);
|
FreehandLineDrag (EditingContext&, ArdourCanvas::Item*, ArdourCanvas::Rectangle&, Temporal::TimeDomain);
|
||||||
~FreehandLineDrag ();
|
~FreehandLineDrag ();
|
||||||
|
|
||||||
void motion (GdkEvent*, bool);
|
void motion (GdkEvent*, bool);
|
||||||
|
|
@ -1606,7 +1620,7 @@ class FreehandLineDrag : public Drag
|
||||||
class AutomationDrawDrag : public FreehandLineDrag<Evoral::ControlList::OrderedPoints, Evoral::ControlList::OrderedPoint>
|
class AutomationDrawDrag : public FreehandLineDrag<Evoral::ControlList::OrderedPoints, Evoral::ControlList::OrderedPoint>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
AutomationDrawDrag (Editor*, ArdourCanvas::Item*, ArdourCanvas::Rectangle&, Temporal::TimeDomain);
|
AutomationDrawDrag (EditingContext&, ArdourCanvas::Item*, ArdourCanvas::Rectangle&, Temporal::TimeDomain);
|
||||||
~AutomationDrawDrag ();
|
~AutomationDrawDrag ();
|
||||||
|
|
||||||
void finished (GdkEvent*, bool);
|
void finished (GdkEvent*, bool);
|
||||||
|
|
@ -1616,7 +1630,7 @@ class AutomationDrawDrag : public FreehandLineDrag<Evoral::ControlList::OrderedP
|
||||||
class VelocityLineDrag : public FreehandLineDrag<Evoral::ControlList::OrderedPoints, Evoral::ControlList::OrderedPoint>
|
class VelocityLineDrag : public FreehandLineDrag<Evoral::ControlList::OrderedPoints, Evoral::ControlList::OrderedPoint>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
VelocityLineDrag (Editor*, ArdourCanvas::Rectangle&, Temporal::TimeDomain);
|
VelocityLineDrag (EditingContext&, ArdourCanvas::Rectangle&, Temporal::TimeDomain);
|
||||||
~VelocityLineDrag ();
|
~VelocityLineDrag ();
|
||||||
|
|
||||||
void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
|
void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
|
||||||
|
|
|
||||||
|
|
@ -1524,7 +1524,7 @@ Editor::marker_menu_set_from_playhead ()
|
||||||
|
|
||||||
timepos_t pos (_session->audible_sample());
|
timepos_t pos (_session->audible_sample());
|
||||||
|
|
||||||
if (default_time_domain() == Temporal::BeatTime) {
|
if (time_domain() == Temporal::BeatTime) {
|
||||||
pos = timepos_t (pos.beats());
|
pos = timepos_t (pos.beats());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -175,7 +175,7 @@ Editor::canvas_event_time (GdkEvent const * event, double* pcx, double* pcy) con
|
||||||
{
|
{
|
||||||
timepos_t pos (canvas_event_sample (event, pcx, pcy));
|
timepos_t pos (canvas_event_sample (event, pcx, pcy));
|
||||||
|
|
||||||
if (default_time_domain() == Temporal::AudioTime) {
|
if (time_domain() == Temporal::AudioTime) {
|
||||||
return pos;
|
return pos;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -765,7 +765,7 @@ Editor::button_press_handler_1 (ArdourCanvas::Item* item, GdkEvent* event, ItemT
|
||||||
|
|
||||||
switch (item_type) {
|
switch (item_type) {
|
||||||
case PlayheadCursorItem:
|
case PlayheadCursorItem:
|
||||||
_drags->set (new CursorDrag (this, *_playhead_cursor, true), event);
|
_drags->set (new CursorDrag (*this, *_playhead_cursor, true), event);
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
case MarkerItem:
|
case MarkerItem:
|
||||||
|
|
@ -774,9 +774,9 @@ Editor::button_press_handler_1 (ArdourCanvas::Item* item, GdkEvent* event, ItemT
|
||||||
} else {
|
} else {
|
||||||
ArdourMarker* marker = static_cast<ArdourMarker*> (item->get_data ("marker"));
|
ArdourMarker* marker = static_cast<ArdourMarker*> (item->get_data ("marker"));
|
||||||
if (marker->type() == ArdourMarker::RegionCue) {
|
if (marker->type() == ArdourMarker::RegionCue) {
|
||||||
_drags->set (new RegionMarkerDrag (this, marker->region_view(), item), event);
|
_drags->set (new RegionMarkerDrag (*this, marker->region_view(), item), event);
|
||||||
} else {
|
} else {
|
||||||
_drags->set (new MarkerDrag (this, item), event);
|
_drags->set (new MarkerDrag (*this, item), event);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
@ -786,34 +786,28 @@ Editor::button_press_handler_1 (ArdourCanvas::Item* item, GdkEvent* event, ItemT
|
||||||
|
|
||||||
case TempoMarkerItem:
|
case TempoMarkerItem:
|
||||||
if (ArdourKeyboard::indicates_constraint (event->button.state)) {
|
if (ArdourKeyboard::indicates_constraint (event->button.state)) {
|
||||||
_drags->set (new TempoEndDrag (this, item), event);
|
_drags->set (new TempoEndDrag (*this, item), event);
|
||||||
} else {
|
} else {
|
||||||
_drags->set (new TempoMarkerDrag (this, item), event);
|
_drags->set (new TempoMarkerDrag (*this, item), event);
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
case BBTMarkerItem:
|
case BBTMarkerItem:
|
||||||
_drags->set (new BBTMarkerDrag (this, item), event);
|
_drags->set (new BBTMarkerDrag (*this, item), event);
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
case SelectionMarkerItem:
|
case SelectionMarkerItem:
|
||||||
_drags->set (new SelectionMarkerDrag (this, item), event);
|
_drags->set (new SelectionMarkerDrag (*this, item), event);
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
case MeterMarkerItem:
|
case MeterMarkerItem:
|
||||||
_drags->set (
|
_drags->set (
|
||||||
new MeterMarkerDrag (
|
new MeterMarkerDrag (*this, item, ArdourKeyboard::indicates_copy (event->button.state)), event);
|
||||||
this,
|
|
||||||
item,
|
|
||||||
ArdourKeyboard::indicates_copy (event->button.state)
|
|
||||||
),
|
|
||||||
event
|
|
||||||
);
|
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
case VideoBarItem:
|
case VideoBarItem:
|
||||||
_drags->set (new VideoTimeLineDrag (this, item), event);
|
_drags->set (new VideoTimeLineDrag (*this, item), event);
|
||||||
return true;
|
return true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
@ -821,9 +815,9 @@ Editor::button_press_handler_1 (ArdourCanvas::Item* item, GdkEvent* event, ItemT
|
||||||
case TempoCurveItem:
|
case TempoCurveItem:
|
||||||
if (!Keyboard::modifier_state_equals (event->button.state, Keyboard::PrimaryModifier)
|
if (!Keyboard::modifier_state_equals (event->button.state, Keyboard::PrimaryModifier)
|
||||||
&& !ArdourKeyboard::indicates_constraint (event->button.state)) {
|
&& !ArdourKeyboard::indicates_constraint (event->button.state)) {
|
||||||
_drags->set (new CursorDrag (this, *_playhead_cursor, false), event);
|
_drags->set (new CursorDrag (*this, *_playhead_cursor, false), event);
|
||||||
} else if (Keyboard::modifier_state_equals (event->button.state, Keyboard::PrimaryModifier)) {
|
} else if (Keyboard::modifier_state_equals (event->button.state, Keyboard::PrimaryModifier)) {
|
||||||
_drags->set (new TempoCurveDrag (this, item), event);
|
_drags->set (new TempoCurveDrag (*this, item), event);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
@ -831,14 +825,14 @@ Editor::button_press_handler_1 (ArdourCanvas::Item* item, GdkEvent* event, ItemT
|
||||||
case MeterBarItem:
|
case MeterBarItem:
|
||||||
if (!Keyboard::modifier_state_equals (event->button.state, Keyboard::PrimaryModifier)
|
if (!Keyboard::modifier_state_equals (event->button.state, Keyboard::PrimaryModifier)
|
||||||
&& !ArdourKeyboard::indicates_constraint (event->button.state)) {
|
&& !ArdourKeyboard::indicates_constraint (event->button.state)) {
|
||||||
_drags->set (new CursorDrag (this, *_playhead_cursor, false), event);
|
_drags->set (new CursorDrag (*this, *_playhead_cursor, false), event);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
case BBTRulerItem:
|
case BBTRulerItem:
|
||||||
if (!Keyboard::modifier_state_equals (event->button.state, Keyboard::PrimaryModifier)
|
if (!Keyboard::modifier_state_equals (event->button.state, Keyboard::PrimaryModifier)
|
||||||
&& !ArdourKeyboard::indicates_constraint (event->button.state)) {
|
&& !ArdourKeyboard::indicates_constraint (event->button.state)) {
|
||||||
_drags->set (new CursorDrag (this, *_playhead_cursor, false), event);
|
_drags->set (new CursorDrag (*this, *_playhead_cursor, false), event);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
|
@ -849,23 +843,23 @@ Editor::button_press_handler_1 (ArdourCanvas::Item* item, GdkEvent* event, ItemT
|
||||||
case SectionMarkerBarItem:
|
case SectionMarkerBarItem:
|
||||||
if (!Keyboard::modifier_state_equals (event->button.state, Keyboard::PrimaryModifier)
|
if (!Keyboard::modifier_state_equals (event->button.state, Keyboard::PrimaryModifier)
|
||||||
&& !ArdourKeyboard::indicates_constraint (event->button.state)) {
|
&& !ArdourKeyboard::indicates_constraint (event->button.state)) {
|
||||||
_drags->set (new CursorDrag (this, *_playhead_cursor, false), event);
|
_drags->set (new CursorDrag (*this, *_playhead_cursor, false), event);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
case RangeMarkerBarItem:
|
case RangeMarkerBarItem:
|
||||||
if (Keyboard::modifier_state_contains (event->button.state, Keyboard::TertiaryModifier)) {
|
if (Keyboard::modifier_state_contains (event->button.state, Keyboard::TertiaryModifier)) {
|
||||||
_drags->set (new RangeMarkerBarDrag (this, item, RangeMarkerBarDrag::CreateSkipMarker), event);
|
_drags->set (new RangeMarkerBarDrag (*this, item, RangeMarkerBarDrag::CreateSkipMarker), event);
|
||||||
} else if (Keyboard::modifier_state_equals (event->button.state, Keyboard::PrimaryModifier)) {
|
} else if (Keyboard::modifier_state_equals (event->button.state, Keyboard::PrimaryModifier)) {
|
||||||
_drags->set (new RangeMarkerBarDrag (this, item, RangeMarkerBarDrag::CreateRangeMarker), event);
|
_drags->set (new RangeMarkerBarDrag (*this, item, RangeMarkerBarDrag::CreateRangeMarker), event);
|
||||||
} else {
|
} else {
|
||||||
_drags->set (new CursorDrag (this, *_playhead_cursor, false), event);
|
_drags->set (new CursorDrag (*this, *_playhead_cursor, false), event);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case VelocityItem:
|
case VelocityItem:
|
||||||
_drags->set (new LollipopDrag (this, item), event);
|
_drags->set (new LollipopDrag (*this, item), event);
|
||||||
return true;
|
return true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
@ -873,7 +867,7 @@ Editor::button_press_handler_1 (ArdourCanvas::Item* item, GdkEvent* event, ItemT
|
||||||
{
|
{
|
||||||
VelocityGhostRegion* grv = static_cast<VelocityGhostRegion*> (item->get_data ("ghostregionview"));
|
VelocityGhostRegion* grv = static_cast<VelocityGhostRegion*> (item->get_data ("ghostregionview"));
|
||||||
if (grv) {
|
if (grv) {
|
||||||
_drags->set (new VelocityLineDrag (this, grv->base_item(), Temporal::BeatTime), event);
|
_drags->set (new VelocityLineDrag (*this, grv->base_item(), Temporal::BeatTime), event);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
@ -891,9 +885,9 @@ Editor::button_press_handler_1 (ArdourCanvas::Item* item, GdkEvent* event, ItemT
|
||||||
* over a region.
|
* over a region.
|
||||||
*/
|
*/
|
||||||
if (item_type == StartSelectionTrimItem) {
|
if (item_type == StartSelectionTrimItem) {
|
||||||
_drags->set (new SelectionDrag (this, item, SelectionDrag::SelectionStartTrim), event);
|
_drags->set (new SelectionDrag (*this, item, SelectionDrag::SelectionStartTrim), event);
|
||||||
} else if (item_type == EndSelectionTrimItem) {
|
} else if (item_type == EndSelectionTrimItem) {
|
||||||
_drags->set (new SelectionDrag (this, item, SelectionDrag::SelectionEndTrim), event);
|
_drags->set (new SelectionDrag (*this, item, SelectionDrag::SelectionEndTrim), event);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -917,11 +911,11 @@ Editor::button_press_handler_1 (ArdourCanvas::Item* item, GdkEvent* event, ItemT
|
||||||
case MouseRange:
|
case MouseRange:
|
||||||
switch (item_type) {
|
switch (item_type) {
|
||||||
case StartSelectionTrimItem:
|
case StartSelectionTrimItem:
|
||||||
_drags->set (new SelectionDrag (this, item, SelectionDrag::SelectionStartTrim), event);
|
_drags->set (new SelectionDrag (*this, item, SelectionDrag::SelectionStartTrim), event);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EndSelectionTrimItem:
|
case EndSelectionTrimItem:
|
||||||
_drags->set (new SelectionDrag (this, item, SelectionDrag::SelectionEndTrim), event);
|
_drags->set (new SelectionDrag (*this, item, SelectionDrag::SelectionEndTrim), event);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SelectionItem:
|
case SelectionItem:
|
||||||
|
|
@ -930,34 +924,34 @@ Editor::button_press_handler_1 (ArdourCanvas::Item* item, GdkEvent* event, ItemT
|
||||||
return true;
|
return true;
|
||||||
} else if (Keyboard::modifier_state_equals (event->button.state, Keyboard::SecondaryModifier)) {
|
} else if (Keyboard::modifier_state_equals (event->button.state, Keyboard::SecondaryModifier)) {
|
||||||
/* grab selection for moving */
|
/* grab selection for moving */
|
||||||
_drags->set (new SelectionDrag (this, item, SelectionDrag::SelectionMove), event);
|
_drags->set (new SelectionDrag (*this, item, SelectionDrag::SelectionMove), event);
|
||||||
} else {
|
} else {
|
||||||
/* this was debated, but decided the more common action was to make a new selection */
|
/* this was debated, but decided the more common action was to make a new selection */
|
||||||
_drags->set (new SelectionDrag (this, item, SelectionDrag::CreateSelection), event);
|
_drags->set (new SelectionDrag (*this, item, SelectionDrag::CreateSelection), event);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case StreamItem:
|
case StreamItem:
|
||||||
if (Keyboard::modifier_state_equals (event->button.state, Keyboard::RangeSelectModifier) && !selection->time.empty()) {
|
if (Keyboard::modifier_state_equals (event->button.state, Keyboard::RangeSelectModifier) && !selection->time.empty()) {
|
||||||
_drags->set (new SelectionDrag (this, item, SelectionDrag::SelectionExtend), event);
|
_drags->set (new SelectionDrag (*this, item, SelectionDrag::SelectionExtend), event);
|
||||||
} else {
|
} else {
|
||||||
_drags->set (new SelectionDrag (this, item, SelectionDrag::CreateSelection), event);
|
_drags->set (new SelectionDrag (*this, item, SelectionDrag::CreateSelection), event);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RegionViewNameHighlight:
|
case RegionViewNameHighlight:
|
||||||
if (!clicked_regionview->region()->locked()) {
|
if (!clicked_regionview->region()->locked()) {
|
||||||
_drags->set (new TrimDrag (this, item, clicked_regionview, selection->regions.by_layer(), drag_time_domain (clicked_regionview->region())), event);
|
_drags->set (new TrimDrag (*this, item, clicked_regionview, selection->regions.by_layer(), drag_time_domain (clicked_regionview->region())), event);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
if (Keyboard::modifier_state_equals (event->button.state, Keyboard::RangeSelectModifier) && !selection->time.empty()) {
|
if (Keyboard::modifier_state_equals (event->button.state, Keyboard::RangeSelectModifier) && !selection->time.empty()) {
|
||||||
_drags->set (new SelectionDrag (this, item, SelectionDrag::SelectionExtend), event);
|
_drags->set (new SelectionDrag (*this, item, SelectionDrag::SelectionExtend), event);
|
||||||
} else {
|
} else {
|
||||||
_drags->set (new SelectionDrag (this, item, SelectionDrag::CreateSelection), event);
|
_drags->set (new SelectionDrag (*this, item, SelectionDrag::CreateSelection), event);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
@ -975,7 +969,7 @@ Editor::button_press_handler_1 (ArdourCanvas::Item* item, GdkEvent* event, ItemT
|
||||||
case RegionViewName:
|
case RegionViewName:
|
||||||
case StreamItem:
|
case StreamItem:
|
||||||
case AutomationTrackItem:
|
case AutomationTrackItem:
|
||||||
_drags->set (new RegionCutDrag (this, item, canvas_event_sample (event)), event, get_canvas_cursor());
|
_drags->set (new RegionCutDrag (*this, item, canvas_event_sample (event)), event, get_canvas_cursor());
|
||||||
return true;
|
return true;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
@ -989,44 +983,44 @@ Editor::button_press_handler_1 (ArdourCanvas::Item* item, GdkEvent* event, ItemT
|
||||||
/* Existing note: allow trimming/motion */
|
/* Existing note: allow trimming/motion */
|
||||||
if ((note = reinterpret_cast<NoteBase*> (item->get_data ("notebase")))) {
|
if ((note = reinterpret_cast<NoteBase*> (item->get_data ("notebase")))) {
|
||||||
if (note->big_enough_to_trim() && note->mouse_near_ends()) {
|
if (note->big_enough_to_trim() && note->mouse_near_ends()) {
|
||||||
_drags->set (new NoteResizeDrag (this, item), event, get_canvas_cursor());
|
_drags->set (new NoteResizeDrag (*this, item), event, get_canvas_cursor());
|
||||||
} else {
|
} else {
|
||||||
_drags->set (new NoteDrag (this, item), event);
|
_drags->set (new NoteDrag (*this, item), event);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
case GainLineItem:
|
case GainLineItem:
|
||||||
_drags->set (new LineDrag (this, item), event);
|
_drags->set (new LineDrag (*this, item), event);
|
||||||
return true;
|
return true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ControlPointItem:
|
case ControlPointItem:
|
||||||
_drags->set (new ControlPointDrag (this, item), event);
|
_drags->set (new ControlPointDrag (*this, item), event);
|
||||||
return true;
|
return true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case AutomationLineItem:
|
case AutomationLineItem:
|
||||||
_drags->set (new LineDrag (this, item), event);
|
_drags->set (new LineDrag (*this, item), event);
|
||||||
return true;
|
return true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case StreamItem:
|
case StreamItem:
|
||||||
/* in the past, we created a new midi region here, but perhaps that is best left to the Draw mode */
|
/* in the past, we created a new midi region here, but perhaps that is best left to the Draw mode */
|
||||||
/* .. now we allow for rubberband selection (region gain) */
|
/* .. now we allow for rubberband selection (region gain) */
|
||||||
_drags->set (new EditorRubberbandSelectDrag (this, item), event);
|
_drags->set (new EditorRubberbandSelectDrag (*this, item), event);
|
||||||
return true;
|
return true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case AutomationTrackItem:
|
case AutomationTrackItem:
|
||||||
/* rubberband drag to select automation points */
|
/* rubberband drag to select automation points */
|
||||||
_drags->set (new EditorRubberbandSelectDrag (this, item), event);
|
_drags->set (new EditorRubberbandSelectDrag (*this, item), event);
|
||||||
return true;
|
return true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RegionItem:
|
case RegionItem:
|
||||||
/* rubberband drag to select region gain points */
|
/* rubberband drag to select region gain points */
|
||||||
_drags->set (new EditorRubberbandSelectDrag (this, item), event);
|
_drags->set (new EditorRubberbandSelectDrag (*this, item), event);
|
||||||
return true;
|
return true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
@ -1039,7 +1033,7 @@ Editor::button_press_handler_1 (ArdourCanvas::Item* item, GdkEvent* event, ItemT
|
||||||
if (Keyboard::modifier_state_contains (event->button.state, Keyboard::ModifierMask(Keyboard::PrimaryModifier|Keyboard::SecondaryModifier)) &&
|
if (Keyboard::modifier_state_contains (event->button.state, Keyboard::ModifierMask(Keyboard::PrimaryModifier|Keyboard::SecondaryModifier)) &&
|
||||||
event->type == GDK_BUTTON_PRESS) {
|
event->type == GDK_BUTTON_PRESS) {
|
||||||
|
|
||||||
_drags->set (new EditorRubberbandSelectDrag (this, item), event);
|
_drags->set (new EditorRubberbandSelectDrag (*this, item), event);
|
||||||
|
|
||||||
} else if (event->type == GDK_BUTTON_PRESS) {
|
} else if (event->type == GDK_BUTTON_PRESS) {
|
||||||
|
|
||||||
|
|
@ -1048,7 +1042,7 @@ Editor::button_press_handler_1 (ArdourCanvas::Item* item, GdkEvent* event, ItemT
|
||||||
{
|
{
|
||||||
RegionView* rv = reinterpret_cast<RegionView*> (item->get_data("regionview"));
|
RegionView* rv = reinterpret_cast<RegionView*> (item->get_data("regionview"));
|
||||||
assert (rv);
|
assert (rv);
|
||||||
_drags->set (new FadeInDrag (this, item, rv, selection->regions, drag_time_domain (rv->region())), event, _cursors->fade_in);
|
_drags->set (new FadeInDrag (*this, item, rv, selection->regions, drag_time_domain (rv->region())), event, _cursors->fade_in);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1056,7 +1050,7 @@ Editor::button_press_handler_1 (ArdourCanvas::Item* item, GdkEvent* event, ItemT
|
||||||
{
|
{
|
||||||
RegionView* rv = reinterpret_cast<RegionView*> (item->get_data("regionview"));
|
RegionView* rv = reinterpret_cast<RegionView*> (item->get_data("regionview"));
|
||||||
assert (rv);
|
assert (rv);
|
||||||
_drags->set (new FadeOutDrag (this, item, rv, selection->regions, drag_time_domain (rv->region())), event, _cursors->fade_out);
|
_drags->set (new FadeOutDrag (*this, item, rv, selection->regions, drag_time_domain (rv->region())), event, _cursors->fade_out);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1066,7 +1060,7 @@ Editor::button_press_handler_1 (ArdourCanvas::Item* item, GdkEvent* event, ItemT
|
||||||
* For not this is not fully implemented */
|
* For not this is not fully implemented */
|
||||||
#if 0
|
#if 0
|
||||||
if (!clicked_regionview->region()->locked()) {
|
if (!clicked_regionview->region()->locked()) {
|
||||||
_drags->set (new TrimDrag (this, item, clicked_regionview, selection->regions.by_layer(), drag_time_domain (clicked_regionview->region()), true), event);
|
_drags->set (new TrimDrag (*this, item, clicked_regionview, selection->regions.by_layer(), drag_time_domain (clicked_regionview->region()), true), event);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -1079,7 +1073,7 @@ Editor::button_press_handler_1 (ArdourCanvas::Item* item, GdkEvent* event, ItemT
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
_drags->set (new FeatureLineDrag (this, item), event);
|
_drags->set (new FeatureLineDrag (*this, item), event);
|
||||||
return true;
|
return true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
@ -1100,7 +1094,7 @@ Editor::button_press_handler_1 (ArdourCanvas::Item* item, GdkEvent* event, ItemT
|
||||||
|
|
||||||
if (Keyboard::modifier_state_equals (event->button.state, ArdourKeyboard::slip_contents_modifier ())) {
|
if (Keyboard::modifier_state_equals (event->button.state, ArdourKeyboard::slip_contents_modifier ())) {
|
||||||
if (!clicked_regionview->region()->locked() && (Config->get_edit_mode() != Lock)) {
|
if (!clicked_regionview->region()->locked() && (Config->get_edit_mode() != Lock)) {
|
||||||
_drags->add (new RegionSlipContentsDrag (this, item, clicked_regionview, selection->regions.by_layer(), drag_time_domain (clicked_regionview->region())));
|
_drags->add (new RegionSlipContentsDrag (*this, item, clicked_regionview, selection->regions.by_layer(), drag_time_domain (clicked_regionview->region())));
|
||||||
}
|
}
|
||||||
} else if (ArdourKeyboard::indicates_copy (event->button.state)) {
|
} else if (ArdourKeyboard::indicates_copy (event->button.state)) {
|
||||||
add_region_drag (item, event, clicked_regionview, true);
|
add_region_drag (item, event, clicked_regionview, true);
|
||||||
|
|
@ -1119,7 +1113,7 @@ Editor::button_press_handler_1 (ArdourCanvas::Item* item, GdkEvent* event, ItemT
|
||||||
case LeftFrameHandle:
|
case LeftFrameHandle:
|
||||||
case RightFrameHandle:
|
case RightFrameHandle:
|
||||||
if (!clicked_regionview->region()->locked()) {
|
if (!clicked_regionview->region()->locked()) {
|
||||||
_drags->set (new TrimDrag (this, item, clicked_regionview, selection->regions.by_layer(), drag_time_domain (clicked_regionview->region()), false), event);
|
_drags->set (new TrimDrag (*this, item, clicked_regionview, selection->regions.by_layer(), drag_time_domain (clicked_regionview->region()), false), event);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
@ -1127,7 +1121,7 @@ Editor::button_press_handler_1 (ArdourCanvas::Item* item, GdkEvent* event, ItemT
|
||||||
case FadeInTrimHandleItem:
|
case FadeInTrimHandleItem:
|
||||||
case FadeOutTrimHandleItem:
|
case FadeOutTrimHandleItem:
|
||||||
if (!clicked_regionview->region()->locked()) {
|
if (!clicked_regionview->region()->locked()) {
|
||||||
_drags->set (new TrimDrag (this, item, clicked_regionview, selection->regions.by_layer(), drag_time_domain (clicked_regionview->region()), true), event);
|
_drags->set (new TrimDrag (*this, item, clicked_regionview, selection->regions.by_layer(), drag_time_domain (clicked_regionview->region()), true), event);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
@ -1136,24 +1130,24 @@ Editor::button_press_handler_1 (ArdourCanvas::Item* item, GdkEvent* event, ItemT
|
||||||
{
|
{
|
||||||
/* rename happens on edit clicks */
|
/* rename happens on edit clicks */
|
||||||
if (clicked_regionview->get_name_highlight()) {
|
if (clicked_regionview->get_name_highlight()) {
|
||||||
_drags->set (new TrimDrag (this, clicked_regionview->get_name_highlight(), clicked_regionview, selection->regions.by_layer(), drag_time_domain (clicked_regionview->region())), event);
|
_drags->set (new TrimDrag (*this, clicked_regionview->get_name_highlight(), clicked_regionview, selection->regions.by_layer(), drag_time_domain (clicked_regionview->region())), event);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case ControlPointItem:
|
case ControlPointItem:
|
||||||
_drags->set (new ControlPointDrag (this, item), event);
|
_drags->set (new ControlPointDrag (*this, item), event);
|
||||||
return true;
|
return true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case AutomationLineItem:
|
case AutomationLineItem:
|
||||||
_drags->set (new LineDrag (this, item), event);
|
_drags->set (new LineDrag (*this, item), event);
|
||||||
return true;
|
return true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case StreamItem:
|
case StreamItem:
|
||||||
_drags->set (new EditorRubberbandSelectDrag (this, item), event);
|
_drags->set (new EditorRubberbandSelectDrag (*this, item), event);
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
case AutomationTrackItem:
|
case AutomationTrackItem:
|
||||||
|
|
@ -1168,20 +1162,20 @@ Editor::button_press_handler_1 (ArdourCanvas::Item* item, GdkEvent* event, ItemT
|
||||||
std::shared_ptr<Playlist> pl = p->track()->playlist ();
|
std::shared_ptr<Playlist> pl = p->track()->playlist ();
|
||||||
if (pl->n_regions() == 0) {
|
if (pl->n_regions() == 0) {
|
||||||
/* Parent has no regions; create one so that we have somewhere to put automation */
|
/* Parent has no regions; create one so that we have somewhere to put automation */
|
||||||
_drags->set (new RegionCreateDrag (this, item, parent), event);
|
_drags->set (new RegionCreateDrag (*this, item, parent), event);
|
||||||
} else {
|
} else {
|
||||||
/* See if there's a region before the click that we can extend, and extend it if so */
|
/* See if there's a region before the click that we can extend, and extend it if so */
|
||||||
timepos_t const t (canvas_event_sample (event));
|
timepos_t const t (canvas_event_sample (event));
|
||||||
std::shared_ptr<Region> prev = pl->find_next_region (t, End, -1);
|
std::shared_ptr<Region> prev = pl->find_next_region (t, End, -1);
|
||||||
if (!prev) {
|
if (!prev) {
|
||||||
_drags->set (new RegionCreateDrag (this, item, parent), event);
|
_drags->set (new RegionCreateDrag (*this, item, parent), event);
|
||||||
} else {
|
} else {
|
||||||
prev->set_length (prev->position ().distance (t));
|
prev->set_length (prev->position ().distance (t));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
/* rubberband drag to select automation points */
|
/* rubberband drag to select automation points */
|
||||||
_drags->set (new EditorRubberbandSelectDrag (this, item), event);
|
_drags->set (new EditorRubberbandSelectDrag (*this, item), event);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
@ -1211,11 +1205,11 @@ Editor::button_press_handler_1 (ArdourCanvas::Item* item, GdkEvent* event, ItemT
|
||||||
case MouseDraw:
|
case MouseDraw:
|
||||||
switch (item_type) {
|
switch (item_type) {
|
||||||
case GainLineItem:
|
case GainLineItem:
|
||||||
_drags->set (new LineDrag (this, item), event);
|
_drags->set (new LineDrag (*this, item), event);
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
case ControlPointItem:
|
case ControlPointItem:
|
||||||
_drags->set (new ControlPointDrag (this, item), event);
|
_drags->set (new ControlPointDrag (*this, item), event);
|
||||||
return true;
|
return true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
@ -1236,14 +1230,14 @@ Editor::button_press_handler_1 (ArdourCanvas::Item* item, GdkEvent* event, ItemT
|
||||||
/* if there's no line yet, AutomationRangeDrag will need to be told what the initial value of this control is */
|
/* if there's no line yet, AutomationRangeDrag will need to be told what the initial value of this control is */
|
||||||
float init_value = atv->control()->get_value();
|
float init_value = atv->control()->get_value();
|
||||||
|
|
||||||
_drags->set (new AutomationRangeDrag (this, atv, init_value, selection->time), event, _cursors->up_down);
|
_drags->set (new AutomationRangeDrag (*this, atv, init_value, selection->time), event, _cursors->up_down);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (dynamic_cast<AutomationRegionView*>(clicked_regionview)) {
|
if (dynamic_cast<AutomationRegionView*>(clicked_regionview)) {
|
||||||
/* MIDI CC or similar -- TODO handle multiple? */
|
/* MIDI CC or similar -- TODO handle multiple? */
|
||||||
list<RegionView*> rvl;
|
list<RegionView*> rvl;
|
||||||
rvl.push_back (clicked_regionview);
|
rvl.push_back (clicked_regionview);
|
||||||
_drags->set (new AutomationRangeDrag (this, rvl, selection->time,
|
_drags->set (new AutomationRangeDrag (*this, rvl, selection->time,
|
||||||
clicked_regionview->get_time_axis_view().y_position(),
|
clicked_regionview->get_time_axis_view().y_position(),
|
||||||
clicked_regionview->get_time_axis_view().current_height()),
|
clicked_regionview->get_time_axis_view().current_height()),
|
||||||
event, _cursors->up_down);
|
event, _cursors->up_down);
|
||||||
|
|
@ -1258,7 +1252,7 @@ Editor::button_press_handler_1 (ArdourCanvas::Item* item, GdkEvent* event, ItemT
|
||||||
list<RegionView*> rvl;
|
list<RegionView*> rvl;
|
||||||
rvl.push_back (clicked_regionview);
|
rvl.push_back (clicked_regionview);
|
||||||
// TODO: handle layer_display() == Stacked
|
// TODO: handle layer_display() == Stacked
|
||||||
_drags->set (new AutomationRangeDrag (this, rvl, selection->time,
|
_drags->set (new AutomationRangeDrag (*this, rvl, selection->time,
|
||||||
clicked_regionview->get_time_axis_view().y_position(),
|
clicked_regionview->get_time_axis_view().y_position(),
|
||||||
clicked_regionview->get_time_axis_view().current_height()),
|
clicked_regionview->get_time_axis_view().current_height()),
|
||||||
event, _cursors->up_down);
|
event, _cursors->up_down);
|
||||||
|
|
@ -1300,7 +1294,7 @@ Editor::button_press_handler_1 (ArdourCanvas::Item* item, GdkEvent* event, ItemT
|
||||||
double yy = event->button.y - _trackview_group->canvas_origin().y;
|
double yy = event->button.y - _trackview_group->canvas_origin().y;
|
||||||
y_pos += floor ((yy - y_pos) / height) * height;
|
y_pos += floor ((yy - y_pos) / height) * height;
|
||||||
}
|
}
|
||||||
_drags->set (new AutomationRangeDrag (this, rvl, selection->time, y_pos, height),
|
_drags->set (new AutomationRangeDrag (*this, rvl, selection->time, y_pos, height),
|
||||||
event, _cursors->up_down);
|
event, _cursors->up_down);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
@ -1313,7 +1307,7 @@ Editor::button_press_handler_1 (ArdourCanvas::Item* item, GdkEvent* event, ItemT
|
||||||
{
|
{
|
||||||
AutomationTimeAxisView* atv = static_cast<AutomationTimeAxisView*> (item->get_data ("trackview"));
|
AutomationTimeAxisView* atv = static_cast<AutomationTimeAxisView*> (item->get_data ("trackview"));
|
||||||
if (atv) {
|
if (atv) {
|
||||||
_drags->set (new AutomationDrawDrag (this, nullptr, atv->base_item(), Temporal::AudioTime), event);
|
_drags->set (new AutomationDrawDrag (*this, nullptr, atv->base_item(), Temporal::AudioTime), event);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
@ -1322,10 +1316,10 @@ Editor::button_press_handler_1 (ArdourCanvas::Item* item, GdkEvent* event, ItemT
|
||||||
if ((note = reinterpret_cast<NoteBase*>(item->get_data ("notebase")))) {
|
if ((note = reinterpret_cast<NoteBase*>(item->get_data ("notebase")))) {
|
||||||
if (note->big_enough_to_trim() && note->mouse_near_ends()) {
|
if (note->big_enough_to_trim() && note->mouse_near_ends()) {
|
||||||
/* Note is big and pointer is near the end, trim */
|
/* Note is big and pointer is near the end, trim */
|
||||||
_drags->set (new NoteResizeDrag (this, item), event, get_canvas_cursor());
|
_drags->set (new NoteResizeDrag (*this, item), event, get_canvas_cursor());
|
||||||
} else {
|
} else {
|
||||||
/* Drag note */
|
/* Drag note */
|
||||||
_drags->set (new NoteDrag (this, item), event);
|
_drags->set (new NoteDrag (*this, item), event);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
@ -1333,14 +1327,14 @@ Editor::button_press_handler_1 (ArdourCanvas::Item* item, GdkEvent* event, ItemT
|
||||||
|
|
||||||
case StreamItem:
|
case StreamItem:
|
||||||
if (dynamic_cast<MidiTimeAxisView*> (clicked_axisview)) {
|
if (dynamic_cast<MidiTimeAxisView*> (clicked_axisview)) {
|
||||||
_drags->set (new RegionCreateDrag (this, item, clicked_axisview), event);
|
_drags->set (new RegionCreateDrag (*this, item, clicked_axisview), event);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
case RegionItem: {
|
case RegionItem: {
|
||||||
RegionView* rv;
|
RegionView* rv;
|
||||||
if ((rv = dynamic_cast<RegionView*> (clicked_regionview))) {
|
if ((rv = dynamic_cast<RegionView*> (clicked_regionview))) {
|
||||||
ArdourCanvas::Rectangle* r = dynamic_cast<ArdourCanvas::Rectangle*> (rv->get_canvas_frame());
|
ArdourCanvas::Rectangle* r = dynamic_cast<ArdourCanvas::Rectangle*> (rv->get_canvas_frame());
|
||||||
_drags->set (new AutomationDrawDrag (this, rv->get_canvas_group(), *r, Temporal::AudioTime), event);
|
_drags->set (new AutomationDrawDrag (*this, rv->get_canvas_group(), *r, Temporal::AudioTime), event);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
@ -1356,13 +1350,13 @@ Editor::button_press_handler_1 (ArdourCanvas::Item* item, GdkEvent* event, ItemT
|
||||||
/* resize-drag notes */
|
/* resize-drag notes */
|
||||||
if ((note = reinterpret_cast<NoteBase*>(item->get_data ("notebase")))) {
|
if ((note = reinterpret_cast<NoteBase*>(item->get_data ("notebase")))) {
|
||||||
if (note->big_enough_to_trim()) {
|
if (note->big_enough_to_trim()) {
|
||||||
_drags->set (new NoteResizeDrag (this, item), event, get_canvas_cursor());
|
_drags->set (new NoteResizeDrag (*this, item), event, get_canvas_cursor());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
} else if (clicked_regionview) {
|
} else if (clicked_regionview) {
|
||||||
/* do time-FX */
|
/* do time-FX */
|
||||||
_drags->set (new TimeFXDrag (this, item, clicked_regionview, selection->regions.by_layer(), drag_time_domain (clicked_regionview->region())), event);
|
_drags->set (new TimeFXDrag (*this, item, clicked_regionview, selection->regions.by_layer(), drag_time_domain (clicked_regionview->region())), event);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
@ -1394,7 +1388,7 @@ Editor::button_press_handler_2 (ArdourCanvas::Item* item, GdkEvent* event, ItemT
|
||||||
return true;
|
return true;
|
||||||
break;
|
break;
|
||||||
case ControlPointItem:
|
case ControlPointItem:
|
||||||
_drags->set (new ControlPointDrag (this, item), event);
|
_drags->set (new ControlPointDrag (*this, item), event);
|
||||||
return true;
|
return true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
@ -1404,18 +1398,18 @@ Editor::button_press_handler_2 (ArdourCanvas::Item* item, GdkEvent* event, ItemT
|
||||||
|
|
||||||
switch (item_type) {
|
switch (item_type) {
|
||||||
case RegionViewNameHighlight:
|
case RegionViewNameHighlight:
|
||||||
_drags->set (new TrimDrag (this, item, clicked_regionview, selection->regions.by_layer(), drag_time_domain (clicked_regionview->region())), event);
|
_drags->set (new TrimDrag (*this, item, clicked_regionview, selection->regions.by_layer(), drag_time_domain (clicked_regionview->region())), event);
|
||||||
return true;
|
return true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case LeftFrameHandle:
|
case LeftFrameHandle:
|
||||||
case RightFrameHandle:
|
case RightFrameHandle:
|
||||||
_drags->set (new TrimDrag (this, item, clicked_regionview, selection->regions.by_layer(), drag_time_domain (clicked_regionview->region())), event);
|
_drags->set (new TrimDrag (*this, item, clicked_regionview, selection->regions.by_layer(), drag_time_domain (clicked_regionview->region())), event);
|
||||||
return true;
|
return true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RegionViewName:
|
case RegionViewName:
|
||||||
_drags->set (new TrimDrag (this, clicked_regionview->get_name_highlight(), clicked_regionview, selection->regions.by_layer(), drag_time_domain (clicked_regionview->region())), event);
|
_drags->set (new TrimDrag (*this, clicked_regionview->get_name_highlight(), clicked_regionview, selection->regions.by_layer(), drag_time_domain (clicked_regionview->region())), event);
|
||||||
return true;
|
return true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
@ -2643,7 +2637,7 @@ Editor::add_region_drag (ArdourCanvas::Item* item, GdkEvent*, RegionView* region
|
||||||
|
|
||||||
assert (!_drags->active ());
|
assert (!_drags->active ());
|
||||||
|
|
||||||
_drags->add (new RegionMoveDrag (this, item, region_view, selection->regions.by_layer(), copy, drag_time_domain (region_view->region())));
|
_drags->add (new RegionMoveDrag (*this, item, region_view, selection->regions.by_layer(), copy, drag_time_domain (region_view->region())));
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
@ -2662,7 +2656,7 @@ Editor::add_region_brush_drag (ArdourCanvas::Item* item, GdkEvent*, RegionView*
|
||||||
}
|
}
|
||||||
|
|
||||||
std::list<RegionView*> empty;
|
std::list<RegionView*> empty;
|
||||||
_drags->add (new RegionBrushDrag (this, item, region_view, empty, drag_time_domain (region_view->region())));
|
_drags->add (new RegionBrushDrag (*this, item, region_view, empty, drag_time_domain (region_view->region())));
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Start a grab where a time range is selected, track(s) are selected, and the
|
/** Start a grab where a time range is selected, track(s) are selected, and the
|
||||||
|
|
@ -2726,7 +2720,7 @@ Editor::start_selection_grab (ArdourCanvas::Item* /*item*/, GdkEvent* event)
|
||||||
|
|
||||||
commit_reversible_command ();
|
commit_reversible_command ();
|
||||||
|
|
||||||
_drags->set (new RegionMoveDrag (this, latest_regionviews.front()->get_canvas_group(), latest_regionviews.front(), latest_regionviews, false, drag_time_domain (latest_regionviews.front()->region())), event);
|
_drags->set (new RegionMoveDrag (*this, latest_regionviews.front()->get_canvas_group(), latest_regionviews.front(), latest_regionviews, false, drag_time_domain (latest_regionviews.front()->region())), event);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
@ -2981,18 +2975,18 @@ Editor::choose_mapping_drag (ArdourCanvas::Item* item, GdkEvent* event)
|
||||||
|
|
||||||
if (at_end) {
|
if (at_end) {
|
||||||
_session->current_reversible_command()->set_name (_("tempo mapping: end-stretch"));
|
_session->current_reversible_command()->set_name (_("tempo mapping: end-stretch"));
|
||||||
_drags->set (new MappingEndDrag (this, item, map, tempo, *focus, *before_state), event);
|
_drags->set (new MappingEndDrag (*this, item, map, tempo, *focus, *before_state), event);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (before && focus && after) {
|
if (before && focus && after) {
|
||||||
_session->current_reversible_command()->set_name (_("tempo mapping: mid-twist"));
|
_session->current_reversible_command()->set_name (_("tempo mapping: mid-twist"));
|
||||||
_drags->set (new MappingTwistDrag (this, item, map, *before, *focus, *after, *before_state, ramped), event);
|
_drags->set (new MappingTwistDrag (*this, item, map, *before, *focus, *after, *before_state, ramped), event);
|
||||||
} else if (ramped && focus && after) {
|
} else if (ramped && focus && after) {
|
||||||
/* special case 4: user is manipulating a beat line after the INITIAL tempo marker, so there is no prior marker*/
|
/* special case 4: user is manipulating a beat line after the INITIAL tempo marker, so there is no prior marker*/
|
||||||
_session->current_reversible_command()->set_name (_("tempo mapping: mid-twist"));
|
_session->current_reversible_command()->set_name (_("tempo mapping: mid-twist"));
|
||||||
before = focus; /* this is unused in MappingTwistDrag, when ramped is true, but let's not pass in garbage */
|
before = focus; /* this is unused in MappingTwistDrag, when ramped is true, but let's not pass in garbage */
|
||||||
_drags->set (new MappingTwistDrag (this, item, map, *before, *focus, *after, *before_state, ramped), event);
|
_drags->set (new MappingTwistDrag (*this, item, map, *before, *focus, *after, *before_state, ramped), event);
|
||||||
} else {
|
} else {
|
||||||
abort_tempo_mapping (); /* NOTREACHED */
|
abort_tempo_mapping (); /* NOTREACHED */
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@
|
||||||
#include "ardour/session.h"
|
#include "ardour/session.h"
|
||||||
|
|
||||||
#include "automation_line.h"
|
#include "automation_line.h"
|
||||||
#include "editor.h"
|
#include "editing_context.h"
|
||||||
#include "mergeable_line.h"
|
#include "mergeable_line.h"
|
||||||
#include "route_time_axis.h"
|
#include "route_time_axis.h"
|
||||||
#include "selectable.h"
|
#include "selectable.h"
|
||||||
|
|
@ -32,7 +32,7 @@
|
||||||
using namespace ARDOUR;
|
using namespace ARDOUR;
|
||||||
|
|
||||||
void
|
void
|
||||||
MergeableLine::merge_drawn_line (Editor& e, Session& s, Evoral::ControlList::OrderedPoints& points, bool thin)
|
MergeableLine::merge_drawn_line (EditingContext& e, Session& s, Evoral::ControlList::OrderedPoints& points, bool thin)
|
||||||
{
|
{
|
||||||
if (points.empty()) {
|
if (points.empty()) {
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@
|
||||||
|
|
||||||
class AutomationLine;
|
class AutomationLine;
|
||||||
class RouteTimeAxisView;
|
class RouteTimeAxisView;
|
||||||
class Editor;
|
class EditingContext;
|
||||||
|
|
||||||
namespace ARDOUR {
|
namespace ARDOUR {
|
||||||
class Session;
|
class Session;
|
||||||
|
|
@ -50,7 +50,7 @@ class MergeableLine
|
||||||
|
|
||||||
virtual ~MergeableLine() {}
|
virtual ~MergeableLine() {}
|
||||||
|
|
||||||
void merge_drawn_line (Editor& e, ARDOUR::Session& s, Evoral::ControlList::OrderedPoints& points, bool thin);
|
void merge_drawn_line (EditingContext& e, ARDOUR::Session& s, Evoral::ControlList::OrderedPoints& points, bool thin);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::shared_ptr<AutomationLine> _line;
|
std::shared_ptr<AutomationLine> _line;
|
||||||
|
|
|
||||||
|
|
@ -505,9 +505,9 @@ MidiRegionView::button_press (GdkEventButton* ev)
|
||||||
if (m == MouseDraw || (m == MouseContent && Keyboard::modifier_state_contains (ev->state, Keyboard::insert_note_modifier()))) {
|
if (m == MouseDraw || (m == MouseContent && Keyboard::modifier_state_contains (ev->state, Keyboard::insert_note_modifier()))) {
|
||||||
|
|
||||||
if (midi_view()->note_mode() == Percussive) {
|
if (midi_view()->note_mode() == Percussive) {
|
||||||
// editor->drags()->set (new HitCreateDrag (dynamic_cast<Editor *> (editor), group, this), (GdkEvent *) ev);
|
editing_context.drags()->set (new HitCreateDrag (editing_context, group, this), (GdkEvent *) ev);
|
||||||
} else {
|
} else {
|
||||||
// editor->drags()->set (new NoteCreateDrag (dynamic_cast<Editor *> (editor), group, this), (GdkEvent *) ev);
|
editing_context.drags()->set (new NoteCreateDrag (editing_context, group, this), (GdkEvent *) ev);
|
||||||
}
|
}
|
||||||
|
|
||||||
_mouse_state = AddDragging;
|
_mouse_state = AddDragging;
|
||||||
|
|
@ -575,7 +575,7 @@ MidiRegionView::button_release (GdkEventButton* ev)
|
||||||
/* Don't a ghost note when we added a note - wait until motion to avoid visual confusion.
|
/* Don't a ghost note when we added a note - wait until motion to avoid visual confusion.
|
||||||
we don't want one when we were drag-selecting either. */
|
we don't want one when we were drag-selecting either. */
|
||||||
case SelectRectDragging:
|
case SelectRectDragging:
|
||||||
// editor.drags()->end_grab ((GdkEvent *) ev);
|
editing_context.drags()->end_grab ((GdkEvent *) ev);
|
||||||
_mouse_state = None;
|
_mouse_state = None;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
@ -642,7 +642,7 @@ MidiRegionView::motion (GdkEventMotion* ev)
|
||||||
MouseMode m = editing_context.current_mouse_mode();
|
MouseMode m = editing_context.current_mouse_mode();
|
||||||
|
|
||||||
if (m == MouseContent && !Keyboard::modifier_state_contains (ev->state, Keyboard::insert_note_modifier())) {
|
if (m == MouseContent && !Keyboard::modifier_state_contains (ev->state, Keyboard::insert_note_modifier())) {
|
||||||
// editing_context.drags()->set (new MidiRubberbandSelectDrag (dynamic_cast<Editor *> (&editor), this), (GdkEvent *) ev);
|
editing_context.drags()->set (new MidiRubberbandSelectDrag (editing_context, this), (GdkEvent *) ev);
|
||||||
if (!Keyboard::modifier_state_equals (ev->state, Keyboard::TertiaryModifier)) {
|
if (!Keyboard::modifier_state_equals (ev->state, Keyboard::TertiaryModifier)) {
|
||||||
clear_selection_internal ();
|
clear_selection_internal ();
|
||||||
_mouse_changed_selection = true;
|
_mouse_changed_selection = true;
|
||||||
|
|
@ -650,7 +650,7 @@ MidiRegionView::motion (GdkEventMotion* ev)
|
||||||
_mouse_state = SelectRectDragging;
|
_mouse_state = SelectRectDragging;
|
||||||
return true;
|
return true;
|
||||||
} else if (m == MouseRange) {
|
} else if (m == MouseRange) {
|
||||||
// editing_context.drags()->set (new MidiVerticalSelectDrag (dynamic_cast<Editor *> (&editor), this), (GdkEvent *) ev);
|
editing_context.drags()->set (new MidiVerticalSelectDrag (editing_context, this), (GdkEvent *) ev);
|
||||||
_mouse_state = SelectVerticalDragging;
|
_mouse_state = SelectVerticalDragging;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
@ -661,7 +661,7 @@ MidiRegionView::motion (GdkEventMotion* ev)
|
||||||
case SelectRectDragging:
|
case SelectRectDragging:
|
||||||
case SelectVerticalDragging:
|
case SelectVerticalDragging:
|
||||||
case AddDragging:
|
case AddDragging:
|
||||||
// editing_context.drags()->motion_handler ((GdkEvent *) ev, false);
|
editing_context.drags()->motion_handler ((GdkEvent *) ev, false);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SelectTouchDragging:
|
case SelectTouchDragging:
|
||||||
|
|
@ -680,9 +680,9 @@ MidiRegionView::motion (GdkEventMotion* ev)
|
||||||
bool
|
bool
|
||||||
MidiRegionView::scroll (GdkEventScroll* ev)
|
MidiRegionView::scroll (GdkEventScroll* ev)
|
||||||
{
|
{
|
||||||
// if (editing_context.drags()->active()) {
|
if (editing_context.drags()->active()) {
|
||||||
// return false;
|
return false;
|
||||||
// }
|
}
|
||||||
|
|
||||||
if (!editing_context.get_selection().selected (this)) {
|
if (!editing_context.get_selection().selected (this)) {
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -863,7 +863,7 @@ void
|
||||||
MidiRegionView::show_list_editor ()
|
MidiRegionView::show_list_editor ()
|
||||||
{
|
{
|
||||||
if (!_list_editor) {
|
if (!_list_editor) {
|
||||||
_list_editor = new MidiListEditor (trackview.session(), midi_region(), midi_view()->midi_track());
|
_list_editor = new MidiListEditor (editing_context.session(), midi_region(), midi_view()->midi_track());
|
||||||
}
|
}
|
||||||
_list_editor->present ();
|
_list_editor->present ();
|
||||||
}
|
}
|
||||||
|
|
@ -1022,7 +1022,7 @@ MidiRegionView::apply_note_diff (bool as_subcommand, bool was_copy)
|
||||||
{
|
{
|
||||||
PBD::Unwinder<bool> puw (_select_all_notes_after_add, true);
|
PBD::Unwinder<bool> puw (_select_all_notes_after_add, true);
|
||||||
/*note that we don't use as_commit here, because that would BEGIN a new undo record; we already have one underway*/
|
/*note that we don't use as_commit here, because that would BEGIN a new undo record; we already have one underway*/
|
||||||
_model->apply_diff_command_as_subcommand (*trackview.session(), _note_diff_command);
|
_model->apply_diff_command_as_subcommand (*editing_context.session(), _note_diff_command);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!as_subcommand) {
|
if (!as_subcommand) {
|
||||||
|
|
@ -1454,7 +1454,7 @@ MidiRegionView::display_sysexes()
|
||||||
|
|
||||||
/* get an approximate value for the number of samples per video frame */
|
/* get an approximate value for the number of samples per video frame */
|
||||||
|
|
||||||
double video_frame = trackview.session()->sample_rate() * (1.0/30);
|
double video_frame = editing_context.session()->sample_rate() * (1.0/30);
|
||||||
|
|
||||||
/* if we are zoomed out beyond than the cutoff (i.e. more
|
/* if we are zoomed out beyond than the cutoff (i.e. more
|
||||||
* samples per pixel than samples per 4 video frames), don't
|
* samples per pixel than samples per 4 video frames), don't
|
||||||
|
|
@ -2215,9 +2215,9 @@ MidiRegionView::delete_selection()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// if (editing_context.drags()->active()) {
|
if (editing_context.drags()->active()) {
|
||||||
// return;
|
return;
|
||||||
// }
|
}
|
||||||
|
|
||||||
start_note_diff_command (_("delete selection"));
|
start_note_diff_command (_("delete selection"));
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -171,7 +171,7 @@ PatchChange::event_handler (GdkEvent* ev)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
} else if (ev->button.button == 1) {
|
} else if (ev->button.button == 1) {
|
||||||
e->drags ()->set (new PatchChangeDrag (e, this, &_region), ev);
|
e->drags ()->set (new PatchChangeDrag (*e, this, &_region), ev);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -138,11 +138,6 @@ public:
|
||||||
|
|
||||||
virtual void setup_tooltips() = 0;
|
virtual void setup_tooltips() = 0;
|
||||||
|
|
||||||
/* returns the time domain to be used when there's no other overriding
|
|
||||||
* reason to choose one.
|
|
||||||
*/
|
|
||||||
virtual Temporal::TimeDomain default_time_domain() const = 0;
|
|
||||||
|
|
||||||
/** Attach this editor to a Session.
|
/** Attach this editor to a Session.
|
||||||
* @param s Session to connect to.
|
* @param s Session to connect to.
|
||||||
*/
|
*/
|
||||||
|
|
@ -306,18 +301,6 @@ public:
|
||||||
|
|
||||||
virtual void toggle_cue_behavior () = 0;
|
virtual void toggle_cue_behavior () = 0;
|
||||||
|
|
||||||
/** Set whether the editor should follow the playhead.
|
|
||||||
* @param yn true to follow playhead, otherwise false.
|
|
||||||
* @param catch_up true to reset the editor view to show the playhead (if yn == true), otherwise false.
|
|
||||||
*/
|
|
||||||
virtual void set_follow_playhead (bool yn, bool catch_up = true) = 0;
|
|
||||||
|
|
||||||
/** Toggle whether the editor is following the playhead */
|
|
||||||
virtual void toggle_follow_playhead () = 0;
|
|
||||||
|
|
||||||
/** @return true if the editor is following the playhead */
|
|
||||||
virtual bool follow_playhead () const = 0;
|
|
||||||
|
|
||||||
/** @return true if the playhead is currently being dragged, otherwise false */
|
/** @return true if the playhead is currently being dragged, otherwise false */
|
||||||
virtual bool dragging_playhead () const = 0;
|
virtual bool dragging_playhead () const = 0;
|
||||||
virtual samplepos_t leftmost_sample() const = 0;
|
virtual samplepos_t leftmost_sample() const = 0;
|
||||||
|
|
@ -453,12 +436,6 @@ public:
|
||||||
|
|
||||||
virtual MixerStrip* get_current_mixer_strip () const = 0;
|
virtual MixerStrip* get_current_mixer_strip () const = 0;
|
||||||
|
|
||||||
virtual DragManager* drags () const = 0;
|
|
||||||
virtual bool drag_active () const = 0;
|
|
||||||
virtual bool preview_video_drag_active () const = 0;
|
|
||||||
virtual void maybe_autoscroll (bool, bool, bool from_headers) = 0;
|
|
||||||
virtual void stop_canvas_autoscroll () = 0;
|
|
||||||
virtual bool autoscroll_active() const = 0;
|
|
||||||
|
|
||||||
virtual Temporal::TempoMap::WritableSharedPtr begin_tempo_map_edit () = 0;
|
virtual Temporal::TempoMap::WritableSharedPtr begin_tempo_map_edit () = 0;
|
||||||
virtual void abort_tempo_map_edit () = 0;
|
virtual void abort_tempo_map_edit () = 0;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue