open_projects_;
/**
* @brief Currently active tool
@@ -522,6 +545,11 @@ private:
*/
static Core* instance_;
+ /**
+ * @brief Internal translator
+ */
+ QTranslator* translator_;
+
private slots:
void SaveAutorecovery();
@@ -530,7 +558,7 @@ private slots:
/**
* @brief Adds a project to the "open projects" list
*/
- void AddOpenProject(OLIVE_NAMESPACE::ProjectPtr p);
+ void AddOpenProject(olive::Project* p);
void AddOpenProjectFromTask(Task* task);
@@ -551,6 +579,6 @@ private slots:
};
-OLIVE_NAMESPACE_EXIT
+}
#endif // CORE_H
diff --git a/app/dialog/CMakeLists.txt b/app/dialog/CMakeLists.txt
index 61e5eada9..239e46b8f 100644
--- a/app/dialog/CMakeLists.txt
+++ b/app/dialog/CMakeLists.txt
@@ -1,5 +1,5 @@
# Olive - Non-Linear Video Editor
-# Copyright (C) 2019 Olive Team
+# Copyright (C) 2020 Olive Team
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/app/dialog/about/CMakeLists.txt b/app/dialog/about/CMakeLists.txt
index c4a932e77..61b668baa 100644
--- a/app/dialog/about/CMakeLists.txt
+++ b/app/dialog/about/CMakeLists.txt
@@ -1,5 +1,5 @@
# Olive - Non-Linear Video Editor
-# Copyright (C) 2019 Olive Team
+# Copyright (C) 2020 Olive Team
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/app/dialog/about/about.cpp b/app/dialog/about/about.cpp
index a37229a93..aa3f8f9be 100644
--- a/app/dialog/about/about.cpp
+++ b/app/dialog/about/about.cpp
@@ -1,7 +1,7 @@
/***
Olive - Non-Linear Video Editor
- Copyright (C) 2019 Olive Team
+ Copyright (C) 2020 Olive Team
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -25,7 +25,7 @@
#include
#include
-OLIVE_NAMESPACE_ENTER
+namespace olive {
AboutDialog::AboutDialog(QWidget *parent) :
QDialog(parent)
@@ -38,7 +38,7 @@ AboutDialog::AboutDialog(QWidget *parent) :
// Construct About text
QLabel* label =
new QLabel(QStringLiteral(""
- "
"
+ "
"
""
""
"https://www.olivevideoeditor.org/"
@@ -67,4 +67,4 @@ AboutDialog::AboutDialog(QWidget *parent) :
connect(buttons, &QDialogButtonBox::accepted, this, &QDialog::accept);
}
-OLIVE_NAMESPACE_EXIT
+}
diff --git a/app/dialog/about/about.h b/app/dialog/about/about.h
index c430d9ee7..53557ebec 100644
--- a/app/dialog/about/about.h
+++ b/app/dialog/about/about.h
@@ -1,7 +1,7 @@
/***
Olive - Non-Linear Video Editor
- Copyright (C) 2019 Olive Team
+ Copyright (C) 2020 Olive Team
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -25,7 +25,7 @@
#include "common/define.h"
-OLIVE_NAMESPACE_ENTER
+namespace olive {
/**
* @brief The AboutDialog class
@@ -49,6 +49,6 @@ public:
explicit AboutDialog(QWidget *parent = nullptr);
};
-OLIVE_NAMESPACE_EXIT
+}
#endif // ABOUTDIALOG_H
diff --git a/app/dialog/actionsearch/CMakeLists.txt b/app/dialog/actionsearch/CMakeLists.txt
index 16d7e7a68..2aa104524 100644
--- a/app/dialog/actionsearch/CMakeLists.txt
+++ b/app/dialog/actionsearch/CMakeLists.txt
@@ -1,5 +1,5 @@
# Olive - Non-Linear Video Editor
-# Copyright (C) 2019 Olive Team
+# Copyright (C) 2020 Olive Team
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/app/dialog/actionsearch/actionsearch.cpp b/app/dialog/actionsearch/actionsearch.cpp
index 57c1cd2dc..ac632f415 100644
--- a/app/dialog/actionsearch/actionsearch.cpp
+++ b/app/dialog/actionsearch/actionsearch.cpp
@@ -25,7 +25,7 @@
#include
#include
-OLIVE_NAMESPACE_ENTER
+namespace olive {
ActionSearch::ActionSearch(QWidget *parent) :
QDialog(parent),
@@ -254,4 +254,4 @@ void ActionSearchList::mouseDoubleClickEvent(QMouseEvent *) {
}
-OLIVE_NAMESPACE_EXIT
+}
diff --git a/app/dialog/actionsearch/actionsearch.h b/app/dialog/actionsearch/actionsearch.h
index 386a0cd07..ecb446955 100644
--- a/app/dialog/actionsearch/actionsearch.h
+++ b/app/dialog/actionsearch/actionsearch.h
@@ -29,7 +29,7 @@
#include "common/define.h"
-OLIVE_NAMESPACE_ENTER
+namespace olive {
class ActionSearchList;
@@ -182,6 +182,6 @@ signals:
void moveSelectionDown();
};
-OLIVE_NAMESPACE_EXIT
+}
#endif // ACTIONSEARCH_H
diff --git a/app/dialog/color/CMakeLists.txt b/app/dialog/color/CMakeLists.txt
index f36cd6b5d..a50056c0b 100644
--- a/app/dialog/color/CMakeLists.txt
+++ b/app/dialog/color/CMakeLists.txt
@@ -1,5 +1,5 @@
# Olive - Non-Linear Video Editor
-# Copyright (C) 2019 Olive Team
+# Copyright (C) 2020 Olive Team
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/app/dialog/color/colordialog.cpp b/app/dialog/color/colordialog.cpp
index e578cfdd2..e838ce982 100644
--- a/app/dialog/color/colordialog.cpp
+++ b/app/dialog/color/colordialog.cpp
@@ -1,7 +1,7 @@
/***
Olive - Non-Linear Video Editor
- Copyright (C) 2019 Olive Team
+ Copyright (C) 2020 Olive Team
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -26,7 +26,7 @@
#include "common/qtutils.h"
-OLIVE_NAMESPACE_ENTER
+namespace olive {
ColorDialog::ColorDialog(ColorManager* color_manager, const ManagedColor& start, QWidget *parent) :
QDialog(parent),
@@ -48,7 +48,7 @@ ColorDialog::ColorDialog(ColorManager* color_manager, const ManagedColor& start,
wheel_layout->addWidget(color_wheel_);
hsv_value_gradient_ = new ColorGradientWidget(Qt::Vertical);
- hsv_value_gradient_->setFixedWidth(QFontMetricsWidth(fontMetrics(), QStringLiteral("HHH")));
+ hsv_value_gradient_->setFixedWidth(QtUtils::QFontMetricsWidth(fontMetrics(), QStringLiteral("HHH")));
wheel_layout->addWidget(hsv_value_gradient_);
QWidget* value_area = new QWidget();
@@ -160,4 +160,4 @@ void ColorDialog::ColorSpaceChanged(const QString &input, const ColorTransform &
color_values_widget_->SetColorProcessor(input_to_ref_processor_, ref_to_display, nullptr, ref_to_input);
}
-OLIVE_NAMESPACE_EXIT
+}
diff --git a/app/dialog/color/colordialog.h b/app/dialog/color/colordialog.h
index 356924c5b..ccba97c18 100644
--- a/app/dialog/color/colordialog.h
+++ b/app/dialog/color/colordialog.h
@@ -1,7 +1,7 @@
/***
Olive - Non-Linear Video Editor
- Copyright (C) 2019 Olive Team
+ Copyright (C) 2020 Olive Team
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -31,7 +31,7 @@
#include "widget/colorwheel/colorvalueswidget.h"
#include "widget/colorwheel/colorwheelwidget.h"
-OLIVE_NAMESPACE_ENTER
+namespace olive {
class ColorDialog : public QDialog
{
@@ -87,6 +87,6 @@ private slots:
};
-OLIVE_NAMESPACE_EXIT
+}
#endif // COLORDIALOG_H
diff --git a/app/dialog/crashhandler/crashhandler.cpp b/app/dialog/crashhandler/crashhandler.cpp
index 2b21293f9..61f8c276b 100644
--- a/app/dialog/crashhandler/crashhandler.cpp
+++ b/app/dialog/crashhandler/crashhandler.cpp
@@ -1,7 +1,7 @@
/***
Olive - Non-Linear Video Editor
- Copyright (C) 2019 Olive Team
+ Copyright (C) 2020 Olive Team
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -36,7 +36,7 @@
#include "common/crashpadutils.h"
-OLIVE_NAMESPACE_ENTER
+namespace olive {
CrashHandlerDialog::CrashHandlerDialog(const char *report_dir, const char* crash_time)
{
@@ -208,4 +208,4 @@ void CrashHandlerDialog::SendErrorReport()
manager->post(request, multipart);
}
-OLIVE_NAMESPACE_EXIT
+}
diff --git a/app/dialog/crashhandler/crashhandler.h b/app/dialog/crashhandler/crashhandler.h
index 7ec91669b..f93be9dfa 100644
--- a/app/dialog/crashhandler/crashhandler.h
+++ b/app/dialog/crashhandler/crashhandler.h
@@ -1,7 +1,7 @@
/***
Olive - Non-Linear Video Editor
- Copyright (C) 2019 Olive Team
+ Copyright (C) 2020 Olive Team
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -30,7 +30,7 @@
#include "common/define.h"
-OLIVE_NAMESPACE_ENTER
+namespace olive {
class CrashHandlerDialog : public QDialog
{
@@ -72,6 +72,6 @@ private slots:
};
-OLIVE_NAMESPACE_EXIT
+}
#endif // CRASHHANDLERDIALOG_H
diff --git a/app/dialog/crashhandler/crashhandlermain.cpp b/app/dialog/crashhandler/crashhandlermain.cpp
index d0fe76368..7142fc244 100644
--- a/app/dialog/crashhandler/crashhandlermain.cpp
+++ b/app/dialog/crashhandler/crashhandlermain.cpp
@@ -1,7 +1,7 @@
/***
Olive - Non-Linear Video Editor
- Copyright (C) 2019 Olive Team
+ Copyright (C) 2020 Olive Team
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -30,7 +30,7 @@ int main(int argc, char *argv[])
QApplication a(argc, argv);
- OLIVE_NAMESPACE::CrashHandlerDialog chd(argv[1], argv[2]);
+ olive::CrashHandlerDialog chd(argv[1], argv[2]);
chd.open();
return a.exec();
diff --git a/app/dialog/diskcache/CMakeLists.txt b/app/dialog/diskcache/CMakeLists.txt
index 6ca59d549..077c712ca 100644
--- a/app/dialog/diskcache/CMakeLists.txt
+++ b/app/dialog/diskcache/CMakeLists.txt
@@ -1,5 +1,5 @@
# Olive - Non-Linear Video Editor
-# Copyright (C) 2019 Olive Team
+# Copyright (C) 2020 Olive Team
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/app/dialog/diskcache/diskcachedialog.cpp b/app/dialog/diskcache/diskcachedialog.cpp
index 6e542b7c3..3e8831f49 100644
--- a/app/dialog/diskcache/diskcachedialog.cpp
+++ b/app/dialog/diskcache/diskcachedialog.cpp
@@ -1,7 +1,7 @@
/***
Olive - Non-Linear Video Editor
- Copyright (C) 2019 Olive Team
+ Copyright (C) 2020 Olive Team
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -27,7 +27,7 @@
#include "config/config.h"
-OLIVE_NAMESPACE_ENTER
+namespace olive {
DiskCacheDialog::DiskCacheDialog(DiskCacheFolder *folder, QWidget* parent) :
QDialog(parent),
@@ -104,4 +104,4 @@ void DiskCacheDialog::ClearDiskCache()
}
}
-OLIVE_NAMESPACE_EXIT
+}
diff --git a/app/dialog/diskcache/diskcachedialog.h b/app/dialog/diskcache/diskcachedialog.h
index 69c3a20f3..b1ea61395 100644
--- a/app/dialog/diskcache/diskcachedialog.h
+++ b/app/dialog/diskcache/diskcachedialog.h
@@ -1,7 +1,7 @@
/***
Olive - Non-Linear Video Editor
- Copyright (C) 2019 Olive Team
+ Copyright (C) 2020 Olive Team
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -28,7 +28,7 @@
#include "render/diskmanager.h"
#include "widget/slider/floatslider.h"
-OLIVE_NAMESPACE_ENTER
+namespace olive {
class DiskCacheDialog : public QDialog
{
@@ -53,6 +53,6 @@ private slots:
};
-OLIVE_NAMESPACE_EXIT
+}
#endif // DISKCACHEDIALOG_H
diff --git a/app/dialog/export/CMakeLists.txt b/app/dialog/export/CMakeLists.txt
index ef122e43d..e13b45686 100644
--- a/app/dialog/export/CMakeLists.txt
+++ b/app/dialog/export/CMakeLists.txt
@@ -1,5 +1,5 @@
# Olive - Non-Linear Video Editor
-# Copyright (C) 2019 Olive Team
+# Copyright (C) 2020 Olive Team
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/app/dialog/export/codec/CMakeLists.txt b/app/dialog/export/codec/CMakeLists.txt
index cb8d22213..b7ccf6c22 100644
--- a/app/dialog/export/codec/CMakeLists.txt
+++ b/app/dialog/export/codec/CMakeLists.txt
@@ -1,5 +1,5 @@
# Olive - Non-Linear Video Editor
-# Copyright (C) 2019 Olive Team
+# Copyright (C) 2020 Olive Team
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/app/dialog/export/codec/codecsection.cpp b/app/dialog/export/codec/codecsection.cpp
index 309facaba..9847bb697 100644
--- a/app/dialog/export/codec/codecsection.cpp
+++ b/app/dialog/export/codec/codecsection.cpp
@@ -1,7 +1,7 @@
/***
Olive - Non-Linear Video Editor
- Copyright (C) 2019 Olive Team
+ Copyright (C) 2020 Olive Team
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -20,11 +20,11 @@
#include "codecsection.h"
-OLIVE_NAMESPACE_ENTER
+namespace olive {
CodecSection::CodecSection(QWidget *parent) :
QWidget(parent)
{
}
-OLIVE_NAMESPACE_EXIT
+}
diff --git a/app/dialog/export/codec/codecsection.h b/app/dialog/export/codec/codecsection.h
index e187b0df7..82f70b69e 100644
--- a/app/dialog/export/codec/codecsection.h
+++ b/app/dialog/export/codec/codecsection.h
@@ -1,7 +1,7 @@
/***
Olive - Non-Linear Video Editor
- Copyright (C) 2019 Olive Team
+ Copyright (C) 2020 Olive Team
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -25,10 +25,11 @@
#include "codec/encoder.h"
-OLIVE_NAMESPACE_ENTER
+namespace olive {
class CodecSection : public QWidget
{
+ Q_OBJECT
public:
CodecSection(QWidget* parent = nullptr);
@@ -36,6 +37,6 @@ public:
};
-OLIVE_NAMESPACE_EXIT
+}
#endif // CODECSECTION_H
diff --git a/app/dialog/export/codec/h264section.cpp b/app/dialog/export/codec/h264section.cpp
index e0e50fb55..ac4dcda78 100644
--- a/app/dialog/export/codec/h264section.cpp
+++ b/app/dialog/export/codec/h264section.cpp
@@ -1,7 +1,7 @@
/***
Olive - Non-Linear Video Editor
- Copyright (C) 2019 Olive Team
+ Copyright (C) 2020 Olive Team
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -28,7 +28,7 @@
#include "common/qtutils.h"
#include "widget/slider/integerslider.h"
-OLIVE_NAMESPACE_ENTER
+namespace olive {
H264Section::H264Section(QWidget *parent) :
CodecSection(parent)
@@ -117,7 +117,7 @@ H264CRFSection::H264CRFSection(QWidget *parent) :
layout->addWidget(crf_slider_);
IntegerSlider* crf_input = new IntegerSlider();
- crf_input->setMaximumWidth(QFontMetricsWidth(crf_input->fontMetrics(), QStringLiteral("HHHH")));
+ crf_input->setMaximumWidth(QtUtils::QFontMetricsWidth(crf_input->fontMetrics(), QStringLiteral("HHHH")));
crf_input->SetMinimum(kMinimumCRF);
crf_input->SetMaximum(kMaximumCRF);
crf_input->SetValue(kDefaultCRF);
@@ -208,4 +208,4 @@ int64_t H264FileSizeSection::GetFileSize() const
return qRound64(file_size_->GetValue() * 1024.0 * 1024.0 * 8.0);
}
-OLIVE_NAMESPACE_EXIT
+}
diff --git a/app/dialog/export/codec/h264section.h b/app/dialog/export/codec/h264section.h
index 6e85e632a..f00e9cb17 100644
--- a/app/dialog/export/codec/h264section.h
+++ b/app/dialog/export/codec/h264section.h
@@ -1,7 +1,7 @@
/***
Olive - Non-Linear Video Editor
- Copyright (C) 2019 Olive Team
+ Copyright (C) 2020 Olive Team
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -27,10 +27,11 @@
#include "codecsection.h"
#include "widget/slider/floatslider.h"
-OLIVE_NAMESPACE_ENTER
+namespace olive {
class H264CRFSection : public QWidget
{
+ Q_OBJECT
public:
H264CRFSection(QWidget* parent = nullptr);
@@ -49,6 +50,7 @@ private:
class H264BitRateSection : public QWidget
{
+ Q_OBJECT
public:
H264BitRateSection(QWidget* parent = nullptr);
@@ -71,6 +73,7 @@ private:
class H264FileSizeSection : public QWidget
{
+ Q_OBJECT
public:
H264FileSizeSection(QWidget* parent = nullptr);
@@ -86,6 +89,7 @@ private:
class H264Section : public CodecSection
{
+ Q_OBJECT
public:
enum CompressionMethod {
kConstantRateFactor,
@@ -108,6 +112,6 @@ private:
};
-OLIVE_NAMESPACE_EXIT
+}
#endif // H264SECTION_H
diff --git a/app/dialog/export/codec/imagesection.cpp b/app/dialog/export/codec/imagesection.cpp
index 8b373796e..611a99504 100644
--- a/app/dialog/export/codec/imagesection.cpp
+++ b/app/dialog/export/codec/imagesection.cpp
@@ -1,7 +1,7 @@
/***
Olive - Non-Linear Video Editor
- Copyright (C) 2019 Olive Team
+ Copyright (C) 2020 Olive Team
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -23,7 +23,7 @@
#include
#include
-OLIVE_NAMESPACE_ENTER
+namespace olive {
ImageSection::ImageSection(QWidget* parent) :
CodecSection(parent)
@@ -44,4 +44,4 @@ QCheckBox *ImageSection::image_sequence_checkbox() const
return image_sequence_checkbox_;
}
-OLIVE_NAMESPACE_EXIT
+}
diff --git a/app/dialog/export/codec/imagesection.h b/app/dialog/export/codec/imagesection.h
index a40d4dd8a..d21f782a2 100644
--- a/app/dialog/export/codec/imagesection.h
+++ b/app/dialog/export/codec/imagesection.h
@@ -1,7 +1,7 @@
/***
Olive - Non-Linear Video Editor
- Copyright (C) 2019 Olive Team
+ Copyright (C) 2020 Olive Team
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -25,10 +25,11 @@
#include "codecsection.h"
-OLIVE_NAMESPACE_ENTER
+namespace olive {
class ImageSection : public CodecSection
{
+ Q_OBJECT
public:
ImageSection(QWidget* parent = nullptr);
@@ -39,6 +40,6 @@ private:
};
-OLIVE_NAMESPACE_EXIT
+}
#endif // IMAGESECTION_H
diff --git a/app/dialog/export/export.cpp b/app/dialog/export/export.cpp
index 2d3250be9..54fece4e8 100644
--- a/app/dialog/export/export.cpp
+++ b/app/dialog/export/export.cpp
@@ -1,7 +1,7 @@
/***
Olive - Non-Linear Video Editor
- Copyright (C) 2019 Olive Team
+ Copyright (C) 2020 Olive Team
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -30,18 +30,19 @@
#include
#include
+#include "common/qtutils.h"
#include "core.h"
#include "dialog/task/task.h"
#include "project/item/sequence/sequence.h"
#include "project/project.h"
-#include "render/pixelformat.h"
#include "ui/icons/icons.h"
-OLIVE_NAMESPACE_ENTER
+namespace olive {
-ExportDialog::ExportDialog(ViewerOutput *viewer_node, QWidget *parent) :
+ExportDialog::ExportDialog(ViewerOutput *viewer_node, TimelinePoints *points, QWidget *parent) :
QDialog(parent),
- viewer_node_(viewer_node)
+ viewer_node_(viewer_node),
+ points_(points)
{
QHBoxLayout* layout = new QHBoxLayout(this);
@@ -95,10 +96,23 @@ ExportDialog::ExportDialog(ViewerOutput *viewer_node, QWidget *parent) :
row++;
- QFrame* horizontal_line = new QFrame();
- horizontal_line->setFrameShape(QFrame::HLine);
- horizontal_line->setFrameShadow(QFrame::Sunken);
- preferences_layout->addWidget(horizontal_line, row, 0, 1, 4);
+ preferences_layout->addWidget(QtUtils::CreateHorizontalLine(), row, 0, 1, 4);
+
+ row++;
+
+ preferences_layout->addWidget(new QLabel(tr("Range:")), row, 0);
+
+ range_combobox_ = new QComboBox();
+ range_combobox_->addItem(tr("Entire Sequence"));
+ range_combobox_->addItem(tr("In to Out"));
+ if (!points_) {
+ range_combobox_->setEnabled(false);
+ }
+ preferences_layout->addWidget(range_combobox_, row, 1, 1, 3);
+
+ row++;
+
+ preferences_layout->addWidget(QtUtils::CreateHorizontalLine(), row, 0, 1, 4);
row++;
@@ -156,6 +170,9 @@ ExportDialog::ExportDialog(ViewerOutput *viewer_node, QWidget *parent) :
preview_layout->addWidget(preview_viewer_);
splitter->addWidget(preview_area);
+ // Prioritize preview area
+ splitter->setSizes({1, 99999});
+
// Set default filename
SetDefaultFilename();
@@ -179,6 +196,7 @@ ExportDialog::ExportDialog(ViewerOutput *viewer_node, QWidget *parent) :
video_tab_->height_slider()->SetDefaultValue(viewer_node_->video_params().height());
video_tab_->frame_rate_combobox()->SetFrameRate(viewer_node_->video_params().time_base().flipped());
video_tab_->pixel_aspect_combobox()->SetPixelAspectRatio(viewer_node_->video_params().pixel_aspect_ratio());
+ video_tab_->pixel_format_field()->SetPixelFormat(static_cast(Config::Current()["OnlinePixelFormat"].toInt()));
video_tab_->interlaced_combobox()->SetInterlaceMode(viewer_node_->video_params().interlacing());
audio_tab_->sample_rate_combobox()->SetSampleRate(viewer_node_->audio_params().sample_rate());
audio_tab_->channel_layout_combobox()->SetChannelLayout(viewer_node_->audio_params().channel_layout());
@@ -212,6 +230,7 @@ ExportDialog::ExportDialog(ViewerOutput *viewer_node, QWidget *parent) :
// Set viewer to view the node
preview_viewer_->ConnectViewerNode(viewer_node_);
+ preview_viewer_->ruler()->ConnectTimelinePoints(points_);
preview_viewer_->SetColorMenuEnabled(false);
preview_viewer_->SetColorTransform(video_tab_->CurrentOCIOColorSpace());
}
@@ -232,27 +251,28 @@ void ExportDialog::StartExport()
// Validate if the entered filename contains the correct extension (the extension is necessary
// for both FFmpeg and OIIO to determine the output format)
QString necessary_ext = QStringLiteral(".%1").arg(ExportFormat::GetExtension(static_cast(format_combobox_->currentIndex())));
+ QString proposed_filename = filename_edit_->text().trimmed();
// If it doesn't, see if the user wants to append it automatically. If not, we don't abort the export.
- if (!filename_edit_->text().endsWith(necessary_ext, Qt::CaseInsensitive)) {
+ if (!proposed_filename.endsWith(necessary_ext, Qt::CaseInsensitive)) {
QMessageBox b(this);
b.setIcon(QMessageBox::Warning);
b.setWindowModality(Qt::WindowModal);
b.setWindowTitle(tr("Invalid filename"));
- b.setText(tr("The filename must contain the extension \".%1\". Would you like to append it "
- "automatically?"));
+ b.setText(tr("The filename must contain the extension \"%1\". Would you like to append it "
+ "automatically?").arg(necessary_ext));
b.addButton(QMessageBox::Yes);
b.addButton(QMessageBox::No);
if (b.exec() == QMessageBox::Yes) {
- filename_edit_->setText(filename_edit_->text().append(necessary_ext));
+ filename_edit_->setText(proposed_filename.append(necessary_ext));
} else {
return;
}
}
// Validate the intended path
- QFileInfo file_info(filename_edit_->text());
+ QFileInfo file_info(proposed_filename);
QFileInfo dir_info(file_info.path());
// If the directory does not exist, try to create it
@@ -275,7 +295,7 @@ void ExportDialog::StartExport()
b.setWindowModality(Qt::WindowModal);
b.setWindowTitle(tr("Confirm Overwrite"));
b.setText(tr("The file \"%1\" already exists. Do you want to overwrite it?")
- .arg(filename_edit_->text()));
+ .arg(proposed_filename));
b.addButton(QMessageBox::Yes);
b.addButton(QMessageBox::No);
@@ -285,25 +305,36 @@ void ExportDialog::StartExport()
}
// Validate video resolution
- if (video_enabled_->isChecked()) {
- if (video_tab_->width_slider()->GetValue() % 2 != 0
- || video_tab_->height_slider()->GetValue() % 2 != 0) {
- QMessageBox b(this);
- b.setIcon(QMessageBox::Critical);
- b.setWindowModality(Qt::WindowModal);
- b.setWindowTitle(tr("Invalid parameters"));
- b.setText(tr("Width and height must be multiples of 2."));
- b.exec();
- return;
- }
+ if (video_enabled_->isChecked()
+ && video_tab_->GetSelectedCodec() == ExportCodec::kCodecH264
+ && (video_tab_->width_slider()->GetValue()%2 != 0 || video_tab_->height_slider()->GetValue()%2 != 0)) {
+ QMessageBox b(this);
+ b.setIcon(QMessageBox::Critical);
+ b.setWindowModality(Qt::WindowModal);
+ b.setWindowTitle(tr("Invalid Parameters"));
+ b.setText(tr("Width and height must be multiples of 2."));
+ b.exec();
+ return;
}
ExportTask* task = new ExportTask(viewer_node_, color_manager_, GenerateParams());
TaskDialog* td = new TaskDialog(task, tr("Export"), this);
- connect(td, &TaskDialog::TaskSucceeded, this, &QDialog::accept);
+ connect(td, &TaskDialog::TaskSucceeded, this, &ExportDialog::ExportFinished);
td->open();
}
+void ExportDialog::ExportFinished()
+{
+ TaskDialog* td = static_cast(sender());
+
+ if (td->GetTask()->IsCancelled()) {
+ // If this task was cancelled, we stay open so the user can potentially queue another export
+ } else {
+ // Accept this dialog and close
+ this->accept();
+ }
+}
+
void ExportDialog::closeEvent(QCloseEvent *e)
{
preview_viewer_->ConnectViewerNode(nullptr);
@@ -317,7 +348,7 @@ void ExportDialog::BrowseFilename()
QString browsed_fn = QFileDialog::getSaveFileName(this,
"",
- filename_edit_->text(),
+ filename_edit_->text().trimmed(),
QStringLiteral("%1 (*.%2)").arg(ExportFormat::GetName(f), ExportFormat::GetExtension(f)),
nullptr,
@@ -331,7 +362,7 @@ void ExportDialog::BrowseFilename()
void ExportDialog::FormatChanged(int index)
{
- QString current_filename = filename_edit_->text();
+ QString current_filename = filename_edit_->text().trimmed();
QString previously_selected_ext = ExportFormat::GetExtension(previously_selected_format_);
ExportFormat::Format current_format = static_cast(index);
QString currently_selected_ext = ExportFormat::GetExtension(current_format);
@@ -373,7 +404,7 @@ void ExportDialog::ResolutionChanged()
new_width *= video_aspect_ratio_;
// Align to even number and set
- video_tab_->width_slider()->SetValue(AlignEvenNumber(new_width));
+ video_tab_->width_slider()->SetValue(new_width);
} else {
@@ -384,7 +415,7 @@ void ExportDialog::ResolutionChanged()
new_height /= video_aspect_ratio_;
// Align to even number and set
- video_tab_->height_slider()->SetValue(AlignEvenNumber(new_height));
+ video_tab_->height_slider()->SetValue(new_height);
}
}
@@ -414,29 +445,31 @@ void ExportDialog::SetDefaultFilename()
filename_edit_->setText(file_location);
}
-int ExportDialog::AlignEvenNumber(double d)
-{
- return qCeil(d * 0.5) * 2;
-}
-
ExportParams ExportDialog::GenerateParams() const
{
VideoParams video_render_params(static_cast(video_tab_->width_slider()->GetValue()),
static_cast(video_tab_->height_slider()->GetValue()),
video_tab_->frame_rate_combobox()->GetFrameRate().flipped(),
- PixelFormat::instance()->GetConfiguredFormatForMode(RenderMode::kOnline),
+ video_tab_->pixel_format_field()->GetPixelFormat(),
+ VideoParams::kInternalChannelCount,
video_tab_->pixel_aspect_combobox()->GetPixelAspectRatio(),
video_tab_->interlaced_combobox()->GetInterlaceMode(),
1);
AudioParams audio_render_params(audio_tab_->sample_rate_combobox()->currentData().toInt(),
audio_tab_->channel_layout_combobox()->GetChannelLayout(),
- SampleFormat::kInternalFormat);
+ AudioParams::kInternalFormat);
ExportParams params;
- params.SetFilename(filename_edit_->text());
+ params.SetFilename(filename_edit_->text().trimmed());
params.SetExportLength(viewer_node_->GetLength());
+ if (range_combobox_->currentIndex() == kRangeInToOut
+ && points_
+ && points_->workarea()->enabled()) {
+ params.set_custom_range(points_->workarea()->range());
+ }
+
if (video_tab_->scaling_method_combobox()->isEnabled()) {
params.set_video_scaling_method(static_cast(video_tab_->scaling_method_combobox()->currentData().toInt()));
}
@@ -477,4 +510,4 @@ void ExportDialog::UpdateViewerDimensions()
preview_viewer_->SetMatrix(transform);
}
-OLIVE_NAMESPACE_EXIT
+}
diff --git a/app/dialog/export/export.h b/app/dialog/export/export.h
index 8313e59cf..37144b6b3 100644
--- a/app/dialog/export/export.h
+++ b/app/dialog/export/export.h
@@ -1,7 +1,7 @@
/***
Olive - Non-Linear Video Editor
- Copyright (C) 2019 Olive Team
+ Copyright (C) 2020 Olive Team
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -34,13 +34,13 @@
#include "task/export/export.h"
#include "widget/viewer/viewer.h"
-OLIVE_NAMESPACE_ENTER
+namespace olive {
class ExportDialog : public QDialog
{
Q_OBJECT
public:
- ExportDialog(ViewerOutput* viewer_node, QWidget* parent = nullptr);
+ ExportDialog(ViewerOutput* viewer_node, TimelinePoints* points = nullptr, QWidget* parent = nullptr);
protected:
virtual void closeEvent(QCloseEvent *e) override;
@@ -49,14 +49,20 @@ private:
void LoadPresets();
void SetDefaultFilename();
- static int AlignEvenNumber(double d);
-
ExportParams GenerateParams() const;
ViewerOutput* viewer_node_;
+ TimelinePoints* points_;
ExportFormat::Format previously_selected_format_;
+ enum RangeSelection {
+ kRangeEntireSequence,
+ kRangeInToOut
+ };
+
+ QComboBox* range_combobox_;
+
QCheckBox* video_enabled_;
QCheckBox* audio_enabled_;
@@ -85,8 +91,10 @@ private slots:
void StartExport();
+ void ExportFinished();
+
};
-OLIVE_NAMESPACE_EXIT
+}
#endif // EXPORTDIALOG_H
diff --git a/app/dialog/export/exportadvancedvideodialog.cpp b/app/dialog/export/exportadvancedvideodialog.cpp
index f4fc6b6e6..9e38969fb 100644
--- a/app/dialog/export/exportadvancedvideodialog.cpp
+++ b/app/dialog/export/exportadvancedvideodialog.cpp
@@ -5,7 +5,7 @@
#include
#include
-OLIVE_NAMESPACE_ENTER
+namespace olive {
ExportAdvancedVideoDialog::ExportAdvancedVideoDialog(const QList &pix_fmts, QWidget *parent) :
QDialog(parent)
@@ -59,4 +59,4 @@ ExportAdvancedVideoDialog::ExportAdvancedVideoDialog(const QList &pix_f
layout->addWidget(buttons);
}
-OLIVE_NAMESPACE_EXIT
+}
diff --git a/app/dialog/export/exportadvancedvideodialog.h b/app/dialog/export/exportadvancedvideodialog.h
index bdadbbebe..275ae44f9 100644
--- a/app/dialog/export/exportadvancedvideodialog.h
+++ b/app/dialog/export/exportadvancedvideodialog.h
@@ -6,7 +6,7 @@
#include "widget/slider/integerslider.h"
-OLIVE_NAMESPACE_ENTER
+namespace olive {
class ExportAdvancedVideoDialog : public QDialog
{
@@ -42,6 +42,6 @@ private:
};
-OLIVE_NAMESPACE_EXIT
+}
#endif // EXPORTADVANCEDVIDEODIALOG_H
diff --git a/app/dialog/export/exportaudiotab.cpp b/app/dialog/export/exportaudiotab.cpp
index c6f4ae003..781183c19 100644
--- a/app/dialog/export/exportaudiotab.cpp
+++ b/app/dialog/export/exportaudiotab.cpp
@@ -1,7 +1,7 @@
/***
Olive - Non-Linear Video Editor
- Copyright (C) 2019 Olive Team
+ Copyright (C) 2020 Olive Team
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -25,7 +25,7 @@
#include "core.h"
-OLIVE_NAMESPACE_ENTER
+namespace olive {
ExportAudioTab::ExportAudioTab(QWidget* parent) :
QWidget(parent)
@@ -64,4 +64,4 @@ ExportAudioTab::ExportAudioTab(QWidget* parent) :
outer_layout->addStretch();
}
-OLIVE_NAMESPACE_EXIT
+}
diff --git a/app/dialog/export/exportaudiotab.h b/app/dialog/export/exportaudiotab.h
index 924d0b655..5ef06d2a2 100644
--- a/app/dialog/export/exportaudiotab.h
+++ b/app/dialog/export/exportaudiotab.h
@@ -1,7 +1,7 @@
/***
Olive - Non-Linear Video Editor
- Copyright (C) 2019 Olive Team
+ Copyright (C) 2020 Olive Team
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -27,10 +27,11 @@
#include "common/define.h"
#include "widget/standardcombos/standardcombos.h"
-OLIVE_NAMESPACE_ENTER
+namespace olive {
class ExportAudioTab : public QWidget
{
+ Q_OBJECT
public:
ExportAudioTab(QWidget* parent = nullptr);
@@ -56,6 +57,6 @@ private:
};
-OLIVE_NAMESPACE_EXIT
+}
#endif // EXPORTAUDIOTAB_H
diff --git a/app/dialog/export/exportvideotab.cpp b/app/dialog/export/exportvideotab.cpp
index 9d62c360f..d37f61389 100644
--- a/app/dialog/export/exportvideotab.cpp
+++ b/app/dialog/export/exportvideotab.cpp
@@ -1,7 +1,7 @@
/***
Olive - Non-Linear Video Editor
- Copyright (C) 2019 Olive Team
+ Copyright (C) 2020 Olive Team
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -31,7 +31,7 @@
#include "render/colormanager.h"
#include "task/export/exportparams.h"
-OLIVE_NAMESPACE_ENTER
+namespace olive {
ExportVideoTab::ExportVideoTab(ColorManager* color_manager, QWidget *parent) :
QWidget(parent),
@@ -115,6 +115,13 @@ QWidget* ExportVideoTab::SetupResolutionSection()
interlaced_combobox_ = new InterlacedComboBox();
layout->addWidget(interlaced_combobox_, row, 1);
+ row++;
+
+ layout->addWidget(new QLabel(tr("Quality:")), row, 0);
+
+ pixel_format_field_ = new PixelFormatComboBox(true);
+ layout->addWidget(pixel_format_field_, row, 1);
+
return resolution_group;
}
@@ -199,4 +206,4 @@ void ExportVideoTab::VideoCodecChanged()
qDebug() << "Set default pix fmt" << pix_fmt_;
}
-OLIVE_NAMESPACE_EXIT
+}
diff --git a/app/dialog/export/exportvideotab.h b/app/dialog/export/exportvideotab.h
index fe35d884b..feed9eb78 100644
--- a/app/dialog/export/exportvideotab.h
+++ b/app/dialog/export/exportvideotab.h
@@ -1,7 +1,7 @@
/***
Olive - Non-Linear Video Editor
- Copyright (C) 2019 Olive Team
+ Copyright (C) 2020 Olive Team
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -33,7 +33,7 @@
#include "widget/slider/integerslider.h"
#include "widget/standardcombos/standardcombos.h"
-OLIVE_NAMESPACE_ENTER
+namespace olive {
class ExportVideoTab : public QWidget
{
@@ -111,6 +111,11 @@ public:
return pixel_aspect_combobox_;
}
+ PixelFormatComboBox* pixel_format_field() const
+ {
+ return pixel_format_field_;
+ }
+
const int& threads() const
{
return threads_;
@@ -149,6 +154,7 @@ private:
InterlacedComboBox* interlaced_combobox_;
PixelAspectRatioComboBox* pixel_aspect_combobox_;
+ PixelFormatComboBox* pixel_format_field_;
int threads_;
@@ -161,6 +167,6 @@ private slots:
};
-OLIVE_NAMESPACE_EXIT
+}
#endif // EXPORTVIDEOTAB_H
diff --git a/app/dialog/footageproperties/CMakeLists.txt b/app/dialog/footageproperties/CMakeLists.txt
index 84282a556..0a3d6a7e2 100644
--- a/app/dialog/footageproperties/CMakeLists.txt
+++ b/app/dialog/footageproperties/CMakeLists.txt
@@ -1,5 +1,5 @@
# Olive - Non-Linear Video Editor
-# Copyright (C) 2019 Olive Team
+# Copyright (C) 2020 Olive Team
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/app/dialog/footageproperties/footageproperties.cpp b/app/dialog/footageproperties/footageproperties.cpp
index d1dbd0fe7..e08da2564 100644
--- a/app/dialog/footageproperties/footageproperties.cpp
+++ b/app/dialog/footageproperties/footageproperties.cpp
@@ -1,7 +1,7 @@
/***
Olive - Non-Linear Video Editor
- Copyright (C) 2019 Olive Team
+ Copyright (C) 2020 Olive Team
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -36,7 +36,7 @@
#include "streamproperties/audiostreamproperties.h"
#include "streamproperties/videostreamproperties.h"
-OLIVE_NAMESPACE_ENTER
+namespace olive {
FootagePropertiesDialog::FootagePropertiesDialog(QWidget *parent, Footage *footage) :
QDialog(parent),
@@ -198,4 +198,4 @@ void FootagePropertiesDialog::StreamEnableChangeCommand::undo_internal()
stream_->set_enabled(old_enabled_);
}
-OLIVE_NAMESPACE_EXIT
+}
diff --git a/app/dialog/footageproperties/footageproperties.h b/app/dialog/footageproperties/footageproperties.h
index d2018699f..614fb8800 100644
--- a/app/dialog/footageproperties/footageproperties.h
+++ b/app/dialog/footageproperties/footageproperties.h
@@ -1,7 +1,7 @@
/***
Olive - Non-Linear Video Editor
- Copyright (C) 2019 Olive Team
+ Copyright (C) 2020 Olive Team
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -32,7 +32,7 @@
#include "project/item/footage/footage.h"
#include "undo/undocommand.h"
-OLIVE_NAMESPACE_ENTER
+namespace olive {
/**
* @brief The MediaPropertiesDialog class
@@ -132,6 +132,6 @@ private slots:
};
-OLIVE_NAMESPACE_EXIT
+}
#endif // MEDIAPROPERTIESDIALOG_H
diff --git a/app/dialog/footageproperties/streamproperties/CMakeLists.txt b/app/dialog/footageproperties/streamproperties/CMakeLists.txt
index b6952d2aa..3228e9520 100644
--- a/app/dialog/footageproperties/streamproperties/CMakeLists.txt
+++ b/app/dialog/footageproperties/streamproperties/CMakeLists.txt
@@ -1,5 +1,5 @@
# Olive - Non-Linear Video Editor
-# Copyright (C) 2019 Olive Team
+# Copyright (C) 2020 Olive Team
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/app/dialog/footageproperties/streamproperties/audiostreamproperties.cpp b/app/dialog/footageproperties/streamproperties/audiostreamproperties.cpp
index d09b5cff4..9f52c0e3e 100644
--- a/app/dialog/footageproperties/streamproperties/audiostreamproperties.cpp
+++ b/app/dialog/footageproperties/streamproperties/audiostreamproperties.cpp
@@ -1,7 +1,7 @@
/***
Olive - Non-Linear Video Editor
- Copyright (C) 2019 Olive Team
+ Copyright (C) 2020 Olive Team
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -20,7 +20,7 @@
#include "audiostreamproperties.h"
-OLIVE_NAMESPACE_ENTER
+namespace olive {
AudioStreamProperties::AudioStreamProperties(AudioStreamPtr stream) :
stream_(stream)
@@ -31,4 +31,4 @@ void AudioStreamProperties::Accept(QUndoCommand*)
{
}
-OLIVE_NAMESPACE_EXIT
+}
diff --git a/app/dialog/footageproperties/streamproperties/audiostreamproperties.h b/app/dialog/footageproperties/streamproperties/audiostreamproperties.h
index 4afc506ba..f3a77c4b9 100644
--- a/app/dialog/footageproperties/streamproperties/audiostreamproperties.h
+++ b/app/dialog/footageproperties/streamproperties/audiostreamproperties.h
@@ -1,7 +1,7 @@
/***
Olive - Non-Linear Video Editor
- Copyright (C) 2019 Olive Team
+ Copyright (C) 2020 Olive Team
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -24,7 +24,7 @@
#include "project/item/footage/audiostream.h"
#include "streamproperties.h"
-OLIVE_NAMESPACE_ENTER
+namespace olive {
class AudioStreamProperties : public StreamProperties
{
@@ -37,6 +37,6 @@ private:
AudioStreamPtr stream_;
};
-OLIVE_NAMESPACE_EXIT
+}
#endif // AUDIOSTREAMPROPERTIES_H
diff --git a/app/dialog/footageproperties/streamproperties/streamproperties.cpp b/app/dialog/footageproperties/streamproperties/streamproperties.cpp
index 2344a1277..96f3bbd5a 100644
--- a/app/dialog/footageproperties/streamproperties/streamproperties.cpp
+++ b/app/dialog/footageproperties/streamproperties/streamproperties.cpp
@@ -1,7 +1,7 @@
/***
Olive - Non-Linear Video Editor
- Copyright (C) 2019 Olive Team
+ Copyright (C) 2020 Olive Team
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -20,11 +20,11 @@
#include "streamproperties.h"
-OLIVE_NAMESPACE_ENTER
+namespace olive {
StreamProperties::StreamProperties(QWidget *parent) :
QWidget(parent)
{
}
-OLIVE_NAMESPACE_EXIT
+}
diff --git a/app/dialog/footageproperties/streamproperties/streamproperties.h b/app/dialog/footageproperties/streamproperties/streamproperties.h
index 9e9e510f5..677be9b0a 100644
--- a/app/dialog/footageproperties/streamproperties/streamproperties.h
+++ b/app/dialog/footageproperties/streamproperties/streamproperties.h
@@ -1,7 +1,7 @@
/***
Olive - Non-Linear Video Editor
- Copyright (C) 2019 Olive Team
+ Copyright (C) 2020 Olive Team
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -26,7 +26,7 @@
#include "common/define.h"
-OLIVE_NAMESPACE_ENTER
+namespace olive {
class StreamProperties : public QWidget
{
@@ -39,6 +39,6 @@ public:
};
-OLIVE_NAMESPACE_EXIT
+}
#endif // STREAMPROPERTIES_H
diff --git a/app/dialog/footageproperties/streamproperties/videostreamproperties.cpp b/app/dialog/footageproperties/streamproperties/videostreamproperties.cpp
index 0aaca3a43..c97b011c0 100644
--- a/app/dialog/footageproperties/streamproperties/videostreamproperties.cpp
+++ b/app/dialog/footageproperties/streamproperties/videostreamproperties.cpp
@@ -1,7 +1,7 @@
/***
Olive - Non-Linear Video Editor
- Copyright (C) 2019 Olive Team
+ Copyright (C) 2020 Olive Team
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -25,18 +25,18 @@
#include
#include
#include
-#include
-namespace OCIO = OCIO_NAMESPACE::v1;
+#include "common/ocioutils.h"
#include "core.h"
#include "project/item/footage/footage.h"
#include "project/project.h"
#include "undo/undostack.h"
-OLIVE_NAMESPACE_ENTER
+namespace olive {
VideoStreamProperties::VideoStreamProperties(VideoStreamPtr stream) :
- stream_(stream)
+ stream_(stream),
+ video_premultiply_alpha_(nullptr)
{
QGridLayout* video_layout = new QGridLayout(this);
video_layout->setMargin(0);
@@ -78,11 +78,13 @@ VideoStreamProperties::VideoStreamProperties(VideoStreamPtr stream) :
video_layout->addWidget(video_color_space_, row, 1);
- row++;
+ if (stream->channel_count() == VideoParams::kRGBAChannelCount) {
+ row++;
- video_premultiply_alpha_ = new QCheckBox(tr("Premultiplied Alpha"));
- video_premultiply_alpha_->setChecked(stream_->premultiplied_alpha());
- video_layout->addWidget(video_premultiply_alpha_, row, 0, 1, 2);
+ video_premultiply_alpha_ = new QCheckBox(tr("Premultiplied Alpha"));
+ video_premultiply_alpha_->setChecked(stream_->premultiplied_alpha());
+ video_layout->addWidget(video_premultiply_alpha_, row, 0, 1, 2);
+ }
row++;
@@ -130,13 +132,13 @@ void VideoStreamProperties::Accept(QUndoCommand *parent)
set_colorspace = video_color_space_->currentText();
}
- if (video_premultiply_alpha_->isChecked() != stream_->premultiplied_alpha()
+ if ((video_premultiply_alpha_ && video_premultiply_alpha_->isChecked() != stream_->premultiplied_alpha())
|| set_colorspace != stream_->colorspace(false)
|| static_cast(video_interlace_combo_->currentIndex()) != stream_->interlacing()
|| pixel_aspect_combo_->GetPixelAspectRatio() != stream_->pixel_aspect_ratio()) {
new VideoStreamChangeCommand(stream_,
- video_premultiply_alpha_->isChecked(),
+ video_premultiply_alpha_ ? video_premultiply_alpha_->isChecked() : stream_->premultiplied_alpha(),
set_colorspace,
static_cast(video_interlace_combo_->currentIndex()),
pixel_aspect_combo_->GetPixelAspectRatio(),
@@ -251,4 +253,4 @@ void VideoStreamProperties::ImageSequenceChangeCommand::undo_internal()
video_stream_->set_timebase(old_frame_rate_.flipped());
}
-OLIVE_NAMESPACE_EXIT
+}
diff --git a/app/dialog/footageproperties/streamproperties/videostreamproperties.h b/app/dialog/footageproperties/streamproperties/videostreamproperties.h
index 2b82b80d1..96416f596 100644
--- a/app/dialog/footageproperties/streamproperties/videostreamproperties.h
+++ b/app/dialog/footageproperties/streamproperties/videostreamproperties.h
@@ -1,7 +1,7 @@
/***
Olive - Non-Linear Video Editor
- Copyright (C) 2019 Olive Team
+ Copyright (C) 2020 Olive Team
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -30,10 +30,11 @@
#include "widget/slider/integerslider.h"
#include "widget/standardcombos/standardcombos.h"
-OLIVE_NAMESPACE_ENTER
+namespace olive {
class VideoStreamProperties : public StreamProperties
{
+ Q_OBJECT
public:
VideoStreamProperties(VideoStreamPtr stream);
@@ -142,6 +143,6 @@ private:
};
-OLIVE_NAMESPACE_EXIT
+}
#endif // VIDEOSTREAMPROPERTIES_H
diff --git a/app/dialog/footagerelink/CMakeLists.txt b/app/dialog/footagerelink/CMakeLists.txt
index 3d420d890..74f158922 100644
--- a/app/dialog/footagerelink/CMakeLists.txt
+++ b/app/dialog/footagerelink/CMakeLists.txt
@@ -1,5 +1,5 @@
# Olive - Non-Linear Video Editor
-# Copyright (C) 2019 Olive Team
+# Copyright (C) 2020 Olive Team
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/app/dialog/footagerelink/footagerelinkdialog.cpp b/app/dialog/footagerelink/footagerelinkdialog.cpp
index eae68b38e..cfdde7fc5 100644
--- a/app/dialog/footagerelink/footagerelinkdialog.cpp
+++ b/app/dialog/footagerelink/footagerelinkdialog.cpp
@@ -27,7 +27,7 @@
#include
#include
-OLIVE_NAMESPACE_ENTER
+namespace olive {
FootageRelinkDialog::FootageRelinkDialog(const QList& footage, QWidget* parent) :
QDialog(parent),
@@ -100,4 +100,4 @@ void FootageRelinkDialog::BrowseForFootage()
}
}
-OLIVE_NAMESPACE_EXIT
+}
diff --git a/app/dialog/footagerelink/footagerelinkdialog.h b/app/dialog/footagerelink/footagerelinkdialog.h
index 1c9984f9c..b201b6762 100644
--- a/app/dialog/footagerelink/footagerelinkdialog.h
+++ b/app/dialog/footagerelink/footagerelinkdialog.h
@@ -26,7 +26,7 @@
#include "project/item/footage/footage.h"
-OLIVE_NAMESPACE_ENTER
+namespace olive {
class FootageRelinkDialog : public QDialog
{
@@ -44,6 +44,6 @@ private slots:
};
-OLIVE_NAMESPACE_EXIT
+}
#endif // FOOTAGERELINKDIALOG_H
diff --git a/app/dialog/keyframeproperties/CMakeLists.txt b/app/dialog/keyframeproperties/CMakeLists.txt
index fc3b399ec..1764bab10 100644
--- a/app/dialog/keyframeproperties/CMakeLists.txt
+++ b/app/dialog/keyframeproperties/CMakeLists.txt
@@ -1,5 +1,5 @@
# Olive - Non-Linear Video Editor
-# Copyright (C) 2019 Olive Team
+# Copyright (C) 2020 Olive Team
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/app/dialog/keyframeproperties/keyframeproperties.cpp b/app/dialog/keyframeproperties/keyframeproperties.cpp
index 090902cd0..469734cfd 100644
--- a/app/dialog/keyframeproperties/keyframeproperties.cpp
+++ b/app/dialog/keyframeproperties/keyframeproperties.cpp
@@ -1,7 +1,7 @@
/***
Olive - Non-Linear Video Editor
- Copyright (C) 2019 Olive Team
+ Copyright (C) 2020 Olive Team
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -28,7 +28,7 @@
#include "widget/keyframeview/keyframeviewundo.h"
#include "widget/nodeparamview/nodeparamviewundo.h"
-OLIVE_NAMESPACE_ENTER
+namespace olive {
KeyframePropertiesDialog::KeyframePropertiesDialog(const QList &keys, const rational &timebase, QWidget *parent) :
QDialog(parent),
@@ -240,4 +240,4 @@ void KeyframePropertiesDialog::KeyTypeChanged(int index)
bezier_group_->setEnabled(type_select_->itemData(index) == NodeKeyframe::kBezier);
}
-OLIVE_NAMESPACE_EXIT
+}
diff --git a/app/dialog/keyframeproperties/keyframeproperties.h b/app/dialog/keyframeproperties/keyframeproperties.h
index fdf9f7076..3ad6145af 100644
--- a/app/dialog/keyframeproperties/keyframeproperties.h
+++ b/app/dialog/keyframeproperties/keyframeproperties.h
@@ -1,7 +1,7 @@
/***
Olive - Non-Linear Video Editor
- Copyright (C) 2019 Olive Team
+ Copyright (C) 2020 Olive Team
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -29,7 +29,7 @@
#include "widget/slider/floatslider.h"
#include "widget/slider/timeslider.h"
-OLIVE_NAMESPACE_ENTER
+namespace olive {
class KeyframePropertiesDialog : public QDialog
{
@@ -66,6 +66,6 @@ private slots:
};
-OLIVE_NAMESPACE_EXIT
+}
#endif // KEYFRAMEPROPERTIESDIALOG_H
diff --git a/app/dialog/preferences/CMakeLists.txt b/app/dialog/preferences/CMakeLists.txt
index 82201b179..85eaf5822 100644
--- a/app/dialog/preferences/CMakeLists.txt
+++ b/app/dialog/preferences/CMakeLists.txt
@@ -1,5 +1,5 @@
# Olive - Non-Linear Video Editor
-# Copyright (C) 2019 Olive Team
+# Copyright (C) 2020 Olive Team
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/app/dialog/preferences/keysequenceeditor.cpp b/app/dialog/preferences/keysequenceeditor.cpp
index d0e6645d8..34012ef2f 100644
--- a/app/dialog/preferences/keysequenceeditor.cpp
+++ b/app/dialog/preferences/keysequenceeditor.cpp
@@ -1,7 +1,7 @@
/***
Olive - Non-Linear Video Editor
- Copyright (C) 2019 Olive Team
+ Copyright (C) 2020 Olive Team
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -22,7 +22,7 @@
#include
-OLIVE_NAMESPACE_ENTER
+namespace olive {
KeySequenceEditor::KeySequenceEditor(QWidget* parent, QAction* a)
: QKeySequenceEdit(parent), action(a) {
@@ -49,4 +49,4 @@ QString KeySequenceEditor::export_shortcut() {
return nullptr;
}
-OLIVE_NAMESPACE_EXIT
+}
diff --git a/app/dialog/preferences/keysequenceeditor.h b/app/dialog/preferences/keysequenceeditor.h
index b3fc396b9..3231df622 100644
--- a/app/dialog/preferences/keysequenceeditor.h
+++ b/app/dialog/preferences/keysequenceeditor.h
@@ -1,7 +1,7 @@
/***
Olive - Non-Linear Video Editor
- Copyright (C) 2019 Olive Team
+ Copyright (C) 2020 Olive Team
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -25,7 +25,7 @@
#include "common/debug.h"
-OLIVE_NAMESPACE_ENTER
+namespace olive {
/**
* @brief The KeySequenceEditor class
@@ -101,6 +101,6 @@ private:
QAction* action;
};
-OLIVE_NAMESPACE_EXIT
+}
#endif // KEYSEQUENCEEDITOR_H
diff --git a/app/dialog/preferences/preferences.cpp b/app/dialog/preferences/preferences.cpp
index 6ca624c07..c3c34131f 100644
--- a/app/dialog/preferences/preferences.cpp
+++ b/app/dialog/preferences/preferences.cpp
@@ -1,7 +1,7 @@
/***
Olive - Non-Linear Video Editor
- Copyright (C) 2019 Olive Team
+ Copyright (C) 2020 Olive Team
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -33,7 +33,7 @@
#include "tabs/preferencesaudiotab.h"
#include "tabs/preferenceskeyboardtab.h"
-OLIVE_NAMESPACE_ENTER
+namespace olive {
PreferencesDialog::PreferencesDialog(QWidget *parent, QMenuBar* main_menu_bar) :
QDialog(parent)
@@ -98,4 +98,4 @@ void PreferencesDialog::AddTab(PreferencesTab *tab, const QString &title)
tabs_.append(tab);
}
-OLIVE_NAMESPACE_EXIT
+}
diff --git a/app/dialog/preferences/preferences.h b/app/dialog/preferences/preferences.h
index 6f97e2e08..e337c3eeb 100644
--- a/app/dialog/preferences/preferences.h
+++ b/app/dialog/preferences/preferences.h
@@ -1,7 +1,7 @@
/***
Olive - Non-Linear Video Editor
- Copyright (C) 2019 Olive Team
+ Copyright (C) 2020 Olive Team
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -30,7 +30,7 @@
#include "tabs/preferencestab.h"
-OLIVE_NAMESPACE_ENTER
+namespace olive {
/**
* @brief The PreferencesDialog class
@@ -69,6 +69,6 @@ private:
};
-OLIVE_NAMESPACE_EXIT
+}
#endif // PREFERENCESDIALOG_H
diff --git a/app/dialog/preferences/tabs/CMakeLists.txt b/app/dialog/preferences/tabs/CMakeLists.txt
index 62c3270c1..37bfe7a5a 100644
--- a/app/dialog/preferences/tabs/CMakeLists.txt
+++ b/app/dialog/preferences/tabs/CMakeLists.txt
@@ -1,5 +1,5 @@
# Olive - Non-Linear Video Editor
-# Copyright (C) 2019 Olive Team
+# Copyright (C) 2020 Olive Team
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/app/dialog/preferences/tabs/preferencesappearancetab.cpp b/app/dialog/preferences/tabs/preferencesappearancetab.cpp
index 737821e48..1ad9a6113 100644
--- a/app/dialog/preferences/tabs/preferencesappearancetab.cpp
+++ b/app/dialog/preferences/tabs/preferencesappearancetab.cpp
@@ -1,7 +1,7 @@
/***
Olive - Non-Linear Video Editor
- Copyright (C) 2019 Olive Team
+ Copyright (C) 2020 Olive Team
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -29,7 +29,7 @@
#include "node/node.h"
#include "widget/colorbutton/colorbutton.h"
-OLIVE_NAMESPACE_ENTER
+namespace olive {
PreferencesAppearanceTab::PreferencesAppearanceTab()
{
@@ -122,4 +122,4 @@ void PreferencesAppearanceTab::ColorButtonClicked()
}
}
-OLIVE_NAMESPACE_EXIT
+}
diff --git a/app/dialog/preferences/tabs/preferencesappearancetab.h b/app/dialog/preferences/tabs/preferencesappearancetab.h
index 35dc1ffac..6e3e82751 100644
--- a/app/dialog/preferences/tabs/preferencesappearancetab.h
+++ b/app/dialog/preferences/tabs/preferencesappearancetab.h
@@ -1,7 +1,7 @@
/***
Olive - Non-Linear Video Editor
- Copyright (C) 2019 Olive Team
+ Copyright (C) 2020 Olive Team
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -28,7 +28,7 @@
#include "preferencestab.h"
#include "ui/style/style.h"
-OLIVE_NAMESPACE_ENTER
+namespace olive {
class PreferencesAppearanceTab : public PreferencesTab
{
@@ -60,6 +60,6 @@ private slots:
};
-OLIVE_NAMESPACE_EXIT
+}
#endif // PREFERENCESAPPEARANCETAB_H
diff --git a/app/dialog/preferences/tabs/preferencesaudiotab.cpp b/app/dialog/preferences/tabs/preferencesaudiotab.cpp
index dfe3536a7..66c34a3d9 100644
--- a/app/dialog/preferences/tabs/preferencesaudiotab.cpp
+++ b/app/dialog/preferences/tabs/preferencesaudiotab.cpp
@@ -1,7 +1,7 @@
/***
Olive - Non-Linear Video Editor
- Copyright (C) 2019 Olive Team
+ Copyright (C) 2020 Olive Team
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -26,7 +26,7 @@
#include "audio/audiomanager.h"
#include "config/config.h"
-OLIVE_NAMESPACE_ENTER
+namespace olive {
PreferencesAudioTab::PreferencesAudioTab()
{
@@ -206,4 +206,4 @@ void PreferencesAudioTab::PopulateComboBox(QComboBox *cb, bool still_refreshing,
}
}
-OLIVE_NAMESPACE_EXIT
+}
diff --git a/app/dialog/preferences/tabs/preferencesaudiotab.h b/app/dialog/preferences/tabs/preferencesaudiotab.h
index dcf9252b7..e0cb6fa7b 100644
--- a/app/dialog/preferences/tabs/preferencesaudiotab.h
+++ b/app/dialog/preferences/tabs/preferencesaudiotab.h
@@ -1,7 +1,7 @@
/***
Olive - Non-Linear Video Editor
- Copyright (C) 2019 Olive Team
+ Copyright (C) 2020 Olive Team
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -27,7 +27,7 @@
#include "preferencestab.h"
-OLIVE_NAMESPACE_ENTER
+namespace olive {
class PreferencesAudioTab : public PreferencesTab
{
@@ -79,6 +79,6 @@ private:
};
-OLIVE_NAMESPACE_EXIT
+}
#endif // PREFERENCESAUDIOTAB_H
diff --git a/app/dialog/preferences/tabs/preferencesbehaviortab.cpp b/app/dialog/preferences/tabs/preferencesbehaviortab.cpp
index 6713fe81b..79b6d217c 100644
--- a/app/dialog/preferences/tabs/preferencesbehaviortab.cpp
+++ b/app/dialog/preferences/tabs/preferencesbehaviortab.cpp
@@ -1,7 +1,7 @@
/***
Olive - Non-Linear Video Editor
- Copyright (C) 2019 Olive Team
+ Copyright (C) 2020 Olive Team
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -25,7 +25,7 @@
#include "config/config.h"
-OLIVE_NAMESPACE_ENTER
+namespace olive {
PreferencesBehaviorTab::PreferencesBehaviorTab()
{
@@ -99,6 +99,11 @@ PreferencesBehaviorTab::PreferencesBehaviorTab()
AddItem(tr("Auto-Scale By Default"),
QStringLiteral("AutoscaleByDefault"),
node_group);
+ AddItem(tr("Splitting Clips Copies Dependencies"),
+ QStringLiteral("SplitClipsCopyNodes"),
+ tr("Multiple clips can share the same nodes. Disable this to automatically share node "
+ "dependencies among clips when copying or splitting them."),
+ node_group);
}
void PreferencesBehaviorTab::Accept()
@@ -151,4 +156,4 @@ QTreeWidgetItem *PreferencesBehaviorTab::AddParent(const QString &text, QTreeWid
return AddParent(text, QString(), parent);
}
-OLIVE_NAMESPACE_EXIT
+}
diff --git a/app/dialog/preferences/tabs/preferencesbehaviortab.h b/app/dialog/preferences/tabs/preferencesbehaviortab.h
index 521f36cb4..997aee0cc 100644
--- a/app/dialog/preferences/tabs/preferencesbehaviortab.h
+++ b/app/dialog/preferences/tabs/preferencesbehaviortab.h
@@ -1,7 +1,7 @@
/***
Olive - Non-Linear Video Editor
- Copyright (C) 2019 Olive Team
+ Copyright (C) 2020 Olive Team
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -25,7 +25,7 @@
#include "preferencestab.h"
-OLIVE_NAMESPACE_ENTER
+namespace olive {
class PreferencesBehaviorTab : public PreferencesTab
{
@@ -48,6 +48,6 @@ private:
};
-OLIVE_NAMESPACE_EXIT
+}
#endif // PREFERENCESBEHAVIORTAB_H
diff --git a/app/dialog/preferences/tabs/preferencesdisktab.cpp b/app/dialog/preferences/tabs/preferencesdisktab.cpp
index fef948409..ec1eeefb1 100644
--- a/app/dialog/preferences/tabs/preferencesdisktab.cpp
+++ b/app/dialog/preferences/tabs/preferencesdisktab.cpp
@@ -1,7 +1,7 @@
/***
Olive - Non-Linear Video Editor
- Copyright (C) 2019 Olive Team
+ Copyright (C) 2020 Olive Team
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -29,7 +29,7 @@
#include "common/filefunctions.h"
-OLIVE_NAMESPACE_ENTER
+namespace olive {
PreferencesDiskTab::PreferencesDiskTab()
{
@@ -69,7 +69,7 @@ PreferencesDiskTab::PreferencesDiskTab()
cache_behavior_layout->addWidget(new QLabel(tr("Cache Ahead:")), row, 0);
cache_ahead_slider_ = new FloatSlider();
- cache_ahead_slider_->SetFormat(tr("%1 seconds"));
+ cache_ahead_slider_->SetFormat(tr("%1 second(s)"));
cache_ahead_slider_->SetMinimum(0);
cache_ahead_slider_->SetValue(Config::Current()["DiskCacheAhead"].value().toDouble());
cache_behavior_layout->addWidget(cache_ahead_slider_, row, 1);
@@ -78,7 +78,7 @@ PreferencesDiskTab::PreferencesDiskTab()
cache_behind_slider_ = new FloatSlider();
cache_behind_slider_->SetMinimum(0);
- cache_behind_slider_->SetFormat(tr("%1 seconds"));
+ cache_behind_slider_->SetFormat(tr("%1 second(s)"));
cache_behind_slider_->SetValue(Config::Current()["DiskCacheBehind"].value().toDouble());
cache_behavior_layout->addWidget(cache_behind_slider_, row, 3);
@@ -117,4 +117,4 @@ void PreferencesDiskTab::Accept()
Config::Current()["DiskCacheAhead"] = QVariant::fromValue(rational::fromDouble(cache_ahead_slider_->GetValue()));
}
-OLIVE_NAMESPACE_EXIT
+}
diff --git a/app/dialog/preferences/tabs/preferencesdisktab.h b/app/dialog/preferences/tabs/preferencesdisktab.h
index 5eb7438b7..6f4e45771 100644
--- a/app/dialog/preferences/tabs/preferencesdisktab.h
+++ b/app/dialog/preferences/tabs/preferencesdisktab.h
@@ -1,7 +1,7 @@
/***
Olive - Non-Linear Video Editor
- Copyright (C) 2019 Olive Team
+ Copyright (C) 2020 Olive Team
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -30,7 +30,7 @@
#include "widget/slider/floatslider.h"
#include "widget/path/pathwidget.h"
-OLIVE_NAMESPACE_ENTER
+namespace olive {
class PreferencesDiskTab : public PreferencesTab
{
@@ -53,6 +53,6 @@ private:
};
-OLIVE_NAMESPACE_EXIT
+}
#endif // PREFERENCESDISKTAB_H
diff --git a/app/dialog/preferences/tabs/preferencesgeneraltab.cpp b/app/dialog/preferences/tabs/preferencesgeneraltab.cpp
index 520728c36..aafe93d70 100644
--- a/app/dialog/preferences/tabs/preferencesgeneraltab.cpp
+++ b/app/dialog/preferences/tabs/preferencesgeneraltab.cpp
@@ -1,7 +1,7 @@
/***
Olive - Non-Linear Video Editor
- Copyright (C) 2019 Olive Team
+ Copyright (C) 2020 Olive Team
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -25,10 +25,11 @@
#include
#include "common/autoscroll.h"
+#include "core.h"
#include "dialog/sequence/sequence.h"
#include "project/item/sequence/sequence.h"
-OLIVE_NAMESPACE_ENTER
+namespace olive {
PreferencesGeneralTab::PreferencesGeneralTab()
{
@@ -46,34 +47,23 @@ PreferencesGeneralTab::PreferencesGeneralTab()
language_combobox_ = new QComboBox();
// Add default language (en-US)
- language_combobox_->addItem(QLocale("en_US").nativeLanguageName());
+ QDir language_dir(QStringLiteral(":/ts"));
+ QStringList languages = language_dir.entryList();
+ foreach (const QString& l, languages) {
+ AddLanguage(l);
+ }
- /*
- // add languages from file
- QList translation_paths = get_language_paths();
+ QString current_language = Config::Current()[QStringLiteral("Language")].toString();
+ if (current_language.isEmpty()) {
+ // No configured language, use system language
+ current_language = QLocale::system().name();
- // iterate through all language search paths
- for (int j=0;jaddItem(QLocale(locale_str).nativeLanguageName(), locale_relative_path);
-
- if (olive::config.language_file == locale_relative_path) {
- language_combobox->setCurrentIndex(language_combobox->count() - 1);
- }
- }
- }
+ // If we don't have a language for this, default to en_US
+ if (!languages.contains(current_language)) {
+ current_language = QStringLiteral("en_US");
}
- */
+ }
+ language_combobox_->setCurrentIndex(languages.indexOf(current_language));
general_layout->addWidget(language_combobox_, row, 1);
@@ -103,7 +93,7 @@ PreferencesGeneralTab::PreferencesGeneralTab()
default_still_length_ = new FloatSlider();
default_still_length_->SetMinimum(0.1);
- default_still_length_->SetFormat(tr("%1 seconds"));
+ default_still_length_->SetFormat(tr("%1 second(s)"));
default_still_length_->SetValue(Config::Current()["DefaultStillLength"].value().toDouble());
general_layout->addWidget(default_still_length_);
@@ -112,11 +102,30 @@ PreferencesGeneralTab::PreferencesGeneralTab()
void PreferencesGeneralTab::Accept()
{
- Config::Current()["RectifiedWaveforms"] = rectified_waveforms_->isChecked();
+ Config::Current()[QStringLiteral("RectifiedWaveforms")] = rectified_waveforms_->isChecked();
- Config::Current()["Autoscroll"] = autoscroll_method_->currentData();
+ Config::Current()[QStringLiteral("Autoscroll")] = autoscroll_method_->currentData();
- Config::Current()["DefaultStillLength"] = QVariant::fromValue(rational::fromDouble(default_still_length_->GetValue()));
+ Config::Current()[QStringLiteral("DefaultStillLength")] = QVariant::fromValue(rational::fromDouble(default_still_length_->GetValue()));
+
+ QString set_language = language_combobox_->currentData().toString();
+ if (QLocale::system().name() == set_language) {
+ // Language is set to the system, assume this is effectively "auto"
+ set_language = QString();
+ }
+
+ // If the language has changed, set it now
+ if (Config::Current()[QStringLiteral("Language")].toString() != set_language) {
+ Config::Current()[QStringLiteral("Language")] = set_language;
+ Core::instance()->SetLanguage(set_language.isEmpty() ? QLocale::system().name() : set_language);
+ }
}
-OLIVE_NAMESPACE_EXIT
+void PreferencesGeneralTab::AddLanguage(const QString &locale_name)
+{
+ language_combobox_->addItem(tr("%1 (%2)").arg(QLocale(locale_name).nativeLanguageName(),
+ locale_name));;
+ language_combobox_->setItemData(language_combobox_->count() - 1, locale_name);
+}
+
+}
diff --git a/app/dialog/preferences/tabs/preferencesgeneraltab.h b/app/dialog/preferences/tabs/preferencesgeneraltab.h
index 609d182c9..e48123fc6 100644
--- a/app/dialog/preferences/tabs/preferencesgeneraltab.h
+++ b/app/dialog/preferences/tabs/preferencesgeneraltab.h
@@ -1,7 +1,7 @@
/***
Olive - Non-Linear Video Editor
- Copyright (C) 2019 Olive Team
+ Copyright (C) 2020 Olive Team
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -29,7 +29,7 @@
#include "project/item/sequence/sequence.h"
#include "widget/slider/floatslider.h"
-OLIVE_NAMESPACE_ENTER
+namespace olive {
class PreferencesGeneralTab : public PreferencesTab
{
@@ -40,6 +40,8 @@ public:
virtual void Accept() override;
private:
+ void AddLanguage(const QString& locale_name);
+
QComboBox* language_combobox_;
QComboBox* autoscroll_method_;
@@ -50,6 +52,6 @@ private:
};
-OLIVE_NAMESPACE_EXIT
+}
#endif // PREFERENCESGENERALTAB_H
diff --git a/app/dialog/preferences/tabs/preferenceskeyboardtab.cpp b/app/dialog/preferences/tabs/preferenceskeyboardtab.cpp
index f5cbe3da6..22ab4f652 100644
--- a/app/dialog/preferences/tabs/preferenceskeyboardtab.cpp
+++ b/app/dialog/preferences/tabs/preferenceskeyboardtab.cpp
@@ -1,7 +1,7 @@
/***
Olive - Non-Linear Video Editor
- Copyright (C) 2019 Olive Team
+ Copyright (C) 2020 Olive Team
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -27,7 +27,7 @@
#include
#include
-OLIVE_NAMESPACE_ENTER
+namespace olive {
PreferencesKeyboardTab::PreferencesKeyboardTab(QMenuBar *menubar)
{
@@ -239,4 +239,4 @@ void PreferencesKeyboardTab::save_shortcut_file() {
}
}
-OLIVE_NAMESPACE_EXIT
+}
diff --git a/app/dialog/preferences/tabs/preferenceskeyboardtab.h b/app/dialog/preferences/tabs/preferenceskeyboardtab.h
index 69b906bd6..723d95e44 100644
--- a/app/dialog/preferences/tabs/preferenceskeyboardtab.h
+++ b/app/dialog/preferences/tabs/preferenceskeyboardtab.h
@@ -1,7 +1,7 @@
/***
Olive - Non-Linear Video Editor
- Copyright (C) 2019 Olive Team
+ Copyright (C) 2020 Olive Team
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -27,7 +27,7 @@
#include "preferencestab.h"
#include "../keysequenceeditor.h"
-OLIVE_NAMESPACE_ENTER
+namespace olive {
class PreferencesKeyboardTab : public PreferencesTab
{
@@ -134,6 +134,6 @@ private:
QVector key_shortcut_fields_;
};
-OLIVE_NAMESPACE_EXIT
+}
#endif // PREFERENCESKEYBOARDTAB_H
diff --git a/app/dialog/preferences/tabs/preferencestab.cpp b/app/dialog/preferences/tabs/preferencestab.cpp
index 883f108cb..4dc6d46d8 100644
--- a/app/dialog/preferences/tabs/preferencestab.cpp
+++ b/app/dialog/preferences/tabs/preferencestab.cpp
@@ -1,7 +1,7 @@
/***
Olive - Non-Linear Video Editor
- Copyright (C) 2019 Olive Team
+ Copyright (C) 2020 Olive Team
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -20,11 +20,11 @@
#include "preferencestab.h"
-OLIVE_NAMESPACE_ENTER
+namespace olive {
bool PreferencesTab::Validate()
{
return true;
}
-OLIVE_NAMESPACE_EXIT
+}
diff --git a/app/dialog/preferences/tabs/preferencestab.h b/app/dialog/preferences/tabs/preferencestab.h
index 60e83d950..8bfaec15d 100644
--- a/app/dialog/preferences/tabs/preferencestab.h
+++ b/app/dialog/preferences/tabs/preferencestab.h
@@ -1,7 +1,7 @@
/***
Olive - Non-Linear Video Editor
- Copyright (C) 2019 Olive Team
+ Copyright (C) 2020 Olive Team
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -25,7 +25,7 @@
#include "config/config.h"
-OLIVE_NAMESPACE_ENTER
+namespace olive {
class PreferencesTab : public QWidget
{
@@ -37,6 +37,6 @@ public:
virtual void Accept() = 0;
};
-OLIVE_NAMESPACE_EXIT
+}
#endif // PREFERENCESTAB_H
diff --git a/app/dialog/progress/CMakeLists.txt b/app/dialog/progress/CMakeLists.txt
index 99c331702..0acb642e0 100644
--- a/app/dialog/progress/CMakeLists.txt
+++ b/app/dialog/progress/CMakeLists.txt
@@ -1,5 +1,5 @@
# Olive - Non-Linear Video Editor
-# Copyright (C) 2019 Olive Team
+# Copyright (C) 2020 Olive Team
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/app/dialog/progress/progress.cpp b/app/dialog/progress/progress.cpp
index 011980cb9..3b46c8926 100644
--- a/app/dialog/progress/progress.cpp
+++ b/app/dialog/progress/progress.cpp
@@ -1,7 +1,7 @@
/***
Olive - Non-Linear Video Editor
- Copyright (C) 2019 Olive Team
+ Copyright (C) 2020 Olive Team
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -27,10 +27,11 @@
#include "window/mainwindow/mainwindow.h"
-OLIVE_NAMESPACE_ENTER
+namespace olive {
ProgressDialog::ProgressDialog(const QString& message, const QString& title, QWidget *parent) :
- QDialog(parent)
+ QDialog(parent),
+ show_progress_(true)
{
if (!title.isEmpty()) {
setWindowTitle(title);
@@ -56,7 +57,19 @@ ProgressDialog::ProgressDialog(const QString& message, const QString& title, QWi
cancel_layout->addStretch();
QPushButton* cancel_btn = new QPushButton(tr("Cancel"));
- connect(cancel_btn, &QPushButton::clicked, this, &ProgressDialog::Cancelled);
+
+ // Signal that derivatives can connect to
+ connect(cancel_btn, &QPushButton::clicked, this, &ProgressDialog::Cancelled, Qt::DirectConnection);
+
+ // Stop updating the elapsed/remaining timers
+ connect(cancel_btn, &QPushButton::clicked, elapsed_timer_lbl_, &ElapsedCounterWidget::Stop);
+
+ // Disable the button so that users know they don't need to keep clicking it
+ connect(cancel_btn, &QPushButton::clicked, this, &ProgressDialog::DisableSenderWidget);
+
+ // Prevent the progress bar from continuing to move
+ connect(cancel_btn, &QPushButton::clicked, this, &ProgressDialog::DisableProgressWidgets);
+
cancel_layout->addWidget(cancel_btn);
cancel_layout->addStretch();
@@ -80,6 +93,10 @@ void ProgressDialog::closeEvent(QCloseEvent *e)
void ProgressDialog::SetProgress(double value)
{
+ if (!show_progress_) {
+ return;
+ }
+
int percent = qRound(100.0 * value);
bar_->setValue(percent);
@@ -101,4 +118,14 @@ void ProgressDialog::ShowErrorMessage(const QString &title, const QString &messa
b.exec();
}
-OLIVE_NAMESPACE_EXIT
+void ProgressDialog::DisableSenderWidget()
+{
+ static_cast(sender())->setEnabled(false);
+}
+
+void ProgressDialog::DisableProgressWidgets()
+{
+ show_progress_ = false;
+}
+
+}
diff --git a/app/dialog/progress/progress.h b/app/dialog/progress/progress.h
index 401afe839..38e2854b1 100644
--- a/app/dialog/progress/progress.h
+++ b/app/dialog/progress/progress.h
@@ -1,7 +1,7 @@
/***
Olive - Non-Linear Video Editor
- Copyright (C) 2019 Olive Team
+ Copyright (C) 2020 Olive Team
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -27,7 +27,7 @@
#include "common/debug.h"
#include "widget/taskview/elapsedcounterwidget.h"
-OLIVE_NAMESPACE_ENTER
+namespace olive {
class ProgressDialog : public QDialog
{
@@ -54,8 +54,15 @@ private:
ElapsedCounterWidget* elapsed_timer_lbl_;
+ bool show_progress_;
+
+private slots:
+ void DisableSenderWidget();
+
+ void DisableProgressWidgets();
+
};
-OLIVE_NAMESPACE_EXIT
+}
#endif // PROGRESSDIALOG_H
diff --git a/app/dialog/projectproperties/CMakeLists.txt b/app/dialog/projectproperties/CMakeLists.txt
index 7763f8c34..b45092bf6 100644
--- a/app/dialog/projectproperties/CMakeLists.txt
+++ b/app/dialog/projectproperties/CMakeLists.txt
@@ -1,5 +1,5 @@
# Olive - Non-Linear Video Editor
-# Copyright (C) 2019 Olive Team
+# Copyright (C) 2020 Olive Team
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/app/dialog/projectproperties/projectproperties.cpp b/app/dialog/projectproperties/projectproperties.cpp
index 5a8713f5c..7f7414f3f 100644
--- a/app/dialog/projectproperties/projectproperties.cpp
+++ b/app/dialog/projectproperties/projectproperties.cpp
@@ -1,7 +1,7 @@
/***
Olive - Non-Linear Video Editor
- Copyright (C) 2019 Olive Team
+ Copyright (C) 2020 Olive Team
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -27,16 +27,15 @@
#include
#include
#include
-#include
-namespace OCIO = OCIO_NAMESPACE::v1;
#include "common/filefunctions.h"
+#include "common/ocioutils.h"
#include "config/config.h"
#include "core.h"
#include "render/colormanager.h"
#include "render/diskmanager.h"
-OLIVE_NAMESPACE_ENTER
+namespace olive {
ProjectPropertiesDialog::ProjectPropertiesDialog(Project* p, QWidget *parent) :
QDialog(parent),
@@ -243,4 +242,4 @@ void ProjectPropertiesDialog::OCIOFilenameUpdated()
}
}
-OLIVE_NAMESPACE_EXIT
+}
diff --git a/app/dialog/projectproperties/projectproperties.h b/app/dialog/projectproperties/projectproperties.h
index 5c0f31347..e861004b8 100644
--- a/app/dialog/projectproperties/projectproperties.h
+++ b/app/dialog/projectproperties/projectproperties.h
@@ -1,7 +1,7 @@
/***
Olive - Non-Linear Video Editor
- Copyright (C) 2019 Olive Team
+ Copyright (C) 2020 Olive Team
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -31,7 +31,7 @@
#include "project/project.h"
#include "widget/path/pathwidget.h"
-OLIVE_NAMESPACE_ENTER
+namespace olive {
class ProjectPropertiesDialog : public QDialog
{
@@ -68,6 +68,6 @@ private slots:
};
-OLIVE_NAMESPACE_EXIT
+}
#endif // PROJECTPROPERTIESDIALOG_H
diff --git a/app/dialog/rendercancel/CMakeLists.txt b/app/dialog/rendercancel/CMakeLists.txt
index a9ca563e9..36c3f9cbb 100644
--- a/app/dialog/rendercancel/CMakeLists.txt
+++ b/app/dialog/rendercancel/CMakeLists.txt
@@ -1,5 +1,5 @@
# Olive - Non-Linear Video Editor
-# Copyright (C) 2019 Olive Team
+# Copyright (C) 2020 Olive Team
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/app/dialog/rendercancel/rendercancel.cpp b/app/dialog/rendercancel/rendercancel.cpp
index d0f3af8a0..29aee8137 100644
--- a/app/dialog/rendercancel/rendercancel.cpp
+++ b/app/dialog/rendercancel/rendercancel.cpp
@@ -1,7 +1,7 @@
/***
Olive - Non-Linear Video Editor
- Copyright (C) 2019 Olive Team
+ Copyright (C) 2020 Olive Team
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -20,7 +20,7 @@
#include "rendercancel.h"
-OLIVE_NAMESPACE_ENTER
+namespace olive {
RenderCancelDialog::RenderCancelDialog(QWidget *parent) :
ProgressDialog(tr("Waiting for workers to finish..."), tr("Renderer"), parent),
@@ -79,4 +79,4 @@ void RenderCancelDialog::UpdateProgress()
}
}
-OLIVE_NAMESPACE_EXIT
+}
diff --git a/app/dialog/rendercancel/rendercancel.h b/app/dialog/rendercancel/rendercancel.h
index 75ba0a563..bc6dd72ed 100644
--- a/app/dialog/rendercancel/rendercancel.h
+++ b/app/dialog/rendercancel/rendercancel.h
@@ -1,7 +1,7 @@
/***
Olive - Non-Linear Video Editor
- Copyright (C) 2019 Olive Team
+ Copyright (C) 2020 Olive Team
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -23,7 +23,7 @@
#include "dialog/progress/progress.h"
-OLIVE_NAMESPACE_ENTER
+namespace olive {
class RenderCancelDialog : public ProgressDialog
{
@@ -54,6 +54,6 @@ private:
};
-OLIVE_NAMESPACE_EXIT
+}
#endif // RENDERCANCELDIALOG_H
diff --git a/app/dialog/richtext/CMakeLists.txt b/app/dialog/richtext/CMakeLists.txt
index c434be383..28528c8b5 100644
--- a/app/dialog/richtext/CMakeLists.txt
+++ b/app/dialog/richtext/CMakeLists.txt
@@ -1,5 +1,5 @@
# Olive - Non-Linear Video Editor
-# Copyright (C) 2019 Olive Team
+# Copyright (C) 2020 Olive Team
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/app/dialog/richtext/richtext.cpp b/app/dialog/richtext/richtext.cpp
index 40f2baabd..a623ed3e1 100644
--- a/app/dialog/richtext/richtext.cpp
+++ b/app/dialog/richtext/richtext.cpp
@@ -1,7 +1,7 @@
/***
Olive - Non-Linear Video Editor
- Copyright (C) 2019 Olive Team
+ Copyright (C) 2020 Olive Team
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -28,7 +28,7 @@
#include "ui/icons/icons.h"
-OLIVE_NAMESPACE_ENTER
+namespace olive {
RichTextDialog::RichTextDialog(QString start, QWidget* parent) :
QDialog(parent)
@@ -336,4 +336,4 @@ void RichTextDialog::UpdateButtons()
*/
}
-OLIVE_NAMESPACE_EXIT
+}
diff --git a/app/dialog/richtext/richtext.h b/app/dialog/richtext/richtext.h
index b3514df4b..479581cb9 100644
--- a/app/dialog/richtext/richtext.h
+++ b/app/dialog/richtext/richtext.h
@@ -1,7 +1,7 @@
/***
Olive - Non-Linear Video Editor
- Copyright (C) 2019 Olive Team
+ Copyright (C) 2020 Olive Team
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -28,7 +28,7 @@
#include "common/define.h"
#include "widget/slider/floatslider.h"
-OLIVE_NAMESPACE_ENTER
+namespace olive {
class RichTextDialog : public QDialog
{
@@ -82,6 +82,6 @@ private slots:
};
-OLIVE_NAMESPACE_EXIT
+}
#endif // RICHTEXTDIALOG_H
diff --git a/app/dialog/sequence/CMakeLists.txt b/app/dialog/sequence/CMakeLists.txt
index d4a05877d..294b9caeb 100644
--- a/app/dialog/sequence/CMakeLists.txt
+++ b/app/dialog/sequence/CMakeLists.txt
@@ -1,5 +1,5 @@
# Olive - Non-Linear Video Editor
-# Copyright (C) 2019 Olive Team
+# Copyright (C) 2020 Olive Team
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/app/dialog/sequence/presetmanager.h b/app/dialog/sequence/presetmanager.h
index 08f88f89f..1ac467a9e 100644
--- a/app/dialog/sequence/presetmanager.h
+++ b/app/dialog/sequence/presetmanager.h
@@ -1,7 +1,7 @@
/***
Olive - Non-Linear Video Editor
- Copyright (C) 2019 Olive Team
+ Copyright (C) 2020 Olive Team
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -34,7 +34,7 @@
#include "common/filefunctions.h"
#include "common/xmlutils.h"
-OLIVE_NAMESPACE_ENTER
+namespace olive {
class Preset
{
@@ -234,6 +234,6 @@ private:
};
-OLIVE_NAMESPACE_EXIT
+}
#endif // PRESETMANAGER_H
diff --git a/app/dialog/sequence/sequence.cpp b/app/dialog/sequence/sequence.cpp
index 3006c2b73..db9e50615 100644
--- a/app/dialog/sequence/sequence.cpp
+++ b/app/dialog/sequence/sequence.cpp
@@ -1,7 +1,7 @@
/***
Olive - Non-Linear Video Editor
- Copyright (C) 2019 Olive Team
+ Copyright (C) 2020 Olive Team
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -33,7 +33,7 @@
#include "common/rational.h"
#include "undo/undostack.h"
-OLIVE_NAMESPACE_ENTER
+namespace olive {
SequenceDialog::SequenceDialog(Sequence* s, Type t, QWidget* parent) :
QDialog(parent),
@@ -107,13 +107,14 @@ void SequenceDialog::accept()
parameter_tab_->GetSelectedVideoHeight(),
parameter_tab_->GetSelectedVideoFrameRate().flipped(),
parameter_tab_->GetSelectedPreviewFormat(),
+ VideoParams::kInternalChannelCount,
parameter_tab_->GetSelectedVideoPixelAspect(),
parameter_tab_->GetSelectedVideoInterlacingMode(),
parameter_tab_->GetSelectedPreviewResolution());
AudioParams audio_params = AudioParams(parameter_tab_->GetSelectedAudioSampleRate(),
parameter_tab_->GetSelectedAudioChannelLayout(),
- SampleFormat::kInternalFormat);
+ AudioParams::kInternalFormat);
if (make_undoable_) {
@@ -170,4 +171,4 @@ void SequenceDialog::SequenceParamCommand::undo_internal()
sequence_->set_name(old_name_);
}
-OLIVE_NAMESPACE_EXIT
+}
diff --git a/app/dialog/sequence/sequence.h b/app/dialog/sequence/sequence.h
index acbe22a0b..947627642 100644
--- a/app/dialog/sequence/sequence.h
+++ b/app/dialog/sequence/sequence.h
@@ -1,7 +1,7 @@
/***
Olive - Non-Linear Video Editor
- Copyright (C) 2019 Olive Team
+ Copyright (C) 2020 Olive Team
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -30,7 +30,7 @@
#include "sequencedialogpresettab.h"
#include "undo/undocommand.h"
-OLIVE_NAMESPACE_ENTER
+namespace olive {
/**
* @brief A dialog for editing Sequence parameters
@@ -133,6 +133,6 @@ private:
};
};
-OLIVE_NAMESPACE_EXIT
+}
#endif // SEQUENCEDIALOG_H
diff --git a/app/dialog/sequence/sequencedialogparametertab.cpp b/app/dialog/sequence/sequencedialogparametertab.cpp
index 98689b16c..11ea7ea71 100644
--- a/app/dialog/sequence/sequencedialogparametertab.cpp
+++ b/app/dialog/sequence/sequencedialogparametertab.cpp
@@ -7,7 +7,7 @@
#include "core.h"
-OLIVE_NAMESPACE_ENTER
+namespace olive {
SequenceDialogParameterTab::SequenceDialogParameterTab(Sequence* sequence, QWidget* parent) :
QWidget(parent)
@@ -74,8 +74,8 @@ SequenceDialogParameterTab::SequenceDialogParameterTab(Sequence* sequence, QWidg
preview_resolution_label_ = new QLabel();
preview_layout->addWidget(preview_resolution_label_, row, 2);
row++;
- preview_layout->addWidget(new QLabel(tr("Format:")), row, 0);
- preview_format_field_ = new PixelFormatComboBox(true, true);
+ preview_layout->addWidget(new QLabel(tr("Quality:")), row, 0);
+ preview_format_field_ = new PixelFormatComboBox(true);
preview_layout->addWidget(preview_format_field_, row, 1, 1, 2);
layout->addWidget(preview_group);
@@ -133,7 +133,8 @@ void SequenceDialogParameterTab::UpdatePreviewResolutionLabel()
{
VideoParams test_param(video_width_field_->GetValue(),
video_height_field_->GetValue(),
- PixelFormat::PIX_FMT_INVALID,
+ VideoParams::kFormatInvalid,
+ VideoParams::kInternalChannelCount,
rational(1),
VideoParams::kInterlaceNone,
preview_resolution_field_->currentData().toInt());
@@ -142,4 +143,4 @@ void SequenceDialogParameterTab::UpdatePreviewResolutionLabel()
QString::number(test_param.effective_height())));
}
-OLIVE_NAMESPACE_EXIT
+}
diff --git a/app/dialog/sequence/sequencedialogparametertab.h b/app/dialog/sequence/sequencedialogparametertab.h
index 794abe505..dcc1a4b4e 100644
--- a/app/dialog/sequence/sequencedialogparametertab.h
+++ b/app/dialog/sequence/sequencedialogparametertab.h
@@ -10,7 +10,7 @@
#include "widget/slider/integerslider.h"
#include "widget/standardcombos/standardcombos.h"
-OLIVE_NAMESPACE_ENTER
+namespace olive {
class SequenceDialogParameterTab : public QWidget
{
@@ -58,7 +58,7 @@ public:
return preview_resolution_field_->GetDivider();
}
- PixelFormat::Format GetSelectedPreviewFormat() const
+ VideoParams::Format GetSelectedPreviewFormat() const
{
return preview_format_field_->GetPixelFormat();
}
@@ -97,6 +97,6 @@ private slots:
};
-OLIVE_NAMESPACE_EXIT
+}
#endif // SEQUENCEDIALOGPARAMETERTAB_H
diff --git a/app/dialog/sequence/sequencedialogpresettab.cpp b/app/dialog/sequence/sequencedialogpresettab.cpp
index 18c9419db..a57852b64 100644
--- a/app/dialog/sequence/sequencedialogpresettab.cpp
+++ b/app/dialog/sequence/sequencedialogpresettab.cpp
@@ -1,7 +1,7 @@
/***
Olive - Non-Linear Video Editor
- Copyright (C) 2019 Olive Team
+ Copyright (C) 2020 Olive Team
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -30,19 +30,18 @@
#include
#include "common/filefunctions.h"
+#include "config/config.h"
#include "node/input.h"
#include "render/videoparams.h"
#include "ui/icons/icons.h"
#include "widget/menu/menu.h"
-OLIVE_NAMESPACE_ENTER
+namespace olive {
const int kDataIsPreset = Qt::UserRole;
const int kDataPresetIsCustomRole = Qt::UserRole + 1;
const int kDataPresetDataRole = Qt::UserRole + 2;
-const PixelFormat::Format kDefaultPreviewFormat = PixelFormat::PIX_FMT_RGBA16F;
-
SequenceDialogPresetTab::SequenceDialogPresetTab(QWidget* parent) :
QWidget(parent),
PresetManager(this, QStringLiteral("sequencepresets"))
@@ -100,6 +99,7 @@ QTreeWidgetItem* SequenceDialogPresetTab::CreateFolder(const QString &name)
QTreeWidgetItem *SequenceDialogPresetTab::CreateHDPresetFolder(const QString &name, int width, int height, int divider)
{
+ VideoParams::Format default_format = static_cast(Config::Current()["OfflinePixelFormat"].toInt());
QTreeWidgetItem* parent = CreateFolder(name);
AddStandardItem(parent, SequencePreset::Create(tr("%1 23.976 FPS").arg(name),
width,
@@ -110,7 +110,7 @@ QTreeWidgetItem *SequenceDialogPresetTab::CreateHDPresetFolder(const QString &na
48000,
AV_CH_LAYOUT_STEREO,
divider,
- kDefaultPreviewFormat));
+ default_format));
AddStandardItem(parent, SequencePreset::Create(tr("%1 25 FPS").arg(name),
width,
height,
@@ -120,7 +120,7 @@ QTreeWidgetItem *SequenceDialogPresetTab::CreateHDPresetFolder(const QString &na
48000,
AV_CH_LAYOUT_STEREO,
divider,
- kDefaultPreviewFormat));
+ default_format));
AddStandardItem(parent, SequencePreset::Create(tr("%1 29.97 FPS").arg(name),
width,
height,
@@ -130,7 +130,7 @@ QTreeWidgetItem *SequenceDialogPresetTab::CreateHDPresetFolder(const QString &na
48000,
AV_CH_LAYOUT_STEREO,
divider,
- kDefaultPreviewFormat));
+ default_format));
AddStandardItem(parent, SequencePreset::Create(tr("%1 50 FPS").arg(name),
width,
height,
@@ -140,7 +140,7 @@ QTreeWidgetItem *SequenceDialogPresetTab::CreateHDPresetFolder(const QString &na
48000,
AV_CH_LAYOUT_STEREO,
divider,
- kDefaultPreviewFormat));
+ default_format));
AddStandardItem(parent, SequencePreset::Create(tr("%1 59.94 FPS").arg(name),
width,
height,
@@ -150,12 +150,13 @@ QTreeWidgetItem *SequenceDialogPresetTab::CreateHDPresetFolder(const QString &na
48000,
AV_CH_LAYOUT_STEREO,
divider,
- kDefaultPreviewFormat));
+ default_format));
return parent;
}
QTreeWidgetItem *SequenceDialogPresetTab::CreateSDPresetFolder(const QString &name, int width, int height, const rational& frame_rate, const rational &standard_par, const rational &wide_par, int divider)
{
+ VideoParams::Format default_format = static_cast(Config::Current()["OfflinePixelFormat"].toInt());
QTreeWidgetItem* parent = CreateFolder(name);
preset_tree_->addTopLevelItem(parent);
AddStandardItem(parent, SequencePreset::Create(tr("%1 Standard").arg(name),
@@ -167,7 +168,7 @@ QTreeWidgetItem *SequenceDialogPresetTab::CreateSDPresetFolder(const QString &na
48000,
AV_CH_LAYOUT_STEREO,
divider,
- kDefaultPreviewFormat));
+ default_format));
AddStandardItem(parent, SequencePreset::Create(tr("%1 Widescreen").arg(name),
width,
height,
@@ -177,7 +178,7 @@ QTreeWidgetItem *SequenceDialogPresetTab::CreateSDPresetFolder(const QString &na
48000,
AV_CH_LAYOUT_STEREO,
divider,
- kDefaultPreviewFormat));
+ default_format));
return parent;
}
@@ -294,4 +295,4 @@ void SequenceDialogPresetTab::DeleteSelectedPreset()
}
}
-OLIVE_NAMESPACE_EXIT
+}
diff --git a/app/dialog/sequence/sequencedialogpresettab.h b/app/dialog/sequence/sequencedialogpresettab.h
index a2ef8a95d..c6296673f 100644
--- a/app/dialog/sequence/sequencedialogpresettab.h
+++ b/app/dialog/sequence/sequencedialogpresettab.h
@@ -1,7 +1,7 @@
/***
Olive - Non-Linear Video Editor
- Copyright (C) 2019 Olive Team
+ Copyright (C) 2020 Olive Team
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -28,7 +28,7 @@
#include "presetmanager.h"
#include "sequencepreset.h"
-OLIVE_NAMESPACE_ENTER
+namespace olive {
class SequenceDialogPresetTab : public QWidget, public PresetManager
{
@@ -77,6 +77,6 @@ private slots:
};
-OLIVE_NAMESPACE_EXIT
+}
#endif // SEQUENCEDIALOGPRESETTAB_H
diff --git a/app/dialog/sequence/sequencepreset.h b/app/dialog/sequence/sequencepreset.h
index 6b134b8f1..f6fc052b9 100644
--- a/app/dialog/sequence/sequencepreset.h
+++ b/app/dialog/sequence/sequencepreset.h
@@ -1,7 +1,7 @@
/***
Olive - Non-Linear Video Editor
- Copyright (C) 2019 Olive Team
+ Copyright (C) 2020 Olive Team
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -26,10 +26,9 @@
#include "common/rational.h"
#include "common/xmlutils.h"
#include "dialog/sequence/presetmanager.h"
-#include "render/pixelformat.h"
#include "render/videoparams.h"
-OLIVE_NAMESPACE_ENTER
+namespace olive {
class SequencePreset : public Preset {
public:
@@ -44,7 +43,7 @@ public:
int sample_rate,
uint64_t channel_layout,
int preview_divider,
- PixelFormat::Format preview_format) :
+ VideoParams::Format preview_format) :
width_(width),
height_(height),
frame_rate_(frame_rate),
@@ -67,7 +66,7 @@ public:
int sample_rate,
uint64_t channel_layout,
int preview_divider,
- PixelFormat::Format preview_format)
+ VideoParams::Format preview_format)
{
return std::make_shared(name, width, height, frame_rate, pixel_aspect,
interlacing, sample_rate, channel_layout,
@@ -96,7 +95,7 @@ public:
} else if (reader->name() == QStringLiteral("divider")) {
preview_divider_ = reader->readElementText().toInt();
} else if (reader->name() == QStringLiteral("format")) {
- preview_format_ = static_cast(reader->readElementText().toInt());
+ preview_format_ = static_cast(reader->readElementText().toInt());
} else {
reader->skipCurrentElement();
}
@@ -157,7 +156,7 @@ public:
return preview_divider_;
}
- PixelFormat::Format preview_format() const
+ VideoParams::Format preview_format() const
{
return preview_format_;
}
@@ -171,10 +170,10 @@ private:
int sample_rate_;
uint64_t channel_layout_;
int preview_divider_;
- PixelFormat::Format preview_format_;
+ VideoParams::Format preview_format_;
};
-OLIVE_NAMESPACE_EXIT
+}
#endif // SEQUENCEPARAM_H
diff --git a/app/dialog/task/CMakeLists.txt b/app/dialog/task/CMakeLists.txt
index df35aad3a..e387095d8 100644
--- a/app/dialog/task/CMakeLists.txt
+++ b/app/dialog/task/CMakeLists.txt
@@ -1,5 +1,5 @@
# Olive - Non-Linear Video Editor
-# Copyright (C) 2019 Olive Team
+# Copyright (C) 2020 Olive Team
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/app/dialog/task/task.cpp b/app/dialog/task/task.cpp
index e3e1f673b..094d91120 100644
--- a/app/dialog/task/task.cpp
+++ b/app/dialog/task/task.cpp
@@ -1,7 +1,7 @@
/***
Olive - Non-Linear Video Editor
- Copyright (C) 2019 Olive Team
+ Copyright (C) 2020 Olive Team
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -22,7 +22,7 @@
#include
-OLIVE_NAMESPACE_ENTER
+namespace olive {
TaskDialog::TaskDialog(Task* task, const QString& title, QWidget *parent) :
ProgressDialog(task->GetTitle(), title, parent),
@@ -85,4 +85,4 @@ void TaskDialog::TaskFinished()
close();
}
-OLIVE_NAMESPACE_EXIT
+}
diff --git a/app/dialog/task/task.h b/app/dialog/task/task.h
index e796ff248..7fbfaa239 100644
--- a/app/dialog/task/task.h
+++ b/app/dialog/task/task.h
@@ -1,7 +1,7 @@
/***
Olive - Non-Linear Video Editor
- Copyright (C) 2019 Olive Team
+ Copyright (C) 2020 Olive Team
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -24,7 +24,7 @@
#include "dialog/progress/progress.h"
#include "task/task.h"
-OLIVE_NAMESPACE_ENTER
+namespace olive {
class TaskDialog : public ProgressDialog
{
@@ -77,6 +77,6 @@ private slots:
};
-OLIVE_NAMESPACE_EXIT
+}
#endif // TASKDIALOG_H
diff --git a/app/main.cpp b/app/main.cpp
index 3cfa34db2..4043a53d3 100644
--- a/app/main.cpp
+++ b/app/main.cpp
@@ -1,7 +1,7 @@
/***
Olive - Non-Linear Video Editor
- Copyright (C) 2019 Olive Team
+ Copyright (C) 2020 Olive Team
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -48,7 +48,7 @@ extern "C" {
int main(int argc, char *argv[])
{
// Set up debug handler
- qInstallMessageHandler(OLIVE_NAMESPACE::DebugHandler);
+ qInstallMessageHandler(olive::DebugHandler);
// Generate version string
QString app_version = APPVERSION;
@@ -63,18 +63,16 @@ int main(int argc, char *argv[])
QCoreApplication::setOrganizationName("olivevideoeditor.org");
QCoreApplication::setOrganizationDomain("olivevideoeditor.org");
QCoreApplication::setApplicationName("Olive");
+ QGuiApplication::setDesktopFileName("org.olivevideoeditor.Olive");
QCoreApplication::setApplicationVersion(app_version);
-#if (QT_VERSION >= QT_VERSION_CHECK(5, 7, 0))
- QGuiApplication::setDesktopFileName("org.olivevideoeditor.Olive");
-#endif
//
// Parse command line arguments
//
- OLIVE_NAMESPACE::Core::CoreParams startup_params;
+ olive::Core::CoreParams startup_params;
CommandLineParser parser;
@@ -94,6 +92,12 @@ int main(int argc, char *argv[])
parser.AddOption({QStringLiteral("x"), QStringLiteral("-export")},
QCoreApplication::translate("main", "Export only (No GUI)"));
+ const CommandLineParser::Option* ts_option =
+ parser.AddOption({QStringLiteral("-ts")},
+ QCoreApplication::translate("main", "Override language with file"),
+ true,
+ QCoreApplication::translate("main", "qm-file"));
+
const CommandLineParser::PositionalArgument* project_argument =
parser.AddPositionalArgument(QStringLiteral("project"),
QCoreApplication::translate("main", "Project to open on startup"));
@@ -113,18 +117,36 @@ int main(int argc, char *argv[])
}
if (export_option->IsSet()) {
- startup_params.set_run_mode(OLIVE_NAMESPACE::Core::CoreParams::kHeadlessExport);
+ startup_params.set_run_mode(olive::Core::CoreParams::kHeadlessExport);
+ }
+
+ if (ts_option->IsSet()) {
+ if (ts_option->GetSetting().isEmpty()) {
+ qWarning() << "--ts was set but no translation file was provided";
+ } else {
+ startup_params.set_startup_language(ts_option->GetSetting());
+ }
}
startup_params.set_fullscreen(fullscreen_option->IsSet());
startup_params.set_startup_project(project_argument->GetSetting());
- // Set OpenGL display profile (3.2 Core)
+ // Set OpenGL display profile
QSurfaceFormat format;
+
+ // Tries to cover all bases. If drivers don't support 3.2, they should fallback to the closest
+ // alternative. Unfortunately Qt doesn't support 3.0-3.1 without DeprecatedFunctions, so we
+ // declare that too. We also force Qt to not use ANGLE because I've had a lot of problems with it
+ // so far.
+ //
+ // https://bugreports.qt.io/browse/QTBUG-46140
+ QCoreApplication::setAttribute(Qt::AA_UseDesktopOpenGL);
format.setVersion(3, 2);
- format.setDepthBufferSize(24);
format.setProfile(QSurfaceFormat::CoreProfile);
+ format.setOption(QSurfaceFormat::DeprecatedFunctions);
+
+ format.setDepthBufferSize(24);
QSurfaceFormat::setDefaultFormat(format);
// Enable application automatically using higher resolution images from icons
@@ -133,7 +155,7 @@ int main(int argc, char *argv[])
// Create application instance
std::unique_ptr a;
- if (startup_params.run_mode() == OLIVE_NAMESPACE::Core::CoreParams::kRunNormal) {
+ if (startup_params.run_mode() == olive::Core::CoreParams::kRunNormal) {
a.reset(new QApplication(argc, argv));
} else {
a.reset(new QCoreApplication(argc, argv));
@@ -155,7 +177,8 @@ int main(int argc, char *argv[])
#endif // USE_CRASHPAD
// Start core
- OLIVE_NAMESPACE::Core c(startup_params);
+ olive::Core c(startup_params);
+
c.Start();
int ret = a->exec();
diff --git a/app/node/CMakeLists.txt b/app/node/CMakeLists.txt
index 744bc7da9..a39950a51 100644
--- a/app/node/CMakeLists.txt
+++ b/app/node/CMakeLists.txt
@@ -1,5 +1,5 @@
# Olive - Non-Linear Video Editor
-# Copyright (C) 2019 Olive Team
+# Copyright (C) 2020 Olive Team
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -16,6 +16,7 @@
add_subdirectory(audio)
add_subdirectory(block)
+add_subdirectory(distort)
add_subdirectory(filter)
add_subdirectory(generator)
add_subdirectory(input)
diff --git a/app/node/audio/CMakeLists.txt b/app/node/audio/CMakeLists.txt
index e8bfe8647..e1dfd8173 100644
--- a/app/node/audio/CMakeLists.txt
+++ b/app/node/audio/CMakeLists.txt
@@ -1,5 +1,5 @@
# Olive - Non-Linear Video Editor
-# Copyright (C) 2019 Olive Team
+# Copyright (C) 2020 Olive Team
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/app/node/audio/pan/CMakeLists.txt b/app/node/audio/pan/CMakeLists.txt
index 66384293d..56e7ed226 100644
--- a/app/node/audio/pan/CMakeLists.txt
+++ b/app/node/audio/pan/CMakeLists.txt
@@ -1,5 +1,5 @@
# Olive - Non-Linear Video Editor
-# Copyright (C) 2019 Olive Team
+# Copyright (C) 2020 Olive Team
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/app/node/audio/pan/pan.cpp b/app/node/audio/pan/pan.cpp
index dad795d02..71ae6ea6f 100644
--- a/app/node/audio/pan/pan.cpp
+++ b/app/node/audio/pan/pan.cpp
@@ -1,7 +1,7 @@
/***
Olive - Non-Linear Video Editor
- Copyright (C) 2019 Olive Team
+ Copyright (C) 2020 Olive Team
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -20,7 +20,7 @@
#include "pan.h"
-OLIVE_NAMESPACE_ENTER
+namespace olive {
PanNode::PanNode()
{
@@ -28,9 +28,9 @@ PanNode::PanNode()
AddInput(samples_input_);
panning_input_ = new NodeInput("panning_in", NodeParam::kFloat, 0.0);
- panning_input_->set_property("min", -1.0);
- panning_input_->set_property("max", 1.0);
- panning_input_->set_property("view", "percent");
+ panning_input_->setProperty("min", -1.0);
+ panning_input_->setProperty("max", 1.0);
+ panning_input_->setProperty("view", QStringLiteral("percent"));
AddInput(panning_input_);
}
@@ -49,7 +49,7 @@ QString PanNode::id() const
return QStringLiteral("org.olivevideoeditor.Olive.pan");
}
-QList PanNode::Category() const
+QVector PanNode::Category() const
{
return {kCategoryChannels};
}
@@ -69,7 +69,7 @@ NodeValueTable PanNode::Value(NodeValueDatabase &value) const
NodeValueTable table = value.Merge();
if (job.HasSamples()) {
- float pan_volume = job.GetValue(panning_input_).data().toFloat();
+ float pan_volume = job.GetValue(panning_input_).data.toFloat();
if (panning_input_->is_static()) {
if (!qIsNull(pan_volume) && job.samples()->audio_params().channel_count() == 2) {
if (pan_volume > 0) {
@@ -114,4 +114,4 @@ void PanNode::Retranslate()
panning_input_->set_name(tr("Pan"));
}
-OLIVE_NAMESPACE_EXIT
+}
diff --git a/app/node/audio/pan/pan.h b/app/node/audio/pan/pan.h
index df23f9d0f..e6298fc84 100644
--- a/app/node/audio/pan/pan.h
+++ b/app/node/audio/pan/pan.h
@@ -1,7 +1,7 @@
/***
Olive - Non-Linear Video Editor
- Copyright (C) 2019 Olive Team
+ Copyright (C) 2020 Olive Team
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -23,10 +23,11 @@
#include "node/node.h"
-OLIVE_NAMESPACE_ENTER
+namespace olive {
class PanNode : public Node
{
+ Q_OBJECT
public:
PanNode();
@@ -34,7 +35,7 @@ public:
virtual QString Name() const override;
virtual QString id() const override;
- virtual QList