added cut/copy/paste

This commit is contained in:
itsmattkc
2018-06-08 18:20:50 -07:00
parent 5f2ed68f7b
commit cf18e52e90
13 changed files with 312 additions and 189 deletions
+10 -10
View File
@@ -27,34 +27,34 @@ QMutex cc_lock;
void handle_media(Sequence* sequence, long playhead, bool multithreaded) {
for (int i=0;i<sequence->clip_count();i++) {
Clip& c = sequence->get_clip(i);
Clip* c = sequence->get_clip(i);
// if clip starts within one second and/or hasn't finished yet
if (is_clip_active(&c, playhead)) {
if (is_clip_active(c, playhead)) {
// if thread is already working, we don't want to touch this,
// but we also don't want to hang the UI thread
if (!c.open) {
if (c.lock.tryLock()) {
open_clip(&c, multithreaded);
if (!c->open) {
if (c->lock.tryLock()) {
open_clip(c, multithreaded);
// add to current_clips, (insertion) sorted by track so composite them in order
cc_lock.lock();
bool found = false;
for (int j=0;j<current_clips.size();j++) {
if (current_clips[j]->track < c.track) {
current_clips.insert(current_clips.begin()+j, &c);
if (current_clips[j]->track < c->track) {
current_clips.insert(current_clips.begin()+j, c);
found = true;
break;
}
}
if (!found) {
current_clips.push_back(&c);
current_clips.push_back(c);
}
cc_lock.unlock();
}
}
} else if (c.open) {
close_clip(&c);
} else if (c->open) {
close_clip(c);
}
}
}