summaryrefslogtreecommitdiff
path: root/gtk2_ardour/editor_drag.h
diff options
context:
space:
mode:
authornick_m <mainsbridge@gmail.com>2017-01-27 00:41:17 +1100
committernick_m <mainsbridge@gmail.com>2017-02-04 22:57:36 +1100
commit59daffea1d78cb55b35fe19c135cc4ab472bd01d (patch)
tree45e514f2e4f5a1935e360fd4fa3e2475ec217006 /gtk2_ardour/editor_drag.h
parenta21a414615505269bf770ad2358482e698e841af (diff)
rework snap
snap now fills in a struct (MusicFrame) which contins a snapped frame along with a music divisor. this gives useful information wrt magnetic snap which may or may not have rounded to an exact musical position. region position may now be set musically (using quarter notes for now). this patch fixes several problems in the current code: - dragging a list of music-locked regions now maintains correct musical offsets within the list. - splitting regions using magnetic snap works correctly (#7192) - cut drag should now work correctly with magnetic snap. - musical length of split midi regions is no longer frame based.
Diffstat (limited to 'gtk2_ardour/editor_drag.h')
-rw-r--r--gtk2_ardour/editor_drag.h22
1 files changed, 11 insertions, 11 deletions
diff --git a/gtk2_ardour/editor_drag.h b/gtk2_ardour/editor_drag.h
index b5ebc3b39d..e5a02743fc 100644
--- a/gtk2_ardour/editor_drag.h
+++ b/gtk2_ardour/editor_drag.h
@@ -144,7 +144,7 @@ public:
bool motion_handler (GdkEvent*, bool);
void abort ();
- ARDOUR::framepos_t adjusted_frame (ARDOUR::framepos_t, GdkEvent const *, bool snap = true) const;
+ ARDOUR::MusicFrame adjusted_frame (ARDOUR::framepos_t, GdkEvent const *, bool snap = true) const;
ARDOUR::framepos_t adjusted_current_frame (GdkEvent const *, bool snap = true) const;
bool was_double_click() const { return _was_double_click; }
@@ -247,9 +247,9 @@ protected:
double current_pointer_y () const;
/* sets snap delta from unsnapped pos */
- void setup_snap_delta (framepos_t pos);
+ void setup_snap_delta (ARDOUR::MusicFrame pos);
- boost::shared_ptr<ARDOUR::Region> add_midi_region (MidiTimeAxisView*, bool commit, const int32_t sub_num);
+ boost::shared_ptr<ARDOUR::Region> add_midi_region (MidiTimeAxisView*, bool commit);
void show_verbose_cursor_time (framepos_t);
void show_verbose_cursor_duration (framepos_t, framepos_t, double xoffset = 0);
@@ -281,7 +281,7 @@ private:
/* difference between some key position's snapped and unsnapped
* framepos. used for relative snap.
*/
- ARDOUR::frameoffset_t _snap_delta;
+ ARDOUR::MusicFrame _snap_delta;
CursorContext::Handle _cursor_ctx; ///< cursor change context
bool _constraint_pressed; ///< if the keyboard indicated constraint modifier was pressed on start_grab()
};
@@ -328,7 +328,6 @@ protected:
std::vector<TimeAxisView*> _time_axis_views;
int find_time_axis_view (TimeAxisView *) const;
int apply_track_delta (const int start, const int delta, const int skip, const bool distance_only = false) const;
- int32_t current_music_divisor (framepos_t pos, int32_t button_state);
int _visible_y_low;
int _visible_y_high;
@@ -363,12 +362,12 @@ public:
protected:
- double compute_x_delta (GdkEvent const *, ARDOUR::framepos_t *);
+ double compute_x_delta (GdkEvent const *, ARDOUR::MusicFrame *);
virtual bool y_movement_allowed (int, double, int skip_invisible = 0) const;
bool _brushing;
bool _ignore_video_lock;
- ARDOUR::framepos_t _last_frame_position; ///< last position of the thing being dragged
+ ARDOUR::MusicFrame _last_position; ///< last position of the thing being dragged
double _total_x_delta;
int _last_pointer_time_axis_view;
double _last_pointer_layer;
@@ -410,14 +409,14 @@ private:
void finished_no_copy (
bool const,
bool const,
- ARDOUR::framecnt_t const,
+ ARDOUR::MusicFrame,
int32_t const ev_state
);
void finished_copy (
bool const,
bool const,
- ARDOUR::framecnt_t const,
+ ARDOUR::MusicFrame,
int32_t const ev_state
);
@@ -425,9 +424,10 @@ private:
boost::shared_ptr<ARDOUR::Region>,
RouteTimeAxisView*,
ARDOUR::layer_t,
- ARDOUR::framecnt_t,
+ ARDOUR::MusicFrame,
+ double quarter_note,
PlaylistSet&,
- const int32_t sub_num
+ bool for_music = false
);
void remove_region_from_playlist (