summaryrefslogtreecommitdiff
path: root/gtk2_ardour/editor.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.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.h')
-rw-r--r--gtk2_ardour/editor.h40
1 files changed, 20 insertions, 20 deletions
diff --git a/gtk2_ardour/editor.h b/gtk2_ardour/editor.h
index 8ff19580c6..fa5ed9057a 100644
--- a/gtk2_ardour/editor.h
+++ b/gtk2_ardour/editor.h
@@ -452,20 +452,20 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
TrackViewList axis_views_from_routes (boost::shared_ptr<ARDOUR::RouteList>) const;
- void snap_to (framepos_t& first,
- ARDOUR::RoundMode direction = ARDOUR::RoundNearest,
- bool for_mark = false,
- bool ensure_snap = false);
+ void snap_to (ARDOUR::MusicFrame& first,
+ ARDOUR::RoundMode direction = ARDOUR::RoundNearest,
+ bool for_mark = false,
+ bool ensure_snap = false);
- void snap_to_with_modifier (framepos_t& first,
- GdkEvent const * ev,
- ARDOUR::RoundMode direction = ARDOUR::RoundNearest,
- bool for_mark = false);
+ void snap_to_with_modifier (ARDOUR::MusicFrame& first,
+ GdkEvent const * ev,
+ ARDOUR::RoundMode direction = ARDOUR::RoundNearest,
+ bool for_mark = false);
- void snap_to (framepos_t& first,
- framepos_t& last,
- ARDOUR::RoundMode direction = ARDOUR::RoundNearest,
- bool for_mark = false);
+ void snap_to (ARDOUR::MusicFrame& first,
+ ARDOUR::MusicFrame& last,
+ ARDOUR::RoundMode direction = ARDOUR::RoundNearest,
+ bool for_mark = false);
void begin_selection_op_history ();
void begin_reversible_selection_op (std::string cmd_name);
@@ -542,7 +542,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
/* editing operations that need to be public */
void mouse_add_new_marker (framepos_t where, bool is_cd=false);
- void split_regions_at (framepos_t, RegionSelection&, const int32_t sub_num, bool snap = true);
+ void split_regions_at (ARDOUR::MusicFrame, RegionSelection&, bool snap = true);
void split_region_at_points (boost::shared_ptr<ARDOUR::Region>, ARDOUR::AnalysisFeatureList&, bool can_ferret, bool select_new = false);
RegionSelection get_regions_from_selection_and_mouse (framepos_t);
@@ -2152,14 +2152,14 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
void select_next_route ();
void select_prev_route ();
- void snap_to_internal (framepos_t& first,
- ARDOUR::RoundMode direction = ARDOUR::RoundNearest,
- bool for_mark = false,
- bool ensure_snap = false);
+ void snap_to_internal (ARDOUR::MusicFrame& first,
+ ARDOUR::RoundMode direction = ARDOUR::RoundNearest,
+ bool for_mark = false,
+ bool ensure_snap = false);
- void timecode_snap_to_internal (framepos_t& first,
- ARDOUR::RoundMode direction = ARDOUR::RoundNearest,
- bool for_mark = false);
+ void timecode_snap_to_internal (ARDOUR::MusicFrame& first,
+ ARDOUR::RoundMode direction = ARDOUR::RoundNearest,
+ bool for_mark = false);
RhythmFerret* rhythm_ferret;