NO-OP: cleanup snap-to code, mostly whitespace

This commit is contained in:
Robin Gareus 2020-04-05 20:08:33 +02:00
parent 3a2f0e40cf
commit 6b9bdbf0ff
No known key found for this signature in database
GPG key ID: A090BCE02CF57F04

View file

@ -2690,7 +2690,7 @@ Editor::snap_to (MusicSample& start, RoundMode direction, SnapPref pref, bool en
snap_to_internal (start, direction, pref, ensure_snap); snap_to_internal (start, direction, pref, ensure_snap);
} }
void static void
check_best_snap (samplepos_t presnap, samplepos_t &test, samplepos_t &dist, samplepos_t &best) check_best_snap (samplepos_t presnap, samplepos_t &test, samplepos_t &dist, samplepos_t &best)
{ {
samplepos_t diff = abs (test - presnap); samplepos_t diff = abs (test - presnap);
@ -2971,6 +2971,7 @@ Editor::snap_to_marker (samplepos_t presnap, RoundMode direction)
void void
Editor::snap_to_internal (MusicSample& start, RoundMode direction, SnapPref pref, bool ensure_snap) Editor::snap_to_internal (MusicSample& start, RoundMode direction, SnapPref pref, bool ensure_snap)
{ {
UIConfiguration const& uic (UIConfiguration::instance ());
const samplepos_t presnap = start.sample; const samplepos_t presnap = start.sample;
samplepos_t test = max_samplepos; // for each snap, we'll use this value samplepos_t test = max_samplepos; // for each snap, we'll use this value
@ -2978,13 +2979,11 @@ Editor::snap_to_internal (MusicSample& start, RoundMode direction, SnapPref pref
samplepos_t best = max_samplepos; // this records the best snap-result we've found so far samplepos_t best = max_samplepos; // this records the best snap-result we've found so far
/* check snap-to-marker */ /* check snap-to-marker */
if ((pref == SnapToAny_Visual) && UIConfiguration::instance().get_snap_to_marks()) { if ((pref == SnapToAny_Visual) && uic.get_snap_to_marks ()) {
test = snap_to_marker (presnap, direction); test = snap_to_marker (presnap, direction);
check_best_snap (presnap, test, dist, best); check_best_snap (presnap, test, dist, best);
} }
const UIConfiguration& uic (UIConfiguration::instance());
/* check snap-to-region-{start/end/sync} */ /* check snap-to-region-{start/end/sync} */
if ((pref == SnapToAny_Visual) && (uic.get_snap_to_region_start () || uic.get_snap_to_region_end () || uic.get_snap_to_region_sync ())) { if ((pref == SnapToAny_Visual) && (uic.get_snap_to_region_start () || uic.get_snap_to_region_end () || uic.get_snap_to_region_sync ())) {