added go to cut shortcuts and fixed waveform display bug

This commit is contained in:
itsmattkc
2018-06-21 10:50:19 -07:00
parent 937f714183
commit f344e262e8
12 changed files with 88 additions and 29 deletions
+32
View File
@@ -64,6 +64,38 @@ void Timeline::next_frame() {
seek(playhead+1);
}
void Timeline::previous_cut() {
bool seek_enabled = false;
long p_cut = 0;
for (int i=0;i<sequence->clip_count();i++) {
Clip* c = sequence->get_clip(i);
if (c->timeline_out > p_cut && c->timeline_out < playhead) {
p_cut = c->timeline_out;
seek_enabled = true;
} else if (c->timeline_in > p_cut && c->timeline_in < playhead) {
p_cut = c->timeline_in;
seek_enabled = true;
}
}
if (seek_enabled) seek(p_cut);
}
void Timeline::next_cut() {
bool seek_enabled = false;
long n_cut = LONG_MAX;
for (int i=0;i<sequence->clip_count();i++) {
Clip* c = sequence->get_clip(i);
if (c->timeline_out < n_cut && c->timeline_out > playhead) {
n_cut = c->timeline_out;
seek_enabled = true;
} else if (c->timeline_in < n_cut && c->timeline_in > playhead) {
n_cut = c->timeline_in;
seek_enabled = true;
}
}
if (seek_enabled) seek(n_cut);
}
void Timeline::seek(long p) {
pause();