Merge pull request #378 from olive-editor/variousimprovements

various improvements
This commit is contained in:
itsmattkc
2019-01-30 23:21:23 +11:00
committed by GitHub
53 changed files with 795 additions and 527 deletions
+12 -13
View File
@@ -10,21 +10,20 @@ AboutDialog::AboutDialog(QWidget *parent) :
setWindowTitle("About Olive");
setMaximumWidth(360);
QVBoxLayout* layout = new QVBoxLayout();
QVBoxLayout* layout = new QVBoxLayout(this);
layout->setSpacing(20);
setLayout(layout);
QLabel* label =
new QLabel("<html><head/><body>"
"<p><img src=\":/icons/olive-splash.png\"/></p>"
"<p><a href=\"https://www.olivevideoeditor.org/\">"
"<span style=\" text-decoration: underline; color:#007af4;\">"
"https://www.olivevideoeditor.org/"
"</span></a></p><p>"
+ tr("Olive is a non-linear video editor. This software is free and protected by the GNU GPL.")
+ "</p><p>"
+ tr("Olive Team is obliged to inform users that Olive source code is available for download from its website.")
+ "</p></body></html>");
QLabel* label =
new QLabel("<html><head/><body>"
"<p><img src=\":/icons/olive-splash.png\"/></p>"
"<p><a href=\"https://www.olivevideoeditor.org/\">"
"<span style=\" text-decoration: underline; color:#007af4;\">"
"https://www.olivevideoeditor.org/"
"</span></a></p><p>"
+ tr("Olive is a non-linear video editor. This software is free and protected by the GNU GPL.")
+ "</p><p>"
+ tr("Olive Team is obliged to inform users that Olive source code is available for download from its website.")
+ "</p></body></html>", this);
label->setAlignment(Qt::AlignCenter);
label->setWordWrap(true);
layout->addWidget(label);
+9 -7
View File
@@ -17,28 +17,26 @@ ActionSearch::ActionSearch(QWidget *parent) :
setWindowFlags(Qt::Popup);
QVBoxLayout* layout = new QVBoxLayout();
QVBoxLayout* layout = new QVBoxLayout(this);
ActionSearchEntry* entry_field = new ActionSearchEntry();
ActionSearchEntry* entry_field = new ActionSearchEntry(this);
QFont entry_field_font = entry_field->font();
entry_field_font.setPointSize(qRound(entry_field_font.pointSize()*1.2));
entry_field->setFont(entry_field_font);
entry_field->setPlaceholderText(tr("Search for action..."));
entry_field->setPlaceholderText(tr("Search for action..."));
connect(entry_field, SIGNAL(textChanged(const QString&)), this, SLOT(search_update(const QString &)));
connect(entry_field, SIGNAL(returnPressed()), this, SLOT(perform_action()));
connect(entry_field, SIGNAL(moveSelectionUp()), this, SLOT(move_selection_up()));
connect(entry_field, SIGNAL(moveSelectionDown()), this, SLOT(move_selection_down()));
layout->addWidget(entry_field);
list_widget = new ActionSearchList();
list_widget = new ActionSearchList(this);
QFont list_widget_font = list_widget->font();
list_widget_font.setPointSize(qRound(list_widget_font.pointSize()*1.2));
list_widget->setFont(list_widget_font);
layout->addWidget(list_widget);
connect(list_widget, SIGNAL(dbl_click()), this, SLOT(perform_action()));
setLayout(layout);
entry_field->setFocus();
}
@@ -65,7 +63,7 @@ void ActionSearch::search_update(const QString &s, const QString &p, QMenu *pare
} else {
QString comp = a->text().replace("&", "");
if (comp.contains(s, Qt::CaseInsensitive)) {
QListWidgetItem* item = new QListWidgetItem(comp + "\n(" + menu_text + ")");
QListWidgetItem* item = new QListWidgetItem(QString("%1\n(%2)").arg(comp, menu_text), list_widget);
item->setData(Qt::UserRole+1, reinterpret_cast<quintptr>(a));
list_widget->addItem(item);
}
@@ -107,6 +105,8 @@ void ActionSearch::move_selection_down() {
}
}
ActionSearchEntry::ActionSearchEntry(QWidget *parent) : QLineEdit(parent) {}
void ActionSearchEntry::keyPressEvent(QKeyEvent * event) {
switch (event->key()) {
case Qt::Key_Up:
@@ -120,6 +120,8 @@ void ActionSearchEntry::keyPressEvent(QKeyEvent * event) {
}
}
ActionSearchList::ActionSearchList(QWidget *parent) : QListWidget(parent) {}
void ActionSearchList::mouseDoubleClickEvent(QMouseEvent *) {
emit dbl_click();
}
+6 -2
View File
@@ -10,6 +10,8 @@ class QMenu;
class ActionSearchList : public QListWidget {
Q_OBJECT
public:
ActionSearchList(QWidget* parent);
protected:
void mouseDoubleClickEvent(QMouseEvent *event);
signals:
@@ -20,9 +22,9 @@ class ActionSearch : public QDialog
{
Q_OBJECT
public:
ActionSearch(QWidget* parent = 0);
ActionSearch(QWidget* parent = nullptr);
private slots:
void search_update(const QString& s, const QString &p = 0, QMenu *parent = nullptr);
void search_update(const QString& s, const QString &p = nullptr, QMenu *parent = nullptr);
void perform_action();
void move_selection_up();
void move_selection_down();
@@ -32,6 +34,8 @@ private:
class ActionSearchEntry : public QLineEdit {
Q_OBJECT
public:
ActionSearchEntry(QWidget* parent);
protected:
void keyPressEvent(QKeyEvent * event);
signals:
+2 -3
View File
@@ -11,10 +11,9 @@ DebugDialog* debug_dialog = nullptr;
DebugDialog::DebugDialog(QWidget *parent) : QDialog(parent) {
setWindowTitle(tr("Debug Log"));
QVBoxLayout* layout = new QVBoxLayout();
setLayout(layout);
QVBoxLayout* layout = new QVBoxLayout(this);
textEdit = new QTextEdit();
textEdit = new QTextEdit(this);
textEdit->setWordWrapMode(QTextOption::NoWrap);
layout->addWidget(textEdit);
}
+16 -17
View File
@@ -7,31 +7,30 @@
DemoNotice::DemoNotice(QWidget *parent) :
QDialog(parent)
{
setWindowTitle(tr("Welcome to Olive!"));
setWindowTitle(tr("Welcome to Olive!"));
setMaximumWidth(600);
QVBoxLayout* vlayout = new QVBoxLayout();
setLayout(vlayout);
QVBoxLayout* vlayout = new QVBoxLayout(this);
QHBoxLayout* layout = new QHBoxLayout();
QHBoxLayout* layout = new QHBoxLayout(this);
layout->setMargin(10);
layout->setSpacing(20);
QLabel* icon = new QLabel("<html><head/><body>"
"<p><img src=\":/icons/olive-splash.png\"/></p>"
"</body></html>");
QLabel* icon = new QLabel("<html><head/><body>"
"<p><img src=\":/icons/olive-splash.png\"/></p>"
"</body></html>", this);
layout->addWidget(icon);
QLabel* text = new QLabel("<html><head/><body><p>"
"<span style=\" font-size:14pt;\">"
+ tr("Welcome to Olive!")
+ "</span></p><p>"
+ tr("Olive is a free open-source video editor released under the GNU GPL. If you have paid for this software, you have been scammed.")
+ "</p><p>"
+ tr("This software is currently in ALPHA which means it is unstable and very likely to crash, have bugs, and have missing features. We offer no warranty so use at your own risk. Please report any bugs or feature requests at %1").arg("<a href=\"https://olivevideoeditor.org/\"><span style=\" text-decoration: underline; color:#007af4;\">www.olivevideoeditor.org</span></a>")
+ "</p><p>"
+ tr("Thank you for trying Olive and we hope you enjoy it!")
+ "</p></body></html>");
QLabel* text = new QLabel("<html><head/><body><p>"
"<span style=\" font-size:14pt;\">"
+ tr("Welcome to Olive!")
+ "</span></p><p>"
+ tr("Olive is a free open-source video editor released under the GNU GPL. If you have paid for this software, you have been scammed.")
+ "</p><p>"
+ tr("This software is currently in ALPHA which means it is unstable and very likely to crash, have bugs, and have missing features. We offer no warranty so use at your own risk. Please report any bugs or feature requests at %1").arg("<a href=\"https://olivevideoeditor.org/\"><span style=\" text-decoration: underline; color:#007af4;\">www.olivevideoeditor.org</span></a>")
+ "</p><p>"
+ tr("Thank you for trying Olive and we hope you enjoy it!")
+ "</p></body></html>", this);
text->setWordWrap(true);
layout->addWidget(text);
+12 -13
View File
@@ -498,7 +498,7 @@ void ExportDialog::export_action() {
}
}
et = new ExportThread();
et = new ExportThread(this);
connect(et, SIGNAL(finished()), et, SLOT(deleteLater()));
connect(et, SIGNAL(finished()), this, SLOT(render_thread_finished()));
@@ -601,17 +601,16 @@ void ExportDialog::setup_ui() {
QHBoxLayout* format_layout = new QHBoxLayout();
format_layout->addWidget(new QLabel(tr("Format:")));
formatCombobox = new QComboBox(this);
format_layout->addWidget(new QLabel(tr("Format:"), this));
formatCombobox = new QComboBox();
format_layout->addWidget(formatCombobox);
verticalLayout->addLayout(format_layout);
QHBoxLayout* range_layout = new QHBoxLayout();
range_layout->addWidget(new QLabel(tr("Range:")));
range_layout->addWidget(new QLabel(tr("Range:"), this));
rangeCombobox = new QComboBox(this);
rangeCombobox->addItem(tr("Entire Sequence"));
@@ -628,27 +627,27 @@ void ExportDialog::setup_ui() {
QGridLayout* videoGridLayout = new QGridLayout(videoGroupbox);
videoGridLayout->addWidget(new QLabel(tr("Codec:")), 0, 0, 1, 1);
videoGridLayout->addWidget(new QLabel(tr("Codec:"), this), 0, 0, 1, 1);
vcodecCombobox = new QComboBox(videoGroupbox);
videoGridLayout->addWidget(vcodecCombobox, 0, 1, 1, 1);
videoGridLayout->addWidget(new QLabel(tr("Width:")), 1, 0, 1, 1);
videoGridLayout->addWidget(new QLabel(tr("Width:"), this), 1, 0, 1, 1);
widthSpinbox = new QSpinBox(videoGroupbox);
widthSpinbox->setMaximum(16777216);
videoGridLayout->addWidget(widthSpinbox, 1, 1, 1, 1);
videoGridLayout->addWidget(new QLabel(tr("Height:")), 2, 0, 1, 1);
videoGridLayout->addWidget(new QLabel(tr("Height:"), this), 2, 0, 1, 1);
heightSpinbox = new QSpinBox(videoGroupbox);
heightSpinbox->setMaximum(16777216);
videoGridLayout->addWidget(heightSpinbox, 2, 1, 1, 1);
videoGridLayout->addWidget(new QLabel(tr("Frame Rate:")), 3, 0, 1, 1);
videoGridLayout->addWidget(new QLabel(tr("Frame Rate:"), this), 3, 0, 1, 1);
framerateSpinbox = new QDoubleSpinBox(videoGroupbox);
framerateSpinbox->setMaximum(60);
framerateSpinbox->setValue(0);
videoGridLayout->addWidget(framerateSpinbox, 3, 1, 1, 1);
videoGridLayout->addWidget(new QLabel(tr("Compression Type:")), 4, 0, 1, 1);
videoGridLayout->addWidget(new QLabel(tr("Compression Type:"), this), 4, 0, 1, 1);
compressionTypeCombobox = new QComboBox(videoGroupbox);
videoGridLayout->addWidget(compressionTypeCombobox, 4, 1, 1, 1);
@@ -667,17 +666,17 @@ void ExportDialog::setup_ui() {
QGridLayout* audioGridLayout = new QGridLayout(audioGroupbox);
audioGridLayout->addWidget(new QLabel(tr("Codec:")), 0, 0, 1, 1);
audioGridLayout->addWidget(new QLabel(tr("Codec:"), this), 0, 0, 1, 1);
acodecCombobox = new QComboBox(audioGroupbox);
audioGridLayout->addWidget(acodecCombobox, 0, 1, 1, 1);
audioGridLayout->addWidget(new QLabel(tr("Sampling Rate:")), 1, 0, 1, 1);
audioGridLayout->addWidget(new QLabel(tr("Sampling Rate:"), this), 1, 0, 1, 1);
samplingRateSpinbox = new QSpinBox(audioGroupbox);
samplingRateSpinbox->setMaximum(96000);
samplingRateSpinbox->setValue(0);
audioGridLayout->addWidget(samplingRateSpinbox, 1, 1, 1, 1);
audioGridLayout->addWidget(new QLabel(tr("Bitrate (Kbps/CBR):")), 3, 0, 1, 1);
audioGridLayout->addWidget(new QLabel(tr("Bitrate (Kbps/CBR):"), this), 3, 0, 1, 1);
audiobitrateSpinbox = new QSpinBox(audioGroupbox);
audiobitrateSpinbox->setMaximum(320);
audiobitrateSpinbox->setValue(256);
+6 -7
View File
@@ -14,22 +14,21 @@
#include "mainwindow.h"
LoadDialog::LoadDialog(QWidget *parent, bool autorecovery) : QDialog(parent) {
setWindowTitle(tr("Loading..."));
setWindowTitle(tr("Loading..."));
setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
QVBoxLayout* layout = new QVBoxLayout();
setLayout(layout);
QVBoxLayout* layout = new QVBoxLayout(this);
layout->addWidget(new QLabel(tr("Loading '%1'...").arg(project_url.mid(project_url.lastIndexOf('/')+1))));
layout->addWidget(new QLabel(tr("Loading '%1'...").arg(project_url.mid(project_url.lastIndexOf('/')+1)), this));
bar = new QProgressBar();
bar = new QProgressBar(this);
bar->setValue(0);
layout->addWidget(bar);
cancel_button = new QPushButton(tr("Cancel"));
cancel_button = new QPushButton(tr("Cancel"), this);
connect(cancel_button, SIGNAL(clicked(bool)), this, SLOT(cancel()));
hboxLayout = new QHBoxLayout();
hboxLayout = new QHBoxLayout(this);
hboxLayout->addStretch();
hboxLayout->addWidget(cancel_button);
hboxLayout->addStretch();
+15 -14
View File
@@ -23,17 +23,16 @@ MediaPropertiesDialog::MediaPropertiesDialog(QWidget *parent, Media *i) :
setWindowTitle(tr("\"%1\" Properties").arg(i->get_name()));
setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
QGridLayout* grid = new QGridLayout();
setLayout(grid);
QGridLayout* grid = new QGridLayout(this);
int row = 0;
Footage* f = item->to_footage();
grid->addWidget(new QLabel(tr("Tracks:")), row, 0, 1, 2);
grid->addWidget(new QLabel(tr("Tracks:"), this), row, 0, 1, 2);
row++;
track_list = new QListWidget();
track_list = new QListWidget(this);
for (int i=0;i<f->video_tracks.size();i++) {
const FootageStream& fs = f->video_tracks.at(i);
@@ -43,7 +42,8 @@ MediaPropertiesDialog::MediaPropertiesDialog(QWidget *parent, Media *i) :
QString::number(fs.video_width),
QString::number(fs.video_height),
QString::number(fs.video_frame_rate)
)
),
track_list
);
item->setFlags(item->flags() | Qt::ItemIsUserCheckable);
item->setCheckState(fs.enabled ? Qt::Checked : Qt::Unchecked);
@@ -57,7 +57,8 @@ MediaPropertiesDialog::MediaPropertiesDialog(QWidget *parent, Media *i) :
QString::number(fs.file_index),
QString::number(fs.audio_frequency),
QString::number(fs.audio_channels)
)
),
track_list
);
item->setFlags(item->flags() | Qt::ItemIsUserCheckable);
item->setCheckState(fs.enabled ? Qt::Checked : Qt::Unchecked);
@@ -70,8 +71,8 @@ MediaPropertiesDialog::MediaPropertiesDialog(QWidget *parent, Media *i) :
if (f->video_tracks.size() > 0) {
// frame conforming
if (!f->video_tracks.at(0).infinite_length) {
grid->addWidget(new QLabel(tr("Conform to Frame Rate:")), row, 0);
conform_fr = new QDoubleSpinBox();
grid->addWidget(new QLabel(tr("Conform to Frame Rate:"), this), row, 0);
conform_fr = new QDoubleSpinBox(this);
conform_fr->setMinimum(0.01);
conform_fr->setValue(f->video_tracks.at(0).video_frame_rate * f->speed);
grid->addWidget(conform_fr, row, 1);
@@ -80,14 +81,14 @@ MediaPropertiesDialog::MediaPropertiesDialog(QWidget *parent, Media *i) :
row++;
// premultiplied alpha mode
premultiply_alpha_setting = new QCheckBox(tr("Alpha is Premultiplied"));
premultiply_alpha_setting = new QCheckBox(tr("Alpha is Premultiplied"), this);
premultiply_alpha_setting->setChecked(f->alpha_is_premultiplied);
grid->addWidget(premultiply_alpha_setting, row, 0);
row++;
// deinterlacing mode
interlacing_box = new QComboBox();
interlacing_box = new QComboBox(this);
interlacing_box->addItem(
tr("Auto (%1)").arg(
get_interlacing_name(f->video_tracks.at(0).video_auto_interlacing)
@@ -102,18 +103,18 @@ MediaPropertiesDialog::MediaPropertiesDialog(QWidget *parent, Media *i) :
? 0
: f->video_tracks.at(0).video_interlacing + 1);
grid->addWidget(new QLabel(tr("Interlacing:")), row, 0);
grid->addWidget(new QLabel(tr("Interlacing:"), this), row, 0);
grid->addWidget(interlacing_box, row, 1);
row++;
}
name_box = new QLineEdit(item->get_name());
grid->addWidget(new QLabel(tr("Name:")), row, 0);
name_box = new QLineEdit(item->get_name(), this);
grid->addWidget(new QLabel(tr("Name:"), this), row, 0);
grid->addWidget(name_box, row, 1);
row++;
QDialogButtonBox* buttons = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
QDialogButtonBox* buttons = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this);
buttons->setCenterButtons(true);
grid->addWidget(buttons, row, 0, 1, 2);
+11 -17
View File
@@ -8,6 +8,7 @@
#include "panels/timeline.h"
#include "playback/playback.h"
#include "project/media.h"
#include "playback/audio.h"
#include <QVariant>
#include <QVBoxLayout>
@@ -103,8 +104,7 @@ void NewSequenceDialog::create() {
accept();
}
void NewSequenceDialog::preset_changed(int index)
{
void NewSequenceDialog::preset_changed(int index) {
switch (index) {
case 0: // FILM 4K
width_numeric->setValue(4096);
@@ -157,7 +157,7 @@ void NewSequenceDialog::setup_ui() {
QHBoxLayout* preset_layout = new QHBoxLayout(widget);
preset_layout->setContentsMargins(0, 0, 0, 0);
preset_layout->addWidget(new QLabel(tr("Preset:")));
preset_layout->addWidget(new QLabel(tr("Preset:"), this));
preset_combobox = new QComboBox(widget);
@@ -183,19 +183,19 @@ void NewSequenceDialog::setup_ui() {
QGridLayout* videoLayout = new QGridLayout(videoGroupBox);
videoLayout->addWidget(new QLabel(tr("Width:")), 0, 0, 1, 1);
videoLayout->addWidget(new QLabel(tr("Width:"), this), 0, 0, 1, 1);
width_numeric = new QSpinBox(videoGroupBox);
width_numeric->setMaximum(9999);
width_numeric->setValue(1920);
videoLayout->addWidget(width_numeric, 0, 2, 1, 2);
videoLayout->addWidget(new QLabel(tr("Height:")), 1, 0, 1, 2);
videoLayout->addWidget(new QLabel(tr("Height:"), this), 1, 0, 1, 2);
height_numeric = new QSpinBox(videoGroupBox);
height_numeric->setMaximum(9999);
height_numeric->setValue(1080);
videoLayout->addWidget(height_numeric, 1, 2, 1, 2);
videoLayout->addWidget(new QLabel(tr("Frame Rate:")), 2, 0, 1, 1);
videoLayout->addWidget(new QLabel(tr("Frame Rate:"), this), 2, 0, 1, 1);
frame_rate_combobox = new QComboBox(videoGroupBox);
frame_rate_combobox->addItem("10 FPS", 10.0);
frame_rate_combobox->addItem("12.5 FPS", 12.5);
@@ -211,12 +211,12 @@ void NewSequenceDialog::setup_ui() {
frame_rate_combobox->setCurrentIndex(6);
videoLayout->addWidget(frame_rate_combobox, 2, 2, 1, 2);
videoLayout->addWidget(new QLabel(tr("Pixel Aspect Ratio:")), 4, 0, 1, 1);
videoLayout->addWidget(new QLabel(tr("Pixel Aspect Ratio:"), this), 4, 0, 1, 1);
par_combobox = new QComboBox(videoGroupBox);
par_combobox->addItem(tr("Square Pixels (1.0)"));
videoLayout->addWidget(par_combobox, 4, 2, 1, 2);
videoLayout->addWidget(new QLabel(tr("Interlacing:")), 6, 0, 1, 1);
videoLayout->addWidget(new QLabel(tr("Interlacing:"), this), 6, 0, 1, 1);
interlacing_combobox = new QComboBox(videoGroupBox);
interlacing_combobox->addItem(tr("None (Progressive)"));
// interlacing_combobox->addItem("Upper Field First");
@@ -230,16 +230,10 @@ void NewSequenceDialog::setup_ui() {
QGridLayout* audioLayout = new QGridLayout(audioGroupBox);
audioLayout->addWidget(new QLabel(tr("Sample Rate: ")), 0, 0, 1, 1);
audioLayout->addWidget(new QLabel(tr("Sample Rate: "), this), 0, 0, 1, 1);
audio_frequency_combobox = new QComboBox(audioGroupBox);
audio_frequency_combobox->addItem("22050 Hz", 22050);
audio_frequency_combobox->addItem("24000 Hz", 24000);
audio_frequency_combobox->addItem("32000 Hz", 32000);
audio_frequency_combobox->addItem("44100 Hz", 44100);
audio_frequency_combobox->addItem("48000 Hz", 48000);
audio_frequency_combobox->addItem("88200 Hz", 88200);
audio_frequency_combobox->addItem("96000 Hz", 96000);
combobox_audio_sample_rates(audio_frequency_combobox);
audio_frequency_combobox->setCurrentIndex(4);
audioLayout->addWidget(audio_frequency_combobox, 0, 1, 1, 1);
@@ -250,7 +244,7 @@ void NewSequenceDialog::setup_ui() {
QHBoxLayout* nameLayout = new QHBoxLayout(nameWidget);
nameLayout->setContentsMargins(0, 0, 0, 0);
nameLayout->addWidget(new QLabel("Name:"));
nameLayout->addWidget(new QLabel(tr("Name:"), this));
sequence_name_edit = new QLineEdit(nameWidget);
+97 -26
View File
@@ -1,6 +1,7 @@
#include "preferencesdialog.h"
#include "io/config.h"
#include "playback/audio.h"
#include "mainwindow.h"
#include <QMenuBar>
@@ -22,6 +23,7 @@
#include <QDoubleSpinBox>
#include <QFileDialog>
#include <QMessageBox>
#include <QAudioDeviceInfo>
#include "debug.h"
@@ -71,7 +73,7 @@ void PreferencesDialog::setup_kbd_shortcut_worker(QMenu* menu, QTreeWidgetItem*
QAction* a = actions.at(i);
if (!a->isSeparator() && a->property("keyignore").isNull()) {
QTreeWidgetItem* item = new QTreeWidgetItem();
QTreeWidgetItem* item = new QTreeWidgetItem(parent);
item->setText(0, a->text().replace("&", ""));
parent->addChild(item);
@@ -93,7 +95,7 @@ void PreferencesDialog::setup_kbd_shortcuts(QMenuBar* menubar) {
for (int i=0;i<menus.size();i++) {
QMenu* menu = menus.at(i)->menu();
QTreeWidgetItem* item = new QTreeWidgetItem();
QTreeWidgetItem* item = new QTreeWidgetItem(keyboard_tree);
item->setText(0, menu->title().replace("&", ""));
keyboard_tree->addTopLevelItem(item);
@@ -133,6 +135,14 @@ void PreferencesDialog::save() {
config.previous_queue_size = previous_queue_spinbox->value();
config.previous_queue_type = previous_queue_type->currentIndex();
// audio preferences
bool reset_audio_required = (config.preferred_audio_output != audio_output_devices->currentData().toString()
|| config.preferred_audio_input != audio_input_devices->currentData().toString());
config.preferred_audio_output = audio_output_devices->currentData().toString();
config.preferred_audio_input = audio_input_devices->currentData().toString();
qDebug() << "selected audio input" << audio_input_devices->currentData().toString();
config.audio_rate = audio_sample_rate->currentData().toInt();
// the following settings may require a restart of Olive to take effect:
bool needs_restart = false;
@@ -152,6 +162,10 @@ void PreferencesDialog::save() {
key_shortcut_fields.at(i)->set_action_shortcut();
}
if (reset_audio_required) {
init_audio();
}
if (needs_restart) {
QMessageBox::information(this, tr("Warning"), tr("Some changed settings will require restarting Olive to take effect"));
}
@@ -286,11 +300,11 @@ void PreferencesDialog::setup_ui() {
QTabWidget* tabWidget = new QTabWidget(this);
// General
QTabWidget* general_tab = new QTabWidget();
QWidget* general_tab = new QWidget(this);
QGridLayout* general_layout = new QGridLayout(general_tab);
// General -> Custom CSS
general_layout->addWidget(new QLabel(tr("Custom CSS:")), 0, 0, 1, 1);
general_layout->addWidget(new QLabel(tr("Custom CSS:"), this), 0, 0, 1, 1);
custom_css_fn = new QLineEdit(general_tab);
custom_css_fn->setText(config.css_path);
@@ -301,14 +315,14 @@ void PreferencesDialog::setup_ui() {
general_layout->addWidget(custom_css_browse, 0, 2, 1, 1);
// General -> Image Sequence Formats
general_layout->addWidget(new QLabel(tr("Image sequence formats:")), 1, 0, 1, 1);
general_layout->addWidget(new QLabel(tr("Image sequence formats:"), this), 1, 0, 1, 1);
imgSeqFormatEdit = new QLineEdit(general_tab);
general_layout->addWidget(imgSeqFormatEdit, 1, 1, 1, 2);
// General -> Audio Recording
general_layout->addWidget(new QLabel(tr("Audio Recording:")), 2, 0, 1, 1);
general_layout->addWidget(new QLabel(tr("Audio Recording:"), this), 2, 0, 1, 1);
recordingComboBox = new QComboBox(general_tab);
recordingComboBox->addItem(tr("Mono"));
@@ -316,7 +330,7 @@ void PreferencesDialog::setup_ui() {
general_layout->addWidget(recordingComboBox, 2, 1, 1, 2);
// General -> Effect Textbox Lines
general_layout->addWidget(new QLabel(tr("Effect Textbox Lines:")), 3, 0, 1, 1);
general_layout->addWidget(new QLabel(tr("Effect Textbox Lines:"), this), 3, 0, 1, 1);
effect_textbox_lines_field = new QSpinBox(general_tab);
effect_textbox_lines_field->setMinimum(1);
@@ -332,15 +346,15 @@ void PreferencesDialog::setup_ui() {
tabWidget->addTab(general_tab, tr("General"));
// Behavior
QWidget* behavior_tab = new QWidget();
QWidget* behavior_tab = new QWidget(this);
tabWidget->addTab(behavior_tab, tr("Behavior"));
// Playback
QWidget* playback_tab = new QWidget();
QWidget* playback_tab = new QWidget(this);
QVBoxLayout* playback_tab_layout = new QVBoxLayout(playback_tab);
// Playback -> Disable Multithreading on Images
disable_img_multithread = new QCheckBox(tr("Disable Multithreading on Images"));
disable_img_multithread = new QCheckBox(tr("Disable Multithreading on Images"), playback_tab);
disable_img_multithread->setChecked(config.disable_multithreading_for_images);
playback_tab_layout->addWidget(disable_img_multithread);
@@ -360,20 +374,20 @@ void PreferencesDialog::setup_ui() {
QGroupBox* memory_usage_group = new QGroupBox(playback_tab);
memory_usage_group->setTitle(tr("Memory Usage"));
QGridLayout* memory_usage_layout = new QGridLayout(memory_usage_group);
memory_usage_layout->addWidget(new QLabel(tr("Upcoming Frame Queue:")), 0, 0);
upcoming_queue_spinbox = new QDoubleSpinBox();
memory_usage_layout->addWidget(new QLabel(tr("Upcoming Frame Queue:"), playback_tab), 0, 0);
upcoming_queue_spinbox = new QDoubleSpinBox(playback_tab);
upcoming_queue_spinbox->setValue(config.upcoming_queue_size);
memory_usage_layout->addWidget(upcoming_queue_spinbox, 0, 1);
upcoming_queue_type = new QComboBox();
upcoming_queue_type = new QComboBox(playback_tab);
upcoming_queue_type->addItem(tr("frames"));
upcoming_queue_type->addItem(tr("seconds"));
upcoming_queue_type->setCurrentIndex(config.upcoming_queue_type);
memory_usage_layout->addWidget(upcoming_queue_type, 0, 2);
memory_usage_layout->addWidget(new QLabel(tr("Previous Frame Queue:")), 1, 0);
previous_queue_spinbox = new QDoubleSpinBox();
memory_usage_layout->addWidget(new QLabel(tr("Previous Frame Queue:"), playback_tab), 1, 0);
previous_queue_spinbox = new QDoubleSpinBox(playback_tab);
previous_queue_spinbox->setValue(config.previous_queue_size);
memory_usage_layout->addWidget(previous_queue_spinbox, 1, 1);
previous_queue_type = new QComboBox();
previous_queue_type = new QComboBox(playback_tab);
previous_queue_type->addItem(tr("frames"));
previous_queue_type->addItem(tr("seconds"));
previous_queue_type->setCurrentIndex(config.previous_queue_type);
@@ -382,39 +396,98 @@ void PreferencesDialog::setup_ui() {
tabWidget->addTab(playback_tab, tr("Playback"));
QWidget* shortcut_tab = new QWidget();
// Audio
QWidget* audio_tab = new QWidget(this);
QGridLayout* audio_tab_layout = new QGridLayout(audio_tab);
audio_tab_layout->addWidget(new QLabel(tr("Output Device:")), 0, 0);
audio_output_devices = new QComboBox();
audio_output_devices->addItem(tr("Default"), "");
// list all available audio output devices
QList<QAudioDeviceInfo> devs = QAudioDeviceInfo::availableDevices(QAudio::AudioOutput);
bool found_preferred_device = false;
for (int i=0;i<devs.size();i++) {
audio_output_devices->addItem(devs.at(i).deviceName(), devs.at(i).deviceName());
if (!found_preferred_device
&& devs.at(i).deviceName() == config.preferred_audio_output) {
audio_output_devices->setCurrentIndex(audio_output_devices->count()-1);
found_preferred_device = true;
}
}
audio_tab_layout->addWidget(audio_output_devices, 0, 1);
audio_tab_layout->addWidget(new QLabel(tr("Input Device:")), 1, 0);
audio_input_devices = new QComboBox();
audio_input_devices->addItem(tr("Default"), "");
// list all available audio input devices
devs = QAudioDeviceInfo::availableDevices(QAudio::AudioInput);
found_preferred_device = false;
for (int i=0;i<devs.size();i++) {
audio_input_devices->addItem(devs.at(i).deviceName(), devs.at(i).deviceName());
if (!found_preferred_device
&& devs.at(i).deviceName() == config.preferred_audio_input) {
audio_input_devices->setCurrentIndex(audio_input_devices->count()-1);
found_preferred_device = true;
}
}
audio_tab_layout->addWidget(audio_input_devices, 1, 1);
audio_tab_layout->addWidget(new QLabel(tr("Sample Rate:")), 2, 0);
audio_sample_rate = new QComboBox();
combobox_audio_sample_rates(audio_sample_rate);
for (int i=0;i<audio_sample_rate->count();i++) {
if (audio_sample_rate->itemData(i).toInt() == config.audio_rate) {
audio_sample_rate->setCurrentIndex(i);
break;
}
}
audio_tab_layout->addWidget(audio_sample_rate, 2, 1);
tabWidget->addTab(audio_tab, tr("Audio"));
// Shortcuts
QWidget* shortcut_tab = new QWidget(this);
QVBoxLayout* shortcut_layout = new QVBoxLayout(shortcut_tab);
QLineEdit* key_search_line = new QLineEdit();
QLineEdit* key_search_line = new QLineEdit(shortcut_tab);
key_search_line->setPlaceholderText(tr("Search for action or shortcut"));
connect(key_search_line, SIGNAL(textChanged(const QString &)), this, SLOT(refine_shortcut_list(const QString &)));
shortcut_layout->addWidget(key_search_line);
keyboard_tree = new QTreeWidget();
keyboard_tree = new QTreeWidget(shortcut_tab);
QTreeWidgetItem* tree_header = keyboard_tree->headerItem();
tree_header->setText(0, tr("Action"));
tree_header->setText(1, tr("Shortcut"));
shortcut_layout->addWidget(keyboard_tree);
QHBoxLayout* reset_shortcut_layout = new QHBoxLayout();
QHBoxLayout* reset_shortcut_layout = new QHBoxLayout(shortcut_tab);
QPushButton* import_shortcut_button = new QPushButton(tr("Import"));
QPushButton* import_shortcut_button = new QPushButton(tr("Import"), shortcut_tab);
reset_shortcut_layout->addWidget(import_shortcut_button);
connect(import_shortcut_button, SIGNAL(clicked(bool)), this, SLOT(load_shortcut_file()));
QPushButton* export_shortcut_button = new QPushButton(tr("Export"));
QPushButton* export_shortcut_button = new QPushButton(tr("Export"), shortcut_tab);
reset_shortcut_layout->addWidget(export_shortcut_button);
connect(export_shortcut_button, SIGNAL(clicked(bool)), this, SLOT(save_shortcut_file()));
reset_shortcut_layout->addStretch();
QPushButton* reset_selected_shortcut_button = new QPushButton(tr("Reset Selected"));
QPushButton* reset_selected_shortcut_button = new QPushButton(tr("Reset Selected"), shortcut_tab);
reset_shortcut_layout->addWidget(reset_selected_shortcut_button);
connect(reset_selected_shortcut_button, SIGNAL(clicked(bool)), this, SLOT(reset_default_shortcut()));
QPushButton* reset_all_shortcut_button = new QPushButton(tr("Reset All"));
QPushButton* reset_all_shortcut_button = new QPushButton(tr("Reset All"), shortcut_tab);
reset_shortcut_layout->addWidget(reset_all_shortcut_button);
connect(reset_all_shortcut_button, SIGNAL(clicked(bool)), this, SLOT(reset_all_shortcuts()));
@@ -432,6 +505,4 @@ void PreferencesDialog::setup_ui() {
connect(buttonBox, SIGNAL(accepted()), this, SLOT(save()));
connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
tabWidget->setCurrentIndex(2);
}
+3
View File
@@ -62,6 +62,9 @@ private:
QComboBox* previous_queue_type;
QSpinBox* effect_textbox_lines_field;
QCheckBox* use_software_fallbacks_checkbox;
QComboBox* audio_output_devices;
QComboBox* audio_input_devices;
QComboBox* audio_sample_rate;
QVector<QAction*> key_shortcut_actions;
QVector<QTreeWidgetItem*> key_shortcut_items;
+74
View File
@@ -0,0 +1,74 @@
#include "proxydialog.h"
#include <QGridLayout>
#include <QLabel>
#include <QDialogButtonBox>
#include <QComboBox>
#include <QFileDialog>
ProxyDialog::ProxyDialog(QWidget *parent, const QVector<Footage *> &footage) : QDialog(parent) {
// set dialog title
setWindowTitle(tr("Create Proxy"));
// set proxy folder name to "Proxy", depending on the user's language
proxy_folder_name = tr("Proxy");
// set up dialog's layout
QGridLayout* layout = new QGridLayout(this);
// set the video dimensions of the proxy
layout->addWidget(new QLabel(tr("Dimensions:"), this), 0, 0);
QComboBox* size_combobox = new QComboBox(this);
size_combobox->addItem(tr("Same Size as Source"), 1.0);
size_combobox->addItem(tr("Half Resolution (1/2)"), 0.5);
size_combobox->addItem(tr("Quarter Resolution (1/4)"), 0.25);
size_combobox->addItem(tr("Eighth Resolution (1/8)"), 0.125);
size_combobox->addItem(tr("Sixteenth Resolution (1/16)"), 0.0625);
layout->addWidget(size_combobox, 0, 1);
// set the desired format of the proxy to create
layout->addWidget(new QLabel(tr("Format:"), this), 1, 0);
QComboBox* format_combobox = new QComboBox(this);
format_combobox->addItem(tr("ProRes HQ"));
format_combobox->addItem(tr("ProRes SQ"));
format_combobox->addItem(tr("ProRes LT"));
format_combobox->addItem(tr("DNxHD"));
format_combobox->addItem(tr("H.264"));
layout->addWidget(format_combobox, 1, 1);
// set the location to place the proxies
layout->addWidget(new QLabel(tr("Location:"), this), 2, 0);
location_combobox = new QComboBox(this);
location_combobox->addItem(tr("Same as Source (in \"%1\" folder)").arg(proxy_folder_name));
location_combobox->addItem("");
connect(location_combobox, SIGNAL(currentIndexChanged(int)), this, SLOT(location_changed(int)));
layout->addWidget(location_combobox, 2, 1);
// location_changed will set the default "location" items
location_changed(0);
// set up dialog buttons
QDialogButtonBox* buttons = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this);
buttons->setCenterButtons(true);
layout->addWidget(buttons, 3, 0, 1, 2);
connect(buttons, SIGNAL(accepted()), this, SLOT(accept()));
connect(buttons, SIGNAL(rejected()), this, SLOT(reject()));
}
void ProxyDialog::location_changed(int i) {
custom_location.clear();
if (i == 1) {
QString s = QFileDialog::getExistingDirectory(this);
if (s.isEmpty()) {
location_combobox->setCurrentIndex(0);
} else {
location_combobox->setItemText(1, s);
custom_location = s;
}
} else {
location_combobox->setItemText(1, tr("Custom Location"));
}
}
+30
View File
@@ -0,0 +1,30 @@
#ifndef PROXYDIALOG_H
#define PROXYDIALOG_H
#include <QDialog>
#include <QVector>
#include <QComboBox>
struct Footage;
class ProxyDialog : public QDialog {
Q_OBJECT
public:
ProxyDialog(QWidget* parent, const QVector<Footage*>& footage);
private:
// user's dimensions
QComboBox* size_combobox;
// allows users to set the location to store proxies
QComboBox* location_combobox;
// stores the custom location to store proxies if the user sets a custom location
QString custom_location;
// stores the subdirectory to be made next to the source in the user's language
QString proxy_folder_name;
private slots:
void location_changed(int i);
};
#endif // PROXYDIALOG_H
+32 -34
View File
@@ -23,31 +23,31 @@ ReplaceClipMediaDialog::ReplaceClipMediaDialog(QWidget *parent, Media *old_media
QDialog(parent),
media(old_media)
{
setWindowTitle(tr("Replace clips using \"%1\"").arg(old_media->get_name()));
setWindowTitle(tr("Replace clips using \"%1\"").arg(old_media->get_name()));
resize(300, 400);
QVBoxLayout* layout = new QVBoxLayout();
QVBoxLayout* layout = new QVBoxLayout(this);
layout->addWidget(new QLabel(tr("Select which media you want to replace this media's clips with:")));
layout->addWidget(new QLabel(tr("Select which media you want to replace this media's clips with:"), this));
tree = new QTreeView();
tree = new QTreeView(this);
layout->addWidget(tree);
use_same_media_in_points = new QCheckBox(tr("Keep the same media in-points"));
use_same_media_in_points = new QCheckBox(tr("Keep the same media in-points"), this);
use_same_media_in_points->setChecked(true);
layout->addWidget(use_same_media_in_points);
QHBoxLayout* buttons = new QHBoxLayout();
QHBoxLayout* buttons = new QHBoxLayout(this);
buttons->addStretch();
QPushButton* replace_button = new QPushButton(tr("Replace"));
QPushButton* replace_button = new QPushButton(tr("Replace"), this);
connect(replace_button, SIGNAL(clicked(bool)), this, SLOT(replace()));
buttons->addWidget(replace_button);
QPushButton* cancel_button = new QPushButton(tr("Cancel"));
QPushButton* cancel_button = new QPushButton(tr("Cancel"), this);
connect(cancel_button, SIGNAL(clicked(bool)), this, SLOT(close()));
buttons->addWidget(cancel_button);
@@ -55,44 +55,42 @@ ReplaceClipMediaDialog::ReplaceClipMediaDialog(QWidget *parent, Media *old_media
layout->addLayout(buttons);
setLayout(layout);
tree->setModel(&project_model);
}
void ReplaceClipMediaDialog::replace() {
QModelIndexList selected_items = tree->selectionModel()->selectedRows();
if (selected_items.size() != 1) {
QMessageBox::critical(
this,
tr("No media selected"),
tr("Please select a media to replace with or click 'Cancel'."),
QMessageBox::Ok
);
QMessageBox::critical(
this,
tr("No media selected"),
tr("Please select a media to replace with or click 'Cancel'."),
QMessageBox::Ok
);
} else {
Media* new_item = static_cast<Media*>(selected_items.at(0).internalPointer());
if (media == new_item) {
QMessageBox::critical(
this,
tr("Same media selected"),
tr("You selected the same media that you're replacing. Please select a different one or click 'Cancel'."),
QMessageBox::Ok
);
QMessageBox::critical(
this,
tr("Same media selected"),
tr("You selected the same media that you're replacing. Please select a different one or click 'Cancel'."),
QMessageBox::Ok
);
} else if (new_item->get_type() == MEDIA_TYPE_FOLDER) {
QMessageBox::critical(
this,
tr("Folder selected"),
tr("You cannot replace footage with a folder."),
QMessageBox::Ok
);
QMessageBox::critical(
this,
tr("Folder selected"),
tr("You cannot replace footage with a folder."),
QMessageBox::Ok
);
} else {
if (new_item->get_type() == MEDIA_TYPE_SEQUENCE && sequence == new_item->to_sequence()) {
QMessageBox::critical(
this,
tr("Active sequence selected"),
tr("You cannot insert a sequence into itself."),
QMessageBox::Ok
);
QMessageBox::critical(
this,
tr("Active sequence selected"),
tr("You cannot insert a sequence into itself."),
QMessageBox::Ok
);
} else {
ReplaceClipMediaCommand* rcmc = new ReplaceClipMediaCommand(
media,
+13 -14
View File
@@ -19,43 +19,42 @@
#include "project/media.h"
SpeedDialog::SpeedDialog(QWidget *parent) : QDialog(parent) {
setWindowTitle(tr("Speed/Duration"));
setWindowTitle(tr("Speed/Duration"));
QVBoxLayout* main_layout = new QVBoxLayout();
setLayout(main_layout);
QVBoxLayout* main_layout = new QVBoxLayout(this);
QGridLayout* grid = new QGridLayout();
QGridLayout* grid = new QGridLayout(this);
grid->setSpacing(6);
grid->addWidget(new QLabel(tr("Speed:")), 0, 0);
percent = new LabelSlider();
grid->addWidget(new QLabel(tr("Speed:"), this), 0, 0);
percent = new LabelSlider(this);
percent->decimal_places = 2;
percent->set_display_type(LABELSLIDER_PERCENT);
percent->set_default_value(1);
grid->addWidget(percent, 0, 1);
grid->addWidget(new QLabel(tr("Frame Rate:")), 1, 0);
frame_rate = new LabelSlider();
grid->addWidget(new QLabel(tr("Frame Rate:"), this), 1, 0);
frame_rate = new LabelSlider(this);
frame_rate->decimal_places = 3;
grid->addWidget(frame_rate, 1, 1);
grid->addWidget(new QLabel(tr("Duration:")), 2, 0);
duration = new LabelSlider();
grid->addWidget(new QLabel(tr("Duration:"), this), 2, 0);
duration = new LabelSlider(this);
duration->set_display_type(LABELSLIDER_FRAMENUMBER);
duration->set_frame_rate(sequence->frame_rate);
grid->addWidget(duration, 2, 1);
main_layout->addLayout(grid);
reverse = new QCheckBox(tr("Reverse"));
maintain_pitch = new QCheckBox(tr("Maintain Audio Pitch"));
ripple = new QCheckBox(tr("Ripple Changes"));
reverse = new QCheckBox(tr("Reverse"), this);
maintain_pitch = new QCheckBox(tr("Maintain Audio Pitch"), this);
ripple = new QCheckBox(tr("Ripple Changes"), this);
main_layout->addWidget(reverse);
main_layout->addWidget(maintain_pitch);
main_layout->addWidget(ripple);
QDialogButtonBox* buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
QDialogButtonBox* buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this);
buttonBox->setCenterButtons(true);
main_layout->addWidget(buttonBox);
connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
+64 -63
View File
@@ -8,96 +8,97 @@
#include "ui/labelslider.h"
// NOTE: this is never used in Olive, hasn't been maintained, and needs to be written
StabilizerDialog::StabilizerDialog(QWidget *parent) : QDialog(parent) {
setWindowTitle("Stabilizer");
setWindowTitle("Stabilizer");
layout = new QVBoxLayout(this);
setLayout(layout);
layout = new QVBoxLayout(this);
enable_stab = new QCheckBox(this);
enable_stab->setText("Enable Stabilizer");
layout->addWidget(enable_stab);
enable_stab = new QCheckBox(this);
enable_stab->setText("Enable Stabilizer");
layout->addWidget(enable_stab);
analysis = new QGroupBox("Analysis", this);
layout->addWidget(analysis);
analysis = new QGroupBox("Analysis", this);
layout->addWidget(analysis);
analysis_layout = new QGridLayout(analysis);
analysis->setLayout(analysis_layout);
analysis_layout = new QGridLayout(analysis);
analysis->setLayout(analysis_layout);
analysis_layout->addWidget(new QLabel("Shakiness:"), 0, 0);
analysis_layout->addWidget(new QLabel("Shakiness:", this), 0, 0);
shakiness_slider = new LabelSlider();
shakiness_slider->set_minimum_value(1);
shakiness_slider->set_default_value(5);
shakiness_slider->set_maximum_value(10);
analysis_layout->addWidget(shakiness_slider, 0, 1);
shakiness_slider = new LabelSlider(this);
shakiness_slider->set_minimum_value(1);
shakiness_slider->set_default_value(5);
shakiness_slider->set_maximum_value(10);
analysis_layout->addWidget(shakiness_slider, 0, 1);
analysis_layout->addWidget(new QLabel("Accuracy:"), 1, 0);
analysis_layout->addWidget(new QLabel("Accuracy:", this), 1, 0);
accuracy_slider = new LabelSlider();
accuracy_slider->set_minimum_value(1);
accuracy_slider->set_default_value(15);
accuracy_slider->set_maximum_value(15);
analysis_layout->addWidget(accuracy_slider, 1, 1);
accuracy_slider = new LabelSlider(this);
accuracy_slider->set_minimum_value(1);
accuracy_slider->set_default_value(15);
accuracy_slider->set_maximum_value(15);
analysis_layout->addWidget(accuracy_slider, 1, 1);
analysis_layout->addWidget(new QLabel("Step Size:"), 2, 0);
analysis_layout->addWidget(new QLabel("Step Size:", this), 2, 0);
stepsize_slider = new LabelSlider();
stepsize_slider->set_minimum_value(1);
stepsize_slider->set_default_value(6);
analysis_layout->addWidget(stepsize_slider, 2, 1);
stepsize_slider = new LabelSlider(this);
stepsize_slider->set_minimum_value(1);
stepsize_slider->set_default_value(6);
analysis_layout->addWidget(stepsize_slider, 2, 1);
analysis_layout->addWidget(new QLabel("Minimum Contrast:"), 3, 0);
analysis_layout->addWidget(new QLabel("Minimum Contrast:", this), 3, 0);
mincontrast_slider = new LabelSlider();
mincontrast_slider->set_minimum_value(0);
mincontrast_slider->set_default_value(0.3);
mincontrast_slider->set_maximum_value(1);
analysis_layout->addWidget(mincontrast_slider, 3, 1);
mincontrast_slider = new LabelSlider(this);
mincontrast_slider->set_minimum_value(0);
mincontrast_slider->set_default_value(0.3);
mincontrast_slider->set_maximum_value(1);
analysis_layout->addWidget(mincontrast_slider, 3, 1);
/*analysis_layout->addWidget(new QLabel("Tripod Mode:"), 4, 0);
/*analysis_layout->addWidget(new QLabel("Tripod Mode:"), 4, 0);
tripod_mode_box = new QCheckBox();
analysis_layout->addWidget(tripod_mode_box, 4, 1);*/
tripod_mode_box = new QCheckBox();
analysis_layout->addWidget(tripod_mode_box, 4, 1);*/
stabilization = new QGroupBox("Stabilization", this);
layout->addWidget(stabilization);
stabilization = new QGroupBox("Stabilization", this);
layout->addWidget(stabilization);
stabilization_layout = new QGridLayout();
stabilization->setLayout(stabilization_layout);
stabilization_layout = new QGridLayout(this);
stabilization->setLayout(stabilization_layout);
stabilization_layout->addWidget(new QLabel("Smoothing:"), 0, 0);
stabilization_layout->addWidget(new QLabel("Smoothing:", this), 0, 0);
smoothing_slider = new LabelSlider();
smoothing_slider->set_minimum_value(0);
smoothing_slider->set_default_value(10);
stabilization_layout->addWidget(smoothing_slider, 0, 1);
smoothing_slider = new LabelSlider();
smoothing_slider->set_minimum_value(0);
smoothing_slider->set_default_value(10);
stabilization_layout->addWidget(smoothing_slider, 0, 1);
stabilization_layout->addWidget(new QLabel("Gaussian Motion:"), 1, 0);
stabilization_layout->addWidget(new QLabel("Gaussian Motion:"), 1, 0);
gaussian_motion = new QCheckBox();
gaussian_motion->setChecked(true);
stabilization_layout->addWidget(gaussian_motion, 1, 1);
gaussian_motion = new QCheckBox();
gaussian_motion->setChecked(true);
stabilization_layout->addWidget(gaussian_motion, 1, 1);
stabilization_layout->addWidget(new QLabel("Maximum Movement:"), 2, 0);
stabilization_layout->addWidget(new QLabel("Maximum Rotation:"), 3, 0);
stabilization_layout->addWidget(new QLabel("Crop:"), 4, 0);
stabilization_layout->addWidget(new QLabel("Zoom Behavior:"), 5, 0);
stabilization_layout->addWidget(new QLabel("Zoom Speed:"), 6, 0);
stabilization_layout->addWidget(new QLabel("Interpolation Quality:"), 7, 0);
stabilization_layout->addWidget(new QLabel("Maximum Movement:"), 2, 0);
stabilization_layout->addWidget(new QLabel("Maximum Rotation:"), 3, 0);
stabilization_layout->addWidget(new QLabel("Crop:"), 4, 0);
stabilization_layout->addWidget(new QLabel("Zoom Behavior:"), 5, 0);
stabilization_layout->addWidget(new QLabel("Zoom Speed:"), 6, 0);
stabilization_layout->addWidget(new QLabel("Interpolation Quality:"), 7, 0);
buttons = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this);
layout->addWidget(buttons);
buttons = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this);
layout->addWidget(buttons);
connect(buttons, SIGNAL(accepted()), this, SLOT(accept()));
connect(buttons, SIGNAL(rejected()), this, SLOT(reject()));
connect(buttons, SIGNAL(accepted()), this, SLOT(accept()));
connect(buttons, SIGNAL(rejected()), this, SLOT(reject()));
connect(enable_stab, SIGNAL(toggled(bool)), this, SLOT(set_all_enabled(bool)));
connect(enable_stab, SIGNAL(toggled(bool)), this, SLOT(set_all_enabled(bool)));
set_all_enabled(false);
set_all_enabled(false);
}
void StabilizerDialog::set_all_enabled(bool e) {
analysis->setEnabled(e);
stabilization->setEnabled(e);
analysis->setEnabled(e);
stabilization->setEnabled(e);
}
+4 -5
View File
@@ -7,16 +7,15 @@
TextEditDialog::TextEditDialog(QWidget *parent, const QString &s) :
QDialog(parent)
{
setWindowTitle(tr("Edit Text"));
setWindowTitle(tr("Edit Text"));
QVBoxLayout* layout = new QVBoxLayout();
setLayout(layout);
QVBoxLayout* layout = new QVBoxLayout(this);
textEdit = new QPlainTextEdit();
textEdit = new QPlainTextEdit(this);
textEdit->setPlainText(s);
layout->addWidget(textEdit);
QDialogButtonBox* buttons = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
QDialogButtonBox* buttons = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this);
layout->addWidget(buttons);
connect(buttons, SIGNAL(accepted()), this, SLOT(save()));
connect(buttons, SIGNAL(rejected()), this, SLOT(cancel()));
+5 -5
View File
@@ -61,11 +61,11 @@ void CornerPinEffect::process_coords(double timecode, GLTextureCoords &coords, i
coords.vertexBottomRightY += bottom_right_y->get_double_value(timecode);
}
void CornerPinEffect::process_shader(double timecode, GLTextureCoords &coords, int iterations) {
glslProgram->setUniformValue("p0", (GLfloat) coords.vertexBottomLeftX, (GLfloat) coords.vertexBottomLeftY);
glslProgram->setUniformValue("p1", (GLfloat) coords.vertexBottomRightX, (GLfloat) coords.vertexBottomRightY);
glslProgram->setUniformValue("p2", (GLfloat) coords.vertexTopLeftX, (GLfloat) coords.vertexTopLeftY);
glslProgram->setUniformValue("p3", (GLfloat) coords.vertexTopRightX, (GLfloat) coords.vertexTopRightY);
void CornerPinEffect::process_shader(double timecode, GLTextureCoords &coords, int) {
glslProgram->setUniformValue("p0", GLfloat(coords.vertexBottomLeftX), GLfloat(coords.vertexBottomLeftY));
glslProgram->setUniformValue("p1", GLfloat(coords.vertexBottomRightX), GLfloat(coords.vertexBottomRightY));
glslProgram->setUniformValue("p2", GLfloat(coords.vertexTopLeftX), GLfloat(coords.vertexTopLeftY));
glslProgram->setUniformValue("p3", GLfloat(coords.vertexTopRightX), GLfloat(coords.vertexTopRightY));
glslProgram->setUniformValue("perspective", perspective->get_bool_value(timecode));
}
+2 -2
View File
@@ -11,11 +11,11 @@ VoidEffect::VoidEffect(Clip *c, const QString& n) : Effect(c, nullptr) {
name = n;
QString display_name;
if (n.isEmpty()) {
display_name = tr("(unknown)");
display_name = tr("(unknown)");
} else {
display_name = n;
}
EffectRow* row = add_row(tr("Missing Effect"), false, false);
EffectRow* row = add_row(tr("Missing Effect"), false, false);
row->add_widget(new QLabel(display_name));
container->setText(display_name);
}
+3
View File
@@ -240,6 +240,9 @@ VSTHost::~VSTHost() {
delete [] inputs;
freePlugin();
delete show_interface_btn;
delete dialog;
}
void VSTHost::process_audio(double, double, quint8* samples, int nb_bytes, int) {
+8
View File
@@ -173,6 +173,12 @@ void Config::load(QString path) {
} else if (stream.name() == "CenterTimelineTimecodes") {
stream.readNext();
center_timeline_timecodes = (stream.text() == "1");
} else if (stream.name() == "PreferredAudioOutput") {
stream.readNext();
preferred_audio_output = stream.text().toString();
} else if (stream.name() == "PreferredAudioInput") {
stream.readNext();
preferred_audio_input = stream.text().toString();
}
}
}
@@ -235,6 +241,8 @@ void Config::save(QString path) {
stream.writeTextElement("EffectTextboxLines", QString::number(effect_textbox_lines));
stream.writeTextElement("UseSoftwareFallback", QString::number(use_software_fallback));
stream.writeTextElement("CenterTimelineTimecodes", QString::number(center_timeline_timecodes));
stream.writeTextElement("PreferredAudioOutput", preferred_audio_output);
stream.writeTextElement("PreferredAudioInput", preferred_audio_input);
stream.writeEndElement(); // configuration
stream.writeEndDocument(); // doc
+2
View File
@@ -64,6 +64,8 @@ struct Config {
int effect_textbox_lines;
bool use_software_fallback;
bool center_timeline_timecodes;
QString preferred_audio_output;
QString preferred_audio_input;
void load(QString path);
void save(QString path);
+30 -21
View File
@@ -27,7 +27,10 @@ extern "C" {
#include <QOpenGLPaintDevice>
#include <QPainter>
ExportThread::ExportThread() : continueEncode(true) {
ExportThread::ExportThread(QObject *parent) :
QThread(parent),
continueEncode(true)
{
surface.create();
fmt_ctx = nullptr;
@@ -35,7 +38,6 @@ ExportThread::ExportThread() : continueEncode(true) {
vcodec = nullptr;
vcodec_ctx = nullptr;
video_frame = nullptr;
sws_frame = nullptr;
sws_ctx = nullptr;
audio_stream = nullptr;
acodec = nullptr;
@@ -122,18 +124,14 @@ bool ExportThread::setupVideo() {
vcodec_ctx->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;
}
if (vcodec_ctx->codec_id == AV_CODEC_ID_H264) {
/*char buffer[50];
itoa(vcodec_ctx, buffer, 10);*/
//av_opt_set(vcodec_ctx->priv_data, "preset", "fast", AV_OPT_SEARCH_CHILDREN);
//av_opt_set(vcodec_ctx->priv_data, "x264opts", "opencl", AV_OPT_SEARCH_CHILDREN);
switch (vcodec_ctx->codec_id) {
case AV_CODEC_ID_H264:
switch (video_compression_type) {
case COMPRESSION_TYPE_CFR:
av_opt_set(vcodec_ctx->priv_data, "crf", QString::number(static_cast<int>(video_bitrate)).toUtf8(), AV_OPT_SEARCH_CHILDREN);
break;
}
break;
}
AVDictionary* opts = nullptr;
@@ -177,12 +175,6 @@ bool ExportThread::setupVideo() {
nullptr
);
sws_frame = av_frame_alloc();
sws_frame->format = vcodec_ctx->pix_fmt;
sws_frame->width = video_width;
sws_frame->height = video_height;
av_frame_get_buffer(sws_frame, 0);
return true;
}
@@ -366,16 +358,36 @@ void ExportThread::run() {
// encode last frame while rendering next frame
double timecode_secs = (double) (sequence->playhead-start_frame) / sequence->frame_rate;
if (video_enabled) {
// change pixel format
// create sws_frame for converting pixel format
//
// - I'm not sure why, but we have to alloc/free sws_frame every frame, or it breaks GIF exporting.
// - (i.e. GIFs get stuck on the first frame)
// - The same problem/solution can be seen here: https://stackoverflow.com/a/38997739
// - Perhaps this is the intended way to use swscale, but it seems inefficient.
// - Anyway, here we are.
//
sws_frame = av_frame_alloc();
sws_frame->format = vcodec_ctx->pix_fmt;
sws_frame->width = video_width;
sws_frame->height = video_height;
av_frame_get_buffer(sws_frame, 0);
// convert pixel format to format expected by the encoder
sws_scale(sws_ctx, video_frame->data, video_frame->linesize, 0, video_frame->height, sws_frame->data, sws_frame->linesize);
sws_frame->pts = qRound(timecode_secs/av_q2d(video_stream->time_base));
// send to encoder
// send converted frame to encoder
if (!encode(fmt_ctx, vcodec_ctx, sws_frame, &video_pkt, video_stream, false)) continueEncode = false;
av_frame_free(&sws_frame);
}
if (audio_enabled) {
// do we need to encode more audio samples?
while (continueEncode && file_audio_samples <= (timecode_secs*audio_sampling_rate)) {
// copy samples from audio buffer to AVFrame
int adjusted_read = audio_ibuffer_read%audio_ibuffer_size;
int copylen = qMin(aframe_bytes, audio_ibuffer_size-adjusted_read);
@@ -402,15 +414,13 @@ void ExportThread::run() {
}
}
// encoding stats
// generating encoding statistics (time it took to encode this frame/estimated remaining time)
frame_time = (QDateTime::currentMSecsSinceEpoch()-start_time);
total_time += frame_time;
remaining_frames = (end_frame-sequence->playhead);
avg_time = (total_time/frame_count);
eta = (remaining_frames*avg_time);
// qInfo() << "Encoded frame" << sequence->playhead << "- took" << frame_time << "ms (avg:" << avg_time << "ms, remaining:" << remaining_frames << ", ETA:" << eta << ")";
emit progress_changed(qRound((double(sequence->playhead-start_frame) / double(end_frame-start_frame)) * 100.0), eta);
sequence->playhead++;
frame_count++;
@@ -478,7 +488,6 @@ void ExportThread::run() {
if (sws_ctx != nullptr) {
sws_freeContext(sws_ctx);
av_frame_free(&sws_frame);
}
if (swr_ctx != nullptr) {
swr_free(&swr_ctx);
+1 -1
View File
@@ -28,7 +28,7 @@ extern "C" {
class ExportThread : public QThread {
Q_OBJECT
public:
ExportThread();
ExportThread(QObject* parent = nullptr);
void run();
// export parameters
+8 -7
View File
@@ -19,6 +19,7 @@
#include <QDateTime>
#define WAVEFORM_RESOLUTION 64
#define THUMBNAIL_RESOLUTION 120
extern "C" {
#include <libavformat/avformat.h>
@@ -30,7 +31,7 @@ extern "C" {
QSemaphore sem(5); // only 5 preview generators can run at one time
PreviewGenerator::PreviewGenerator(Media* i, Footage* m, bool r) :
QThread(0),
QThread(nullptr),
fmt_ctx(nullptr),
media(i),
footage(m),
@@ -50,7 +51,7 @@ PreviewGenerator::PreviewGenerator(Media* i, Footage* m, bool r) :
void PreviewGenerator::parse_media() {
// detect video/audio streams in file
for (int i=0;i<(int)fmt_ctx->nb_streams;i++) {
for (int i=0;i<int(fmt_ctx->nb_streams);i++) {
// Find the decoder for the video stream
if (avcodec_find_decoder(fmt_ctx->streams[i]->codecpar->codec_id) == nullptr) {
qCritical() << "Unsupported codec in stream" << i << "of file" << footage->name;
@@ -106,7 +107,7 @@ void PreviewGenerator::parse_media() {
append = true;
} else if (fmt_ctx->streams[i]->codecpar->codec_type == AVMEDIA_TYPE_AUDIO) {
ms.audio_channels = fmt_ctx->streams[i]->codecpar->channels;
ms.audio_layout = fmt_ctx->streams[i]->codecpar->channel_layout;
ms.audio_layout = int(fmt_ctx->streams[i]->codecpar->channel_layout);
ms.audio_frequency = fmt_ctx->streams[i]->codecpar->sample_rate;
append = true;
@@ -277,9 +278,9 @@ void PreviewGenerator::generate_waveform() {
if (s != nullptr) {
if (fmt_ctx->streams[packet->stream_index]->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) {
if (!s->preview_done) {
int dstH = 120;
int dstW = dstH * ((float)temp_frame->width/(float)temp_frame->height);
uint8_t* data = new uint8_t[dstW*dstH*4];
int dstH = THUMBNAIL_RESOLUTION;
int dstW = qRound(dstH * (float(temp_frame->width)/float(temp_frame->height)));
uint8_t* data = new uint8_t[size_t(dstW*dstH*4)];
sws_ctx = sws_getContext(
temp_frame->width,
@@ -414,7 +415,7 @@ void PreviewGenerator::generate_waveform() {
maximum_stream = i;
}
}
footage->length = (double) media_lengths[maximum_stream] / av_q2d(fmt_ctx->streams[maximum_stream]->avg_frame_rate) * AV_TIME_BASE; // TODO redo with PTS
footage->length = double(media_lengths[maximum_stream]) / av_q2d(fmt_ctx->streams[maximum_stream]->avg_frame_rate) * AV_TIME_BASE; // TODO redo with PTS
finalize_media();
}
delete [] media_lengths;
+15 -13
View File
@@ -4,10 +4,12 @@
#include <QThread>
#include <QSemaphore>
#define ICON_TYPE_VIDEO 0
#define ICON_TYPE_AUDIO 1
#define ICON_TYPE_IMAGE 2
#define ICON_TYPE_ERROR 3
enum IconType {
ICON_TYPE_VIDEO,
ICON_TYPE_AUDIO,
ICON_TYPE_IMAGE,
ICON_TYPE_ERROR
};
struct Footage;
struct FootageStream;
@@ -16,28 +18,28 @@ class Media;
class PreviewGenerator : public QThread
{
Q_OBJECT
Q_OBJECT
public:
PreviewGenerator(Media*, Footage*, bool);
void run();
void run();
void cancel();
signals:
void set_icon(int, bool);
private:
void parse_media();
void parse_media();
bool retrieve_preview(const QString &hash);
void generate_waveform();
void generate_waveform();
void finalize_media();
AVFormatContext* fmt_ctx;
Media* media;
Footage* footage;
AVFormatContext* fmt_ctx;
Media* media;
Footage* footage;
bool retrieve_duration;
bool contains_still_image;
bool replace;
bool cancelled;
QString data_path;
QString get_thumbnail_path(const QString &hash, const FootageStream &ms);
QString get_waveform_path(const QString& hash, const FootageStream &ms);
QString get_thumbnail_path(const QString &hash, const FootageStream &ms);
QString get_waveform_path(const QString& hash, const FootageStream &ms);
};
#endif // PREVIEWGENERATOR_H
+5
View File
@@ -2,7 +2,10 @@
#include <QApplication>
#include "debug.h"
// importing classes for certain command line args
#include "project/effect.h"
#include "ui/renderfunctions.h"
extern "C" {
#include <libavformat/avformat.h>
@@ -40,6 +43,8 @@ int main(int argc, char *argv[]) {
shaders_are_enabled = false;
} else if (!strcmp(argv[i], "--no-debug")) {
use_internal_logger = false;
} else if (!strcmp(argv[i], "--disable-blend-modes")) {
disable_blending = true;
} else {
printf("[ERROR] Unknown argument '%s'\n", argv[1]);
return 1;
+3 -6
View File
@@ -558,6 +558,7 @@ bool MainWindow::can_close_project() {
);
m->setWindowModality(Qt::WindowModal);
int r = m->exec();
delete m;
if (r == QMessageBox::Yes) {
return save_project();
} else if (r == QMessageBox::Cancel) {
@@ -581,7 +582,7 @@ void MainWindow::setup_menus() {
file_menu->addAction(tr("&Open Project"), this, SLOT(open_project()), QKeySequence("Ctrl+O"))->setProperty("id", "openproj");
clear_open_recent_action = new QAction(tr("Clear Recent List"));
clear_open_recent_action = new QAction(tr("Clear Recent List"), menuBar);
clear_open_recent_action->setProperty("id", "clearopenrecent");
connect(clear_open_recent_action, SIGNAL(triggered()), panel_project, SLOT(clear_recent_projects()));
@@ -1037,12 +1038,8 @@ void MainWindow::paintEvent(QPaintEvent *event) {
#ifndef QT_DEBUG
DemoNotice* d = new DemoNotice(this);
d->open();
connect(d, SIGNAL(finished()), d, SLOT(deleteLater()));
#endif
/*if (windowState() != Qt::WindowFullScreen) {
// workaround for setting to maximized - on some systems, setting
// to maximized doesn't work until after the paintEvent
setWindowState(Qt::WindowMaximized);
}*/
demoNoticeShown = true;
}
+8 -2
View File
@@ -35,6 +35,10 @@ system("which git") {
CONFIG += c++11
CONFIG(debug, debug|release) {
CONFIG += console
}
SOURCES += \
main.cpp \
mainwindow.cpp \
@@ -133,7 +137,8 @@ SOURCES += \
project/effectloaders.cpp \
io/crossplatformlib.cpp \
effects/internal/vsthost.cpp \
ui/flowlayout.cpp
ui/flowlayout.cpp \
dialogs/proxydialog.cpp
HEADERS += \
mainwindow.h \
@@ -234,7 +239,8 @@ HEADERS += \
project/effectloaders.h \
io/crossplatformlib.h \
effects/internal/vsthost.h \
ui/flowlayout.h
ui/flowlayout.h \
dialogs/proxydialog.h
FORMS +=
+28 -28
View File
@@ -172,8 +172,7 @@ void EffectControls::show_effect_menu(int type, int subtype) {
const EffectMeta& em = effects.at(i);
if (em.type == type && em.subtype == subtype) {
QAction* action = new QAction(&effects_menu);
action->setText(em.name);
QAction* action = effects_menu.addAction(em.name);
action->setData(reinterpret_cast<quintptr>(&em));
if (!em.tooltip.isEmpty()) {
action->setToolTip(em.tooltip);
@@ -193,9 +192,8 @@ void EffectControls::show_effect_menu(int type, int subtype) {
}
}
if (!found) {
parent = new QMenu(&effects_menu);
parent = effects_menu.addMenu(em.category);
parent->setToolTipsVisible(true);
parent->setTitle(em.category);
bool found = false;
for (int i=0;i<effects_menu.actions().size();i++) {
@@ -275,17 +273,17 @@ void EffectControls::open_effect(QVBoxLayout* layout, Effect* e) {
}
void EffectControls::setup_ui() {
QWidget* contents = new QWidget();
QWidget* contents = new QWidget(this);
QHBoxLayout* hlayout = new QHBoxLayout(contents);
hlayout->setSpacing(0);
hlayout->setMargin(0);
QSplitter* splitter = new QSplitter(contents);
QSplitter* splitter = new QSplitter();
splitter->setOrientation(Qt::Horizontal);
splitter->setChildrenCollapsible(false);
scrollArea = new QScrollArea(splitter);
scrollArea = new QScrollArea();
scrollArea->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Expanding);
scrollArea->setFrameShape(QFrame::NoFrame);
scrollArea->setFrameShadow(QFrame::Plain);
@@ -299,7 +297,7 @@ void EffectControls::setup_ui() {
scrollAreaLayout->setSpacing(0);
scrollAreaLayout->setMargin(0);
effects_area = new EffectsArea(scrollAreaWidgetContents);
effects_area = new EffectsArea();
effects_area->setContextMenuPolicy(Qt::CustomContextMenu);
connect(effects_area, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(effects_area_context_menu()));
@@ -307,12 +305,12 @@ void EffectControls::setup_ui() {
effects_area_layout->setSpacing(0);
effects_area_layout->setMargin(0);
vcontainer = new QWidget(effects_area);
vcontainer = new QWidget();
QVBoxLayout* vcontainerLayout = new QVBoxLayout(vcontainer);
vcontainerLayout->setSpacing(0);
vcontainerLayout->setMargin(0);
QWidget* veHeader = new QWidget(vcontainer);
QWidget* veHeader = new QWidget();
veHeader->setObjectName(QStringLiteral("veHeader"));
veHeader->setStyleSheet(QLatin1String("#veHeader { background: rgba(0, 0, 0, 0.25); }"));
@@ -320,7 +318,7 @@ void EffectControls::setup_ui() {
veHeaderLayout->setSpacing(0);
veHeaderLayout->setMargin(0);
QPushButton* btnAddVideoEffect = new QPushButton(veHeader);
QPushButton* btnAddVideoEffect = new QPushButton();
btnAddVideoEffect->setIcon(QIcon(":/icons/add-effect.png"));
btnAddVideoEffect->setToolTip(tr("Add Video Effect"));
veHeaderLayout->addWidget(btnAddVideoEffect);
@@ -328,7 +326,7 @@ void EffectControls::setup_ui() {
veHeaderLayout->addStretch();
QLabel* lblVideoEffects = new QLabel(veHeader);
QLabel* lblVideoEffects = new QLabel();
QFont font;
font.setPointSize(9);
lblVideoEffects->setFont(font);
@@ -338,16 +336,15 @@ void EffectControls::setup_ui() {
veHeaderLayout->addStretch();
QPushButton* btnAddVideoTransition = new QPushButton(veHeader);
QPushButton* btnAddVideoTransition = new QPushButton();
btnAddVideoTransition->setIcon(QIcon(":/icons/add-transition.png"));
btnAddVideoTransition->setToolTip(tr("Add Video Transition"));
connect(btnAddVideoTransition, SIGNAL(clicked(bool)), this, SLOT(video_transition_click()));
veHeaderLayout->addWidget(btnAddVideoTransition);
vcontainerLayout->addWidget(veHeader);
video_effect_area = new QWidget(vcontainer);
video_effect_area = new QWidget();
QVBoxLayout* veAreaLayout = new QVBoxLayout(video_effect_area);
veAreaLayout->setSpacing(0);
veAreaLayout->setMargin(0);
@@ -356,11 +353,11 @@ void EffectControls::setup_ui() {
effects_area_layout->addWidget(vcontainer);
acontainer = new QWidget(effects_area);
acontainer = new QWidget();
QVBoxLayout* acontainerLayout = new QVBoxLayout(acontainer);
acontainerLayout->setSpacing(0);
acontainerLayout->setMargin(0);
QWidget* aeHeader = new QWidget(acontainer);
QWidget* aeHeader = new QWidget();
aeHeader->setObjectName(QStringLiteral("aeHeader"));
aeHeader->setStyleSheet(QLatin1String("#aeHeader { background: rgba(0, 0, 0, 0.25); }"));
@@ -368,7 +365,7 @@ void EffectControls::setup_ui() {
aeHeaderLayout->setSpacing(0);
aeHeaderLayout->setMargin(0);
QPushButton* btnAddAudioEffect = new QPushButton(aeHeader);
QPushButton* btnAddAudioEffect = new QPushButton();
btnAddAudioEffect->setIcon(QIcon(":/icons/add-effect.png"));
btnAddAudioEffect->setToolTip(tr("Add Audio Effect"));
connect(btnAddAudioEffect, SIGNAL(clicked(bool)), this, SLOT(audio_effect_click()));
@@ -376,7 +373,7 @@ void EffectControls::setup_ui() {
aeHeaderLayout->addStretch();
QLabel* lblAudioEffects = new QLabel(aeHeader);
QLabel* lblAudioEffects = new QLabel();
lblAudioEffects->setFont(font);
lblAudioEffects->setAlignment(Qt::AlignCenter);
lblAudioEffects->setText(tr("AUDIO EFFECTS"));
@@ -384,7 +381,7 @@ void EffectControls::setup_ui() {
aeHeaderLayout->addStretch();
QPushButton* btnAddAudioTransition = new QPushButton(aeHeader);
QPushButton* btnAddAudioTransition = new QPushButton();
btnAddAudioTransition->setIcon(QIcon(":/icons/add-transition.png"));
btnAddAudioTransition->setToolTip(tr("Add Audio Transition"));
connect(btnAddAudioTransition, SIGNAL(clicked(bool)), this, SLOT(audio_transition_click()));
@@ -392,7 +389,7 @@ void EffectControls::setup_ui() {
acontainerLayout->addWidget(aeHeader);
audio_effect_area = new QWidget(acontainer);
audio_effect_area = new QWidget();
QVBoxLayout* aeAreaLayout = new QVBoxLayout(audio_effect_area);
aeAreaLayout->setSpacing(0);
aeAreaLayout->setMargin(0);
@@ -401,7 +398,7 @@ void EffectControls::setup_ui() {
effects_area_layout->addWidget(acontainer);
lblMultipleClipsSelected = new QLabel(effects_area);
lblMultipleClipsSelected = new QLabel();
lblMultipleClipsSelected->setAlignment(Qt::AlignCenter);
lblMultipleClipsSelected->setText(tr("(Multiple clips selected)"));
effects_area_layout->addWidget(lblMultipleClipsSelected);
@@ -412,30 +409,33 @@ void EffectControls::setup_ui() {
scrollArea->setWidget(scrollAreaWidgetContents);
splitter->addWidget(scrollArea);
QWidget* keyframeArea = new QWidget(splitter);
QWidget* keyframeArea = new QWidget();
QSizePolicy keyframe_sp;
keyframe_sp.setHorizontalPolicy(QSizePolicy::Minimum);
keyframe_sp.setVerticalPolicy(QSizePolicy::Preferred);
keyframe_sp.setHorizontalStretch(1);
keyframeArea->setSizePolicy(keyframe_sp);
QVBoxLayout* keyframeAreaLayout = new QVBoxLayout(keyframeArea);
keyframeAreaLayout->setSpacing(0);
keyframeAreaLayout->setMargin(0);
headers = new TimelineHeader(keyframeArea);
headers = new TimelineHeader();
keyframeAreaLayout->addWidget(headers);
QWidget* keyframeCenterWidget = new QWidget(keyframeArea);
QWidget* keyframeCenterWidget = new QWidget();
QHBoxLayout* keyframeCenterLayout = new QHBoxLayout(keyframeCenterWidget);
keyframeCenterLayout->setSpacing(0);
keyframeCenterLayout->setMargin(0);
keyframeView = new KeyframeView(keyframeCenterWidget);
keyframeView = new KeyframeView();
keyframeCenterLayout->addWidget(keyframeView);
verticalScrollBar = new QScrollBar(keyframeCenterWidget);
verticalScrollBar = new QScrollBar();
verticalScrollBar->setOrientation(Qt::Vertical);
keyframeCenterLayout->addWidget(verticalScrollBar);
@@ -443,7 +443,7 @@ void EffectControls::setup_ui() {
keyframeAreaLayout->addWidget(keyframeCenterWidget);
horizontalScrollBar = new ResizableScrollBar(keyframeArea);
horizontalScrollBar = new ResizableScrollBar();
horizontalScrollBar->setOrientation(Qt::Horizontal);
keyframeAreaLayout->addWidget(horizontalScrollBar);
+11 -19
View File
@@ -23,36 +23,31 @@ GraphEditor::GraphEditor(QWidget* parent) : QDockWidget(parent), row(nullptr) {
setWindowTitle(tr("Graph Editor"));
resize(720, 480);
QWidget* main_widget = new QWidget();
QWidget* main_widget = new QWidget(this);
QVBoxLayout* layout = new QVBoxLayout(main_widget);
setWidget(main_widget);
QVBoxLayout* layout = new QVBoxLayout();
main_widget->setLayout(layout);
QWidget* tool_widget = new QWidget();
tool_widget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Maximum);
QHBoxLayout* tools = new QHBoxLayout();
tool_widget->setLayout(tools);
QHBoxLayout* tools = new QHBoxLayout(tool_widget);
QWidget* left_tool_widget = new QWidget();
QHBoxLayout* left_tool_layout = new QHBoxLayout();
QHBoxLayout* left_tool_layout = new QHBoxLayout(left_tool_widget);
left_tool_layout->setSpacing(0);
left_tool_layout->setMargin(0);
left_tool_widget->setLayout(left_tool_layout);
tools->addWidget(left_tool_widget);
QWidget* center_tool_widget = new QWidget();
QHBoxLayout* center_tool_layout = new QHBoxLayout();
QHBoxLayout* center_tool_layout = new QHBoxLayout(center_tool_widget);
center_tool_layout->setSpacing(0);
center_tool_layout->setMargin(0);
center_tool_widget->setLayout(center_tool_layout);
tools->addWidget(center_tool_widget);
QWidget* right_tool_widget = new QWidget();
QHBoxLayout* right_tool_layout = new QHBoxLayout();
QHBoxLayout* right_tool_layout = new QHBoxLayout(right_tool_widget);
right_tool_layout->setSpacing(0);
right_tool_layout->setMargin(0);
right_tool_widget->setLayout(right_tool_layout);
tools->addWidget(right_tool_widget);
keyframe_nav = new KeyframeNavigator(0, false);
keyframe_nav = new KeyframeNavigator(nullptr, false);
keyframe_nav->enable_keyframes(true);
keyframe_nav->enable_keyframe_toggle(false);
left_tool_layout->addWidget(keyframe_nav);
@@ -76,8 +71,7 @@ GraphEditor::GraphEditor(QWidget* parent) : QDockWidget(parent), row(nullptr) {
layout->addWidget(tool_widget);
QWidget* central_widget = new QWidget();
QVBoxLayout* central_layout = new QVBoxLayout();
central_widget->setLayout(central_layout);
QVBoxLayout* central_layout = new QVBoxLayout(central_widget);
central_layout->setSpacing(0);
central_layout->setMargin(0);
header = new TimelineHeader();
@@ -90,15 +84,13 @@ GraphEditor::GraphEditor(QWidget* parent) : QDockWidget(parent), row(nullptr) {
QWidget* value_widget = new QWidget();
value_widget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Maximum);
QHBoxLayout* values = new QHBoxLayout();
value_widget->setLayout(values);
QHBoxLayout* values = new QHBoxLayout(value_widget);
values->addStretch();
QWidget* central_value_widget = new QWidget();
value_layout = new QHBoxLayout();
value_layout = new QHBoxLayout(central_value_widget);
value_layout->setMargin(0);
value_layout->addWidget(new QLabel("")); // a spacer so the layout doesn't jump
central_value_widget->setLayout(value_layout);
values->addWidget(central_value_widget);
values->addStretch();
@@ -191,7 +183,7 @@ void GraphEditor::set_row(EffectRow *r) {
connect(keyframe_nav, SIGNAL(goto_next_key()), row, SLOT(goto_next_key()));
} else {
row = nullptr;
current_row_desc->setText(0);
current_row_desc->setText(nullptr);
}
view->set_row(row);
update_panel();
+1
View File
@@ -100,6 +100,7 @@ void update_effect_controls() {
if (panel_effect_controls->multiple != multiple || !same) {
panel_effect_controls->multiple = multiple;
panel_effect_controls->set_clips(selected_clips, mode);
}
}
+15 -15
View File
@@ -63,9 +63,10 @@ Project::Project(QWidget *parent) :
{
setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
QWidget* dockWidgetContents = new QWidget();
QWidget* dockWidgetContents = new QWidget(this);
QVBoxLayout* verticalLayout = new QVBoxLayout(dockWidgetContents);
verticalLayout->setContentsMargins(0, 0, 0, 0);
verticalLayout->setMargin(0);
verticalLayout->setSpacing(0);
setWidget(dockWidgetContents);
@@ -79,12 +80,12 @@ Project::Project(QWidget *parent) :
toolbar_widget = new QWidget();
toolbar_widget->setVisible(config.show_project_toolbar);
toolbar_widget->setObjectName("project_toolbar");
QHBoxLayout* toolbar = new QHBoxLayout();
QHBoxLayout* toolbar = new QHBoxLayout(toolbar_widget);
toolbar->setMargin(0);
toolbar->setSpacing(0);
toolbar_widget->setLayout(toolbar);
QPushButton* toolbar_new = new QPushButton(toolbar_widget);
QPushButton* toolbar_new = new QPushButton();
QIcon icon1;
icon1.addFile(QStringLiteral(":/icons/add-button.png"), QSize(), QIcon::Normal, QIcon::On);
icon1.addFile(QStringLiteral(":/icons/add-button-disabled.png"), QSize(), QIcon::Disabled, QIcon::On);
@@ -93,7 +94,7 @@ Project::Project(QWidget *parent) :
connect(toolbar_new, SIGNAL(clicked(bool)), this, SLOT(make_new_menu()));
toolbar->addWidget(toolbar_new);
QPushButton* toolbar_open = new QPushButton(toolbar_widget);
QPushButton* toolbar_open = new QPushButton();
QIcon icon2;
icon2.addFile(QStringLiteral(":/icons/open.png"), QSize(), QIcon::Normal, QIcon::On);
icon2.addFile(QStringLiteral(":/icons/open-disabled.png"), QSize(), QIcon::Disabled, QIcon::On);
@@ -102,7 +103,7 @@ Project::Project(QWidget *parent) :
connect(toolbar_open, SIGNAL(clicked(bool)), mainWindow, SLOT(open_project()));
toolbar->addWidget(toolbar_open);
QPushButton* toolbar_save = new QPushButton(toolbar_widget);
QPushButton* toolbar_save = new QPushButton();
QIcon icon3;
icon3.addFile(QStringLiteral(":/icons/save.png"), QSize(), QIcon::Normal, QIcon::On);
icon3.addFile(QStringLiteral(":/icons/save-disabled.png"), QSize(), QIcon::Disabled, QIcon::On);
@@ -111,7 +112,7 @@ Project::Project(QWidget *parent) :
connect(toolbar_save, SIGNAL(clicked(bool)), mainWindow, SLOT(save_project()));
toolbar->addWidget(toolbar_save);
QPushButton* toolbar_undo = new QPushButton(toolbar_widget);
QPushButton* toolbar_undo = new QPushButton();
QIcon icon4;
icon4.addFile(QStringLiteral(":/icons/undo.png"), QSize(), QIcon::Normal, QIcon::On);
icon4.addFile(QStringLiteral(":/icons/undo-disabled.png"), QSize(), QIcon::Disabled, QIcon::On);
@@ -120,7 +121,7 @@ Project::Project(QWidget *parent) :
connect(toolbar_undo, SIGNAL(clicked(bool)), mainWindow, SLOT(undo()));
toolbar->addWidget(toolbar_undo);
QPushButton* toolbar_redo = new QPushButton(toolbar_widget);
QPushButton* toolbar_redo = new QPushButton();
QIcon icon5;
icon5.addFile(QStringLiteral(":/icons/redo.png"), QSize(), QIcon::Normal, QIcon::On);
icon5.addFile(QStringLiteral(":/icons/redo-disabled.png"), QSize(), QIcon::Disabled, QIcon::On);
@@ -130,7 +131,7 @@ Project::Project(QWidget *parent) :
toolbar->addWidget(toolbar_redo);
toolbar->addStretch();
QPushButton* toolbar_tree_view = new QPushButton(toolbar_widget);
QPushButton* toolbar_tree_view = new QPushButton();
QIcon icon6;
icon6.addFile(QStringLiteral(":/icons/treeview.png"), QSize(), QIcon::Normal, QIcon::On);
icon6.addFile(QStringLiteral(":/icons/treeview-disabled.png"), QSize(), QIcon::Disabled, QIcon::On);
@@ -139,7 +140,7 @@ Project::Project(QWidget *parent) :
connect(toolbar_tree_view, SIGNAL(clicked(bool)), this, SLOT(set_tree_view()));
toolbar->addWidget(toolbar_tree_view);
QPushButton* toolbar_icon_view = new QPushButton(toolbar_widget);
QPushButton* toolbar_icon_view = new QPushButton();
QIcon icon7;
icon7.addFile(QStringLiteral(":/icons/iconview.png"), QSize(), QIcon::Normal, QIcon::On);
icon7.addFile(QStringLiteral(":/icons/iconview-disabled.png"), QSize(), QIcon::Disabled, QIcon::On);
@@ -151,7 +152,7 @@ Project::Project(QWidget *parent) :
verticalLayout->addWidget(toolbar_widget);
// tree view
tree_view = new SourceTable(dockWidgetContents);
tree_view = new SourceTable();
tree_view->project_parent = this;
tree_view->setModel(sorter);
verticalLayout->addWidget(tree_view);
@@ -159,10 +160,9 @@ Project::Project(QWidget *parent) :
// icon view
icon_view_container = new QWidget();
QVBoxLayout* icon_view_container_layout = new QVBoxLayout();
QVBoxLayout* icon_view_container_layout = new QVBoxLayout(icon_view_container);
icon_view_container_layout->setMargin(0);
icon_view_container_layout->setSpacing(0);
icon_view_container->setLayout(icon_view_container_layout);
QHBoxLayout* icon_view_controls = new QHBoxLayout();
icon_view_controls->setMargin(0);
@@ -187,7 +187,7 @@ Project::Project(QWidget *parent) :
icon_view_container_layout->addLayout(icon_view_controls);
icon_view = new SourceIconView(dockWidgetContents);
icon_view = new SourceIconView();
icon_view->project_parent = this;
icon_view->setModel(sorter);
icon_view->setIconSize(QSize(100, 100));
+44 -40
View File
@@ -540,7 +540,7 @@ void Timeline::resizeEvent(QResizeEvent *) {
}
int comp_height = tool_button_widget->height();
int cols = qCeil(double(total_client_height)/double(comp_height));
tool_button_widget->setFixedWidth((tool_button_children.at(0)->width())*cols + horizontal_spacing*(cols-1) + 1);
tool_button_widget->setFixedWidth((tool_button_children.at(0)->sizeHint().width())*cols + horizontal_spacing*(cols-1) + 1);
}
void Timeline::delete_in_out(bool ripple) {
@@ -1097,7 +1097,7 @@ void Timeline::paste(bool insert) {
QPushButton* replace_button = box.addButton(tr("Replace"), QMessageBox::NoRole);
QPushButton* skip_button = box.addButton(tr("Skip"), QMessageBox::RejectRole);
QCheckBox* future_box = new QCheckBox(tr("Do this for all conflicts found"));
QCheckBox* future_box = new QCheckBox(tr("Do this for all conflicts found"), &box);
box.setCheckBox(future_box);
box.exec();
@@ -1645,18 +1645,19 @@ void Timeline::setup_ui() {
QHBoxLayout* horizontalLayout = new QHBoxLayout(dockWidgetContents);
horizontalLayout->setSpacing(0);
horizontalLayout->setContentsMargins(0, 0, 0, 0);
horizontalLayout->setMargin(0);
tool_button_widget = new QWidget(dockWidgetContents);
tool_button_widget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
setWidget(dockWidgetContents);
tool_button_widget = new QWidget();
tool_button_widget->setObjectName("timeline_toolbar");
tool_button_widget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
FlowLayout* tool_buttons_layout = new FlowLayout(tool_button_widget);
// tool_buttons_layout->setSizeConstraint(QLayout::SetNoConstraint);
tool_buttons_layout->setSpacing(4);
tool_buttons_layout->setContentsMargins(0, 0, 0, 0);
tool_buttons_layout->setMargin(0);
toolArrowButton = new QPushButton(tool_button_widget);
toolArrowButton = new QPushButton();
QIcon arrow_icon;
arrow_icon.addFile(QStringLiteral(":/icons/arrow.png"), QSize(), QIcon::Normal, QIcon::Off);
arrow_icon.addFile(QStringLiteral(":/icons/arrow-disabled.png"), QSize(), QIcon::Disabled, QIcon::Off);
@@ -1667,7 +1668,7 @@ void Timeline::setup_ui() {
connect(toolArrowButton, SIGNAL(clicked(bool)), this, SLOT(set_tool()));
tool_buttons_layout->addWidget(toolArrowButton);
toolEditButton = new QPushButton(tool_button_widget);
toolEditButton = new QPushButton();
QIcon icon1;
icon1.addFile(QStringLiteral(":/icons/beam.png"), QSize(), QIcon::Normal, QIcon::Off);
icon1.addFile(QStringLiteral(":/icons/beam-disabled.png"), QSize(), QIcon::Disabled, QIcon::Off);
@@ -1678,7 +1679,7 @@ void Timeline::setup_ui() {
connect(toolEditButton, SIGNAL(clicked(bool)), this, SLOT(set_tool()));
tool_buttons_layout->addWidget(toolEditButton);
toolRippleButton = new QPushButton(tool_button_widget);
toolRippleButton = new QPushButton();
QIcon icon2;
icon2.addFile(QStringLiteral(":/icons/ripple.png"), QSize(), QIcon::Normal, QIcon::Off);
icon2.addFile(QStringLiteral(":/icons/ripple-disabled.png"), QSize(), QIcon::Disabled, QIcon::Off);
@@ -1689,7 +1690,7 @@ void Timeline::setup_ui() {
connect(toolRippleButton, SIGNAL(clicked(bool)), this, SLOT(set_tool()));
tool_buttons_layout->addWidget(toolRippleButton);
toolRazorButton = new QPushButton(tool_button_widget);
toolRazorButton = new QPushButton();
QIcon icon4;
icon4.addFile(QStringLiteral(":/icons/razor.png"), QSize(), QIcon::Normal, QIcon::Off);
icon4.addFile(QStringLiteral(":/icons/razor-disabled.png"), QSize(), QIcon::Disabled, QIcon::Off);
@@ -1700,7 +1701,7 @@ void Timeline::setup_ui() {
connect(toolRazorButton, SIGNAL(clicked(bool)), this, SLOT(set_tool()));
tool_buttons_layout->addWidget(toolRazorButton);
toolSlipButton = new QPushButton(tool_button_widget);
toolSlipButton = new QPushButton();
QIcon icon5;
icon5.addFile(QStringLiteral(":/icons/slip.png"), QSize(), QIcon::Normal, QIcon::On);
icon5.addFile(QStringLiteral(":/icons/slip-disabled.png"), QSize(), QIcon::Disabled, QIcon::On);
@@ -1711,7 +1712,7 @@ void Timeline::setup_ui() {
connect(toolSlipButton, SIGNAL(clicked(bool)), this, SLOT(set_tool()));
tool_buttons_layout->addWidget(toolSlipButton);
toolSlideButton = new QPushButton(tool_button_widget);
toolSlideButton = new QPushButton();
QIcon icon6;
icon6.addFile(QStringLiteral(":/icons/slide.png"), QSize(), QIcon::Normal, QIcon::On);
icon6.addFile(QStringLiteral(":/icons/slide-disabled.png"), QSize(), QIcon::Disabled, QIcon::On);
@@ -1722,7 +1723,7 @@ void Timeline::setup_ui() {
connect(toolSlideButton, SIGNAL(clicked(bool)), this, SLOT(set_tool()));
tool_buttons_layout->addWidget(toolSlideButton);
toolHandButton = new QPushButton(tool_button_widget);
toolHandButton = new QPushButton();
QIcon icon7;
icon7.addFile(QStringLiteral(":/icons/hand.png"), QSize(), QIcon::Normal, QIcon::On);
icon7.addFile(QStringLiteral(":/icons/hand-disabled.png"), QSize(), QIcon::Disabled, QIcon::On);
@@ -1733,7 +1734,7 @@ void Timeline::setup_ui() {
connect(toolHandButton, SIGNAL(clicked(bool)), this, SLOT(set_tool()));
tool_buttons_layout->addWidget(toolHandButton);
toolTransitionButton = new QPushButton(tool_button_widget);
toolTransitionButton = new QPushButton();
QIcon icon8;
icon8.addFile(QStringLiteral(":/icons/transition-tool.png"), QSize(), QIcon::Normal, QIcon::On);
icon8.addFile(QStringLiteral(":/icons/transition-tool-disabled.png"), QSize(), QIcon::Disabled, QIcon::On);
@@ -1743,7 +1744,7 @@ void Timeline::setup_ui() {
connect(toolTransitionButton, SIGNAL(clicked(bool)), this, SLOT(transition_tool_click()));
tool_buttons_layout->addWidget(toolTransitionButton);
snappingButton = new QPushButton(tool_button_widget);
snappingButton = new QPushButton();
QIcon icon9;
icon9.addFile(QStringLiteral(":/icons/magnet.png"), QSize(), QIcon::Normal, QIcon::On);
icon9.addFile(QStringLiteral(":/icons/magnet-disabled.png"), QSize(), QIcon::Disabled, QIcon::On);
@@ -1754,7 +1755,7 @@ void Timeline::setup_ui() {
connect(snappingButton, SIGNAL(toggled(bool)), this, SLOT(snapping_clicked(bool)));
tool_buttons_layout->addWidget(snappingButton);
zoomInButton = new QPushButton(tool_button_widget);
zoomInButton = new QPushButton();
QIcon icon10;
icon10.addFile(QStringLiteral(":/icons/zoomin.png"), QSize(), QIcon::Normal, QIcon::On);
icon10.addFile(QStringLiteral(":/icons/zoomin-disabled.png"), QSize(), QIcon::Disabled, QIcon::On);
@@ -1763,7 +1764,7 @@ void Timeline::setup_ui() {
connect(zoomInButton, SIGNAL(clicked(bool)), this, SLOT(zoom_in()));
tool_buttons_layout->addWidget(zoomInButton);
zoomOutButton = new QPushButton(tool_button_widget);
zoomOutButton = new QPushButton();
QIcon icon11;
icon11.addFile(QStringLiteral(":/icons/zoomout.png"), QSize(), QIcon::Normal, QIcon::On);
icon11.addFile(QStringLiteral(":/icons/zoomout-disabled.png"), QSize(), QIcon::Disabled, QIcon::On);
@@ -1772,17 +1773,16 @@ void Timeline::setup_ui() {
connect(zoomOutButton, SIGNAL(clicked(bool)), this, SLOT(zoom_out()));
tool_buttons_layout->addWidget(zoomOutButton);
recordButton = new QPushButton(tool_button_widget);
recordButton = new QPushButton();
QIcon icon12;
icon12.addFile(QStringLiteral(":/icons/record.png"), QSize(), QIcon::Normal, QIcon::On);
icon12.addFile(QStringLiteral(":/icons/record-disabled.png"), QSize(), QIcon::Disabled, QIcon::On);
recordButton->setIcon(icon12);
recordButton->setToolTip(tr("Record audio"));
connect(recordButton, SIGNAL(clicked(bool)), this, SLOT(record_btn_click()));
tool_buttons_layout->addWidget(recordButton);
addButton = new QPushButton(tool_button_widget);
addButton = new QPushButton();
QIcon icon13;
icon13.addFile(QStringLiteral(":/icons/add-button.png"), QSize(), QIcon::Normal, QIcon::On);
icon13.addFile(QStringLiteral(":/icons/add-button-disabled.png"), QSize(), QIcon::Disabled, QIcon::On);
@@ -1793,54 +1793,58 @@ void Timeline::setup_ui() {
horizontalLayout->addWidget(tool_button_widget);
timeline_area = new QWidget(dockWidgetContents);
QSizePolicy sizePolicy2(QSizePolicy::Minimum, QSizePolicy::Minimum);
sizePolicy2.setHorizontalStretch(1);
sizePolicy2.setVerticalStretch(0);
sizePolicy2.setHeightForWidth(timeline_area->sizePolicy().hasHeightForWidth());
timeline_area->setSizePolicy(sizePolicy2);
timeline_area = new QWidget();
QSizePolicy timeline_area_policy(QSizePolicy::Minimum, QSizePolicy::Minimum);
timeline_area_policy.setHorizontalStretch(1);
timeline_area_policy.setVerticalStretch(0);
timeline_area_policy.setHeightForWidth(timeline_area->sizePolicy().hasHeightForWidth());
timeline_area->setSizePolicy(timeline_area_policy);
QVBoxLayout* timeline_area_layout = new QVBoxLayout(timeline_area);
timeline_area_layout->setSpacing(0);
timeline_area_layout->setContentsMargins(0, 0, 0, 0);
headers = new TimelineHeader(timeline_area);
headers = new TimelineHeader();
timeline_area_layout->addWidget(headers);
editAreas = new QWidget(timeline_area);
editAreas = new QWidget();
QHBoxLayout* editAreaLayout = new QHBoxLayout(editAreas);
editAreaLayout->setSpacing(0);
editAreaLayout->setContentsMargins(0, 0, 0, 0);
QSplitter* splitter = new QSplitter(editAreas);
QSplitter* splitter = new QSplitter();
splitter->setChildrenCollapsible(false);
splitter->setOrientation(Qt::Vertical);
QWidget* videoContainer = new QWidget(splitter);
QWidget* videoContainer = new QWidget();
QHBoxLayout* videoContainerLayout = new QHBoxLayout(videoContainer);
videoContainerLayout->setSpacing(0);
videoContainerLayout->setContentsMargins(0, 0, 0, 0);
video_area = new TimelineWidget(videoContainer);
video_area->setFocusPolicy(Qt::ClickFocus);
video_area = new TimelineWidget();
video_area->setFocusPolicy(Qt::ClickFocus);
videoContainerLayout->addWidget(video_area);
videoScrollbar = new QScrollBar(videoContainer);
videoScrollbar = new QScrollBar();
videoScrollbar->setMaximum(0);
videoScrollbar->setSingleStep(20);
videoScrollbar->setOrientation(Qt::Vertical);
videoContainerLayout->addWidget(videoScrollbar);
splitter->addWidget(videoContainer);
QWidget* audioContainer = new QWidget(splitter);
QWidget* audioContainer = new QWidget();
QHBoxLayout* audioContainerLayout = new QHBoxLayout(audioContainer);
audioContainerLayout->setSpacing(0);
audioContainerLayout->setContentsMargins(0, 0, 0, 0);
audio_area = new TimelineWidget(audioContainer);
audio_area = new TimelineWidget();
audio_area->setFocusPolicy(Qt::ClickFocus);
audioContainerLayout->addWidget(audio_area);
audioScrollbar = new QScrollBar(audioContainer);
audioScrollbar = new QScrollBar();
audioScrollbar->setMaximum(0);
audioScrollbar->setOrientation(Qt::Vertical);
@@ -1852,7 +1856,7 @@ void Timeline::setup_ui() {
timeline_area_layout->addWidget(editAreas);
horizontalScrollBar = new ResizableScrollBar(timeline_area);
horizontalScrollBar = new ResizableScrollBar();
horizontalScrollBar->setMaximum(0);
horizontalScrollBar->setSingleStep(20);
horizontalScrollBar->setOrientation(Qt::Horizontal);
@@ -1861,7 +1865,7 @@ void Timeline::setup_ui() {
horizontalLayout->addWidget(timeline_area);
audio_monitor = new AudioMonitor(dockWidgetContents);
audio_monitor = new AudioMonitor();
audio_monitor->setMinimumSize(QSize(50, 0));
horizontalLayout->addWidget(audio_monitor);
+2 -1
View File
@@ -481,6 +481,7 @@ int Viewer::get_playback_speed() {
void Viewer::resizeEvent(QResizeEvent *) {
if (seq != nullptr) {
set_sb_max();
viewer_widget->update();
}
}
@@ -586,7 +587,7 @@ long Viewer::get_seq_out() {
}
void Viewer::setup_ui() {
QWidget* contents = new QWidget();
QWidget* contents = new QWidget(this);
QVBoxLayout* layout = new QVBoxLayout(contents);
layout->setSpacing(0);
+46 -13
View File
@@ -17,6 +17,7 @@
#include <QtMath>
#include <QFile>
#include <QDir>
#include <QComboBox>
extern "C" {
#include <libavcodec/avcodec.h>
@@ -43,6 +44,35 @@ bool is_audio_device_set() {
return audio_device_set;
}
QAudioDeviceInfo get_audio_device(QAudio::Mode mode) {
QList<QAudioDeviceInfo> devs = QAudioDeviceInfo::availableDevices(mode);
// try to retrieve preferred device from config
QString preferred_device = (mode == QAudio::AudioOutput) ? config.preferred_audio_output : config.preferred_audio_input;
if (!preferred_device.isEmpty()) {
for (int i=0;i<devs.size();i++) {
// try to match available devices with preferred device
if (devs.at(i).deviceName() == preferred_device) {
return devs.at(i);
}
}
}
// if no preferred output is set, try to get the default device
QAudioDeviceInfo default_device = (mode == QAudio::AudioOutput) ? QAudioDeviceInfo::defaultOutputDevice() : QAudioDeviceInfo::defaultInputDevice();
if (!default_device.isNull()) {
return default_device;
}
// if no default output could be retrieved, just use the first in the list
if (devs.size() > 0) {
return devs.at(0);
}
// couldn't find any audio devices, return null device
return QAudioDeviceInfo();
}
void init_audio() {
stop_audio();
@@ -54,18 +84,9 @@ void init_audio() {
audio_format.setByteOrder(QAudioFormat::LittleEndian);
audio_format.setSampleType(QAudioFormat::SignedInt);
QAudioDeviceInfo info(QAudioDeviceInfo::defaultOutputDevice());
QList<QAudioDeviceInfo> devs = QAudioDeviceInfo::availableDevices(QAudio::AudioOutput);
qInfo() << "Found the following audio devices:";
for (int i=0;i<devs.size();i++) {
dout << " " << devs.at(i).deviceName();
}
if (info.isNull() && devs.size() > 0) {
qWarning() << "Default audio returned nullptr, attempting to use first device found...";
info = devs.at(0);
}
qInfo() << "Using audio device" << info.deviceName();
QAudioDeviceInfo info = get_audio_device(QAudio::AudioOutput);
// see if desired format can be used by the device, use nearest if not
if (!info.isFormatSupported(audio_format)) {
qWarning() << "Audio format is not supported by backend, using nearest";
audio_format = info.nearestFormat(audio_format);
@@ -311,13 +332,15 @@ bool start_recording() {
if (config.recording_mode != audio_format.channelCount()) {
audio_format.setChannelCount(config.recording_mode);
}
QAudioDeviceInfo info = QAudioDeviceInfo::defaultInputDevice();
QAudioDeviceInfo info = get_audio_device(QAudio::AudioInput);
if (!info.isFormatSupported(audio_format)) {
qWarning() << "Default format not supported, using nearest";
audio_format = info.nearestFormat(audio_format);
}
write_wave_header(output_recording, audio_format);
audio_input = new QAudioInput(audio_format);
audio_input = new QAudioInput(info, audio_format);
audio_input->start(&output_recording);
recording = true;
@@ -341,3 +364,13 @@ void stop_recording() {
QString get_recorded_audio_filename() {
return output_recording.fileName();
}
void combobox_audio_sample_rates(QComboBox *combobox) {
combobox->addItem("22050 Hz", 22050);
combobox->addItem("24000 Hz", 24000);
combobox->addItem("32000 Hz", 32000);
combobox->addItem("44100 Hz", 44100);
combobox->addItem("48000 Hz", 48000);
combobox->addItem("88200 Hz", 88200);
combobox->addItem("96000 Hz", 96000);
}
+3
View File
@@ -11,6 +11,7 @@
class QIODevice;
class QAudioOutput;
class QComboBox;
struct Sequence;
@@ -59,4 +60,6 @@ bool start_recording();
void stop_recording();
QString get_recorded_audio_filename();
void combobox_audio_sample_rates(QComboBox* combobox);
#endif // AUDIO_H
+8 -2
View File
@@ -79,9 +79,15 @@ void close_clip(Clip* clip, bool wait) {
}
if (clip->fbo != nullptr) {
delete clip->fbo[0];
delete clip->fbo[1];
// delete 3 fbos for nested sequences, 2 for most clips
int fbo_count = (clip->media != nullptr && clip->media->get_type() == MEDIA_TYPE_SEQUENCE) ? 3 : 2;
for (int j=0;j<fbo_count;j++) {
delete clip->fbo[j];
}
delete [] clip->fbo;
clip->fbo = nullptr;
}
+3 -4
View File
@@ -108,10 +108,9 @@ Effect::Effect(Clip* c, const EffectMeta *em) :
// set up base UI
container = new CollapsibleWidget();
connect(container->enabled_check, SIGNAL(clicked(bool)), this, SLOT(field_changed()));
ui = new QWidget();
ui_layout = new QGridLayout();
ui = new QWidget(container);
ui_layout = new QGridLayout(ui);
ui_layout->setSpacing(4);
ui->setLayout(ui_layout);
container->setContents(ui);
connect(container->title_bar, SIGNAL(customContextMenuRequested(const QPoint&)), this, SLOT(show_context_menu(const QPoint&)));
@@ -314,7 +313,7 @@ Effect::~Effect() {
close();
}
//delete container;
delete container;
for (int i=0;i<rows.size();i++) {
delete rows.at(i);
+2
View File
@@ -89,6 +89,8 @@ EffectField::EffectField(EffectRow *parent, int t, const QString &i) :
}
}
EffectField::~EffectField() {}
double EffectField::get_validated_keyframe_handle(int key, bool post) {
int comp_key = -1;
+3 -1
View File
@@ -22,11 +22,13 @@ class EffectField : public QObject {
Q_OBJECT
public:
EffectField(EffectRow* parent, int t, const QString& i);
~EffectField();
EffectRow* parent_row;
int type;
QString id;
double get_validated_keyframe_handle(int key, bool post);
double get_validated_keyframe_handle(int key, bool post);
QVariant get_previous_data();
QVariant get_current_data();
+7 -6
View File
@@ -47,6 +47,12 @@ EffectRow::EffectRow(Effect *parent, bool save, QGridLayout *uilayout, const QSt
}
}
EffectRow::~EffectRow() {
for (int i=0;i<fields.size();i++) {
delete fields.at(i);
}
}
bool EffectRow::isKeyframing() {
return keyframing;
}
@@ -162,16 +168,11 @@ EffectField* EffectRow::add_field(int type, const QString& id, int colspan) {
}
void EffectRow::add_widget(QWidget* w) {
widgets.append(w);
ui->addWidget(w, ui_row, column_count);
column_count++;
}
EffectRow::~EffectRow() {
for (int i=0;i<fields.size();i++) {
delete fields.at(i);
}
}
void EffectRow::set_keyframe_now(ComboAction* ca) {
long time = sequence->playhead-parent_effect->parent_clip->timeline_in+parent_effect->parent_clip->clip_in;
+1
View File
@@ -45,6 +45,7 @@ private:
QString name;
int ui_row;
QVector<EffectField*> fields;
QVector<QWidget*> widgets;
KeyframeNavigator* keyframe_nav;
+1
View File
@@ -69,5 +69,6 @@ void FootageStream::make_square_thumb() {
int sqx = (diff < 0) ? -diff : 0;
int sqy = (diff > 0) ? diff : 0;
p.drawImage(sqx, sqy, video_preview);
p.end();
video_preview_square = QIcon(pixmap);
}
+1 -1
View File
@@ -53,7 +53,7 @@ Media::~Media() {
case MEDIA_TYPE_SEQUENCE: if (object != nullptr) delete to_sequence(); break;
}
if (throbber != nullptr) delete throbber;
qDeleteAll(children);
// qDeleteAll(children);
}
Footage *Media::to_footage() {
+13
View File
@@ -9,6 +9,7 @@
#include "panels/viewer.h"
#include "project/projectfilter.h"
#include "io/config.h"
#include "dialogs/proxydialog.h"
#include "mainwindow.h"
#include <QProcess>
@@ -126,6 +127,11 @@ void SourcesCommon::show_context_menu(QWidget* parent, const QModelIndexList& it
if (all_footage) {
QAction* delete_footage_from_sequences = menu.addAction(tr("Delete All Clips Using This Media"));
QObject::connect(delete_footage_from_sequences, SIGNAL(triggered(bool)), project_parent, SLOT(delete_clips_using_selected_media()));
QMenu* proxies = menu.addMenu(tr("Proxy"));
proxies->addAction(tr("Create Proxy"), this, SLOT(open_create_proxy_dialog()));
// proxies->addAction(tr("Modify Proxy"));
// proxies->addAction(tr("Restore Original"));
}
// delete media
@@ -293,3 +299,10 @@ void SourcesCommon::item_renamed(Media* item) {
editing_item = nullptr;
}
}
void SourcesCommon::open_create_proxy_dialog() {
QVector<Footage*> selected_footage;
ProxyDialog pd(mainWindow, selected_footage);
pd.exec();
}
+19 -18
View File
@@ -11,29 +11,30 @@ class QAbstractItemView;
class QDropEvent;
class SourcesCommon : public QObject {
Q_OBJECT
Q_OBJECT
public:
SourcesCommon(Project *parent);
QAbstractItemView* view;
void show_context_menu(QWidget* parent, const QModelIndexList &items);
SourcesCommon(Project *parent);
QAbstractItemView* view;
void show_context_menu(QWidget* parent, const QModelIndexList &items);
void mousePressEvent(QMouseEvent* e);
void mouseDoubleClickEvent(QMouseEvent* e, const QModelIndexList& selected_items);
void dropEvent(QWidget *parent, QDropEvent* e, const QModelIndex& drop_item, const QModelIndexList &items);
void mousePressEvent(QMouseEvent* e);
void mouseDoubleClickEvent(QMouseEvent* e, const QModelIndexList& selected_items);
void dropEvent(QWidget *parent, QDropEvent* e, const QModelIndex& drop_item, const QModelIndexList &items);
void item_click(Media* m, const QModelIndex &index);
void item_click(Media* m, const QModelIndex &index);
private slots:
void create_seq_from_selected();
void reveal_in_browser();
void rename_interval();
void item_renamed(Media *item);
void create_seq_from_selected();
void reveal_in_browser();
void rename_interval();
void item_renamed(Media *item);
void open_create_proxy_dialog();
private:
Media* editing_item;
QModelIndex editing_index;
QModelIndexList selected_items;
Project* project_parent;
void stop_rename_timer();
QTimer rename_timer;
Media* editing_item;
QModelIndex editing_index;
QModelIndexList selected_items;
Project* project_parent;
void stop_rename_timer();
QTimer rename_timer;
};
#endif // SOURCESCOMMON_H
+33 -34
View File
@@ -15,62 +15,61 @@
#include "debug.h"
CollapsibleWidget::CollapsibleWidget(QWidget* parent) : QWidget(parent) {
selected = false;
selected = false;
layout = new QVBoxLayout(this);
layout->setMargin(0);
layout->setSpacing(0);
title_bar = new CollapsibleWidgetHeader();
title_bar = new CollapsibleWidgetHeader(this);
title_bar->setFocusPolicy(Qt::ClickFocus);
title_bar->setAutoFillBackground(true);
title_bar_layout = new QHBoxLayout();
title_bar_layout = new QHBoxLayout(title_bar);
title_bar_layout->setMargin(5);
title_bar->setLayout(title_bar_layout);
enabled_check = new CheckboxEx();
enabled_check = new CheckboxEx(title_bar);
enabled_check->setChecked(true);
header = new QLabel();
collapse_button = new QPushButton();
collapse_button->setIconSize(collapse_button->iconSize()*0.5);
collapse_button->setStyleSheet("QPushButton { border: none; }");
setText(tr("<untitled>"));
title_bar_layout->addWidget(collapse_button);
title_bar_layout->addWidget(enabled_check);
title_bar_layout->addWidget(header);
title_bar_layout->addStretch();
layout->addWidget(title_bar);
header = new QLabel(title_bar);
collapse_button = new QPushButton(title_bar);
collapse_button->setIconSize(collapse_button->iconSize()*0.5);
collapse_button->setStyleSheet("QPushButton { border: none; }");
setText(tr("<untitled>"));
title_bar_layout->addWidget(collapse_button);
title_bar_layout->addWidget(enabled_check);
title_bar_layout->addWidget(header);
title_bar_layout->addStretch();
layout->addWidget(title_bar);
connect(title_bar, SIGNAL(select(bool, bool)), this, SLOT(header_click(bool, bool)));
set_button_icon(true);
set_button_icon(true);
contents = nullptr;
}
void CollapsibleWidget::header_click(bool s, bool deselect) {
selected = s;
title_bar->selected = s;
if (s) {
selected = s;
title_bar->selected = s;
if (s) {
QPalette p = title_bar->palette();
p.setColor(QPalette::Background, QColor(255, 255, 255, 64));
p.setColor(QPalette::Background, QColor(255, 255, 255, 64));
title_bar->setPalette(p);
} else {
title_bar->setPalette(palette());
}
if (deselect) emit deselect_others(this);
if (deselect) emit deselect_others(this);
}
bool CollapsibleWidget::is_focused() {
if (hasFocus()) return true;
return title_bar->hasFocus();
if (hasFocus()) return true;
return title_bar->hasFocus();
}
bool CollapsibleWidget::is_expanded() {
return contents->isVisible();
return contents->isVisible();
}
void CollapsibleWidget::set_button_icon(bool open) {
collapse_button->setIcon(open ? QIcon(":/icons/tri-down.png") : QIcon(":/icons/tri-right.png"));
collapse_button->setIcon(open ? QIcon(":/icons/tri-down.png") : QIcon(":/icons/tri-right.png"));
}
void CollapsibleWidget::setContents(QWidget* c) {
@@ -93,7 +92,7 @@ void CollapsibleWidget::on_enabled_change(bool b) {
void CollapsibleWidget::on_visible_change() {
contents->setVisible(!contents->isVisible());
set_button_icon(contents->isVisible());
set_button_icon(contents->isVisible());
emit visibleChanged();
}
@@ -102,14 +101,14 @@ CollapsibleWidgetHeader::CollapsibleWidgetHeader(QWidget* parent) : QWidget(pare
}
void CollapsibleWidgetHeader::mousePressEvent(QMouseEvent* event) {
if (selected) {
if ((event->modifiers() & Qt::ShiftModifier)) {
selected = false;
emit select(selected, false);
}
} else {
selected = true;
emit select(selected, !(event->modifiers() & Qt::ShiftModifier));
if (selected) {
if ((event->modifiers() & Qt::ShiftModifier)) {
selected = false;
emit select(selected, false);
}
} else {
selected = true;
emit select(selected, !(event->modifiers() & Qt::ShiftModifier));
}
}
+4 -5
View File
@@ -7,13 +7,12 @@
#include <QFileDialog>
EmbeddedFileChooser::EmbeddedFileChooser(QWidget* parent) : QWidget(parent) {
QHBoxLayout* layout = new QHBoxLayout();
QHBoxLayout* layout = new QHBoxLayout(this);
layout->setMargin(0);
setLayout(layout);
file_label = new QLabel();
file_label = new QLabel(this);
update_label();
layout->addWidget(file_label);
QPushButton* browse_button = new QPushButton("...");
QPushButton* browse_button = new QPushButton("...", this);
browse_button->setFixedWidth(25);
layout->addWidget(browse_button);
connect(browse_button, SIGNAL(clicked(bool)), this, SLOT(browse()));
@@ -35,7 +34,7 @@ void EmbeddedFileChooser::setFilename(const QString &s) {
}
void EmbeddedFileChooser::update_label() {
QString l = "<html>" + tr("File:") + " ";
QString l = "<html>" + tr("File:") + " ";
if (filename.isEmpty()) {
l += "(none)";
} else {
+6 -14
View File
@@ -6,7 +6,7 @@
#include <QDesktopWidget>
KeyframeNavigator::KeyframeNavigator(QWidget *parent, bool addLeftPad) : QWidget(parent) {
key_controls = new QHBoxLayout();
key_controls = new QHBoxLayout(this);
key_controls->setSpacing(0);
key_controls->setMargin(0);
@@ -14,9 +14,7 @@ KeyframeNavigator::KeyframeNavigator(QWidget *parent, bool addLeftPad) : QWidget
key_controls->addStretch();
}
setLayout(key_controls);
left_key_nav = new QPushButton();
left_key_nav = new QPushButton(this);
left_key_nav->setIcon(QIcon(":/icons/tri-left.png"));
left_key_nav->setIconSize(left_key_nav->iconSize()*0.5);
left_key_nav->setVisible(false);
@@ -24,7 +22,7 @@ KeyframeNavigator::KeyframeNavigator(QWidget *parent, bool addLeftPad) : QWidget
connect(left_key_nav, SIGNAL(clicked(bool)), this, SIGNAL(goto_previous_key()));
connect(left_key_nav, SIGNAL(clicked(bool)), this, SIGNAL(clicked()));
key_addremove = new QPushButton();
key_addremove = new QPushButton(this);
key_addremove->setIcon(QIcon(":/icons/diamond.png"));
key_addremove->setIconSize(key_addremove->iconSize()*0.5);
key_addremove->setVisible(false);
@@ -32,7 +30,7 @@ KeyframeNavigator::KeyframeNavigator(QWidget *parent, bool addLeftPad) : QWidget
connect(key_addremove, SIGNAL(clicked(bool)), this, SIGNAL(toggle_key()));
connect(key_addremove, SIGNAL(clicked(bool)), this, SIGNAL(clicked()));
right_key_nav = new QPushButton();
right_key_nav = new QPushButton(this);
right_key_nav->setIcon(QIcon(":/icons/tri-right.png"));
right_key_nav->setIconSize(right_key_nav->iconSize()*0.5);
right_key_nav->setVisible(false);
@@ -40,7 +38,7 @@ KeyframeNavigator::KeyframeNavigator(QWidget *parent, bool addLeftPad) : QWidget
connect(right_key_nav, SIGNAL(clicked(bool)), this, SIGNAL(goto_next_key()));
connect(right_key_nav, SIGNAL(clicked(bool)), this, SIGNAL(clicked()));
keyframe_enable = new QPushButton(QIcon(":/icons/clock.png"), "");
keyframe_enable = new QPushButton(QIcon(":/icons/clock.png"), "", this);
keyframe_enable->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Fixed);
keyframe_enable->setIconSize(keyframe_enable->iconSize()*0.75);
keyframe_enable->setCheckable(true);
@@ -51,13 +49,7 @@ KeyframeNavigator::KeyframeNavigator(QWidget *parent, bool addLeftPad) : QWidget
key_controls->addWidget(keyframe_enable);
}
KeyframeNavigator::~KeyframeNavigator() {
delete keyframe_enable;
delete right_key_nav;
delete key_addremove;
delete left_key_nav;
delete key_controls;
}
KeyframeNavigator::~KeyframeNavigator() {}
void KeyframeNavigator::enable_keyframes(bool b) {
keyframe_enable->setChecked(b);
+40 -26
View File
@@ -24,6 +24,8 @@
#include "panels/timeline.h"
#include "panels/viewer.h"
bool disable_blending = false;
extern "C" {
#include <libavformat/avformat.h>
}
@@ -486,11 +488,13 @@ GLuint compose_sequence(ComposeSequenceParams &params) {
// copy front buffer to back buffer
if (params.nests.size() > 0) {
draw_clip(params.ctx, params.nests.last()->fbo[2]->handle(), params.nests.last()->fbo[0]->texture(), true);
} else {
draw_clip(params.ctx, params.backend_buffer2, params.main_attachment, true);
// copy front buffer to back buffer (only if we're using blending modes - which we usually will be)
if (!disable_blending) {
if (params.nests.size() > 0) {
draw_clip(params.ctx, params.nests.last()->fbo[2]->handle(), params.nests.last()->fbo[0]->texture(), true);
} else {
draw_clip(params.ctx, params.backend_buffer2, params.main_attachment, true);
}
}
@@ -502,34 +506,44 @@ GLuint compose_sequence(ComposeSequenceParams &params) {
// bind front buffer as draw buffer
params.ctx->functions()->glBindFramebuffer(GL_DRAW_FRAMEBUFFER, final_fbo);
// load background texture into texture unit 0
params.ctx->functions()->glActiveTexture(GL_TEXTURE0 + 0); // Texture unit 0
params.ctx->functions()->glBindTexture(GL_TEXTURE_2D, backend_tex_2);
if (disable_blending) {
// some GPUs don't like the blending shader, so we provide a pure GL fallback here
// load foreground texture into texture unit 1
params.ctx->functions()->glActiveTexture(GL_TEXTURE0 + 1); // Texture unit 1
params.ctx->functions()->glBindTexture(GL_TEXTURE_2D, backend_tex_1);
params.ctx->functions()->glBindTexture(GL_TEXTURE_2D, backend_tex_1);
// bind and configure blending mode shader
params.blend_mode_program->bind();
params.blend_mode_program->setUniformValue("blendmode", coords.blendmode);
params.blend_mode_program->setUniformValue("opacity", coords.opacity);
params.blend_mode_program->setUniformValue("background", 0);
params.blend_mode_program->setUniformValue("foreground", 1);
full_blit();
glClear(GL_COLOR_BUFFER_BIT);
params.ctx->functions()->glBindTexture(GL_TEXTURE_2D, 0);
} else {
// load background texture into texture unit 0
params.ctx->functions()->glActiveTexture(GL_TEXTURE0 + 0); // Texture unit 0
params.ctx->functions()->glBindTexture(GL_TEXTURE_2D, backend_tex_2);
full_blit();
// load foreground texture into texture unit 1
params.ctx->functions()->glActiveTexture(GL_TEXTURE0 + 1); // Texture unit 1
params.ctx->functions()->glBindTexture(GL_TEXTURE_2D, backend_tex_1);
// release blend mode shader
params.blend_mode_program->release();
// bind and configure blending mode shader
params.blend_mode_program->bind();
params.blend_mode_program->setUniformValue("blendmode", coords.blendmode);
params.blend_mode_program->setUniformValue("opacity", coords.opacity);
params.blend_mode_program->setUniformValue("background", 0);
params.blend_mode_program->setUniformValue("foreground", 1);
// unbind texture from texture unit 1
params.ctx->functions()->glBindTexture(GL_TEXTURE_2D, 0);
glClear(GL_COLOR_BUFFER_BIT);
// unbind texture from texture unit 0
params.ctx->functions()->glActiveTexture(GL_TEXTURE0 + 0); // Texture unit 0
params.ctx->functions()->glBindTexture(GL_TEXTURE_2D, 0);
full_blit();
// release blend mode shader
params.blend_mode_program->release();
// unbind texture from texture unit 1
params.ctx->functions()->glBindTexture(GL_TEXTURE_2D, 0);
// unbind texture from texture unit 0
params.ctx->functions()->glActiveTexture(GL_TEXTURE0 + 0); // Texture unit 0
params.ctx->functions()->glBindTexture(GL_TEXTURE_2D, 0);
}
// unbind framebuffer
params.ctx->functions()->glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
+2
View File
@@ -10,6 +10,8 @@ class QOpenGLShaderProgram;
struct Sequence;
struct Clip;
extern bool disable_blending;
struct ComposeSequenceParams {
Viewer* viewer;
QOpenGLContext* ctx;
+6 -8
View File
@@ -20,6 +20,9 @@ ViewerContainer::ViewerContainer(QWidget *parent) :
horizontal_scrollbar = new QScrollBar(Qt::Horizontal, this);
vertical_scrollbar = new QScrollBar(Qt::Vertical, this);
horizontal_scrollbar->setVisible(false);
vertical_scrollbar->setVisible(false);
horizontal_scrollbar->setSingleStep(20);
vertical_scrollbar->setSingleStep(20);
@@ -30,12 +33,7 @@ ViewerContainer::ViewerContainer(QWidget *parent) :
connect(vertical_scrollbar, SIGNAL(valueChanged(int)), this, SLOT(scroll_changed()));
}
ViewerContainer::~ViewerContainer() {
delete child;
delete horizontal_scrollbar;
delete vertical_scrollbar;
}
ViewerContainer::~ViewerContainer() {}
void ViewerContainer::dragScrollPress(const QPoint &p) {
drag_start_x = p.x();
@@ -133,11 +131,11 @@ void ViewerContainer::adjust() {
void ViewerContainer::resizeEvent(QResizeEvent *event) {
horizontal_scrollbar->move(0, height()-horizontal_scrollbar->height());
horizontal_scrollbar->setFixedWidth(width()-vertical_scrollbar->width());
horizontal_scrollbar->setFixedWidth(qMax(0, width()-vertical_scrollbar->width()));
horizontal_scrollbar->setPageStep(width());
vertical_scrollbar->move(width() - vertical_scrollbar->width(), 0);
vertical_scrollbar->setFixedHeight(height()-horizontal_scrollbar->height());
vertical_scrollbar->setFixedHeight(qMax(0, height()-horizontal_scrollbar->height()));
vertical_scrollbar->setPageStep(height());
event->accept();