first commit of big refactor
This commit is contained in:
+126
-126
@@ -68,7 +68,7 @@ TimelineWidget::TimelineWidget(QWidget *parent) : QWidget(parent) {
|
||||
}
|
||||
|
||||
void TimelineWidget::show_context_menu(const QPoint& pos) {
|
||||
if (sequence != nullptr) {
|
||||
if (Olive::ActiveSequence != nullptr) {
|
||||
// hack because sometimes right clicking doesn't trigger mouse release event
|
||||
panel_timeline->rect_select_init = false;
|
||||
panel_timeline->rect_select_proc = false;
|
||||
@@ -77,16 +77,16 @@ void TimelineWidget::show_context_menu(const QPoint& pos) {
|
||||
|
||||
QAction* undoAction = menu.addAction(tr("&Undo"));
|
||||
QAction* redoAction = menu.addAction(tr("&Redo"));
|
||||
connect(undoAction, SIGNAL(triggered(bool)), mainWindow, SLOT(undo()));
|
||||
connect(redoAction, SIGNAL(triggered(bool)), mainWindow, SLOT(redo()));
|
||||
connect(undoAction, SIGNAL(triggered(bool)), Olive::MainWindow, SLOT(undo()));
|
||||
connect(redoAction, SIGNAL(triggered(bool)), Olive::MainWindow, SLOT(redo()));
|
||||
undoAction->setEnabled(undo_stack.canUndo());
|
||||
redoAction->setEnabled(undo_stack.canRedo());
|
||||
menu.addSeparator();
|
||||
|
||||
// collect all the selected clips
|
||||
QVector<Clip*> selected_clips;
|
||||
for (int i=0;i<sequence->clips.size();i++) {
|
||||
Clip* c = sequence->clips.at(i);
|
||||
for (int i=0;i<Olive::ActiveSequence->clips.size();i++) {
|
||||
Clip* c = Olive::ActiveSequence->clips.at(i);
|
||||
if (c != nullptr && is_clip_selected(c, true)) {
|
||||
selected_clips.append(c);
|
||||
}
|
||||
@@ -94,11 +94,11 @@ void TimelineWidget::show_context_menu(const QPoint& pos) {
|
||||
|
||||
if (!selected_clips.isEmpty()) {
|
||||
// clips are selected
|
||||
menu.addAction(tr("C&ut"), mainWindow, SLOT(cut()));
|
||||
menu.addAction(tr("Cop&y"), mainWindow, SLOT(copy()));
|
||||
menu.addAction(tr("C&ut"), Olive::MainWindow, SLOT(cut()));
|
||||
menu.addAction(tr("Cop&y"), Olive::MainWindow, SLOT(copy()));
|
||||
}
|
||||
|
||||
menu.addAction(tr("&Paste"), mainWindow, SLOT(paste()));
|
||||
menu.addAction(tr("&Paste"), Olive::MainWindow, SLOT(paste()));
|
||||
|
||||
if (selected_clips.isEmpty()) {
|
||||
// no clips are selected
|
||||
@@ -118,18 +118,18 @@ void TimelineWidget::show_context_menu(const QPoint& pos) {
|
||||
|
||||
if (!selected_clips.isEmpty()) {
|
||||
menu.addSeparator();
|
||||
menu.addAction(tr("&Speed/Duration"), mainWindow, SLOT(open_speed_dialog()));
|
||||
menu.addAction(tr("&Speed/Duration"), Olive::MainWindow, SLOT(open_speed_dialog()));
|
||||
|
||||
QAction* autoscaleAction = menu.addAction(tr("Auto-s&cale"), this, SLOT(toggle_autoscale()));
|
||||
autoscaleAction->setCheckable(true);
|
||||
// set autoscale to the first selected clip
|
||||
autoscaleAction->setChecked(selected_clips.at(0)->autoscale);
|
||||
|
||||
menu.addAction(tr("Enable/Disable"), mainWindow, SLOT(toggle_enable_clips()));
|
||||
menu.addAction(tr("Enable/Disable"), Olive::MainWindow, SLOT(toggle_enable_clips()));
|
||||
|
||||
menu.addAction(tr("Link/Unlink"), panel_timeline, SLOT(toggle_links()));
|
||||
|
||||
menu.addAction(tr("&Nest"), mainWindow, SLOT(nest()));
|
||||
menu.addAction(tr("&Nest"), Olive::MainWindow, SLOT(nest()));
|
||||
|
||||
// stabilizer option
|
||||
/*int video_clip_count = 0;
|
||||
@@ -173,8 +173,8 @@ void TimelineWidget::show_context_menu(const QPoint& pos) {
|
||||
|
||||
void TimelineWidget::toggle_autoscale() {
|
||||
SetAutoscaleAction* action = new SetAutoscaleAction();
|
||||
for (int i=0;i<sequence->clips.size();i++) {
|
||||
Clip* c = sequence->clips.at(i);
|
||||
for (int i=0;i<Olive::ActiveSequence->clips.size();i++) {
|
||||
Clip* c = Olive::ActiveSequence->clips.at(i);
|
||||
if (c != nullptr && is_clip_selected(c, true)) {
|
||||
action->clips.append(c);
|
||||
}
|
||||
@@ -187,16 +187,16 @@ void TimelineWidget::toggle_autoscale() {
|
||||
}
|
||||
|
||||
void TimelineWidget::tooltip_timer_timeout() {
|
||||
if (sequence != nullptr) {
|
||||
if (tooltip_clip < sequence->clips.size()) {
|
||||
Clip* c = sequence->clips.at(tooltip_clip);
|
||||
if (Olive::ActiveSequence != nullptr) {
|
||||
if (tooltip_clip < Olive::ActiveSequence->clips.size()) {
|
||||
Clip* c = Olive::ActiveSequence->clips.at(tooltip_clip);
|
||||
if (c != nullptr) {
|
||||
QToolTip::showText(QCursor::pos(),
|
||||
tr("%1\nStart: %2\nEnd: %3\nDuration: %4").arg(
|
||||
c->name,
|
||||
frame_to_timecode(c->timeline_in, config.timecode_view, sequence->frame_rate),
|
||||
frame_to_timecode(c->timeline_out, config.timecode_view, sequence->frame_rate),
|
||||
frame_to_timecode(c->getLength(), config.timecode_view, sequence->frame_rate)
|
||||
frame_to_timecode(c->timeline_in, config.timecode_view, Olive::ActiveSequence->frame_rate),
|
||||
frame_to_timecode(c->timeline_out, config.timecode_view, Olive::ActiveSequence->frame_rate),
|
||||
frame_to_timecode(c->getLength(), config.timecode_view, Olive::ActiveSequence->frame_rate)
|
||||
));
|
||||
}
|
||||
}
|
||||
@@ -206,8 +206,8 @@ void TimelineWidget::tooltip_timer_timeout() {
|
||||
|
||||
void TimelineWidget::rename_clip() {
|
||||
QVector<Clip*> selected_clips;
|
||||
for (int i=0;i<sequence->clips.size();i++) {
|
||||
Clip* c = sequence->clips.at(i);
|
||||
for (int i=0;i<Olive::ActiveSequence->clips.size();i++) {
|
||||
Clip* c = Olive::ActiveSequence->clips.at(i);
|
||||
if (c != nullptr && is_clip_selected(c, true)) {
|
||||
selected_clips.append(c);
|
||||
}
|
||||
@@ -242,7 +242,7 @@ void TimelineWidget::open_sequence_properties() {
|
||||
}
|
||||
panel_project->get_all_media_from_table(all_top_level_items, sequence_items, MEDIA_TYPE_SEQUENCE); // find all sequences in project
|
||||
for (int i=0;i<sequence_items.size();i++) {
|
||||
if (sequence_items.at(i)->to_sequence() == sequence) {
|
||||
if (sequence_items.at(i)->to_sequence() == Olive::ActiveSequence) {
|
||||
NewSequenceDialog nsd(this, sequence_items.at(i));
|
||||
nsd.exec();
|
||||
return;
|
||||
@@ -272,7 +272,7 @@ void TimelineWidget::dragEnterEvent(QDragEnterEvent *event) {
|
||||
|
||||
if (event->source() == panel_footage_viewer->viewer_widget) {
|
||||
Sequence* proposed_seq = panel_footage_viewer->seq;
|
||||
if (proposed_seq != sequence) { // don't allow nesting the same sequence
|
||||
if (proposed_seq != Olive::ActiveSequence) { // don't allow nesting the same sequence
|
||||
media_list.append(panel_footage_viewer->media);
|
||||
import_init = true;
|
||||
}
|
||||
@@ -314,7 +314,7 @@ void TimelineWidget::dragEnterEvent(QDragEnterEvent *event) {
|
||||
event->acceptProposedAction();
|
||||
|
||||
long entry_point;
|
||||
Sequence* seq = sequence;
|
||||
Sequence* seq = Olive::ActiveSequence;
|
||||
|
||||
if (seq == nullptr) {
|
||||
// if no sequence, we're going to create a new one using the clips as a reference
|
||||
@@ -338,7 +338,7 @@ void TimelineWidget::dragMoveEvent(QDragMoveEvent *event) {
|
||||
if (panel_timeline->importing) {
|
||||
event->acceptProposedAction();
|
||||
|
||||
if (sequence != nullptr) {
|
||||
if (Olive::ActiveSequence != nullptr) {
|
||||
QPoint pos = event->pos();
|
||||
update_ghosts(pos, event->keyboardModifiers() & Qt::ShiftModifier);
|
||||
panel_timeline->move_insert = ((event->keyboardModifiers() & Qt::ControlModifier) && (panel_timeline->tool == TIMELINE_TOOL_POINTER || panel_timeline->importing));
|
||||
@@ -424,8 +424,8 @@ void insert_clips(ComboAction* ca) {
|
||||
|
||||
panel_timeline->split_cache.clear();
|
||||
|
||||
for (int i=0;i<sequence->clips.size();i++) {
|
||||
Clip* c = sequence->clips.at(i);
|
||||
for (int i=0;i<Olive::ActiveSequence->clips.size();i++) {
|
||||
Clip* c = Olive::ActiveSequence->clips.at(i);
|
||||
if (c != nullptr) {
|
||||
// don't split any clips that are moving
|
||||
bool found = false;
|
||||
@@ -452,13 +452,13 @@ void insert_clips(ComboAction* ca) {
|
||||
|
||||
long ripple_length = (latest_new_point - earliest_new_point);
|
||||
|
||||
ripple_clips(ca, sequence, earliest_new_point, ripple_length, ignore_clips);
|
||||
ripple_clips(ca, Olive::ActiveSequence, earliest_new_point, ripple_length, ignore_clips);
|
||||
|
||||
if (ripple_old_point) {
|
||||
// works for moving later clips earlier but not earlier to later
|
||||
long second_ripple_length = (earliest_old_point - latest_old_point);
|
||||
|
||||
ripple_clips(ca, sequence, latest_old_point, second_ripple_length, ignore_clips);
|
||||
ripple_clips(ca, Olive::ActiveSequence, latest_old_point, second_ripple_length, ignore_clips);
|
||||
|
||||
if (earliest_old_point < earliest_new_point) {
|
||||
for (int i=0;i<panel_timeline->ghosts.size();i++) {
|
||||
@@ -466,8 +466,8 @@ void insert_clips(ComboAction* ca) {
|
||||
g.in += second_ripple_length;
|
||||
g.out += second_ripple_length;
|
||||
}
|
||||
for (int i=0;i<sequence->selections.size();i++) {
|
||||
Selection& s = sequence->selections[i];
|
||||
for (int i=0;i<Olive::ActiveSequence->selections.size();i++) {
|
||||
Selection& s = Olive::ActiveSequence->selections[i];
|
||||
s.in += second_ripple_length;
|
||||
s.out += second_ripple_length;
|
||||
}
|
||||
@@ -481,7 +481,7 @@ void TimelineWidget::dropEvent(QDropEvent* event) {
|
||||
|
||||
ComboAction* ca = new ComboAction();
|
||||
|
||||
Sequence* s = sequence;
|
||||
Sequence* s = Olive::ActiveSequence;
|
||||
|
||||
// if we're dropping into nothing, create a new sequences based on the clip being dragged
|
||||
if (s == nullptr) {
|
||||
@@ -505,23 +505,23 @@ void TimelineWidget::dropEvent(QDropEvent* event) {
|
||||
}
|
||||
|
||||
void TimelineWidget::mouseDoubleClickEvent(QMouseEvent *event) {
|
||||
if (sequence != nullptr) {
|
||||
if (Olive::ActiveSequence != nullptr) {
|
||||
if (panel_timeline->tool == TIMELINE_TOOL_EDIT) {
|
||||
int clip_index = getClipIndexFromCoords(panel_timeline->cursor_frame, panel_timeline->cursor_track);
|
||||
if (clip_index >= 0) {
|
||||
Clip* clip = sequence->clips.at(clip_index);
|
||||
if (!(event->modifiers() & Qt::ShiftModifier)) sequence->selections.clear();
|
||||
Clip* clip = Olive::ActiveSequence->clips.at(clip_index);
|
||||
if (!(event->modifiers() & Qt::ShiftModifier)) Olive::ActiveSequence->selections.clear();
|
||||
Selection s;
|
||||
s.in = clip->timeline_in;
|
||||
s.out = clip->timeline_out;
|
||||
s.track = clip->track;
|
||||
sequence->selections.append(s);
|
||||
Olive::ActiveSequence->selections.append(s);
|
||||
update_ui(false);
|
||||
}
|
||||
} else if (panel_timeline->tool == TIMELINE_TOOL_POINTER) {
|
||||
int clip_index = getClipIndexFromCoords(panel_timeline->cursor_frame, panel_timeline->cursor_track);
|
||||
if (clip_index >= 0) {
|
||||
Clip* c = sequence->clips.at(clip_index);
|
||||
Clip* c = Olive::ActiveSequence->clips.at(clip_index);
|
||||
if (c->media != nullptr && c->media->get_type() == MEDIA_TYPE_SEQUENCE) {
|
||||
set_sequence(c->media->to_sequence());
|
||||
}
|
||||
@@ -535,7 +535,7 @@ bool isLiveEditing() {
|
||||
}
|
||||
|
||||
void TimelineWidget::mousePressEvent(QMouseEvent *event) {
|
||||
if (sequence != nullptr) {
|
||||
if (Olive::ActiveSequence != nullptr) {
|
||||
int tool = panel_timeline->tool;
|
||||
if (event->button() == Qt::MiddleButton) {
|
||||
tool = TIMELINE_TOOL_HAND;
|
||||
@@ -561,7 +561,7 @@ void TimelineWidget::mousePressEvent(QMouseEvent *event) {
|
||||
bool alt = (event->modifiers() & Qt::AltModifier);
|
||||
|
||||
if (shift) {
|
||||
panel_timeline->selection_offset = sequence->selections.size();
|
||||
panel_timeline->selection_offset = Olive::ActiveSequence->selections.size();
|
||||
} else {
|
||||
panel_timeline->selection_offset = 0;
|
||||
}
|
||||
@@ -608,7 +608,7 @@ void TimelineWidget::mousePressEvent(QMouseEvent *event) {
|
||||
panel_timeline->moving_init = true;
|
||||
} else {
|
||||
if (clip_index >= 0) {
|
||||
Clip* clip = sequence->clips.at(clip_index);
|
||||
Clip* clip = Olive::ActiveSequence->clips.at(clip_index);
|
||||
if (clip != nullptr) {
|
||||
if (is_clip_selected(clip, true)) {
|
||||
if (shift) {
|
||||
@@ -616,7 +616,7 @@ void TimelineWidget::mousePressEvent(QMouseEvent *event) {
|
||||
|
||||
if (!alt) {
|
||||
for (int i=0;i<clip->linked.size();i++) {
|
||||
Clip* link = sequence->clips.at(clip->linked.at(i));
|
||||
Clip* link = Olive::ActiveSequence->clips.at(clip->linked.at(i));
|
||||
panel_timeline->deselect_area(link->timeline_in, link->timeline_out, link->track);
|
||||
}
|
||||
}
|
||||
@@ -624,7 +624,7 @@ void TimelineWidget::mousePressEvent(QMouseEvent *event) {
|
||||
panel_timeline->deselect_area(clip->timeline_in, clip->timeline_out, clip->track);
|
||||
|
||||
for (int i=0;i<clip->linked.size();i++) {
|
||||
Clip* link = sequence->clips.at(clip->linked.at(i));
|
||||
Clip* link = Olive::ActiveSequence->clips.at(clip->linked.at(i));
|
||||
panel_timeline->deselect_area(link->timeline_in, link->timeline_out, link->track);
|
||||
}
|
||||
|
||||
@@ -640,12 +640,12 @@ void TimelineWidget::mousePressEvent(QMouseEvent *event) {
|
||||
s.out = clip->timeline_out;
|
||||
if (clip->get_closing_transition()->secondary_clip != nullptr) s.out += clip->get_closing_transition()->get_true_length();
|
||||
}
|
||||
sequence->selections.append(s);
|
||||
Olive::ActiveSequence->selections.append(s);
|
||||
}
|
||||
} else {
|
||||
// if "shift" is not down
|
||||
if (!shift) {
|
||||
sequence->selections.clear();
|
||||
Olive::ActiveSequence->selections.clear();
|
||||
}
|
||||
|
||||
Selection s;
|
||||
@@ -666,7 +666,7 @@ void TimelineWidget::mousePressEvent(QMouseEvent *event) {
|
||||
}
|
||||
|
||||
s.track = clip->track;
|
||||
sequence->selections.append(s);
|
||||
Olive::ActiveSequence->selections.append(s);
|
||||
|
||||
if (config.select_also_seeks) {
|
||||
panel_sequence_viewer->seek(clip->timeline_in);
|
||||
@@ -675,13 +675,13 @@ void TimelineWidget::mousePressEvent(QMouseEvent *event) {
|
||||
// if alt is not down, select links
|
||||
if (!alt && panel_timeline->transition_select == TA_NO_TRANSITION) {
|
||||
for (int i=0;i<clip->linked.size();i++) {
|
||||
Clip* link = sequence->clips.at(clip->linked.at(i));
|
||||
Clip* link = Olive::ActiveSequence->clips.at(clip->linked.at(i));
|
||||
if (!is_clip_selected(link, true)) {
|
||||
Selection ss;
|
||||
ss.in = link->timeline_in;
|
||||
ss.out = link->timeline_out;
|
||||
ss.track = link->track;
|
||||
sequence->selections.append(ss);
|
||||
Olive::ActiveSequence->selections.append(ss);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -692,7 +692,7 @@ void TimelineWidget::mousePressEvent(QMouseEvent *event) {
|
||||
} else {
|
||||
// if "shift" is not down
|
||||
if (!shift) {
|
||||
sequence->selections.clear();
|
||||
Olive::ActiveSequence->selections.clear();
|
||||
}
|
||||
|
||||
panel_timeline->rect_select_init = true;
|
||||
@@ -758,7 +758,7 @@ void make_room_for_transition(ComboAction* ca, Clip* c, int type, long transitio
|
||||
|
||||
void TimelineWidget::mouseReleaseEvent(QMouseEvent *event) {
|
||||
QToolTip::hideText();
|
||||
if (sequence != nullptr) {
|
||||
if (Olive::ActiveSequence != nullptr) {
|
||||
bool alt = (event->modifiers() & Qt::AltModifier);
|
||||
bool shift = (event->modifiers() & Qt::ShiftModifier);
|
||||
bool ctrl = (event->modifiers() & Qt::ControlModifier);
|
||||
@@ -772,11 +772,11 @@ void TimelineWidget::mouseReleaseEvent(QMouseEvent *event) {
|
||||
const Ghost& g = panel_timeline->ghosts.at(0);
|
||||
|
||||
if (panel_timeline->creating_object == ADD_OBJ_AUDIO) {
|
||||
mainWindow->statusBar()->clearMessage();
|
||||
Olive::MainWindow->statusBar()->clearMessage();
|
||||
panel_sequence_viewer->cue_recording(qMin(g.in, g.out), qMax(g.in, g.out), g.track);
|
||||
panel_timeline->creating = false;
|
||||
} else if (g.in != g.out) {
|
||||
Clip* c = new Clip(sequence);
|
||||
Clip* c = new Clip(Olive::ActiveSequence);
|
||||
c->media = nullptr;
|
||||
c->timeline_in = qMin(g.in, g.out);
|
||||
c->timeline_out = qMax(g.in, g.out);
|
||||
@@ -800,7 +800,7 @@ void TimelineWidget::mouseReleaseEvent(QMouseEvent *event) {
|
||||
|
||||
QVector<Clip*> add;
|
||||
add.append(c);
|
||||
ca->append(new AddClipCommand(sequence, add));
|
||||
ca->append(new AddClipCommand(Olive::ActiveSequence, add));
|
||||
|
||||
if (c->track < 0) {
|
||||
// default video effects (before custom effects)
|
||||
@@ -875,9 +875,9 @@ void TimelineWidget::mouseReleaseEvent(QMouseEvent *event) {
|
||||
ripple_length = first_ghost.old_in - first_ghost.in;
|
||||
ripple_point = first_ghost.old_in;
|
||||
|
||||
for (int i=0;i<sequence->selections.size();i++) {
|
||||
sequence->selections[i].in += ripple_length;
|
||||
sequence->selections[i].out += ripple_length;
|
||||
for (int i=0;i<Olive::ActiveSequence->selections.size();i++) {
|
||||
Olive::ActiveSequence->selections[i].in += ripple_length;
|
||||
Olive::ActiveSequence->selections[i].out += ripple_length;
|
||||
}
|
||||
} else {
|
||||
// if we're trimming an out-point
|
||||
@@ -900,7 +900,7 @@ void TimelineWidget::mouseReleaseEvent(QMouseEvent *event) {
|
||||
}
|
||||
if (!panel_timeline->trim_in_point) ripple_length = -ripple_length;
|
||||
|
||||
ripple_clips(ca, sequence, ripple_point, ripple_length, ignore_clips);
|
||||
ripple_clips(ca, Olive::ActiveSequence, ripple_point, ripple_length, ignore_clips);
|
||||
}
|
||||
|
||||
if (panel_timeline->tool == TIMELINE_TOOL_POINTER
|
||||
@@ -914,7 +914,7 @@ void TimelineWidget::mouseReleaseEvent(QMouseEvent *event) {
|
||||
const Ghost& g = panel_timeline->ghosts.at(i);
|
||||
if (g.old_in != g.in || g.old_out != g.out || g.track != g.old_track || g.clip_in != g.old_clip_in) {
|
||||
// create copy of clip
|
||||
Clip* c = sequence->clips.at(g.clip)->copy(sequence);
|
||||
Clip* c = Olive::ActiveSequence->clips.at(g.clip)->copy(Olive::ActiveSequence);
|
||||
|
||||
c->timeline_in = g.in;
|
||||
c->timeline_out = g.out;
|
||||
@@ -936,7 +936,7 @@ void TimelineWidget::mouseReleaseEvent(QMouseEvent *event) {
|
||||
// relink duplicated clips
|
||||
panel_timeline->relink_clips_using_ids(old_clips, new_clips);
|
||||
|
||||
ca->append(new AddClipCommand(sequence, new_clips));
|
||||
ca->append(new AddClipCommand(Olive::ActiveSequence, new_clips));
|
||||
}
|
||||
} else {
|
||||
// INSERT if holding ctrl
|
||||
@@ -949,7 +949,7 @@ void TimelineWidget::mouseReleaseEvent(QMouseEvent *event) {
|
||||
// step 1 - set clips that are moving to "undeletable" (to avoid step 2 deleting any part of them)
|
||||
const Ghost& g = panel_timeline->ghosts.at(i);
|
||||
|
||||
sequence->clips.at(g.clip)->undeletable = true;
|
||||
Olive::ActiveSequence->clips.at(g.clip)->undeletable = true;
|
||||
if (g.transition != nullptr) {
|
||||
g.transition->parent_clip->undeletable = true;
|
||||
if (g.transition->secondary_clip != nullptr) g.transition->secondary_clip->undeletable = true;
|
||||
@@ -964,7 +964,7 @@ void TimelineWidget::mouseReleaseEvent(QMouseEvent *event) {
|
||||
panel_timeline->delete_areas_and_relink(ca, delete_areas, false);
|
||||
for (int i=0;i<panel_timeline->ghosts.size();i++) {
|
||||
const Ghost& g = panel_timeline->ghosts.at(i);
|
||||
sequence->clips.at(g.clip)->undeletable = false;
|
||||
Olive::ActiveSequence->clips.at(g.clip)->undeletable = false;
|
||||
if (g.transition != nullptr) {
|
||||
g.transition->parent_clip->undeletable = false;
|
||||
if (g.transition->secondary_clip != nullptr) g.transition->secondary_clip->undeletable = false;
|
||||
@@ -975,7 +975,7 @@ void TimelineWidget::mouseReleaseEvent(QMouseEvent *event) {
|
||||
Ghost& g = panel_timeline->ghosts[i];
|
||||
|
||||
// step 3 - move clips
|
||||
Clip* c = sequence->clips.at(g.clip);
|
||||
Clip* c = Olive::ActiveSequence->clips.at(g.clip);
|
||||
if (g.transition == nullptr) {
|
||||
move_clip(ca, c, (g.in - g.old_in), (g.out - g.old_out), (g.clip_in - g.old_clip_in), (g.track - g.old_track), true, true);
|
||||
|
||||
@@ -1047,13 +1047,13 @@ void TimelineWidget::mouseReleaseEvent(QMouseEvent *event) {
|
||||
long transition_start = qMin(g.in, g.out);
|
||||
long transition_end = qMax(g.in, g.out);
|
||||
|
||||
Clip* pre = sequence->clips.at(g.clip);
|
||||
Clip* pre = Olive::ActiveSequence->clips.at(g.clip);
|
||||
Clip* post = pre;
|
||||
|
||||
make_room_for_transition(ca, pre, panel_timeline->transition_tool_type, transition_start, transition_end, true);
|
||||
|
||||
if (panel_timeline->transition_tool_post_clip > -1) {
|
||||
post = sequence->clips.at(panel_timeline->transition_tool_post_clip);
|
||||
post = Olive::ActiveSequence->clips.at(panel_timeline->transition_tool_post_clip);
|
||||
int opposite_type = (panel_timeline->transition_tool_type == TA_OPENING_TRANSITION) ? TA_CLOSING_TRANSITION : TA_OPENING_TRANSITION;
|
||||
make_room_for_transition(
|
||||
ca,
|
||||
@@ -1123,10 +1123,10 @@ void TimelineWidget::mouseReleaseEvent(QMouseEvent *event) {
|
||||
}
|
||||
|
||||
// remove duplicate selections
|
||||
panel_timeline->clean_up_selections(sequence->selections);
|
||||
panel_timeline->clean_up_selections(Olive::ActiveSequence->selections);
|
||||
|
||||
if (selection_command != nullptr) {
|
||||
selection_command->new_data = sequence->selections;
|
||||
selection_command->new_data = Olive::ActiveSequence->selections;
|
||||
ca->append(selection_command);
|
||||
selection_command = nullptr;
|
||||
push_undo = true;
|
||||
@@ -1165,7 +1165,7 @@ void TimelineWidget::mouseReleaseEvent(QMouseEvent *event) {
|
||||
void TimelineWidget::init_ghosts() {
|
||||
for (int i=0;i<panel_timeline->ghosts.size();i++) {
|
||||
Ghost& g = panel_timeline->ghosts[i];
|
||||
Clip* c = sequence->clips.at(g.clip);
|
||||
Clip* c = Olive::ActiveSequence->clips.at(g.clip);
|
||||
|
||||
g.track = g.old_track = c->track;
|
||||
g.clip_in = g.old_clip_in = c->clip_in;
|
||||
@@ -1195,8 +1195,8 @@ void TimelineWidget::init_ghosts() {
|
||||
c->recalculateMaxLength();
|
||||
g.media_length = c->getMaximumLength();
|
||||
}
|
||||
for (int i=0;i<sequence->selections.size();i++) {
|
||||
Selection& s = sequence->selections[i];
|
||||
for (int i=0;i<Olive::ActiveSequence->selections.size();i++) {
|
||||
Selection& s = Olive::ActiveSequence->selections[i];
|
||||
s.old_in = s.in;
|
||||
s.old_out = s.out;
|
||||
s.old_track = s.track;
|
||||
@@ -1271,7 +1271,7 @@ void TimelineWidget::update_ghosts(const QPoint& mouse_pos, bool lock_frame) {
|
||||
|
||||
// if the ghost is attached to a clip, snap its markers too
|
||||
if (panel_timeline->trim_target == -1 && g.clip >= 0) {
|
||||
Clip* c = sequence->clips.at(g.clip);
|
||||
Clip* c = Olive::ActiveSequence->clips.at(g.clip);
|
||||
for (int j=0;j<c->get_markers().size();j++) {
|
||||
long marker_real_time = c->get_markers().at(j).frame + c->timeline_in - c->clip_in;
|
||||
fm = marker_real_time + frame_diff;
|
||||
@@ -1291,7 +1291,7 @@ void TimelineWidget::update_ghosts(const QPoint& mouse_pos, bool lock_frame) {
|
||||
for (int i=0;i<panel_timeline->ghosts.size();i++) {
|
||||
const Ghost& g = panel_timeline->ghosts.at(i);
|
||||
Clip* c = nullptr;
|
||||
if (g.clip != -1) c = sequence->clips.at(g.clip);
|
||||
if (g.clip != -1) c = Olive::ActiveSequence->clips.at(g.clip);
|
||||
|
||||
const FootageStream* ms = nullptr;
|
||||
if (g.clip != -1 && c->media != nullptr && c->media->get_type() == MEDIA_TYPE_FOOTAGE) {
|
||||
@@ -1447,7 +1447,7 @@ void TimelineWidget::update_ghosts(const QPoint& mouse_pos, bool lock_frame) {
|
||||
validate_transitions(c, panel_timeline->transition_tool_type, frame_diff);
|
||||
} else {
|
||||
Clip* otc = c; // open transition clip
|
||||
Clip* ctc = sequence->clips.at(panel_timeline->transition_tool_post_clip); // close transition clip
|
||||
Clip* ctc = Olive::ActiveSequence->clips.at(panel_timeline->transition_tool_post_clip); // close transition clip
|
||||
|
||||
if (panel_timeline->transition_tool_type == TA_CLOSING_TRANSITION) {
|
||||
// swap
|
||||
@@ -1510,7 +1510,7 @@ void TimelineWidget::update_ghosts(const QPoint& mouse_pos, bool lock_frame) {
|
||||
g.in = g.old_in + frame_diff;
|
||||
g.out = g.old_out + frame_diff;
|
||||
|
||||
if (g.transition != nullptr && g.transition == sequence->clips.at(g.clip)->get_opening_transition()) {
|
||||
if (g.transition != nullptr && g.transition == Olive::ActiveSequence->clips.at(g.clip)->get_opening_transition()) {
|
||||
g.clip_in = g.old_clip_in + frame_diff;
|
||||
}
|
||||
|
||||
@@ -1543,8 +1543,8 @@ void TimelineWidget::update_ghosts(const QPoint& mouse_pos, bool lock_frame) {
|
||||
|
||||
// apply changes to selections
|
||||
if (effective_tool != TIMELINE_TOOL_SLIP && !panel_timeline->importing && !panel_timeline->creating) {
|
||||
for (int i=0;i<sequence->selections.size();i++) {
|
||||
Selection& s = sequence->selections[i];
|
||||
for (int i=0;i<Olive::ActiveSequence->selections.size();i++) {
|
||||
Selection& s = Olive::ActiveSequence->selections[i];
|
||||
if (panel_timeline->trim_target > -1) {
|
||||
if (panel_timeline->trim_in_point) {
|
||||
s.in = s.old_in + frame_diff;
|
||||
@@ -1552,8 +1552,8 @@ void TimelineWidget::update_ghosts(const QPoint& mouse_pos, bool lock_frame) {
|
||||
s.out = s.old_out + frame_diff;
|
||||
}
|
||||
} else if (clips_are_movable) {
|
||||
for (int i=0;i<sequence->selections.size();i++) {
|
||||
Selection& s = sequence->selections[i];
|
||||
for (int i=0;i<Olive::ActiveSequence->selections.size();i++) {
|
||||
Selection& s = Olive::ActiveSequence->selections[i];
|
||||
s.in = s.old_in + frame_diff;
|
||||
s.out = s.old_out + frame_diff;
|
||||
s.track = s.old_track;
|
||||
@@ -1574,9 +1574,9 @@ void TimelineWidget::update_ghosts(const QPoint& mouse_pos, bool lock_frame) {
|
||||
}
|
||||
|
||||
if (panel_timeline->importing) {
|
||||
QToolTip::showText(mapToGlobal(mouse_pos), frame_to_timecode(earliest_in_point, config.timecode_view, sequence->frame_rate));
|
||||
QToolTip::showText(mapToGlobal(mouse_pos), frame_to_timecode(earliest_in_point, config.timecode_view, Olive::ActiveSequence->frame_rate));
|
||||
} else {
|
||||
QString tip = ((frame_diff < 0) ? "-" : "+") + frame_to_timecode(qAbs(frame_diff), config.timecode_view, sequence->frame_rate);
|
||||
QString tip = ((frame_diff < 0) ? "-" : "+") + frame_to_timecode(qAbs(frame_diff), config.timecode_view, Olive::ActiveSequence->frame_rate);
|
||||
if (panel_timeline->trim_target > -1) {
|
||||
// find which clip is being moved
|
||||
const Ghost* g = nullptr;
|
||||
@@ -1595,7 +1595,7 @@ void TimelineWidget::update_ghosts(const QPoint& mouse_pos, bool lock_frame) {
|
||||
} else {
|
||||
len += frame_diff;
|
||||
}
|
||||
tip += frame_to_timecode(len, config.timecode_view, sequence->frame_rate);
|
||||
tip += frame_to_timecode(len, config.timecode_view, Olive::ActiveSequence->frame_rate);
|
||||
}
|
||||
}
|
||||
QToolTip::showText(mapToGlobal(mouse_pos), tip);
|
||||
@@ -1604,7 +1604,7 @@ void TimelineWidget::update_ghosts(const QPoint& mouse_pos, bool lock_frame) {
|
||||
|
||||
void TimelineWidget::mouseMoveEvent(QMouseEvent *event) {
|
||||
tooltip_timer.stop();
|
||||
if (sequence != nullptr) {
|
||||
if (Olive::ActiveSequence != nullptr) {
|
||||
bool alt = (event->modifiers() & Qt::AltModifier);
|
||||
|
||||
panel_timeline->cursor_frame = panel_timeline->getTimelineFrameFromScreenPoint(event->pos().x());
|
||||
@@ -1619,12 +1619,12 @@ void TimelineWidget::mouseMoveEvent(QMouseEvent *event) {
|
||||
}
|
||||
if (panel_timeline->selecting) {
|
||||
int selection_count = 1 + qMax(panel_timeline->cursor_track, panel_timeline->drag_track_start) - qMin(panel_timeline->cursor_track, panel_timeline->drag_track_start) + panel_timeline->selection_offset;
|
||||
if (sequence->selections.size() != selection_count) {
|
||||
sequence->selections.resize(selection_count);
|
||||
if (Olive::ActiveSequence->selections.size() != selection_count) {
|
||||
Olive::ActiveSequence->selections.resize(selection_count);
|
||||
}
|
||||
int minimum_selection_track = qMin(panel_timeline->cursor_track, panel_timeline->drag_track_start);
|
||||
for (int i=panel_timeline->selection_offset;i<selection_count;i++) {
|
||||
Selection& s = sequence->selections[i];
|
||||
Selection& s = Olive::ActiveSequence->selections[i];
|
||||
s.track = minimum_selection_track + i - panel_timeline->selection_offset;
|
||||
long in = panel_timeline->drag_frame_start;
|
||||
long out = panel_timeline->cursor_frame;
|
||||
@@ -1634,10 +1634,10 @@ void TimelineWidget::mouseMoveEvent(QMouseEvent *event) {
|
||||
|
||||
// select linked clips too
|
||||
if (config.edit_tool_selects_links) {
|
||||
for (int j=0;j<sequence->clips.size();j++) {
|
||||
Clip* c = sequence->clips.at(j);
|
||||
for (int k=0;k<sequence->selections.size();k++) {
|
||||
const Selection& s = sequence->selections.at(k);
|
||||
for (int j=0;j<Olive::ActiveSequence->clips.size();j++) {
|
||||
Clip* c = Olive::ActiveSequence->clips.at(j);
|
||||
for (int k=0;k<Olive::ActiveSequence->selections.size();k++) {
|
||||
const Selection& s = Olive::ActiveSequence->selections.at(k);
|
||||
if (!(c->timeline_in < s.in && c->timeline_out < s.in) &&
|
||||
!(c->timeline_in > s.out && c->timeline_out > s.out) &&
|
||||
c->track == s.track) {
|
||||
@@ -1645,8 +1645,8 @@ void TimelineWidget::mouseMoveEvent(QMouseEvent *event) {
|
||||
QVector<int> linked_tracks = panel_timeline->get_tracks_of_linked_clips(j);
|
||||
for (int k=0;k<linked_tracks.size();k++) {
|
||||
bool found = false;
|
||||
for (int l=0;l<sequence->selections.size();l++) {
|
||||
const Selection& test_sel = sequence->selections.at(l);
|
||||
for (int l=0;l<Olive::ActiveSequence->selections.size();l++) {
|
||||
const Selection& test_sel = Olive::ActiveSequence->selections.at(l);
|
||||
if (test_sel.track == linked_tracks.at(k) &&
|
||||
test_sel.in == s.in &&
|
||||
test_sel.out == s.out) {
|
||||
@@ -1659,7 +1659,7 @@ void TimelineWidget::mouseMoveEvent(QMouseEvent *event) {
|
||||
link_sel.in = s.in;
|
||||
link_sel.out = s.out;
|
||||
link_sel.track = linked_tracks.at(k);
|
||||
sequence->selections.append(link_sel);
|
||||
Olive::ActiveSequence->selections.append(link_sel);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1701,8 +1701,8 @@ void TimelineWidget::mouseMoveEvent(QMouseEvent *event) {
|
||||
} else {
|
||||
// set up movement
|
||||
// create ghosts
|
||||
for (int i=0;i<sequence->clips.size();i++) {
|
||||
Clip* c = sequence->clips.at(i);
|
||||
for (int i=0;i<Olive::ActiveSequence->clips.size();i++) {
|
||||
Clip* c = Olive::ActiveSequence->clips.at(i);
|
||||
if (c != nullptr) {
|
||||
Ghost g;
|
||||
g.transition = nullptr;
|
||||
@@ -1712,8 +1712,8 @@ void TimelineWidget::mouseMoveEvent(QMouseEvent *event) {
|
||||
// if a whole clip is not selected, maybe just a transition is
|
||||
if (panel_timeline->tool == TIMELINE_TOOL_POINTER && (c->get_opening_transition() != nullptr || c->get_closing_transition() != nullptr)) {
|
||||
// check if any selections contain the whole clip or transition
|
||||
for (int j=0;j<sequence->selections.size();j++) {
|
||||
const Selection& s = sequence->selections.at(j);
|
||||
for (int j=0;j<Olive::ActiveSequence->selections.size();j++) {
|
||||
const Selection& s = Olive::ActiveSequence->selections.at(j);
|
||||
if (s.track == c->track) {
|
||||
if (selection_contains_transition(s, c, TA_OPENING_TRANSITION)) {
|
||||
g.transition = c->get_opening_transition();
|
||||
@@ -1750,11 +1750,11 @@ void TimelineWidget::mouseMoveEvent(QMouseEvent *event) {
|
||||
int size = panel_timeline->ghosts.size();
|
||||
if (panel_timeline->tool == TIMELINE_TOOL_ROLLING) {
|
||||
for (int i=0;i<size;i++) {
|
||||
Clip* ghost_clip = sequence->clips.at(panel_timeline->ghosts.at(i).clip);
|
||||
Clip* ghost_clip = Olive::ActiveSequence->clips.at(panel_timeline->ghosts.at(i).clip);
|
||||
|
||||
// see if any ghosts are touching, in which case flip them
|
||||
for (int k=0;k<size;k++) {
|
||||
Clip* comp_clip = sequence->clips.at(panel_timeline->ghosts.at(k).clip);
|
||||
Clip* comp_clip = Olive::ActiveSequence->clips.at(panel_timeline->ghosts.at(k).clip);
|
||||
if ((panel_timeline->trim_in_point && comp_clip->timeline_out == ghost_clip->timeline_in) ||
|
||||
(!panel_timeline->trim_in_point && comp_clip->timeline_in == ghost_clip->timeline_out)) {
|
||||
panel_timeline->ghosts[k].trim_in = !panel_timeline->trim_in_point;
|
||||
@@ -1765,9 +1765,9 @@ void TimelineWidget::mouseMoveEvent(QMouseEvent *event) {
|
||||
// then look for other clips we're touching
|
||||
for (int i=0;i<size;i++) {
|
||||
const Ghost& g = panel_timeline->ghosts.at(i);
|
||||
Clip* ghost_clip = sequence->clips.at(g.clip);
|
||||
for (int j=0;j<sequence->clips.size();j++) {
|
||||
Clip* comp_clip = sequence->clips.at(j);
|
||||
Clip* ghost_clip = Olive::ActiveSequence->clips.at(g.clip);
|
||||
for (int j=0;j<Olive::ActiveSequence->clips.size();j++) {
|
||||
Clip* comp_clip = Olive::ActiveSequence->clips.at(j);
|
||||
if (comp_clip->track == ghost_clip->track) {
|
||||
if ((panel_timeline->trim_in_point && comp_clip->timeline_out == ghost_clip->timeline_in) ||
|
||||
(!panel_timeline->trim_in_point && comp_clip->timeline_in == ghost_clip->timeline_out)) {
|
||||
@@ -1804,10 +1804,10 @@ void TimelineWidget::mouseMoveEvent(QMouseEvent *event) {
|
||||
} else if (panel_timeline->tool == TIMELINE_TOOL_SLIDE) {
|
||||
for (int i=0;i<size;i++) {
|
||||
const Ghost& g = panel_timeline->ghosts.at(i);
|
||||
Clip* ghost_clip = sequence->clips.at(g.clip);
|
||||
Clip* ghost_clip = Olive::ActiveSequence->clips.at(g.clip);
|
||||
panel_timeline->ghosts[i].trimming = false;
|
||||
for (int j=0;j<sequence->clips.size();j++) {
|
||||
Clip* c = sequence->clips.at(j);
|
||||
for (int j=0;j<Olive::ActiveSequence->clips.size();j++) {
|
||||
Clip* c = Olive::ActiveSequence->clips.at(j);
|
||||
if (c != nullptr && c->track == ghost_clip->track) {
|
||||
bool found = false;
|
||||
for (int k=0;k<size;k++) {
|
||||
@@ -1839,7 +1839,7 @@ void TimelineWidget::mouseMoveEvent(QMouseEvent *event) {
|
||||
long axis = LONG_MAX;
|
||||
|
||||
for (int i=0;i<panel_timeline->ghosts.size();i++) {
|
||||
Clip* c = sequence->clips.at(panel_timeline->ghosts.at(i).clip);
|
||||
Clip* c = Olive::ActiveSequence->clips.at(panel_timeline->ghosts.at(i).clip);
|
||||
if (panel_timeline->trim_in_point) {
|
||||
axis = qMin(axis, c->timeline_in);
|
||||
} else {
|
||||
@@ -1847,8 +1847,8 @@ void TimelineWidget::mouseMoveEvent(QMouseEvent *event) {
|
||||
}
|
||||
}
|
||||
|
||||
for (int i=0;i<sequence->clips.size();i++) {
|
||||
Clip* c = sequence->clips.at(i);
|
||||
for (int i=0;i<Olive::ActiveSequence->clips.size();i++) {
|
||||
Clip* c = Olive::ActiveSequence->clips.at(i);
|
||||
if (c != nullptr && !is_clip_selected(c, true)) {
|
||||
bool clip_is_post = (c->timeline_in >= axis);
|
||||
|
||||
@@ -1874,8 +1874,8 @@ void TimelineWidget::mouseMoveEvent(QMouseEvent *event) {
|
||||
}
|
||||
|
||||
// store selections
|
||||
selection_command = new SetSelectionsCommand(sequence);
|
||||
selection_command->old_data = sequence->selections;
|
||||
selection_command = new SetSelectionsCommand(Olive::ActiveSequence);
|
||||
selection_command->old_data = Olive::ActiveSequence->selections;
|
||||
|
||||
panel_timeline->moving_proc = true;
|
||||
}
|
||||
@@ -1923,8 +1923,8 @@ void TimelineWidget::mouseMoveEvent(QMouseEvent *event) {
|
||||
int track_max = qMax(track_start, track_end);
|
||||
|
||||
QVector<Clip*> selected_clips;
|
||||
for (int i=0;i<sequence->clips.size();i++) {
|
||||
Clip* clip = sequence->clips.at(i);
|
||||
for (int i=0;i<Olive::ActiveSequence->clips.size();i++) {
|
||||
Clip* clip = Olive::ActiveSequence->clips.at(i);
|
||||
if (clip != nullptr &&
|
||||
clip->track >= track_min &&
|
||||
clip->track <= track_max &&
|
||||
@@ -1935,7 +1935,7 @@ void TimelineWidget::mouseMoveEvent(QMouseEvent *event) {
|
||||
|
||||
if (!alt) {
|
||||
for (int j=0;j<clip->linked.size();j++) {
|
||||
session_clips.append(sequence->clips.at(clip->linked.at(j)));
|
||||
session_clips.append(Olive::ActiveSequence->clips.at(clip->linked.at(j)));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1956,9 +1956,9 @@ void TimelineWidget::mouseMoveEvent(QMouseEvent *event) {
|
||||
}
|
||||
}
|
||||
|
||||
sequence->selections.resize(selected_clips.size() + panel_timeline->selection_offset);
|
||||
Olive::ActiveSequence->selections.resize(selected_clips.size() + panel_timeline->selection_offset);
|
||||
for (int i=0;i<selected_clips.size();i++) {
|
||||
Selection& s = sequence->selections[i+panel_timeline->selection_offset];
|
||||
Selection& s = Olive::ActiveSequence->selections[i+panel_timeline->selection_offset];
|
||||
Clip* clip = selected_clips.at(i);
|
||||
s.old_in = s.in = clip->timeline_in;
|
||||
s.old_out = s.out = clip->timeline_out;
|
||||
@@ -2020,8 +2020,8 @@ void TimelineWidget::mouseMoveEvent(QMouseEvent *event) {
|
||||
panel_timeline->trim_target = -1;
|
||||
|
||||
// loop through current clips in the sequence
|
||||
for (int i=0;i<sequence->clips.size();i++) {
|
||||
Clip* c = sequence->clips.at(i);
|
||||
for (int i=0;i<Olive::ActiveSequence->clips.size();i++) {
|
||||
Clip* c = Olive::ActiveSequence->clips.at(i);
|
||||
if (c != nullptr) {
|
||||
|
||||
// cache track range
|
||||
@@ -2195,7 +2195,7 @@ void TimelineWidget::mouseMoveEvent(QMouseEvent *event) {
|
||||
if (panel_timeline->transition_tool_proc) {
|
||||
update_ghosts(event->pos(), event->modifiers() & Qt::ShiftModifier);
|
||||
} else {
|
||||
Clip* c = sequence->clips.at(panel_timeline->transition_tool_pre_clip);
|
||||
Clip* c = Olive::ActiveSequence->clips.at(panel_timeline->transition_tool_pre_clip);
|
||||
|
||||
Ghost g;
|
||||
|
||||
@@ -2212,7 +2212,7 @@ void TimelineWidget::mouseMoveEvent(QMouseEvent *event) {
|
||||
} else {
|
||||
int mouse_clip = getClipIndexFromCoords(panel_timeline->cursor_frame, panel_timeline->cursor_track);
|
||||
if (mouse_clip > -1) {
|
||||
Clip* c = sequence->clips.at(mouse_clip);
|
||||
Clip* c = Olive::ActiveSequence->clips.at(mouse_clip);
|
||||
if (same_sign(c->track, panel_timeline->transition_tool_side)) {
|
||||
panel_timeline->transition_tool_pre_clip = mouse_clip;
|
||||
long halfway = c->timeline_in + (c->getLength()/2);
|
||||
@@ -2350,14 +2350,14 @@ void draw_transition(QPainter& p, Clip* c, const QRect& clip_rect, QRect& text_r
|
||||
|
||||
void TimelineWidget::paintEvent(QPaintEvent*) {
|
||||
// Draw clips
|
||||
if (sequence != nullptr) {
|
||||
if (Olive::ActiveSequence != nullptr) {
|
||||
QPainter p(this);
|
||||
|
||||
// get widget width and height
|
||||
int video_track_limit = 0;
|
||||
int audio_track_limit = 0;
|
||||
for (int i=0;i<sequence->clips.size();i++) {
|
||||
Clip* clip = sequence->clips.at(i);
|
||||
for (int i=0;i<Olive::ActiveSequence->clips.size();i++) {
|
||||
Clip* clip = Olive::ActiveSequence->clips.at(i);
|
||||
if (clip != nullptr) {
|
||||
video_track_limit = qMin(video_track_limit, clip->track);
|
||||
audio_track_limit = qMax(audio_track_limit, clip->track);
|
||||
@@ -2380,8 +2380,8 @@ void TimelineWidget::paintEvent(QPaintEvent*) {
|
||||
scrollBar->setMaximum(qMax(0, panel_height - height()));
|
||||
}
|
||||
|
||||
for (int i=0;i<sequence->clips.size();i++) {
|
||||
Clip* clip = sequence->clips.at(i);
|
||||
for (int i=0;i<Olive::ActiveSequence->clips.size();i++) {
|
||||
Clip* clip = Olive::ActiveSequence->clips.at(i);
|
||||
if (clip != nullptr && is_track_visible(clip->track)) {
|
||||
QRect clip_rect(panel_timeline->getTimelineScreenPointFromFrame(clip->timeline_in), getScreenPointFromTrack(clip->track), getScreenPointFromFrame(panel_timeline->zoom, clip->getLength()), panel_timeline->calculate_track_height(clip->track, -1));
|
||||
QRect text_rect(clip_rect.left() + CLIP_TEXT_PADDING, clip_rect.top() + CLIP_TEXT_PADDING, clip_rect.width() - CLIP_TEXT_PADDING - 1, clip_rect.height() - CLIP_TEXT_PADDING - 1);
|
||||
@@ -2665,8 +2665,8 @@ void TimelineWidget::paintEvent(QPaintEvent*) {
|
||||
}
|
||||
|
||||
// Draw selections
|
||||
for (int i=0;i<sequence->selections.size();i++) {
|
||||
const Selection& s = sequence->selections.at(i);
|
||||
for (int i=0;i<Olive::ActiveSequence->selections.size();i++) {
|
||||
const Selection& s = Olive::ActiveSequence->selections.at(i);
|
||||
if (is_track_visible(s.track)) {
|
||||
int selection_y = getScreenPointFromTrack(s.track);
|
||||
int selection_x = panel_timeline->getTimelineScreenPointFromFrame(s.in);
|
||||
@@ -2743,7 +2743,7 @@ void TimelineWidget::paintEvent(QPaintEvent*) {
|
||||
|
||||
// Draw playhead
|
||||
p.setPen(Qt::red);
|
||||
int playhead_x = panel_timeline->getTimelineScreenPointFromFrame(sequence->playhead);
|
||||
int playhead_x = panel_timeline->getTimelineScreenPointFromFrame(Olive::ActiveSequence->playhead);
|
||||
p.drawLine(playhead_x, rect().top(), playhead_x, rect().bottom());
|
||||
|
||||
// draw border
|
||||
@@ -2817,8 +2817,8 @@ int TimelineWidget::getScreenPointFromTrack(int track) {
|
||||
}
|
||||
|
||||
int TimelineWidget::getClipIndexFromCoords(long frame, int track) {
|
||||
for (int i=0;i<sequence->clips.size();i++) {
|
||||
Clip* c = sequence->clips.at(i);
|
||||
for (int i=0;i<Olive::ActiveSequence->clips.size();i++) {
|
||||
Clip* c = Olive::ActiveSequence->clips.at(i);
|
||||
if (c != nullptr && c->track == track && frame >= c->timeline_in && frame < c->timeline_out) {
|
||||
return i;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user