}
if (sync_frame - sync_offset <= sync_frame) {
- pending_region_position = sync_frame + (sync_dir*sync_offset);
+ pending_region_position = sync_frame - (sync_dir*sync_offset);
} else {
pending_region_position = 0;
}
}
nframes_t newlen = drag_info.last_pointer_frame - clicked_regionview->region()->position();
-#ifdef USE_RUBBERBAND
- float percentage = (float) ((double) newlen / (double) clicked_regionview->region()->length());
-#else
- float percentage = (float) ((double) newlen - (double) clicked_regionview->region()->length()) / ((double) newlen) * 100.0f;
+
+ float percentage = (double) newlen / (double) clicked_regionview->region()->length();
+
+#ifndef USE_RUBBERBAND
+ // Soundtouch uses percentage / 100 instead of normal (/ 1)
+ if (clicked_regionview->region()->data_type() == DataType::AUDIO) {
+ percentage = (float) ((double) newlen - (double) clicked_regionview->region()->length()) / ((double) newlen) * 100.0f;
#endif
+ }
begin_reversible_command (_("timestretch"));