backend transcoding done for proxies
This commit is contained in:
@@ -12,7 +12,7 @@ DemoNotice::DemoNotice(QWidget *parent) :
|
||||
|
||||
QVBoxLayout* vlayout = new QVBoxLayout(this);
|
||||
|
||||
QHBoxLayout* layout = new QHBoxLayout(this);
|
||||
QHBoxLayout* layout = new QHBoxLayout();
|
||||
layout->setMargin(10);
|
||||
layout->setSpacing(20);
|
||||
|
||||
|
||||
+59
-3
@@ -5,8 +5,17 @@
|
||||
#include <QDialogButtonBox>
|
||||
#include <QComboBox>
|
||||
#include <QFileDialog>
|
||||
#include <QMessageBox>
|
||||
|
||||
ProxyDialog::ProxyDialog(QWidget *parent, const QVector<Footage *> &footage) : QDialog(parent) {
|
||||
#include <QDebug>
|
||||
|
||||
#include "io/proxygenerator.h"
|
||||
#include "project/footage.h"
|
||||
|
||||
ProxyDialog::ProxyDialog(QWidget *parent, const QVector<Footage *> &footage) :
|
||||
QDialog(parent),
|
||||
selected_footage(footage)
|
||||
{
|
||||
// set dialog title
|
||||
setWindowTitle(tr("Create Proxy"));
|
||||
|
||||
@@ -19,7 +28,7 @@ ProxyDialog::ProxyDialog(QWidget *parent, const QVector<Footage *> &footage) : Q
|
||||
// set the video dimensions of the proxy
|
||||
layout->addWidget(new QLabel(tr("Dimensions:"), this), 0, 0);
|
||||
|
||||
QComboBox* size_combobox = new QComboBox(this);
|
||||
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);
|
||||
@@ -30,7 +39,7 @@ ProxyDialog::ProxyDialog(QWidget *parent, const QVector<Footage *> &footage) : Q
|
||||
// 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 = new QComboBox(this);
|
||||
format_combobox->addItem(tr("ProRes HQ"));
|
||||
format_combobox->addItem(tr("ProRes SQ"));
|
||||
format_combobox->addItem(tr("ProRes LT"));
|
||||
@@ -58,6 +67,53 @@ ProxyDialog::ProxyDialog(QWidget *parent, const QVector<Footage *> &footage) : Q
|
||||
connect(buttons, SIGNAL(rejected()), this, SLOT(reject()));
|
||||
}
|
||||
|
||||
void ProxyDialog::accept() {
|
||||
QVector<ProxyInfo> info_list;
|
||||
|
||||
for (int i=0;i<selected_footage.size();i++) {
|
||||
// loop through selected footage and send info to the proxy queue
|
||||
|
||||
ProxyInfo info;
|
||||
|
||||
// fill info struct based on user input
|
||||
info.footage = selected_footage.at(i);
|
||||
info.codec_type = 0;
|
||||
info.size_multiplier = size_combobox->currentData().toDouble();
|
||||
|
||||
QString base_footage_fn = QFileInfo(selected_footage.at(i)->url).fileName();
|
||||
|
||||
// determine path from input
|
||||
if (custom_location.isEmpty()) {
|
||||
// use same as source (proxy subfolder)
|
||||
|
||||
// generate full path from footage path and proxy_folder_name's translated "Proxy"
|
||||
info.path = QDir(QFileInfo(selected_footage.at(i)->url).dir().filePath(proxy_folder_name)).filePath(base_footage_fn);
|
||||
} else {
|
||||
// use existing location
|
||||
info.path = QDir(custom_location).filePath(base_footage_fn);
|
||||
}
|
||||
|
||||
// if the proposed proxy file already exists
|
||||
if (QFileInfo::exists(info.path) && QMessageBox::warning(this,
|
||||
tr("Proxy file exists"),
|
||||
tr("The file \"%1\" already exists. Do you wish to replace it?").arg(info.path),
|
||||
QMessageBox::Yes | QMessageBox::No) == QMessageBox::No) {
|
||||
// return to dialog without closing or starting any proxy generation
|
||||
return;
|
||||
}
|
||||
|
||||
// send to proxy generator thread
|
||||
info_list.append(info);
|
||||
}
|
||||
|
||||
// all proxy info checks out, queue it with the proxy generator
|
||||
for (int i=0;i<info_list.size();i++) {
|
||||
proxy_generator.queue(info_list.at(i));
|
||||
}
|
||||
|
||||
QDialog::accept();
|
||||
}
|
||||
|
||||
void ProxyDialog::location_changed(int i) {
|
||||
custom_location.clear();
|
||||
if (i == 1) {
|
||||
|
||||
+12
-2
@@ -11,19 +11,29 @@ class ProxyDialog : public QDialog {
|
||||
Q_OBJECT
|
||||
public:
|
||||
ProxyDialog(QWidget* parent, const QVector<Footage*>& footage);
|
||||
public slots:
|
||||
// called if user clicks "OK" on the dialog
|
||||
virtual void accept() override;
|
||||
private:
|
||||
// user's dimensions
|
||||
// user's desired dimensions
|
||||
QComboBox* size_combobox;
|
||||
|
||||
// user's desired proxy format
|
||||
QComboBox* format_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
|
||||
// stores the subdirectory to be made next to the source (dependent on the user's language)
|
||||
QString proxy_folder_name;
|
||||
|
||||
// list of footage to make proxies for
|
||||
QVector<Footage*> selected_footage;
|
||||
private slots:
|
||||
// triggered when the user changes the index in the location combobox
|
||||
void location_changed(int i);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user