switched global to unique ptr and renamed olive namespace
This commit is contained in:
+150
-150
@@ -82,7 +82,7 @@ TimelineWidget::TimelineWidget(QWidget *parent) : QWidget(parent) {
|
||||
}
|
||||
|
||||
void TimelineWidget::show_context_menu(const QPoint& pos) {
|
||||
if (Olive::ActiveSequence != 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;
|
||||
@@ -93,16 +93,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)), Olive::Global.data(), SLOT(undo()));
|
||||
connect(redoAction, SIGNAL(triggered(bool)), Olive::Global.data(), SLOT(redo()));
|
||||
undoAction->setEnabled(Olive::UndoStack.canUndo());
|
||||
redoAction->setEnabled(Olive::UndoStack.canRedo());
|
||||
connect(undoAction, SIGNAL(triggered(bool)), olive::Global.get(), SLOT(undo()));
|
||||
connect(redoAction, SIGNAL(triggered(bool)), olive::Global.get(), SLOT(redo()));
|
||||
undoAction->setEnabled(olive::UndoStack.canUndo());
|
||||
redoAction->setEnabled(olive::UndoStack.canRedo());
|
||||
menu.addSeparator();
|
||||
|
||||
// collect all the selected clips
|
||||
QVector<Clip*> selected_clips;
|
||||
for (int i=0;i<Olive::ActiveSequence->clips.size();i++) {
|
||||
Clip* c = Olive::ActiveSequence->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);
|
||||
}
|
||||
@@ -110,11 +110,11 @@ void TimelineWidget::show_context_menu(const QPoint& pos) {
|
||||
|
||||
if (!selected_clips.isEmpty()) {
|
||||
// clips are selected
|
||||
menu.addAction(tr("C&ut"), &Olive::FocusFilter, SLOT(cut()));
|
||||
menu.addAction(tr("Cop&y"), &Olive::FocusFilter, SLOT(copy()));
|
||||
menu.addAction(tr("C&ut"), &olive::FocusFilter, SLOT(cut()));
|
||||
menu.addAction(tr("Cop&y"), &olive::FocusFilter, SLOT(copy()));
|
||||
}
|
||||
|
||||
menu.addAction(tr("&Paste"), Olive::Global.data(), SLOT(paste()));
|
||||
menu.addAction(tr("&Paste"), olive::Global.get(), SLOT(paste()));
|
||||
|
||||
if (selected_clips.isEmpty()) {
|
||||
// no clips are selected
|
||||
@@ -134,14 +134,14 @@ void TimelineWidget::show_context_menu(const QPoint& pos) {
|
||||
|
||||
if (!selected_clips.isEmpty()) {
|
||||
menu.addSeparator();
|
||||
menu.addAction(tr("&Speed/Duration"), Olive::Global.data(), SLOT(open_speed_dialog()));
|
||||
menu.addAction(tr("&Speed/Duration"), olive::Global.get(), 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);
|
||||
|
||||
Olive::MenuHelper.make_clip_functions_menu(&menu);
|
||||
olive::MenuHelper.make_clip_functions_menu(&menu);
|
||||
|
||||
// stabilizer option
|
||||
/*int video_clip_count = 0;
|
||||
@@ -185,30 +185,30 @@ void TimelineWidget::show_context_menu(const QPoint& pos) {
|
||||
|
||||
void TimelineWidget::toggle_autoscale() {
|
||||
SetAutoscaleAction* action = new SetAutoscaleAction();
|
||||
for (int i=0;i<Olive::ActiveSequence->clips.size();i++) {
|
||||
Clip* c = Olive::ActiveSequence->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);
|
||||
}
|
||||
}
|
||||
if (action->clips.size() > 0) {
|
||||
Olive::UndoStack.push(action);
|
||||
olive::UndoStack.push(action);
|
||||
} else {
|
||||
delete action;
|
||||
}
|
||||
}
|
||||
|
||||
void TimelineWidget::tooltip_timer_timeout() {
|
||||
if (Olive::ActiveSequence != nullptr) {
|
||||
if (tooltip_clip < Olive::ActiveSequence->clips.size()) {
|
||||
Clip* c = Olive::ActiveSequence->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, Olive::CurrentConfig.timecode_view, Olive::ActiveSequence->frame_rate),
|
||||
frame_to_timecode(c->timeline_out, Olive::CurrentConfig.timecode_view, Olive::ActiveSequence->frame_rate),
|
||||
frame_to_timecode(c->getLength(), Olive::CurrentConfig.timecode_view, Olive::ActiveSequence->frame_rate)
|
||||
frame_to_timecode(c->timeline_in, olive::CurrentConfig.timecode_view, olive::ActiveSequence->frame_rate),
|
||||
frame_to_timecode(c->timeline_out, olive::CurrentConfig.timecode_view, olive::ActiveSequence->frame_rate),
|
||||
frame_to_timecode(c->getLength(), olive::CurrentConfig.timecode_view, olive::ActiveSequence->frame_rate)
|
||||
));
|
||||
}
|
||||
}
|
||||
@@ -218,8 +218,8 @@ void TimelineWidget::tooltip_timer_timeout() {
|
||||
|
||||
void TimelineWidget::rename_clip() {
|
||||
QVector<Clip*> selected_clips;
|
||||
for (int i=0;i<Olive::ActiveSequence->clips.size();i++) {
|
||||
Clip* c = Olive::ActiveSequence->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);
|
||||
}
|
||||
@@ -235,7 +235,7 @@ void TimelineWidget::rename_clip() {
|
||||
RenameClipCommand* rcc = new RenameClipCommand();
|
||||
rcc->new_name = s;
|
||||
rcc->clips = selected_clips;
|
||||
Olive::UndoStack.push(rcc);
|
||||
olive::UndoStack.push(rcc);
|
||||
update_ui(true);
|
||||
}
|
||||
}
|
||||
@@ -249,7 +249,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() == Olive::ActiveSequence) {
|
||||
if (sequence_items.at(i)->to_sequence() == olive::ActiveSequence) {
|
||||
NewSequenceDialog nsd(this, sequence_items.at(i));
|
||||
nsd.exec();
|
||||
return;
|
||||
@@ -279,13 +279,13 @@ void TimelineWidget::dragEnterEvent(QDragEnterEvent *event) {
|
||||
|
||||
if (event->source() == panel_footage_viewer->viewer_widget) {
|
||||
Sequence* proposed_seq = panel_footage_viewer->seq;
|
||||
if (proposed_seq != Olive::ActiveSequence) { // 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;
|
||||
}
|
||||
}
|
||||
|
||||
if (Olive::CurrentConfig.enable_drag_files_to_timeline && event->mimeData()->hasUrls()) {
|
||||
if (olive::CurrentConfig.enable_drag_files_to_timeline && event->mimeData()->hasUrls()) {
|
||||
QList<QUrl> urls = event->mimeData()->urls();
|
||||
if (!urls.isEmpty()) {
|
||||
QStringList file_list;
|
||||
@@ -309,7 +309,7 @@ void TimelineWidget::dragEnterEvent(QDragEnterEvent *event) {
|
||||
}
|
||||
|
||||
if (media_list.isEmpty()) {
|
||||
Olive::UndoStack.undo();
|
||||
olive::UndoStack.undo();
|
||||
} else {
|
||||
import_init = true;
|
||||
panel_timeline->importing_files = true;
|
||||
@@ -321,7 +321,7 @@ void TimelineWidget::dragEnterEvent(QDragEnterEvent *event) {
|
||||
event->acceptProposedAction();
|
||||
|
||||
long entry_point;
|
||||
Sequence* seq = Olive::ActiveSequence;
|
||||
Sequence* seq = olive::ActiveSequence;
|
||||
|
||||
if (seq == nullptr) {
|
||||
// if no sequence, we're going to create a new one using the clips as a reference
|
||||
@@ -345,7 +345,7 @@ void TimelineWidget::dragMoveEvent(QDragMoveEvent *event) {
|
||||
if (panel_timeline->importing) {
|
||||
event->acceptProposedAction();
|
||||
|
||||
if (Olive::ActiveSequence != 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));
|
||||
@@ -379,7 +379,7 @@ void TimelineWidget::wheelEvent(QWheelEvent *event) {
|
||||
int scroll_amount = alt ? (event->angleDelta().x()) : (event->angleDelta().y());
|
||||
|
||||
bool in = (scroll_amount > 0);
|
||||
if (Olive::CurrentConfig.scroll_zooms != shift) {
|
||||
if (olive::CurrentConfig.scroll_zooms != shift) {
|
||||
|
||||
// if config.scroll_zooms is enabled or shift is held, zoom instead of scrolling
|
||||
if (in) {
|
||||
@@ -405,7 +405,7 @@ void TimelineWidget::dragLeaveEvent(QDragLeaveEvent* event) {
|
||||
event->accept();
|
||||
if (panel_timeline->importing) {
|
||||
if (panel_timeline->importing_files) {
|
||||
Olive::UndoStack.undo();
|
||||
olive::UndoStack.undo();
|
||||
}
|
||||
panel_timeline->importing_files = false;
|
||||
panel_timeline->ghosts.clear();
|
||||
@@ -460,8 +460,8 @@ void insert_clips(ComboAction* ca) {
|
||||
|
||||
panel_timeline->split_cache.clear();
|
||||
|
||||
for (int i=0;i<Olive::ActiveSequence->clips.size();i++) {
|
||||
Clip* c = Olive::ActiveSequence->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;
|
||||
@@ -488,13 +488,13 @@ void insert_clips(ComboAction* ca) {
|
||||
|
||||
long ripple_length = (latest_new_point - earliest_new_point);
|
||||
|
||||
ripple_clips(ca, Olive::ActiveSequence, 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, Olive::ActiveSequence, 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++) {
|
||||
@@ -502,8 +502,8 @@ void insert_clips(ComboAction* ca) {
|
||||
g.in += second_ripple_length;
|
||||
g.out += second_ripple_length;
|
||||
}
|
||||
for (int i=0;i<Olive::ActiveSequence->selections.size();i++) {
|
||||
Selection& s = Olive::ActiveSequence->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;
|
||||
}
|
||||
@@ -517,7 +517,7 @@ void TimelineWidget::dropEvent(QDropEvent* event) {
|
||||
|
||||
ComboAction* ca = new ComboAction();
|
||||
|
||||
Sequence* s = Olive::ActiveSequence;
|
||||
Sequence* s = olive::ActiveSequence;
|
||||
|
||||
// if we're dropping into nothing, create a new sequences based on the clip being dragged
|
||||
if (s == nullptr) {
|
||||
@@ -532,7 +532,7 @@ void TimelineWidget::dropEvent(QDropEvent* event) {
|
||||
|
||||
panel_timeline->add_clips_from_ghosts(ca, s);
|
||||
|
||||
Olive::UndoStack.push(ca);
|
||||
olive::UndoStack.push(ca);
|
||||
|
||||
setFocus();
|
||||
|
||||
@@ -541,23 +541,23 @@ void TimelineWidget::dropEvent(QDropEvent* event) {
|
||||
}
|
||||
|
||||
void TimelineWidget::mouseDoubleClickEvent(QMouseEvent *event) {
|
||||
if (Olive::ActiveSequence != 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 = Olive::ActiveSequence->clips.at(clip_index);
|
||||
if (!(event->modifiers() & Qt::ShiftModifier)) Olive::ActiveSequence->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;
|
||||
Olive::ActiveSequence->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 = Olive::ActiveSequence->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());
|
||||
}
|
||||
@@ -571,7 +571,7 @@ bool isLiveEditing() {
|
||||
}
|
||||
|
||||
void TimelineWidget::mousePressEvent(QMouseEvent *event) {
|
||||
if (Olive::ActiveSequence != nullptr) {
|
||||
if (olive::ActiveSequence != nullptr) {
|
||||
int tool = panel_timeline->tool;
|
||||
if (event->button() == Qt::MiddleButton) {
|
||||
tool = TIMELINE_TOOL_HAND;
|
||||
@@ -597,7 +597,7 @@ void TimelineWidget::mousePressEvent(QMouseEvent *event) {
|
||||
bool alt = (event->modifiers() & Qt::AltModifier);
|
||||
|
||||
if (shift) {
|
||||
panel_timeline->selection_offset = Olive::ActiveSequence->selections.size();
|
||||
panel_timeline->selection_offset = olive::ActiveSequence->selections.size();
|
||||
} else {
|
||||
panel_timeline->selection_offset = 0;
|
||||
}
|
||||
@@ -644,7 +644,7 @@ void TimelineWidget::mousePressEvent(QMouseEvent *event) {
|
||||
panel_timeline->moving_init = true;
|
||||
} else {
|
||||
if (clip_index >= 0) {
|
||||
Clip* clip = Olive::ActiveSequence->clips.at(clip_index);
|
||||
Clip* clip = olive::ActiveSequence->clips.at(clip_index);
|
||||
if (clip != nullptr) {
|
||||
if (is_clip_selected(clip, true)) {
|
||||
if (shift) {
|
||||
@@ -652,7 +652,7 @@ void TimelineWidget::mousePressEvent(QMouseEvent *event) {
|
||||
|
||||
if (!alt) {
|
||||
for (int i=0;i<clip->linked.size();i++) {
|
||||
Clip* link = Olive::ActiveSequence->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);
|
||||
}
|
||||
}
|
||||
@@ -660,7 +660,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 = Olive::ActiveSequence->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);
|
||||
}
|
||||
|
||||
@@ -676,12 +676,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();
|
||||
}
|
||||
Olive::ActiveSequence->selections.append(s);
|
||||
olive::ActiveSequence->selections.append(s);
|
||||
}
|
||||
} else {
|
||||
// if "shift" is not down
|
||||
if (!shift) {
|
||||
Olive::ActiveSequence->selections.clear();
|
||||
olive::ActiveSequence->selections.clear();
|
||||
}
|
||||
|
||||
Selection s;
|
||||
@@ -702,22 +702,22 @@ void TimelineWidget::mousePressEvent(QMouseEvent *event) {
|
||||
}
|
||||
|
||||
s.track = clip->track;
|
||||
Olive::ActiveSequence->selections.append(s);
|
||||
olive::ActiveSequence->selections.append(s);
|
||||
|
||||
if (Olive::CurrentConfig.select_also_seeks) {
|
||||
if (olive::CurrentConfig.select_also_seeks) {
|
||||
panel_sequence_viewer->seek(clip->timeline_in);
|
||||
}
|
||||
|
||||
// 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 = Olive::ActiveSequence->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;
|
||||
Olive::ActiveSequence->selections.append(ss);
|
||||
olive::ActiveSequence->selections.append(ss);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -728,7 +728,7 @@ void TimelineWidget::mousePressEvent(QMouseEvent *event) {
|
||||
} else {
|
||||
// if "shift" is not down
|
||||
if (!shift) {
|
||||
Olive::ActiveSequence->selections.clear();
|
||||
olive::ActiveSequence->selections.clear();
|
||||
}
|
||||
|
||||
panel_timeline->rect_select_init = true;
|
||||
@@ -743,7 +743,7 @@ void TimelineWidget::mousePressEvent(QMouseEvent *event) {
|
||||
panel_timeline->drag_y_start = pos.y();
|
||||
break;
|
||||
case TIMELINE_TOOL_EDIT:
|
||||
if (Olive::CurrentConfig.edit_tool_also_seeks) panel_sequence_viewer->seek(panel_timeline->drag_frame_start);
|
||||
if (olive::CurrentConfig.edit_tool_also_seeks) panel_sequence_viewer->seek(panel_timeline->drag_frame_start);
|
||||
panel_timeline->selecting = true;
|
||||
break;
|
||||
case TIMELINE_TOOL_RAZOR:
|
||||
@@ -794,7 +794,7 @@ void make_room_for_transition(ComboAction* ca, Clip* c, int type, long transitio
|
||||
|
||||
void TimelineWidget::mouseReleaseEvent(QMouseEvent *event) {
|
||||
QToolTip::hideText();
|
||||
if (Olive::ActiveSequence != nullptr) {
|
||||
if (olive::ActiveSequence != nullptr) {
|
||||
bool alt = (event->modifiers() & Qt::AltModifier);
|
||||
bool shift = (event->modifiers() & Qt::ShiftModifier);
|
||||
bool ctrl = (event->modifiers() & Qt::ControlModifier);
|
||||
@@ -808,11 +808,11 @@ void TimelineWidget::mouseReleaseEvent(QMouseEvent *event) {
|
||||
const Ghost& g = panel_timeline->ghosts.at(0);
|
||||
|
||||
if (panel_timeline->creating_object == ADD_OBJ_AUDIO) {
|
||||
Olive::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(Olive::ActiveSequence);
|
||||
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);
|
||||
@@ -836,9 +836,9 @@ void TimelineWidget::mouseReleaseEvent(QMouseEvent *event) {
|
||||
|
||||
QVector<Clip*> add;
|
||||
add.append(c);
|
||||
ca->append(new AddClipCommand(Olive::ActiveSequence, add));
|
||||
ca->append(new AddClipCommand(olive::ActiveSequence, add));
|
||||
|
||||
if (c->track < 0 && Olive::CurrentConfig.add_default_effects_to_clips) {
|
||||
if (c->track < 0 && olive::CurrentConfig.add_default_effects_to_clips) {
|
||||
// default video effects (before custom effects)
|
||||
c->effects.append(create_effect(c, get_internal_meta(EFFECT_INTERNAL_TRANSFORM, EFFECT_TYPE_EFFECT)));
|
||||
}
|
||||
@@ -870,7 +870,7 @@ void TimelineWidget::mouseReleaseEvent(QMouseEvent *event) {
|
||||
break;
|
||||
}
|
||||
|
||||
if (c->track >= 0 && Olive::CurrentConfig.add_default_effects_to_clips) {
|
||||
if (c->track >= 0 && olive::CurrentConfig.add_default_effects_to_clips) {
|
||||
// default audio effects (after custom effects)
|
||||
c->effects.append(create_effect(c, get_internal_meta(EFFECT_INTERNAL_VOLUME, EFFECT_TYPE_EFFECT)));
|
||||
c->effects.append(create_effect(c, get_internal_meta(EFFECT_INTERNAL_PAN, EFFECT_TYPE_EFFECT)));
|
||||
@@ -910,9 +910,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<Olive::ActiveSequence->selections.size();i++) {
|
||||
Olive::ActiveSequence->selections[i].in += ripple_length;
|
||||
Olive::ActiveSequence->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
|
||||
@@ -935,7 +935,7 @@ void TimelineWidget::mouseReleaseEvent(QMouseEvent *event) {
|
||||
}
|
||||
if (!panel_timeline->trim_in_point) ripple_length = -ripple_length;
|
||||
|
||||
ripple_clips(ca, Olive::ActiveSequence, ripple_point, ripple_length, ignore_clips);
|
||||
ripple_clips(ca, olive::ActiveSequence, ripple_point, ripple_length, ignore_clips);
|
||||
}
|
||||
|
||||
if (panel_timeline->tool == TIMELINE_TOOL_POINTER
|
||||
@@ -949,7 +949,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 = Olive::ActiveSequence->clips.at(g.clip)->copy(Olive::ActiveSequence);
|
||||
Clip* c = olive::ActiveSequence->clips.at(g.clip)->copy(olive::ActiveSequence);
|
||||
|
||||
c->timeline_in = g.in;
|
||||
c->timeline_out = g.out;
|
||||
@@ -971,7 +971,7 @@ void TimelineWidget::mouseReleaseEvent(QMouseEvent *event) {
|
||||
// relink duplicated clips
|
||||
panel_timeline->relink_clips_using_ids(old_clips, new_clips);
|
||||
|
||||
ca->append(new AddClipCommand(Olive::ActiveSequence, new_clips));
|
||||
ca->append(new AddClipCommand(olive::ActiveSequence, new_clips));
|
||||
}
|
||||
} else {
|
||||
// INSERT if holding ctrl
|
||||
@@ -984,7 +984,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);
|
||||
|
||||
Olive::ActiveSequence->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;
|
||||
@@ -999,7 +999,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);
|
||||
Olive::ActiveSequence->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;
|
||||
@@ -1010,7 +1010,7 @@ void TimelineWidget::mouseReleaseEvent(QMouseEvent *event) {
|
||||
Ghost& g = panel_timeline->ghosts[i];
|
||||
|
||||
// step 3 - move clips
|
||||
Clip* c = Olive::ActiveSequence->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);
|
||||
|
||||
@@ -1082,13 +1082,13 @@ void TimelineWidget::mouseReleaseEvent(QMouseEvent *event) {
|
||||
long transition_start = qMin(g.in, g.out);
|
||||
long transition_end = qMax(g.in, g.out);
|
||||
|
||||
Clip* pre = Olive::ActiveSequence->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 = Olive::ActiveSequence->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,
|
||||
@@ -1158,17 +1158,17 @@ void TimelineWidget::mouseReleaseEvent(QMouseEvent *event) {
|
||||
}
|
||||
|
||||
// remove duplicate selections
|
||||
panel_timeline->clean_up_selections(Olive::ActiveSequence->selections);
|
||||
panel_timeline->clean_up_selections(olive::ActiveSequence->selections);
|
||||
|
||||
if (selection_command != nullptr) {
|
||||
selection_command->new_data = Olive::ActiveSequence->selections;
|
||||
selection_command->new_data = olive::ActiveSequence->selections;
|
||||
ca->append(selection_command);
|
||||
selection_command = nullptr;
|
||||
push_undo = true;
|
||||
}
|
||||
|
||||
if (push_undo) {
|
||||
Olive::UndoStack.push(ca);
|
||||
olive::UndoStack.push(ca);
|
||||
} else {
|
||||
delete ca;
|
||||
}
|
||||
@@ -1200,7 +1200,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 = Olive::ActiveSequence->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;
|
||||
@@ -1230,8 +1230,8 @@ void TimelineWidget::init_ghosts() {
|
||||
c->recalculateMaxLength();
|
||||
g.media_length = c->getMaximumLength();
|
||||
}
|
||||
for (int i=0;i<Olive::ActiveSequence->selections.size();i++) {
|
||||
Selection& s = Olive::ActiveSequence->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;
|
||||
@@ -1306,7 +1306,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 = Olive::ActiveSequence->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;
|
||||
@@ -1326,7 +1326,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 = Olive::ActiveSequence->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) {
|
||||
@@ -1482,7 +1482,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 = Olive::ActiveSequence->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
|
||||
@@ -1545,7 +1545,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 == Olive::ActiveSequence->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;
|
||||
}
|
||||
|
||||
@@ -1578,8 +1578,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<Olive::ActiveSequence->selections.size();i++) {
|
||||
Selection& s = Olive::ActiveSequence->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;
|
||||
@@ -1587,8 +1587,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<Olive::ActiveSequence->selections.size();i++) {
|
||||
Selection& s = Olive::ActiveSequence->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;
|
||||
@@ -1609,9 +1609,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, Olive::CurrentConfig.timecode_view, Olive::ActiveSequence->frame_rate));
|
||||
QToolTip::showText(mapToGlobal(mouse_pos), frame_to_timecode(earliest_in_point, olive::CurrentConfig.timecode_view, olive::ActiveSequence->frame_rate));
|
||||
} else {
|
||||
QString tip = ((frame_diff < 0) ? "-" : "+") + frame_to_timecode(qAbs(frame_diff), Olive::CurrentConfig.timecode_view, Olive::ActiveSequence->frame_rate);
|
||||
QString tip = ((frame_diff < 0) ? "-" : "+") + frame_to_timecode(qAbs(frame_diff), olive::CurrentConfig.timecode_view, olive::ActiveSequence->frame_rate);
|
||||
if (panel_timeline->trim_target > -1) {
|
||||
// find which clip is being moved
|
||||
const Ghost* g = nullptr;
|
||||
@@ -1630,7 +1630,7 @@ void TimelineWidget::update_ghosts(const QPoint& mouse_pos, bool lock_frame) {
|
||||
} else {
|
||||
len += frame_diff;
|
||||
}
|
||||
tip += frame_to_timecode(len, Olive::CurrentConfig.timecode_view, Olive::ActiveSequence->frame_rate);
|
||||
tip += frame_to_timecode(len, olive::CurrentConfig.timecode_view, olive::ActiveSequence->frame_rate);
|
||||
}
|
||||
}
|
||||
QToolTip::showText(mapToGlobal(mouse_pos), tip);
|
||||
@@ -1639,7 +1639,7 @@ void TimelineWidget::update_ghosts(const QPoint& mouse_pos, bool lock_frame) {
|
||||
|
||||
void TimelineWidget::mouseMoveEvent(QMouseEvent *event) {
|
||||
tooltip_timer.stop();
|
||||
if (Olive::ActiveSequence != nullptr) {
|
||||
if (olive::ActiveSequence != nullptr) {
|
||||
bool alt = (event->modifiers() & Qt::AltModifier);
|
||||
|
||||
panel_timeline->cursor_frame = panel_timeline->getTimelineFrameFromScreenPoint(event->pos().x());
|
||||
@@ -1650,16 +1650,16 @@ void TimelineWidget::mouseMoveEvent(QMouseEvent *event) {
|
||||
if (!panel_timeline->moving_init) track_resizing = false;
|
||||
|
||||
if (isLiveEditing()) {
|
||||
panel_timeline->snap_to_timeline(&panel_timeline->cursor_frame, !Olive::CurrentConfig.edit_tool_also_seeks || !panel_timeline->selecting, true, true);
|
||||
panel_timeline->snap_to_timeline(&panel_timeline->cursor_frame, !olive::CurrentConfig.edit_tool_also_seeks || !panel_timeline->selecting, true, true);
|
||||
}
|
||||
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 (Olive::ActiveSequence->selections.size() != selection_count) {
|
||||
Olive::ActiveSequence->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 = Olive::ActiveSequence->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;
|
||||
@@ -1668,11 +1668,11 @@ void TimelineWidget::mouseMoveEvent(QMouseEvent *event) {
|
||||
}
|
||||
|
||||
// select linked clips too
|
||||
if (Olive::CurrentConfig.edit_tool_selects_links) {
|
||||
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 (olive::CurrentConfig.edit_tool_selects_links) {
|
||||
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) {
|
||||
@@ -1680,8 +1680,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<Olive::ActiveSequence->selections.size();l++) {
|
||||
const Selection& test_sel = Olive::ActiveSequence->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) {
|
||||
@@ -1694,7 +1694,7 @@ void TimelineWidget::mouseMoveEvent(QMouseEvent *event) {
|
||||
link_sel.in = s.in;
|
||||
link_sel.out = s.out;
|
||||
link_sel.track = linked_tracks.at(k);
|
||||
Olive::ActiveSequence->selections.append(link_sel);
|
||||
olive::ActiveSequence->selections.append(link_sel);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1704,7 +1704,7 @@ void TimelineWidget::mouseMoveEvent(QMouseEvent *event) {
|
||||
}
|
||||
}
|
||||
|
||||
if (Olive::CurrentConfig.edit_tool_also_seeks) {
|
||||
if (olive::CurrentConfig.edit_tool_also_seeks) {
|
||||
panel_sequence_viewer->seek(qMin(panel_timeline->drag_frame_start, panel_timeline->cursor_frame));
|
||||
} else {
|
||||
panel_timeline->repaint_timeline();
|
||||
@@ -1736,8 +1736,8 @@ void TimelineWidget::mouseMoveEvent(QMouseEvent *event) {
|
||||
} else {
|
||||
// set up movement
|
||||
// create ghosts
|
||||
for (int i=0;i<Olive::ActiveSequence->clips.size();i++) {
|
||||
Clip* c = Olive::ActiveSequence->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;
|
||||
@@ -1747,8 +1747,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<Olive::ActiveSequence->selections.size();j++) {
|
||||
const Selection& s = Olive::ActiveSequence->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();
|
||||
@@ -1785,11 +1785,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 = Olive::ActiveSequence->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 = Olive::ActiveSequence->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;
|
||||
@@ -1800,9 +1800,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 = Olive::ActiveSequence->clips.at(g.clip);
|
||||
for (int j=0;j<Olive::ActiveSequence->clips.size();j++) {
|
||||
Clip* comp_clip = Olive::ActiveSequence->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)) {
|
||||
@@ -1839,10 +1839,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 = Olive::ActiveSequence->clips.at(g.clip);
|
||||
Clip* ghost_clip = olive::ActiveSequence->clips.at(g.clip);
|
||||
panel_timeline->ghosts[i].trimming = false;
|
||||
for (int j=0;j<Olive::ActiveSequence->clips.size();j++) {
|
||||
Clip* c = Olive::ActiveSequence->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++) {
|
||||
@@ -1874,7 +1874,7 @@ void TimelineWidget::mouseMoveEvent(QMouseEvent *event) {
|
||||
long axis = LONG_MAX;
|
||||
|
||||
for (int i=0;i<panel_timeline->ghosts.size();i++) {
|
||||
Clip* c = Olive::ActiveSequence->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 {
|
||||
@@ -1882,8 +1882,8 @@ void TimelineWidget::mouseMoveEvent(QMouseEvent *event) {
|
||||
}
|
||||
}
|
||||
|
||||
for (int i=0;i<Olive::ActiveSequence->clips.size();i++) {
|
||||
Clip* c = Olive::ActiveSequence->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);
|
||||
|
||||
@@ -1909,8 +1909,8 @@ void TimelineWidget::mouseMoveEvent(QMouseEvent *event) {
|
||||
}
|
||||
|
||||
// store selections
|
||||
selection_command = new SetSelectionsCommand(Olive::ActiveSequence);
|
||||
selection_command->old_data = Olive::ActiveSequence->selections;
|
||||
selection_command = new SetSelectionsCommand(olive::ActiveSequence);
|
||||
selection_command->old_data = olive::ActiveSequence->selections;
|
||||
|
||||
panel_timeline->moving_proc = true;
|
||||
}
|
||||
@@ -1958,8 +1958,8 @@ void TimelineWidget::mouseMoveEvent(QMouseEvent *event) {
|
||||
int track_max = qMax(track_start, track_end);
|
||||
|
||||
QVector<Clip*> selected_clips;
|
||||
for (int i=0;i<Olive::ActiveSequence->clips.size();i++) {
|
||||
Clip* clip = Olive::ActiveSequence->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 &&
|
||||
@@ -1970,7 +1970,7 @@ void TimelineWidget::mouseMoveEvent(QMouseEvent *event) {
|
||||
|
||||
if (!alt) {
|
||||
for (int j=0;j<clip->linked.size();j++) {
|
||||
session_clips.append(Olive::ActiveSequence->clips.at(clip->linked.at(j)));
|
||||
session_clips.append(olive::ActiveSequence->clips.at(clip->linked.at(j)));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1991,9 +1991,9 @@ void TimelineWidget::mouseMoveEvent(QMouseEvent *event) {
|
||||
}
|
||||
}
|
||||
|
||||
Olive::ActiveSequence->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 = Olive::ActiveSequence->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;
|
||||
@@ -2055,8 +2055,8 @@ void TimelineWidget::mouseMoveEvent(QMouseEvent *event) {
|
||||
panel_timeline->trim_target = -1;
|
||||
|
||||
// loop through current clips in the sequence
|
||||
for (int i=0;i<Olive::ActiveSequence->clips.size();i++) {
|
||||
Clip* c = Olive::ActiveSequence->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
|
||||
@@ -2181,9 +2181,9 @@ void TimelineWidget::mouseMoveEvent(QMouseEvent *event) {
|
||||
if (found) {
|
||||
|
||||
if (panel_timeline->trim_in_point) { // if we're trimming an IN point
|
||||
setCursor(Olive::Cursor_LeftTrim);
|
||||
setCursor(olive::Cursor_LeftTrim);
|
||||
} else { // if we're trimming an OUT point
|
||||
setCursor(Olive::Cursor_RightTrim);
|
||||
setCursor(olive::Cursor_RightTrim);
|
||||
}
|
||||
|
||||
} else {
|
||||
@@ -2202,7 +2202,7 @@ void TimelineWidget::mouseMoveEvent(QMouseEvent *event) {
|
||||
int mouse_pos = pos.y() + scroll;
|
||||
if (mouse_pos > y_test_value-test_range && mouse_pos < y_test_value+test_range) {
|
||||
// if track lines are hidden, only resize track if a clip is already there
|
||||
if (Olive::CurrentConfig.show_track_lines || cursor_contains_clip) {
|
||||
if (olive::CurrentConfig.show_track_lines || cursor_contains_clip) {
|
||||
found = true;
|
||||
track_resizing = true;
|
||||
track_target = track;
|
||||
@@ -2230,7 +2230,7 @@ void TimelineWidget::mouseMoveEvent(QMouseEvent *event) {
|
||||
if (panel_timeline->transition_tool_proc) {
|
||||
update_ghosts(event->pos(), event->modifiers() & Qt::ShiftModifier);
|
||||
} else {
|
||||
Clip* c = Olive::ActiveSequence->clips.at(panel_timeline->transition_tool_pre_clip);
|
||||
Clip* c = olive::ActiveSequence->clips.at(panel_timeline->transition_tool_pre_clip);
|
||||
|
||||
Ghost g;
|
||||
|
||||
@@ -2247,7 +2247,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 = Olive::ActiveSequence->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);
|
||||
@@ -2300,7 +2300,7 @@ void draw_waveform(Clip* clip, const FootageStream* ms, long media_length, QPain
|
||||
}
|
||||
|
||||
for (int j=0;j<ms->audio_channels;j++) {
|
||||
int mid = (Olive::CurrentConfig.rectified_waveforms) ? clip_rect.top()+channel_height*(j+1) : clip_rect.top()+channel_height*j+(channel_height/2);
|
||||
int mid = (olive::CurrentConfig.rectified_waveforms) ? clip_rect.top()+channel_height*(j+1) : clip_rect.top()+channel_height*j+(channel_height/2);
|
||||
|
||||
int offset_range_start = last_waveform_index+(j*2);
|
||||
int offset_range_end = waveform_index+(j*2);
|
||||
@@ -2317,7 +2317,7 @@ void draw_waveform(Clip* clip, const FootageStream* ms, long media_length, QPain
|
||||
}
|
||||
|
||||
// draw waveforms
|
||||
if (Olive::CurrentConfig.rectified_waveforms) {
|
||||
if (olive::CurrentConfig.rectified_waveforms) {
|
||||
|
||||
// rectified waveforms start from the bottom and draw upwards
|
||||
p->drawLine(clip_rect.left()+i, mid, clip_rect.left()+i, mid - (max - min));
|
||||
@@ -2385,14 +2385,14 @@ void draw_transition(QPainter& p, Clip* c, const QRect& clip_rect, QRect& text_r
|
||||
|
||||
void TimelineWidget::paintEvent(QPaintEvent*) {
|
||||
// Draw clips
|
||||
if (Olive::ActiveSequence != 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<Olive::ActiveSequence->clips.size();i++) {
|
||||
Clip* clip = Olive::ActiveSequence->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);
|
||||
@@ -2415,8 +2415,8 @@ void TimelineWidget::paintEvent(QPaintEvent*) {
|
||||
scrollBar->setMaximum(qMax(0, panel_height - height()));
|
||||
}
|
||||
|
||||
for (int i=0;i<Olive::ActiveSequence->clips.size();i++) {
|
||||
Clip* clip = Olive::ActiveSequence->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);
|
||||
@@ -2689,7 +2689,7 @@ void TimelineWidget::paintEvent(QPaintEvent*) {
|
||||
}
|
||||
|
||||
// Draw track lines
|
||||
if (Olive::CurrentConfig.show_track_lines) {
|
||||
if (olive::CurrentConfig.show_track_lines) {
|
||||
p.setPen(QColor(0, 0, 0, 96));
|
||||
audio_track_limit++;
|
||||
if (video_track_limit == 0) video_track_limit--;
|
||||
@@ -2710,8 +2710,8 @@ void TimelineWidget::paintEvent(QPaintEvent*) {
|
||||
}
|
||||
|
||||
// Draw selections
|
||||
for (int i=0;i<Olive::ActiveSequence->selections.size();i++) {
|
||||
const Selection& s = Olive::ActiveSequence->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);
|
||||
@@ -2788,7 +2788,7 @@ void TimelineWidget::paintEvent(QPaintEvent*) {
|
||||
|
||||
// Draw playhead
|
||||
p.setPen(Qt::red);
|
||||
int playhead_x = panel_timeline->getTimelineScreenPointFromFrame(Olive::ActiveSequence->playhead);
|
||||
int playhead_x = panel_timeline->getTimelineScreenPointFromFrame(olive::ActiveSequence->playhead);
|
||||
p.drawLine(playhead_x, rect().top(), playhead_x, rect().bottom());
|
||||
|
||||
// draw border
|
||||
@@ -2836,7 +2836,7 @@ int TimelineWidget::getTrackFromScreenPoint(int y) {
|
||||
int counter = ((!bottom_align && y > 0) || (bottom_align && y < 0)) ? 0 : -1;
|
||||
int track_height = panel_timeline->calculate_track_height(counter, -1);
|
||||
while (qAbs(y) > height_measure+track_height) {
|
||||
if (Olive::CurrentConfig.show_track_lines && counter != -1) y--;
|
||||
if (olive::CurrentConfig.show_track_lines && counter != -1) y--;
|
||||
height_measure += track_height;
|
||||
if ((!bottom_align && y > 0) || (bottom_align && y < 0)) {
|
||||
counter++;
|
||||
@@ -2855,15 +2855,15 @@ int TimelineWidget::getScreenPointFromTrack(int track) {
|
||||
if (bottom_align) counter--;
|
||||
y += panel_timeline->calculate_track_height(counter, -1);
|
||||
if (!bottom_align) counter++;
|
||||
if (Olive::CurrentConfig.show_track_lines && counter != -1) y++;
|
||||
if (olive::CurrentConfig.show_track_lines && counter != -1) y++;
|
||||
}
|
||||
y++;
|
||||
return (bottom_align) ? height() - y - scroll : y - scroll;
|
||||
}
|
||||
|
||||
int TimelineWidget::getClipIndexFromCoords(long frame, int track) {
|
||||
for (int i=0;i<Olive::ActiveSequence->clips.size();i++) {
|
||||
Clip* c = Olive::ActiveSequence->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