much MUCH less crude audio reversing

This commit is contained in:
itsmattkc
2018-10-08 00:08:23 +11:00
parent 7592898cbf
commit 81d229595f
2 changed files with 16 additions and 14 deletions
+5 -1
View File
@@ -228,7 +228,11 @@ bool get_clip_frame(Clip* c, long playhead) {
double playhead_to_seconds(Clip* c, long playhead) {
// returns time in seconds
return ((qMax(0L, playhead - c->timeline_in) + c->clip_in)/c->sequence->frame_rate)*c->speed;
if (c->reverse) {
return ((c->getMaximumLength() - (qMax(0L, playhead - c->timeline_in) + c->clip_in))/c->sequence->frame_rate)*c->speed;
} else {
return ((qMax(0L, playhead - c->timeline_in) + c->clip_in)/c->sequence->frame_rate)*c->speed;
}
}
long seconds_to_clip_frame(Clip* c, double seconds) {