switched global to unique ptr and renamed olive namespace

This commit is contained in:
itsmattkc
2019-02-16 15:08:33 -08:00
parent 3d0a65c70d
commit e063a5ba8f
65 changed files with 860 additions and 860 deletions
+1 -1
View File
@@ -68,7 +68,7 @@ void AudioMonitor::resizeEvent(QResizeEvent *e) {
}
void AudioMonitor::paintEvent(QPaintEvent *) {
if (Olive::ActiveSequence != nullptr && values.size() > 0) {
if (olive::ActiveSequence != nullptr && values.size() > 0) {
QPainter p(this);
int channel_x = AUDIO_MONITOR_GAP;
int channel_count = values.size();
+1 -1
View File
@@ -28,5 +28,5 @@ CheckboxEx::CheckboxEx(QWidget* parent) : QCheckBox(parent) {
void CheckboxEx::checkbox_command() {
CheckboxCommand* c = new CheckboxCommand(this);
Olive::UndoStack.push(c);
olive::UndoStack.push(c);
}
+3 -3
View File
@@ -31,17 +31,17 @@
class ComboBoxExCommand : public QUndoCommand {
public:
ComboBoxExCommand(ComboBoxEx* obj, int old_index, int new_index) :
combobox(obj), old_val(old_index), new_val(new_index), done(true), old_project_changed(Olive::MainWindow->isWindowModified()) {}
combobox(obj), old_val(old_index), new_val(new_index), done(true), old_project_changed(olive::MainWindow->isWindowModified()) {}
void undo() {
combobox->setCurrentIndex(old_val);
done = false;
Olive::MainWindow->setWindowModified(old_project_changed);
olive::MainWindow->setWindowModified(old_project_changed);
}
void redo() {
if (!done) {
combobox->setCurrentIndex(new_val);
}
Olive::MainWindow->setWindowModified(true);
olive::MainWindow->setWindowModified(true);
}
private:
ComboBoxEx* combobox;
+4 -4
View File
@@ -25,8 +25,8 @@
#include <QDebug>
QCursor Olive::Cursor_LeftTrim;
QCursor Olive::Cursor_RightTrim;
QCursor olive::Cursor_LeftTrim;
QCursor olive::Cursor_RightTrim;
QCursor load_cursor(const QString& file, int hotX, int hotY, const bool& right_aligned){
// load specified file into a pixmap
@@ -43,7 +43,7 @@ QCursor load_cursor(const QString& file, int hotX, int hotY, const bool& right_a
void init_custom_cursors(){
qInfo() << "Initializing custom cursors";
Olive::Cursor_LeftTrim = load_cursor(":/cursors/left_side.png", 0, -1, false);
Olive::Cursor_RightTrim = load_cursor(":/cursors/right_side.png", 0, -1, true);
olive::Cursor_LeftTrim = load_cursor(":/cursors/left_side.png", 0, -1, false);
olive::Cursor_RightTrim = load_cursor(":/cursors/right_side.png", 0, -1, true);
qInfo() << "Finished initializing custom cursors";
}
+1 -1
View File
@@ -25,7 +25,7 @@
void init_custom_cursors();
namespace Olive{
namespace olive{
extern QCursor Cursor_LeftTrim;
extern QCursor Cursor_RightTrim;
}
+5 -5
View File
@@ -24,7 +24,7 @@
#include "project/sequence.h"
#include "ui/timelineheader.h"
FocusFilter Olive::FocusFilter;
FocusFilter olive::FocusFilter;
FocusFilter::FocusFilter() {}
@@ -100,7 +100,7 @@ void FocusFilter::set_viewer_fullscreen() {
}
void FocusFilter::set_marker() {
if (Olive::ActiveSequence != nullptr) {
if (olive::ActiveSequence != nullptr) {
QDockWidget* focused_panel = get_focused_panel();
if (focused_panel == panel_footage_viewer) {
@@ -205,7 +205,7 @@ void FocusFilter::delete_function() {
} else if (panel_graph_editor->view_is_focused()) {
panel_graph_editor->delete_selected_keys();
} else {
panel_timeline->delete_selection(Olive::ActiveSequence->selections, false);
panel_timeline->delete_selection(olive::ActiveSequence->selections, false);
}
}
@@ -251,7 +251,7 @@ void FocusFilter::zoom_out() {
}
void FocusFilter::cut() {
if (Olive::ActiveSequence != nullptr) {
if (olive::ActiveSequence != nullptr) {
QDockWidget* focused_panel = get_focused_panel();
if (panel_effect_controls == focused_panel) {
panel_effect_controls->copy(true);
@@ -262,7 +262,7 @@ void FocusFilter::cut() {
}
void FocusFilter::copy() {
if (Olive::ActiveSequence != nullptr) {
if (olive::ActiveSequence != nullptr) {
QDockWidget* focused_panel = get_focused_panel();
if (panel_effect_controls == focused_panel) {
panel_effect_controls->copy(false);
+1 -1
View File
@@ -224,7 +224,7 @@ public slots:
void zoom_out();
};
namespace Olive {
namespace olive {
extern FocusFilter FocusFilter;
}
+3 -3
View File
@@ -701,7 +701,7 @@ void GraphView::mouseMoveEvent(QMouseEvent *event) {
void GraphView::mouseReleaseEvent(QMouseEvent *) {
if (click_add_proc) {
Olive::UndoStack.push(new KeyframeFieldSet(click_add_field, click_add_key));
olive::UndoStack.push(new KeyframeFieldSet(click_add_field, click_add_key));
} else if (moved_keys && selected_keys.size() > 0) {
ComboAction* ca = new ComboAction();
switch (current_handle) {
@@ -723,7 +723,7 @@ void GraphView::mouseReleaseEvent(QMouseEvent *) {
}
break;
}
Olive::UndoStack.push(ca);
olive::UndoStack.push(ca);
}
moved_keys = false;
mousedown = false;
@@ -812,7 +812,7 @@ void GraphView::set_selected_keyframe_type(int type) {
EffectKeyframe& key = row->field(selected_keys_fields.at(i))->keyframes[selected_keys.at(i)];
ca->append(new SetInt(&key.type, type));
}
Olive::UndoStack.push(ca);
olive::UndoStack.push(ca);
update_ui(false);
}
}
+6 -6
View File
@@ -90,7 +90,7 @@ void KeyframeView::menu_set_key_type(QAction* a) {
EffectField* f = selected_fields.at(i);
ca->append(new SetInt(&f->keyframes[selected_keyframes.at(i)].type, a->data().toInt()));
}
Olive::UndoStack.push(ca);
olive::UndoStack.push(ca);
update_ui(false);
}
}
@@ -106,13 +106,13 @@ void KeyframeView::paintEvent(QPaintEvent*) {
visible_out = 0;
for (int j=0;j<panel_effect_controls->selected_clips.size();j++) {
Clip* c = Olive::ActiveSequence->clips.at(panel_effect_controls->selected_clips.at(j));
Clip* c = olive::ActiveSequence->clips.at(panel_effect_controls->selected_clips.at(j));
visible_in = qMin(visible_in, c->timeline_in);
visible_out = qMax(visible_out, c->timeline_out);
}
for (int j=0;j<panel_effect_controls->selected_clips.size();j++) {
Clip* c = Olive::ActiveSequence->clips.at(panel_effect_controls->selected_clips.at(j));
Clip* c = olive::ActiveSequence->clips.at(panel_effect_controls->selected_clips.at(j));
for (int i=0;i<c->effects.size();i++) {
Effect* e = c->effects.at(i);
if (e->container->is_expanded()) {
@@ -168,7 +168,7 @@ void KeyframeView::paintEvent(QPaintEvent*) {
panel_effect_controls->horizontalScrollBar->setMaximum(qMax(max_width - width(), 0));
header->set_visible_in(visible_in);
int playhead_x = getScreenPointFromFrame(panel_effect_controls->zoom, Olive::ActiveSequence->playhead-visible_in) - x_scroll;
int playhead_x = getScreenPointFromFrame(panel_effect_controls->zoom, olive::ActiveSequence->playhead-visible_in) - x_scroll;
if (dragging && panel_timeline->snapped) {
p.setPen(Qt::white);
} else {
@@ -376,7 +376,7 @@ void KeyframeView::mouseMoveEvent(QMouseEvent* event) {
Clip* c = field->parent_row->parent_effect->parent_clip;
long key_time = old_key_vals.at(i) + frame_diff - c->clip_in + c->timeline_in;
long key_eval = key_time;
if (panel_timeline->snap_to_point(Olive::ActiveSequence->playhead, &key_eval)) {
if (panel_timeline->snap_to_point(olive::ActiveSequence->playhead, &key_eval)) {
frame_diff += (key_eval - key_time);
break;
}
@@ -425,7 +425,7 @@ void KeyframeView::mouseReleaseEvent(QMouseEvent*) {
selected_fields.at(i)->keyframes.at(selected_keyframes.at(i)).time
));
}
Olive::UndoStack.push(ca);
olive::UndoStack.push(ca);
}
select_rect = false;
+2 -2
View File
@@ -88,7 +88,7 @@ QString LabelSlider::valueToString() {
} else {
switch (display_type) {
case LABELSLIDER_FRAMENUMBER:
return frame_to_timecode(long(v), Olive::CurrentConfig.timecode_view, frame_rate);
return frame_to_timecode(long(v), olive::CurrentConfig.timecode_view, frame_rate);
case LABELSLIDER_PERCENT:
return QString::number((v*100), 'f', decimal_places).append("%");
case LABELSLIDER_DECIBEL:
@@ -274,7 +274,7 @@ void LabelSlider::mouseReleaseEvent(QMouseEvent*) {
if (s.isEmpty()) return;
// parse string timecode to a frame number
d = timecode_to_frame(s, Olive::CurrentConfig.timecode_view, frame_rate);
d = timecode_to_frame(s, olive::CurrentConfig.timecode_view, frame_rate);
} else {
+24 -24
View File
@@ -33,22 +33,22 @@
#include <QMessageBox>
#include <QInputDialog>
MenuHelper Olive::MenuHelper;
MenuHelper olive::MenuHelper;
void MenuHelper::make_new_menu(QMenu *parent) {
parent->addAction(tr("&Project"), Olive::Global.data(), SLOT(new_project()), QKeySequence("Ctrl+N"))->setProperty("id", "newproj");
parent->addAction(tr("&Project"), olive::Global.get(), SLOT(new_project()), QKeySequence("Ctrl+N"))->setProperty("id", "newproj");
parent->addSeparator();
parent->addAction(tr("&Sequence"), panel_project, SLOT(new_sequence()), QKeySequence("Ctrl+Shift+N"))->setProperty("id", "newseq");
parent->addAction(tr("&Folder"), panel_project, SLOT(new_folder()))->setProperty("id", "newfolder");
}
void MenuHelper::make_inout_menu(QMenu *parent) {
parent->addAction(tr("Set In Point"), &Olive::FocusFilter, SLOT(set_in_point()), QKeySequence("I"))->setProperty("id", "setinpoint");
parent->addAction(tr("Set Out Point"), &Olive::FocusFilter, SLOT(set_out_point()), QKeySequence("O"))->setProperty("id", "setoutpoint");
parent->addAction(tr("Set In Point"), &olive::FocusFilter, SLOT(set_in_point()), QKeySequence("I"))->setProperty("id", "setinpoint");
parent->addAction(tr("Set Out Point"), &olive::FocusFilter, SLOT(set_out_point()), QKeySequence("O"))->setProperty("id", "setoutpoint");
parent->addSeparator();
parent->addAction(tr("Reset In Point"), &Olive::FocusFilter, SLOT(clear_in()))->setProperty("id", "resetin");
parent->addAction(tr("Reset Out Point"), &Olive::FocusFilter, SLOT(clear_out()))->setProperty("id", "resetout");
parent->addAction(tr("Clear In/Out Point"), &Olive::FocusFilter, SLOT(clear_inout()), QKeySequence("G"))->setProperty("id", "clearinout");
parent->addAction(tr("Reset In Point"), &olive::FocusFilter, SLOT(clear_in()))->setProperty("id", "resetin");
parent->addAction(tr("Reset Out Point"), &olive::FocusFilter, SLOT(clear_out()))->setProperty("id", "resetout");
parent->addAction(tr("Clear In/Out Point"), &olive::FocusFilter, SLOT(clear_inout()), QKeySequence("G"))->setProperty("id", "clearinout");
}
void MenuHelper::make_clip_functions_menu(QMenu *parent) {
@@ -59,12 +59,12 @@ void MenuHelper::make_clip_functions_menu(QMenu *parent) {
}
void MenuHelper::make_edit_functions_menu(QMenu *parent) {
parent->addAction(tr("Cu&t"), &Olive::FocusFilter, SLOT(cut()), QKeySequence("Ctrl+X"))->setProperty("id", "cut");
parent->addAction(tr("Cop&y"), &Olive::FocusFilter, SLOT(copy()), QKeySequence("Ctrl+C"))->setProperty("id", "copy");
parent->addAction(tr("&Paste"), Olive::Global.data(), SLOT(paste()), QKeySequence("Ctrl+V"))->setProperty("id", "paste");
parent->addAction(tr("Paste Insert"), Olive::Global.data(), SLOT(paste_insert()), QKeySequence("Ctrl+Shift+V"))->setProperty("id", "pasteinsert");
parent->addAction(tr("Duplicate"), &Olive::FocusFilter, SLOT(duplicate()), QKeySequence("Ctrl+D"))->setProperty("id", "duplicate");
parent->addAction(tr("Delete"), &Olive::FocusFilter, SLOT(delete_function()), QKeySequence("Del"))->setProperty("id", "delete");
parent->addAction(tr("Cu&t"), &olive::FocusFilter, SLOT(cut()), QKeySequence("Ctrl+X"))->setProperty("id", "cut");
parent->addAction(tr("Cop&y"), &olive::FocusFilter, SLOT(copy()), QKeySequence("Ctrl+C"))->setProperty("id", "copy");
parent->addAction(tr("&Paste"), olive::Global.get(), SLOT(paste()), QKeySequence("Ctrl+V"))->setProperty("id", "paste");
parent->addAction(tr("Paste Insert"), olive::Global.get(), SLOT(paste_insert()), QKeySequence("Ctrl+Shift+V"))->setProperty("id", "pasteinsert");
parent->addAction(tr("Duplicate"), &olive::FocusFilter, SLOT(duplicate()), QKeySequence("Ctrl+D"))->setProperty("id", "duplicate");
parent->addAction(tr("Delete"), &olive::FocusFilter, SLOT(delete_function()), QKeySequence("Del"))->setProperty("id", "delete");
parent->addAction(tr("Ripple Delete"), panel_timeline, SLOT(ripple_delete()), QKeySequence("Shift+Del"))->setProperty("id", "rippledelete");
parent->addAction(tr("Split"), panel_timeline, SLOT(split_at_playhead()), QKeySequence("Ctrl+K"))->setProperty("id", "split");
}
@@ -100,23 +100,23 @@ void MenuHelper::set_titlesafe_from_menu() {
if (qIsNaN(tsa)) {
// disable title safe area
Olive::CurrentConfig.show_title_safe_area = false;
olive::CurrentConfig.show_title_safe_area = false;
} else {
// using title safe area
Olive::CurrentConfig.show_title_safe_area = true;
olive::CurrentConfig.show_title_safe_area = true;
// are we using the default area aspect ratio, or a specific one
if (qIsNull(tsa)) {
// default title safe area
Olive::CurrentConfig.use_custom_title_safe_ratio = false;
olive::CurrentConfig.use_custom_title_safe_ratio = false;
} else {
// using a specific aspect ratio
Olive::CurrentConfig.use_custom_title_safe_ratio = true;
olive::CurrentConfig.use_custom_title_safe_ratio = true;
if (tsa < 0.0) {
@@ -127,22 +127,22 @@ void MenuHelper::set_titlesafe_from_menu() {
do {
if (invalid) {
QMessageBox::critical(Olive::MainWindow, tr("Invalid aspect ratio"), tr("The aspect ratio '%1' is invalid. Please try again.").arg(input));
QMessageBox::critical(olive::MainWindow, tr("Invalid aspect ratio"), tr("The aspect ratio '%1' is invalid. Please try again.").arg(input));
}
input = QInputDialog::getText(Olive::MainWindow, tr("Enter custom aspect ratio"), tr("Enter the aspect ratio to use for the title/action safe area (e.g. 16:9):"));
input = QInputDialog::getText(olive::MainWindow, tr("Enter custom aspect ratio"), tr("Enter the aspect ratio to use for the title/action safe area (e.g. 16:9):"));
invalid = !arTest.exactMatch(input) && !input.isEmpty();
} while (invalid);
if (!input.isEmpty()) {
QStringList inputList = input.split(':');
Olive::CurrentConfig.custom_title_safe_ratio = inputList.at(0).toDouble()/inputList.at(1).toDouble();
olive::CurrentConfig.custom_title_safe_ratio = inputList.at(0).toDouble()/inputList.at(1).toDouble();
}
} else {
// specified tsa is a specific custom aspect ratio
Olive::CurrentConfig.custom_title_safe_ratio = tsa;
olive::CurrentConfig.custom_title_safe_ratio = tsa;
}
}
@@ -154,7 +154,7 @@ void MenuHelper::set_titlesafe_from_menu() {
void MenuHelper::set_autoscroll() {
QAction* action = static_cast<QAction*>(sender());
Olive::CurrentConfig.autoscroll = action->data().toInt();
olive::CurrentConfig.autoscroll = action->data().toInt();
}
void MenuHelper::menu_click_button() {
@@ -163,11 +163,11 @@ void MenuHelper::menu_click_button() {
void MenuHelper::set_timecode_view() {
QAction* action = static_cast<QAction*>(sender());
Olive::CurrentConfig.timecode_view = action->data().toInt();
olive::CurrentConfig.timecode_view = action->data().toInt();
update_ui(false);
}
void MenuHelper::open_recent_from_menu() {
int index = static_cast<QAction*>(sender())->data().toInt();
Olive::Global.data()->open_recent(index);
olive::Global.get()->open_recent(index);
}
+1 -1
View File
@@ -176,7 +176,7 @@ private slots:
};
namespace Olive {
namespace olive {
/**
* @brief A global MenuHelper object to assist menu creation throughout Olive.
*/
+3 -3
View File
@@ -112,7 +112,7 @@ void process_effect(Clip* c,
if (e->enable_coords) {
e->process_coords(timecode, coords, data);
}
bool can_process_shaders = (e->enable_shader && Olive::CurrentRuntimeConfig.shaders_are_enabled);
bool can_process_shaders = (e->enable_shader && olive::CurrentRuntimeConfig.shaders_are_enabled);
if (can_process_shaders || e->enable_superimpose) {
e->startEffect();
if (can_process_shaders && e->is_glsl_linked()) {
@@ -506,7 +506,7 @@ GLuint compose_sequence(ComposeSequenceParams &params) {
// copy front buffer to back buffer (only if we're using blending modes - which we usually will be)
if (!Olive::CurrentRuntimeConfig.disable_blending) {
if (!olive::CurrentRuntimeConfig.disable_blending) {
if (params.nests.size() > 0) {
draw_clip(params.ctx, params.nests.last()->fbo[2]->handle(), params.nests.last()->fbo[0]->texture(), true);
} else {
@@ -523,7 +523,7 @@ GLuint compose_sequence(ComposeSequenceParams &params) {
// bind front buffer as draw buffer
params.ctx->functions()->glBindFramebuffer(GL_DRAW_FRAMEBUFFER, final_fbo);
if (Olive::CurrentRuntimeConfig.disable_blending) {
if (olive::CurrentRuntimeConfig.disable_blending) {
// some GPUs don't like the blending shader, so we provide a pure GL fallback here
params.ctx->functions()->glBindTexture(GL_TEXTURE_2D, backend_tex_1);
+1 -1
View File
@@ -30,7 +30,7 @@
ScrollArea::ScrollArea(QWidget* parent) : QScrollArea(parent) {}
void ScrollArea::wheelEvent(QWheelEvent *e) {
if (Olive::CurrentConfig.scroll_zooms) {
if (olive::CurrentConfig.scroll_zooms) {
e->ignore();
if (e->angleDelta().y() > 0) {
+12 -12
View File
@@ -115,7 +115,7 @@ void TimelineHeader::set_in_point(long new_in) {
new_out = viewer->seq->getEndFrame();
}
Olive::UndoStack.push(new SetTimelineInOutCommand(viewer->seq, true, new_in, new_out));
olive::UndoStack.push(new SetTimelineInOutCommand(viewer->seq, true, new_in, new_out));
update_parents();
}
@@ -127,7 +127,7 @@ void TimelineHeader::set_out_point(long new_out) {
new_in = 0;
}
Olive::UndoStack.push(new SetTimelineInOutCommand(viewer->seq, true, new_in, new_out));
olive::UndoStack.push(new SetTimelineInOutCommand(viewer->seq, true, new_in, new_out));
update_parents();
}
@@ -280,7 +280,7 @@ void TimelineHeader::mouseReleaseEvent(QMouseEvent*) {
if (viewer->seq != nullptr) {
dragging = false;
if (resizing_workarea) {
Olive::UndoStack.push(new SetTimelineInOutCommand(viewer->seq, true, temp_workarea_in, temp_workarea_out));
olive::UndoStack.push(new SetTimelineInOutCommand(viewer->seq, true, temp_workarea_in, temp_workarea_out));
} else if (dragging_markers && selected_markers.size() > 0) {
bool moved = false;
ComboAction* ca = new ComboAction();
@@ -292,7 +292,7 @@ void TimelineHeader::mouseReleaseEvent(QMouseEvent*) {
}
}
if (moved) {
Olive::UndoStack.push(ca);
olive::UndoStack.push(ca);
} else {
delete ca;
}
@@ -330,7 +330,7 @@ void TimelineHeader::delete_markers() {
for (int i=0;i<selected_markers.size();i++) {
dma->markers.append(selected_markers.at(i));
}
Olive::UndoStack.push(dma);
olive::UndoStack.push(dma);
update_parents();
}
}
@@ -372,14 +372,14 @@ void TimelineHeader::paintEvent(QPaintEvent*) {
// draw text
bool draw_text = false;
if (text_enabled && lineX-textWidth > lastTextBoundary) {
timecode = frame_to_timecode(frame + in_visible, Olive::CurrentConfig.timecode_view, viewer->seq->frame_rate);
timecode = frame_to_timecode(frame + in_visible, olive::CurrentConfig.timecode_view, viewer->seq->frame_rate);
fullTextWidth = fm.width(timecode);
textWidth = fullTextWidth>>1;
text_x = lineX;
// centers the text to that point on the timeline, LEFT aligns it if not
if (Olive::CurrentConfig.center_timeline_timecodes) {
if (olive::CurrentConfig.center_timeline_timecodes) {
text_x -= textWidth;
} else {
text_x += TEXT_PADDING_FROM_LINE;
@@ -399,7 +399,7 @@ void TimelineHeader::paintEvent(QPaintEvent*) {
// draw line markers
p.setPen(Qt::gray);
p.drawLine(lineX, (!Olive::CurrentConfig.center_timeline_timecodes && draw_text) ? 0 : yoff, lineX, height());
p.drawLine(lineX, (!olive::CurrentConfig.center_timeline_timecodes && draw_text) ? 0 : yoff, lineX, height());
// draw sub-line markers
for (int j=1;j<sublineCount;j++) {
@@ -457,14 +457,14 @@ void TimelineHeader::paintEvent(QPaintEvent*) {
void TimelineHeader::show_context_menu(const QPoint &pos) {
QMenu menu(this);
Olive::MenuHelper.make_inout_menu(&menu);
olive::MenuHelper.make_inout_menu(&menu);
menu.addSeparator();
QAction* center_timecodes = menu.addAction(tr("Center Timecodes"), Olive::MainWindow, SLOT(toggle_bool_action()));
QAction* center_timecodes = menu.addAction(tr("Center Timecodes"), olive::MainWindow, SLOT(toggle_bool_action()));
center_timecodes->setCheckable(true);
center_timecodes->setChecked(Olive::CurrentConfig.center_timeline_timecodes);
center_timecodes->setData(reinterpret_cast<quintptr>(&Olive::CurrentConfig.center_timeline_timecodes));
center_timecodes->setChecked(olive::CurrentConfig.center_timeline_timecodes);
center_timecodes->setData(reinterpret_cast<quintptr>(&olive::CurrentConfig.center_timeline_timecodes));
menu.exec(mapToGlobal(pos));
}
+150 -150
View File
@@ -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;
}
+5 -5
View File
@@ -426,11 +426,11 @@ void ViewerWidget::draw_title_safe_area() {
double viewportAr = (double) width() / (double) height();
double halfAr = viewportAr*0.5;
if (Olive::CurrentConfig.use_custom_title_safe_ratio && Olive::CurrentConfig.custom_title_safe_ratio > 0) {
if (Olive::CurrentConfig.custom_title_safe_ratio > viewportAr) {
halfHeight = (Olive::CurrentConfig.custom_title_safe_ratio/viewportAr)*0.5;
if (olive::CurrentConfig.use_custom_title_safe_ratio && olive::CurrentConfig.custom_title_safe_ratio > 0) {
if (olive::CurrentConfig.custom_title_safe_ratio > viewportAr) {
halfHeight = (olive::CurrentConfig.custom_title_safe_ratio/viewportAr)*0.5;
} else {
halfWidth = (viewportAr/Olive::CurrentConfig.custom_title_safe_ratio)*0.5;
halfWidth = (viewportAr/olive::CurrentConfig.custom_title_safe_ratio)*0.5;
}
}
@@ -609,7 +609,7 @@ void ViewerWidget::paintGL() {
glBindTexture(GL_TEXTURE_2D, 0);
// draw title/action safe area
if (Olive::CurrentConfig.show_title_safe_area) {
if (olive::CurrentConfig.show_title_safe_area) {
draw_title_safe_area();
}