removed all ui files
This commit is contained in:
+21
-8
@@ -1,14 +1,27 @@
|
||||
#include "aboutdialog.h"
|
||||
#include "ui_aboutdialog.h"
|
||||
|
||||
#include <QVBoxLayout>
|
||||
#include <QLabel>
|
||||
#include <QDialogButtonBox>
|
||||
|
||||
AboutDialog::AboutDialog(QWidget *parent) :
|
||||
QDialog(parent),
|
||||
ui(new Ui::AboutDialog)
|
||||
QDialog(parent)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
}
|
||||
setWindowTitle("About Olive");
|
||||
setMaximumWidth(360);
|
||||
|
||||
AboutDialog::~AboutDialog()
|
||||
{
|
||||
delete ui;
|
||||
QVBoxLayout* layout = new QVBoxLayout();
|
||||
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>Olive is a non-linear video editor. This software is free and protected by the GNU GPL.</p><p>Olive Team is obliged to inform users that Olive source code is available for download from its website.</p><p>Olive uses (at least) the following libraries in accordance with the GNU GPL/LGPL:</p><p>Qt, FFmpeg, libass, libfreetype, libmp3lame, libopenjpeg, libopus, libtheora, libtwolame, libvpx, libwavpack, libwebp, libx264, libx265, lzma, bzlib, zlib, libvidstab, libvorbis.</p></body></html>");
|
||||
label->setAlignment(Qt::AlignCenter);
|
||||
label->setWordWrap(true);
|
||||
layout->addWidget(label);
|
||||
|
||||
QDialogButtonBox* buttons = new QDialogButtonBox(QDialogButtonBox::Ok, this);
|
||||
buttons->setCenterButtons(true);
|
||||
layout->addWidget(buttons);
|
||||
|
||||
connect(buttons, SIGNAL(accepted()), this, SLOT(accept()));
|
||||
}
|
||||
|
||||
@@ -3,20 +3,12 @@
|
||||
|
||||
#include <QDialog>
|
||||
|
||||
namespace Ui {
|
||||
class AboutDialog;
|
||||
}
|
||||
|
||||
class AboutDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit AboutDialog(QWidget *parent = 0);
|
||||
~AboutDialog();
|
||||
|
||||
private:
|
||||
Ui::AboutDialog *ui;
|
||||
};
|
||||
|
||||
#endif // ABOUTDIALOG_H
|
||||
|
||||
@@ -1,80 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>AboutDialog</class>
|
||||
<widget class="QDialog" name="AboutDialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>358</width>
|
||||
<height>422</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>About Olive</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string><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>Olive is a non-linear video editor. This software is free and protected by the GNU GPL.</p><p>Olive Team is obliged to inform users that Olive source code is available for download from its website.</p><p>Olive uses (at least) the following libraries in accordance with the GNU GPL/LGPL:</p><p>Qt, FFmpeg, libass, libfreetype, libmp3lame, libopenjpeg, libopus, libtheora, libtwolame, libvpx, libwavpack, libwebp, libx264, libx265, lzma, bzlib, zlib, libvidstab, libvorbis.</p></body></html></string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Ok</set>
|
||||
</property>
|
||||
<property name="centerButtons">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>accepted()</signal>
|
||||
<receiver>AboutDialog</receiver>
|
||||
<slot>accept()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>248</x>
|
||||
<y>254</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>157</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>rejected()</signal>
|
||||
<receiver>AboutDialog</receiver>
|
||||
<slot>reject()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>316</x>
|
||||
<y>260</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>286</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
</ui>
|
||||
+27
-8
@@ -1,14 +1,33 @@
|
||||
#include "demonotice.h"
|
||||
#include "ui_demonotice.h"
|
||||
|
||||
#include <QHBoxLayout>
|
||||
#include <QLabel>
|
||||
#include <QDialogButtonBox>
|
||||
|
||||
DemoNotice::DemoNotice(QWidget *parent) :
|
||||
QDialog(parent),
|
||||
ui(new Ui::DemoNotice)
|
||||
QDialog(parent)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
}
|
||||
setWindowTitle("Welcome to Olive!");
|
||||
setMaximumWidth(600);
|
||||
|
||||
DemoNotice::~DemoNotice()
|
||||
{
|
||||
delete ui;
|
||||
QVBoxLayout* vlayout = new QVBoxLayout();
|
||||
setLayout(vlayout);
|
||||
|
||||
QHBoxLayout* layout = new QHBoxLayout();
|
||||
layout->setMargin(10);
|
||||
layout->setSpacing(20);
|
||||
|
||||
QLabel* icon = new QLabel("<html><head/><body><p><img src=\":/icons/olive-splash.png\"/></p></body></html>");
|
||||
layout->addWidget(icon);
|
||||
|
||||
QLabel* text = new QLabel("<html><head/><body><p><span style=\" font-size:14pt;\">Welcome to Olive!</span></p><p>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>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 <a href=\"https://olivevideoeditor.org/\"><span style=\" text-decoration: underline; color:#007af4;\">www.olivevideoeditor.org</span></a></p><p>Thank you for trying Olive and we hope you enjoy it!</p></body></html>");
|
||||
text->setWordWrap(true);
|
||||
layout->addWidget(text);
|
||||
|
||||
vlayout->addLayout(layout);
|
||||
|
||||
QDialogButtonBox* buttons = new QDialogButtonBox(QDialogButtonBox::Ok, this);
|
||||
buttons->setCenterButtons(true);
|
||||
connect(buttons, SIGNAL(accepted()), this, SLOT(accept()));
|
||||
vlayout->addWidget(buttons);
|
||||
}
|
||||
|
||||
@@ -3,20 +3,11 @@
|
||||
|
||||
#include <QDialog>
|
||||
|
||||
namespace Ui {
|
||||
class DemoNotice;
|
||||
}
|
||||
|
||||
class DemoNotice : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit DemoNotice(QWidget *parent = 0);
|
||||
~DemoNotice();
|
||||
|
||||
private:
|
||||
Ui::DemoNotice *ui;
|
||||
};
|
||||
|
||||
#endif // DEMONOTICE_H
|
||||
|
||||
@@ -1,97 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>DemoNotice</class>
|
||||
<widget class="QDialog" name="DemoNotice">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>511</width>
|
||||
<height>249</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Welcome</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<property name="spacing">
|
||||
<number>12</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string><html><head/><body><p><img src=":/icons/olive-splash.png"/></p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string><html><head/><body><p><span style=" font-size:14pt;">Welcome to Olive!</span></p><p>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>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 <a href="https://olivevideoeditor.org/"><span style=" text-decoration: underline; color:#007af4;">www.olivevideoeditor.org</span></a></p><p>Thank you for trying Olive and we hope you enjoy it!</p></body></html></string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Ok</set>
|
||||
</property>
|
||||
<property name="centerButtons">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>accepted()</signal>
|
||||
<receiver>DemoNotice</receiver>
|
||||
<slot>accept()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>248</x>
|
||||
<y>254</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>157</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>rejected()</signal>
|
||||
<receiver>DemoNotice</receiver>
|
||||
<slot>reject()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>316</x>
|
||||
<y>260</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>286</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
</ui>
|
||||
+307
-154
@@ -1,5 +1,4 @@
|
||||
#include "exportdialog.h"
|
||||
#include "ui_exportdialog.h"
|
||||
|
||||
#include <QOpenGLWidget>
|
||||
#include <QFileDialog>
|
||||
@@ -7,6 +6,14 @@
|
||||
#include <QMessageBox>
|
||||
#include <QOpenGLContext>
|
||||
#include <QtMath>
|
||||
#include <QVBoxLayout>
|
||||
#include <QHBoxLayout>
|
||||
#include <QLabel>
|
||||
#include <QGroupBox>
|
||||
#include <QComboBox>
|
||||
#include <QSpinBox>
|
||||
#include <QPushButton>
|
||||
#include <QProgressBar>
|
||||
|
||||
#include "debug.h"
|
||||
#include "panels/panels.h"
|
||||
@@ -48,15 +55,14 @@ enum ExportFormats {
|
||||
};
|
||||
|
||||
ExportDialog::ExportDialog(QWidget *parent) :
|
||||
QDialog(parent),
|
||||
ui(new Ui::ExportDialog)
|
||||
QDialog(parent)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
setup_ui();
|
||||
|
||||
ui->rangeCombobox->setCurrentIndex(0);
|
||||
rangeCombobox->setCurrentIndex(0);
|
||||
if (sequence->using_workarea) {
|
||||
ui->rangeCombobox->setEnabled(sequence->using_workarea);
|
||||
ui->rangeCombobox->setCurrentIndex(1);
|
||||
rangeCombobox->setEnabled(sequence->using_workarea);
|
||||
rangeCombobox->setCurrentIndex(1);
|
||||
}
|
||||
|
||||
format_strings.resize(FORMAT_SIZE);
|
||||
@@ -83,27 +89,25 @@ ExportDialog::ExportDialog(QWidget *parent) :
|
||||
format_strings[FORMAT_WMV] = "Windows Media";
|
||||
|
||||
for (int i=0;i<FORMAT_SIZE;i++) {
|
||||
ui->formatCombobox->addItem(format_strings[i]);
|
||||
formatCombobox->addItem(format_strings[i]);
|
||||
}
|
||||
ui->formatCombobox->setCurrentIndex(FORMAT_MPEG4);
|
||||
formatCombobox->setCurrentIndex(FORMAT_MPEG4);
|
||||
|
||||
ui->widthSpinbox->setValue(sequence->width);
|
||||
ui->heightSpinbox->setValue(sequence->height);
|
||||
ui->samplingRateSpinbox->setValue(sequence->audio_frequency);
|
||||
ui->framerateSpinbox->setValue(sequence->frame_rate);
|
||||
widthSpinbox->setValue(sequence->width);
|
||||
heightSpinbox->setValue(sequence->height);
|
||||
samplingRateSpinbox->setValue(sequence->audio_frequency);
|
||||
framerateSpinbox->setValue(sequence->frame_rate);
|
||||
}
|
||||
|
||||
ExportDialog::~ExportDialog()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
{}
|
||||
|
||||
void ExportDialog::on_formatCombobox_currentIndexChanged(int index)
|
||||
void ExportDialog::format_changed(int index)
|
||||
{
|
||||
format_vcodecs.clear();
|
||||
format_acodecs.clear();
|
||||
ui->vcodecCombobox->clear();
|
||||
ui->acodecCombobox->clear();
|
||||
vcodecCombobox->clear();
|
||||
acodecCombobox->clear();
|
||||
|
||||
int default_vcodec = 0;
|
||||
int default_acodec = 0;
|
||||
@@ -241,7 +245,7 @@ void ExportDialog::on_formatCombobox_currentIndexChanged(int index)
|
||||
format_acodecs.append(AV_CODEC_ID_OPUS);
|
||||
format_acodecs.append(AV_CODEC_ID_VORBIS);
|
||||
|
||||
default_acodec = 1;
|
||||
default_acodec = 1;
|
||||
break;
|
||||
case FORMAT_MOV:
|
||||
format_vcodecs.append(AV_CODEC_ID_QTRLE);
|
||||
@@ -288,60 +292,56 @@ void ExportDialog::on_formatCombobox_currentIndexChanged(int index)
|
||||
for (int i=0;i<format_vcodecs.size();i++) {
|
||||
codec_info = avcodec_find_encoder((enum AVCodecID) format_vcodecs.at(i));
|
||||
if (codec_info == NULL) {
|
||||
ui->vcodecCombobox->addItem("NULL");
|
||||
vcodecCombobox->addItem("NULL");
|
||||
} else {
|
||||
ui->vcodecCombobox->addItem(codec_info->long_name);
|
||||
vcodecCombobox->addItem(codec_info->long_name);
|
||||
}
|
||||
}
|
||||
for (int i=0;i<format_acodecs.size();i++) {
|
||||
codec_info = avcodec_find_encoder((enum AVCodecID) format_acodecs.at(i));
|
||||
if (codec_info == NULL) {
|
||||
ui->acodecCombobox->addItem("NULL");
|
||||
acodecCombobox->addItem("NULL");
|
||||
} else {
|
||||
ui->acodecCombobox->addItem(codec_info->long_name);
|
||||
acodecCombobox->addItem(codec_info->long_name);
|
||||
}
|
||||
}
|
||||
|
||||
ui->vcodecCombobox->setCurrentIndex(default_vcodec);
|
||||
ui->acodecCombobox->setCurrentIndex(default_acodec);
|
||||
vcodecCombobox->setCurrentIndex(default_vcodec);
|
||||
acodecCombobox->setCurrentIndex(default_acodec);
|
||||
|
||||
bool video_enabled = format_vcodecs.size() != 0;
|
||||
bool audio_enabled = format_acodecs.size() != 0;
|
||||
ui->videoGroupbox->setChecked(video_enabled);
|
||||
ui->audioGroupbox->setChecked(audio_enabled);
|
||||
ui->videoGroupbox->setEnabled(video_enabled);
|
||||
ui->audioGroupbox->setEnabled(audio_enabled);
|
||||
}
|
||||
|
||||
void ExportDialog::on_pushButton_2_clicked() {
|
||||
close();
|
||||
videoGroupbox->setChecked(video_enabled);
|
||||
audioGroupbox->setChecked(audio_enabled);
|
||||
videoGroupbox->setEnabled(video_enabled);
|
||||
audioGroupbox->setEnabled(audio_enabled);
|
||||
}
|
||||
|
||||
void ExportDialog::render_thread_finished() {
|
||||
if (ui->progressBar->value() < 100 && !cancelled) {
|
||||
QMessageBox::critical(this, "Export Failed", "Export failed - " + export_error, QMessageBox::Ok);
|
||||
}
|
||||
prep_ui_for_render(false);
|
||||
panel_sequence_viewer->viewer_widget->makeCurrent();
|
||||
panel_sequence_viewer->viewer_widget->initializeGL();
|
||||
update_ui(false);
|
||||
if (ui->progressBar->value() == 100) close();
|
||||
if (progressBar->value() < 100 && !cancelled) {
|
||||
QMessageBox::critical(this, "Export Failed", "Export failed - " + export_error, QMessageBox::Ok);
|
||||
}
|
||||
prep_ui_for_render(false);
|
||||
panel_sequence_viewer->viewer_widget->makeCurrent();
|
||||
panel_sequence_viewer->viewer_widget->initializeGL();
|
||||
update_ui(false);
|
||||
if (progressBar->value() == 100) accept();
|
||||
}
|
||||
|
||||
void ExportDialog::prep_ui_for_render(bool r) {
|
||||
ui->pushButton->setEnabled(!r);
|
||||
ui->pushButton_2->setEnabled(!r);
|
||||
ui->renderCancel->setEnabled(r);
|
||||
export_button->setEnabled(!r);
|
||||
cancel_button->setEnabled(!r);
|
||||
renderCancel->setEnabled(r);
|
||||
}
|
||||
|
||||
void ExportDialog::on_pushButton_clicked() {
|
||||
if (ui->widthSpinbox->value()%2 == 1 || ui->heightSpinbox->value()%2 == 1) {
|
||||
void ExportDialog::export_action() {
|
||||
if (widthSpinbox->value()%2 == 1 || heightSpinbox->value()%2 == 1) {
|
||||
QMessageBox::critical(this, "Invalid dimensions", "Export width and height must both be even numbers/divisible by 2.", QMessageBox::Ok);
|
||||
return;
|
||||
}
|
||||
|
||||
QString ext;
|
||||
switch (ui->formatCombobox->currentIndex()) {
|
||||
switch (formatCombobox->currentIndex()) {
|
||||
case FORMAT_3GPP:
|
||||
ext = "3gp";
|
||||
break;
|
||||
@@ -366,57 +366,57 @@ void ExportDialog::on_pushButton_clicked() {
|
||||
case FORMAT_GIF:
|
||||
ext = "gif";
|
||||
break;
|
||||
case FORMAT_IMG:
|
||||
switch (format_vcodecs.at(ui->vcodecCombobox->currentIndex())) {
|
||||
case AV_CODEC_ID_BMP:
|
||||
ext = "bmp";
|
||||
break;
|
||||
case AV_CODEC_ID_MJPEG:
|
||||
ext = "jpg";
|
||||
break;
|
||||
case AV_CODEC_ID_JPEG2000:
|
||||
ext = "jp2";
|
||||
break;
|
||||
case AV_CODEC_ID_PSD:
|
||||
ext = "psd";
|
||||
break;
|
||||
case AV_CODEC_ID_PNG:
|
||||
ext = "png";
|
||||
break;
|
||||
case AV_CODEC_ID_TIFF:
|
||||
ext = "tif";
|
||||
break;
|
||||
default:
|
||||
case FORMAT_IMG:
|
||||
switch (format_vcodecs.at(vcodecCombobox->currentIndex())) {
|
||||
case AV_CODEC_ID_BMP:
|
||||
ext = "bmp";
|
||||
break;
|
||||
case AV_CODEC_ID_MJPEG:
|
||||
ext = "jpg";
|
||||
break;
|
||||
case AV_CODEC_ID_JPEG2000:
|
||||
ext = "jp2";
|
||||
break;
|
||||
case AV_CODEC_ID_PSD:
|
||||
ext = "psd";
|
||||
break;
|
||||
case AV_CODEC_ID_PNG:
|
||||
ext = "png";
|
||||
break;
|
||||
case AV_CODEC_ID_TIFF:
|
||||
ext = "tif";
|
||||
break;
|
||||
default:
|
||||
dout << "[ERROR] Invalid codec selection for an image sequence";
|
||||
QMessageBox::critical(this, "Invalid codec", "Couldn't determine output parameters for the selected codec. This is a bug, please contact the developers.", QMessageBox::Ok);
|
||||
return;
|
||||
}
|
||||
QMessageBox::critical(this, "Invalid codec", "Couldn't determine output parameters for the selected codec. This is a bug, please contact the developers.", QMessageBox::Ok);
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case FORMAT_MP3:
|
||||
ext = "mp3";
|
||||
break;
|
||||
case FORMAT_MPEG1:
|
||||
if (ui->videoGroupbox->isChecked() && !ui->audioGroupbox->isChecked()) {
|
||||
if (videoGroupbox->isChecked() && !audioGroupbox->isChecked()) {
|
||||
ext = "m1v";
|
||||
} else if (!ui->videoGroupbox->isChecked() && ui->audioGroupbox->isChecked()) {
|
||||
} else if (!videoGroupbox->isChecked() && audioGroupbox->isChecked()) {
|
||||
ext = "m1a";
|
||||
} else {
|
||||
ext = "mpg";
|
||||
}
|
||||
break;
|
||||
case FORMAT_MPEG2:
|
||||
if (ui->videoGroupbox->isChecked() && !ui->audioGroupbox->isChecked()) {
|
||||
if (videoGroupbox->isChecked() && !audioGroupbox->isChecked()) {
|
||||
ext = "m2v";
|
||||
} else if (!ui->videoGroupbox->isChecked() && ui->audioGroupbox->isChecked()) {
|
||||
} else if (!videoGroupbox->isChecked() && audioGroupbox->isChecked()) {
|
||||
ext = "m2a";
|
||||
} else {
|
||||
ext = "mpg";
|
||||
}
|
||||
break;
|
||||
case FORMAT_MPEG4:
|
||||
if (ui->videoGroupbox->isChecked() && !ui->audioGroupbox->isChecked()) {
|
||||
if (videoGroupbox->isChecked() && !audioGroupbox->isChecked()) {
|
||||
ext = "m4v";
|
||||
} else if (!ui->videoGroupbox->isChecked() && ui->audioGroupbox->isChecked()) {
|
||||
} else if (!videoGroupbox->isChecked() && audioGroupbox->isChecked()) {
|
||||
ext = "m4a";
|
||||
} else {
|
||||
ext = "mp4";
|
||||
@@ -426,7 +426,7 @@ void ExportDialog::on_pushButton_clicked() {
|
||||
ext = "ts";
|
||||
break;
|
||||
case FORMAT_MKV:
|
||||
if (!ui->videoGroupbox->isChecked()) {
|
||||
if (!videoGroupbox->isChecked()) {
|
||||
ext = "mka";
|
||||
} else {
|
||||
ext = "mkv";
|
||||
@@ -438,14 +438,14 @@ void ExportDialog::on_pushButton_clicked() {
|
||||
case FORMAT_MOV:
|
||||
ext = "mov";
|
||||
break;
|
||||
case FORMAT_WAV:
|
||||
ext = "wav";
|
||||
break;
|
||||
case FORMAT_WAV:
|
||||
ext = "wav";
|
||||
break;
|
||||
case FORMAT_WEBM:
|
||||
ext = "webm";
|
||||
break;
|
||||
case FORMAT_WMV:
|
||||
if (ui->videoGroupbox->isChecked()) {
|
||||
if (videoGroupbox->isChecked()) {
|
||||
ext = "wmv";
|
||||
} else {
|
||||
ext = "wma";
|
||||
@@ -453,66 +453,66 @@ void ExportDialog::on_pushButton_clicked() {
|
||||
break;
|
||||
default:
|
||||
dout << "[ERROR] Invalid format - this is a bug, please inform the developers";
|
||||
QMessageBox::critical(this, "Invalid format", "Couldn't determine output format. This is a bug, please contact the developers.", QMessageBox::Ok);
|
||||
QMessageBox::critical(this, "Invalid format", "Couldn't determine output format. This is a bug, please contact the developers.", QMessageBox::Ok);
|
||||
return;
|
||||
}
|
||||
QString filename = QFileDialog::getSaveFileName(this, "Export Media", "", format_strings[ui->formatCombobox->currentIndex()] + " (*." + ext + ")");
|
||||
QString filename = QFileDialog::getSaveFileName(this, "Export Media", "", format_strings[formatCombobox->currentIndex()] + " (*." + ext + ")");
|
||||
if (!filename.isEmpty()) {
|
||||
if (!filename.endsWith("." + ext, Qt::CaseInsensitive)) {
|
||||
filename += "." + ext;
|
||||
}
|
||||
if (!filename.endsWith("." + ext, Qt::CaseInsensitive)) {
|
||||
filename += "." + ext;
|
||||
}
|
||||
|
||||
if (ui->formatCombobox->currentIndex() == FORMAT_IMG) {
|
||||
int ext_location = filename.lastIndexOf('.');
|
||||
if (ext_location > filename.lastIndexOf('/')) {
|
||||
filename.insert(ext_location, 'd');
|
||||
filename.insert(ext_location, '5');
|
||||
filename.insert(ext_location, '0');
|
||||
filename.insert(ext_location, '%');
|
||||
}
|
||||
}
|
||||
if (formatCombobox->currentIndex() == FORMAT_IMG) {
|
||||
int ext_location = filename.lastIndexOf('.');
|
||||
if (ext_location > filename.lastIndexOf('/')) {
|
||||
filename.insert(ext_location, 'd');
|
||||
filename.insert(ext_location, '5');
|
||||
filename.insert(ext_location, '0');
|
||||
filename.insert(ext_location, '%');
|
||||
}
|
||||
}
|
||||
|
||||
et = new ExportThread();
|
||||
|
||||
connect(et, SIGNAL(finished()), et, SLOT(deleteLater()));
|
||||
connect(et, SIGNAL(finished()), this, SLOT(render_thread_finished()));
|
||||
connect(et, SIGNAL(progress_changed(int, qint64)), this, SLOT(update_progress_bar(int, qint64)));
|
||||
connect(et, SIGNAL(finished()), this, SLOT(render_thread_finished()));
|
||||
connect(et, SIGNAL(progress_changed(int, qint64)), this, SLOT(update_progress_bar(int, qint64)));
|
||||
|
||||
closeActiveClips(sequence, true);
|
||||
|
||||
mainWindow->autorecover_interval();
|
||||
mainWindow->autorecover_interval();
|
||||
|
||||
rendering = true;
|
||||
panel_sequence_viewer->viewer_widget->context()->doneCurrent();
|
||||
panel_sequence_viewer->viewer_widget->context()->moveToThread(et);
|
||||
|
||||
prep_ui_for_render(true);
|
||||
prep_ui_for_render(true);
|
||||
|
||||
et->filename = filename;
|
||||
et->video_enabled = ui->videoGroupbox->isChecked();
|
||||
if (et->video_enabled) {
|
||||
et->video_codec = format_vcodecs.at(ui->vcodecCombobox->currentIndex());
|
||||
et->video_width = ui->widthSpinbox->value();
|
||||
et->video_height = ui->heightSpinbox->value();
|
||||
et->video_frame_rate = ui->framerateSpinbox->value();
|
||||
et->video_compression_type = ui->compressionTypeCombobox->currentData().toInt();
|
||||
et->video_bitrate = ui->videobitrateSpinbox->value();
|
||||
}
|
||||
et->audio_enabled = ui->audioGroupbox->isChecked();
|
||||
if (et->audio_enabled) {
|
||||
et->audio_codec = format_acodecs.at(ui->acodecCombobox->currentIndex());
|
||||
et->audio_sampling_rate = ui->samplingRateSpinbox->value();
|
||||
et->audio_bitrate = ui->audiobitrateSpinbox->value();
|
||||
}
|
||||
et->video_enabled = videoGroupbox->isChecked();
|
||||
if (et->video_enabled) {
|
||||
et->video_codec = format_vcodecs.at(vcodecCombobox->currentIndex());
|
||||
et->video_width = widthSpinbox->value();
|
||||
et->video_height = heightSpinbox->value();
|
||||
et->video_frame_rate = framerateSpinbox->value();
|
||||
et->video_compression_type = compressionTypeCombobox->currentData().toInt();
|
||||
et->video_bitrate = videobitrateSpinbox->value();
|
||||
}
|
||||
et->audio_enabled = audioGroupbox->isChecked();
|
||||
if (et->audio_enabled) {
|
||||
et->audio_codec = format_acodecs.at(acodecCombobox->currentIndex());
|
||||
et->audio_sampling_rate = samplingRateSpinbox->value();
|
||||
et->audio_bitrate = audiobitrateSpinbox->value();
|
||||
}
|
||||
|
||||
et->start_frame = 0;
|
||||
et->end_frame = sequence->getEndFrame(); // entire sequence
|
||||
if (ui->rangeCombobox->currentIndex() == 1) {
|
||||
et->start_frame = qMax(sequence->workarea_in, et->start_frame);
|
||||
et->end_frame = qMin(sequence->workarea_out, et->end_frame);
|
||||
}
|
||||
et->start_frame = 0;
|
||||
et->end_frame = sequence->getEndFrame(); // entire sequence
|
||||
if (rangeCombobox->currentIndex() == 1) {
|
||||
et->start_frame = qMax(sequence->workarea_in, et->start_frame);
|
||||
et->end_frame = qMin(sequence->workarea_out, et->end_frame);
|
||||
}
|
||||
|
||||
et->ed = this;
|
||||
et->ed = this;
|
||||
cancelled = false;
|
||||
|
||||
et->start();
|
||||
@@ -520,54 +520,207 @@ void ExportDialog::on_pushButton_clicked() {
|
||||
}
|
||||
|
||||
void ExportDialog::update_progress_bar(int value, qint64 remaining_ms) {
|
||||
// convert ms to H:MM:SS
|
||||
int seconds = qFloor(remaining_ms*0.001)%60;
|
||||
int minutes = qFloor(remaining_ms/60000)%60;
|
||||
int hours = qFloor(remaining_ms/3600000);
|
||||
ui->progressBar->setFormat("%p% (ETA: " + QString::number(hours) + ":" + QString::number(minutes).rightJustified(2, '0') + ":" + QString::number(seconds).rightJustified(2, '0') + ")");
|
||||
// convert ms to H:MM:SS
|
||||
int seconds = qFloor(remaining_ms*0.001)%60;
|
||||
int minutes = qFloor(remaining_ms/60000)%60;
|
||||
int hours = qFloor(remaining_ms/3600000);
|
||||
progressBar->setFormat("%p% (ETA: " + QString::number(hours) + ":" + QString::number(minutes).rightJustified(2, '0') + ":" + QString::number(seconds).rightJustified(2, '0') + ")");
|
||||
|
||||
ui->progressBar->setValue(value);
|
||||
progressBar->setValue(value);
|
||||
}
|
||||
|
||||
void ExportDialog::on_renderCancel_clicked() {
|
||||
panel_sequence_viewer->viewer_widget->force_quit = true;
|
||||
void ExportDialog::cancel_render() {
|
||||
panel_sequence_viewer->viewer_widget->force_quit = true;
|
||||
et->continueEncode = false;
|
||||
cancelled = true;
|
||||
cancelled = true;
|
||||
}
|
||||
|
||||
void ExportDialog::on_vcodecCombobox_currentIndexChanged(int index) {
|
||||
ui->compressionTypeCombobox->clear();
|
||||
void ExportDialog::vcodec_changed(int index) {
|
||||
compressionTypeCombobox->clear();
|
||||
if ((format_vcodecs.size() > 0 && format_vcodecs.at(index) == AV_CODEC_ID_H264)) {
|
||||
ui->compressionTypeCombobox->setEnabled(true);
|
||||
ui->compressionTypeCombobox->addItem("Quality-based (Constant Rate Factor)", COMPRESSION_TYPE_CFR);
|
||||
// ui->compressionTypeCombobox->addItem("File size-based (Two-Pass)", COMPRESSION_TYPE_TARGETSIZE);
|
||||
// ui->compressionTypeCombobox->addItem("Average bitrate (Two-Pass)", COMPRESSION_TYPE_TARGETBR);
|
||||
compressionTypeCombobox->setEnabled(true);
|
||||
compressionTypeCombobox->addItem("Quality-based (Constant Rate Factor)", COMPRESSION_TYPE_CFR);
|
||||
// compressionTypeCombobox->addItem("File size-based (Two-Pass)", COMPRESSION_TYPE_TARGETSIZE);
|
||||
// compressionTypeCombobox->addItem("Average bitrate (Two-Pass)", COMPRESSION_TYPE_TARGETBR);
|
||||
} else {
|
||||
ui->compressionTypeCombobox->addItem("Constant Bitrate", COMPRESSION_TYPE_CBR);
|
||||
ui->compressionTypeCombobox->setCurrentIndex(0);
|
||||
ui->compressionTypeCombobox->setEnabled(false);
|
||||
compressionTypeCombobox->addItem("Constant Bitrate", COMPRESSION_TYPE_CBR);
|
||||
compressionTypeCombobox->setCurrentIndex(0);
|
||||
compressionTypeCombobox->setEnabled(false);
|
||||
}
|
||||
}
|
||||
|
||||
void ExportDialog::on_compressionTypeCombobox_currentIndexChanged(int) {
|
||||
ui->videobitrateSpinbox->setToolTip("");
|
||||
ui->videobitrateSpinbox->setMinimum(0);
|
||||
ui->videobitrateSpinbox->setMaximum(99.99);
|
||||
switch (ui->compressionTypeCombobox->currentData().toInt()) {
|
||||
void ExportDialog::comp_type_changed(int) {
|
||||
videobitrateSpinbox->setToolTip("");
|
||||
videobitrateSpinbox->setMinimum(0);
|
||||
videobitrateSpinbox->setMaximum(99.99);
|
||||
switch (compressionTypeCombobox->currentData().toInt()) {
|
||||
case COMPRESSION_TYPE_CBR:
|
||||
case COMPRESSION_TYPE_TARGETBR:
|
||||
ui->videoBitrateLabel->setText("Bitrate (Mbps):");
|
||||
ui->videobitrateSpinbox->setValue(qMax(0.5, (double) qRound((0.01528 * sequence->height) - 4.5)));
|
||||
videoBitrateLabel->setText("Bitrate (Mbps):");
|
||||
videobitrateSpinbox->setValue(qMax(0.5, (double) qRound((0.01528 * sequence->height) - 4.5)));
|
||||
break;
|
||||
case COMPRESSION_TYPE_CFR:
|
||||
ui->videoBitrateLabel->setText("Quality (CRF):");
|
||||
ui->videobitrateSpinbox->setValue(36);
|
||||
ui->videobitrateSpinbox->setMaximum(51);
|
||||
ui->videobitrateSpinbox->setToolTip("Quality Factor:\n\n0 = lossless\n17-18 = visually lossless (compressed, but unnoticeable)\n23 = high quality\n51 = lowest quality possible");
|
||||
videoBitrateLabel->setText("Quality (CRF):");
|
||||
videobitrateSpinbox->setValue(36);
|
||||
videobitrateSpinbox->setMaximum(51);
|
||||
videobitrateSpinbox->setToolTip("Quality Factor:\n\n0 = lossless\n17-18 = visually lossless (compressed, but unnoticeable)\n23 = high quality\n51 = lowest quality possible");
|
||||
break;
|
||||
case COMPRESSION_TYPE_TARGETSIZE:
|
||||
ui->videoBitrateLabel->setText("Target File Size (MB):");
|
||||
ui->videobitrateSpinbox->setValue(100);
|
||||
videoBitrateLabel->setText("Target File Size (MB):");
|
||||
videobitrateSpinbox->setValue(100);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void ExportDialog::setup_ui() {
|
||||
QVBoxLayout* verticalLayout = new QVBoxLayout(this);
|
||||
|
||||
QHBoxLayout* horizontalLayout = new QHBoxLayout();
|
||||
|
||||
horizontalLayout->addWidget(new QLabel("Format:"));
|
||||
|
||||
formatCombobox = new QComboBox(this);
|
||||
|
||||
horizontalLayout->addWidget(formatCombobox);
|
||||
|
||||
verticalLayout->addLayout(horizontalLayout);
|
||||
|
||||
QHBoxLayout* horizontalLayout_4 = new QHBoxLayout();
|
||||
|
||||
horizontalLayout_4->addWidget(new QLabel("Range:"));
|
||||
|
||||
rangeCombobox = new QComboBox(this);
|
||||
rangeCombobox->addItem("Entire Sequence");
|
||||
rangeCombobox->addItem("In to Out");
|
||||
|
||||
horizontalLayout_4->addWidget(rangeCombobox);
|
||||
|
||||
verticalLayout->addLayout(horizontalLayout_4);
|
||||
|
||||
videoGroupbox = new QGroupBox(this);
|
||||
videoGroupbox->setTitle("Video");
|
||||
videoGroupbox->setFlat(false);
|
||||
videoGroupbox->setCheckable(true);
|
||||
QGridLayout* gridLayout = new QGridLayout(videoGroupbox);
|
||||
|
||||
gridLayout->addWidget(new QLabel("Compression Type:"), 4, 0, 1, 1);
|
||||
|
||||
compressionTypeCombobox = new QComboBox(videoGroupbox);
|
||||
compressionTypeCombobox->addItem("Quality-based (Constant Rate Factor)");
|
||||
compressionTypeCombobox->addItem("File size-based (Two-Pass)");
|
||||
|
||||
gridLayout->addWidget(compressionTypeCombobox, 4, 1, 1, 1);
|
||||
|
||||
gridLayout->addWidget(new QLabel("Codec:"), 0, 0, 1, 1);
|
||||
|
||||
vcodecCombobox = new QComboBox(videoGroupbox);
|
||||
|
||||
gridLayout->addWidget(vcodecCombobox, 0, 1, 1, 1);
|
||||
|
||||
gridLayout->addWidget(new QLabel("Height:"), 2, 0, 1, 1);
|
||||
|
||||
gridLayout->addWidget(new QLabel("Width:"), 1, 0, 1, 1);
|
||||
|
||||
heightSpinbox = new QSpinBox(videoGroupbox);
|
||||
heightSpinbox->setMaximum(16777216);
|
||||
|
||||
gridLayout->addWidget(heightSpinbox, 2, 1, 1, 1);
|
||||
|
||||
widthSpinbox = new QSpinBox(videoGroupbox);
|
||||
widthSpinbox->setMaximum(16777216);
|
||||
|
||||
gridLayout->addWidget(widthSpinbox, 1, 1, 1, 1);
|
||||
|
||||
videobitrateSpinbox = new QDoubleSpinBox(videoGroupbox);
|
||||
videobitrateSpinbox->setMaximum(100);
|
||||
videobitrateSpinbox->setValue(2);
|
||||
|
||||
gridLayout->addWidget(videobitrateSpinbox, 5, 1, 1, 1);
|
||||
|
||||
videoBitrateLabel = new QLabel(videoGroupbox);
|
||||
|
||||
gridLayout->addWidget(videoBitrateLabel, 5, 0, 1, 1);
|
||||
|
||||
gridLayout->addWidget(new QLabel("Frame Rate:"), 3, 0, 1, 1);
|
||||
|
||||
framerateSpinbox = new QDoubleSpinBox(videoGroupbox);
|
||||
framerateSpinbox->setMaximum(60);
|
||||
framerateSpinbox->setValue(0);
|
||||
|
||||
gridLayout->addWidget(framerateSpinbox, 3, 1, 1, 1);
|
||||
|
||||
|
||||
verticalLayout->addWidget(videoGroupbox);
|
||||
|
||||
audioGroupbox = new QGroupBox(this);
|
||||
audioGroupbox->setTitle("Audio");
|
||||
audioGroupbox->setCheckable(true);
|
||||
|
||||
QGridLayout* gridLayout_2 = new QGridLayout(audioGroupbox);
|
||||
gridLayout_2->addWidget(new QLabel("Codec:"), 0, 0, 1, 1);
|
||||
|
||||
acodecCombobox = new QComboBox(audioGroupbox);
|
||||
|
||||
gridLayout_2->addWidget(acodecCombobox, 0, 1, 1, 1);
|
||||
|
||||
samplingRateSpinbox = new QSpinBox(audioGroupbox);
|
||||
samplingRateSpinbox->setMaximum(96000);
|
||||
samplingRateSpinbox->setValue(0);
|
||||
|
||||
gridLayout_2->addWidget(samplingRateSpinbox, 1, 1, 1, 1);
|
||||
|
||||
gridLayout_2->addWidget(new QLabel("Sampling Rate:"), 1, 0, 1, 1);
|
||||
|
||||
gridLayout_2->addWidget(new QLabel("Bitrate (Kbps/CBR):"), 3, 0, 1, 1);
|
||||
|
||||
audiobitrateSpinbox = new QSpinBox(audioGroupbox);
|
||||
audiobitrateSpinbox->setMaximum(320);
|
||||
audiobitrateSpinbox->setValue(256);
|
||||
|
||||
gridLayout_2->addWidget(audiobitrateSpinbox, 3, 1, 1, 1);
|
||||
|
||||
|
||||
verticalLayout->addWidget(audioGroupbox);
|
||||
|
||||
QHBoxLayout* horizontalLayout_3 = new QHBoxLayout();
|
||||
progressBar = new QProgressBar(this);
|
||||
progressBar->setFormat("%p% (ETA: 0:00:00)");
|
||||
progressBar->setEnabled(false);
|
||||
progressBar->setValue(0);
|
||||
|
||||
horizontalLayout_3->addWidget(progressBar);
|
||||
|
||||
renderCancel = new QPushButton(this);
|
||||
renderCancel->setText("x");
|
||||
renderCancel->setEnabled(false);
|
||||
renderCancel->setMaximumSize(QSize(20, 16777215));
|
||||
connect(renderCancel, SIGNAL(clicked(bool)), this, SLOT(cancel_render()));
|
||||
|
||||
horizontalLayout_3->addWidget(renderCancel);
|
||||
|
||||
|
||||
verticalLayout->addLayout(horizontalLayout_3);
|
||||
|
||||
QHBoxLayout* horizontalLayout_2 = new QHBoxLayout();
|
||||
horizontalLayout_2->addStretch();
|
||||
|
||||
export_button = new QPushButton(this);
|
||||
export_button->setText("Export");
|
||||
connect(export_button, SIGNAL(clicked(bool)), this, SLOT(export_action()));
|
||||
|
||||
horizontalLayout_2->addWidget(export_button);
|
||||
|
||||
cancel_button = new QPushButton(this);
|
||||
cancel_button->setText("Cancel");
|
||||
connect(cancel_button, SIGNAL(clicked(bool)), this, SLOT(reject()));
|
||||
|
||||
horizontalLayout_2->addWidget(cancel_button);
|
||||
|
||||
horizontalLayout_2->addStretch();
|
||||
|
||||
verticalLayout->addLayout(horizontalLayout_2);
|
||||
|
||||
connect(formatCombobox, SIGNAL(currentIndexChanged(int)), this, SLOT(format_changed(int)));
|
||||
connect(compressionTypeCombobox, SIGNAL(currentIndexChanged(int)), this, SLOT(comp_type_changed(int)));
|
||||
connect(vcodecCombobox, SIGNAL(currentIndexChanged(int)), this, SLOT(vcodec_changed(int)));
|
||||
}
|
||||
|
||||
+37
-25
@@ -3,48 +3,60 @@
|
||||
|
||||
#include <QDialog>
|
||||
|
||||
namespace Ui {
|
||||
class ExportDialog;
|
||||
}
|
||||
|
||||
struct Sequence;
|
||||
class ExportThread;
|
||||
class QComboBox;
|
||||
class QSpinBox;
|
||||
class QDoubleSpinBox;
|
||||
class QLabel;
|
||||
class QProgressBar;
|
||||
class QGroupBox;
|
||||
|
||||
class ExportDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit ExportDialog(QWidget *parent = 0);
|
||||
~ExportDialog();
|
||||
QString export_error;
|
||||
~ExportDialog();
|
||||
QString export_error;
|
||||
|
||||
private slots:
|
||||
void on_formatCombobox_currentIndexChanged(int index);
|
||||
|
||||
void on_pushButton_2_clicked();
|
||||
|
||||
void on_pushButton_clicked();
|
||||
|
||||
void update_progress_bar(int value, qint64 remaining_ms);
|
||||
|
||||
void on_renderCancel_clicked();
|
||||
|
||||
void render_thread_finished();
|
||||
|
||||
void on_vcodecCombobox_currentIndexChanged(int index);
|
||||
|
||||
void on_compressionTypeCombobox_currentIndexChanged(int index);
|
||||
void format_changed(int index);
|
||||
void export_action();
|
||||
void update_progress_bar(int value, qint64 remaining_ms);
|
||||
void cancel_render();
|
||||
void render_thread_finished();
|
||||
void vcodec_changed(int index);
|
||||
void comp_type_changed(int index);
|
||||
|
||||
private:
|
||||
Ui::ExportDialog *ui;
|
||||
|
||||
QVector<QString> format_strings;
|
||||
QVector<int> format_vcodecs;
|
||||
QVector<int> format_acodecs;
|
||||
void setup_ui();
|
||||
|
||||
ExportThread* et;
|
||||
ExportThread* et;
|
||||
void prep_ui_for_render(bool r);
|
||||
bool cancelled;
|
||||
bool cancelled;
|
||||
|
||||
QComboBox* rangeCombobox;
|
||||
QSpinBox* widthSpinbox;
|
||||
QDoubleSpinBox* videobitrateSpinbox;
|
||||
QLabel* videoBitrateLabel;
|
||||
QDoubleSpinBox* framerateSpinbox;
|
||||
QComboBox* vcodecCombobox;
|
||||
QComboBox* acodecCombobox;
|
||||
QSpinBox* samplingRateSpinbox;
|
||||
QSpinBox* audiobitrateSpinbox;
|
||||
QProgressBar* progressBar;
|
||||
QComboBox* formatCombobox;
|
||||
QSpinBox* heightSpinbox;
|
||||
QPushButton* export_button;
|
||||
QPushButton* cancel_button;
|
||||
QPushButton* renderCancel;
|
||||
QGroupBox* videoGroupbox;
|
||||
QGroupBox* audioGroupbox;
|
||||
QComboBox* compressionTypeCombobox;
|
||||
};
|
||||
|
||||
#endif // EXPORTDIALOG_H
|
||||
|
||||
@@ -1,317 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>ExportDialog</class>
|
||||
<widget class="QDialog" name="ExportDialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>443</width>
|
||||
<height>562</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Export</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Format: </string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="formatCombobox"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_10">
|
||||
<property name="text">
|
||||
<string>Range:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="rangeCombobox">
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Entire Sequence</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>In to Out</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="videoGroupbox">
|
||||
<property name="title">
|
||||
<string>Video</string>
|
||||
</property>
|
||||
<property name="flat">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="compressionTypeLabel">
|
||||
<property name="text">
|
||||
<string>Compression Type:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<widget class="QComboBox" name="compressionTypeCombobox">
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Quality-based (Constant Rate Factor)</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>File size-based (Two-Pass)</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>Codec:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QComboBox" name="vcodecCombobox"/>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="text">
|
||||
<string>Height:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>Width:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QSpinBox" name="heightSpinbox">
|
||||
<property name="maximum">
|
||||
<number>16777216</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QSpinBox" name="widthSpinbox">
|
||||
<property name="maximum">
|
||||
<number>16777216</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1">
|
||||
<widget class="QDoubleSpinBox" name="videobitrateSpinbox">
|
||||
<property name="maximum">
|
||||
<double>100.000000000000000</double>
|
||||
</property>
|
||||
<property name="value">
|
||||
<double>2.000000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<widget class="QLabel" name="videoBitrateLabel">
|
||||
<property name="text">
|
||||
<string>Bitrate (Mbps):</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="text">
|
||||
<string>Frame Rate:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QDoubleSpinBox" name="framerateSpinbox">
|
||||
<property name="maximum">
|
||||
<double>60.000000000000000</double>
|
||||
</property>
|
||||
<property name="value">
|
||||
<double>0.000000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="audioGroupbox">
|
||||
<property name="title">
|
||||
<string>Audio</string>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_7">
|
||||
<property name="text">
|
||||
<string>Codec:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QComboBox" name="acodecCombobox"/>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QSpinBox" name="samplingRateSpinbox">
|
||||
<property name="maximum">
|
||||
<number>96000</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>0</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_8">
|
||||
<property name="text">
|
||||
<string>Sampling Rate:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="label_9">
|
||||
<property name="text">
|
||||
<string>Bitrate (Kbps/CBR):</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QSpinBox" name="audiobitrateSpinbox">
|
||||
<property name="maximum">
|
||||
<number>320</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>256</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<item>
|
||||
<widget class="QProgressBar" name="progressBar">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="format">
|
||||
<string>%p% (ETA: 0:00:00)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="renderCancel">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>x</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton">
|
||||
<property name="text">
|
||||
<string>Export</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton_2">
|
||||
<property name="text">
|
||||
<string>Cancel</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<tabstops>
|
||||
<tabstop>formatCombobox</tabstop>
|
||||
<tabstop>videoGroupbox</tabstop>
|
||||
<tabstop>vcodecCombobox</tabstop>
|
||||
<tabstop>widthSpinbox</tabstop>
|
||||
<tabstop>heightSpinbox</tabstop>
|
||||
<tabstop>framerateSpinbox</tabstop>
|
||||
<tabstop>videobitrateSpinbox</tabstop>
|
||||
<tabstop>audioGroupbox</tabstop>
|
||||
<tabstop>acodecCombobox</tabstop>
|
||||
<tabstop>samplingRateSpinbox</tabstop>
|
||||
<tabstop>audiobitrateSpinbox</tabstop>
|
||||
<tabstop>renderCancel</tabstop>
|
||||
<tabstop>pushButton</tabstop>
|
||||
<tabstop>pushButton_2</tabstop>
|
||||
</tabstops>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
+14
-13
@@ -14,39 +14,40 @@
|
||||
#include "mainwindow.h"
|
||||
|
||||
LoadDialog::LoadDialog(QWidget *parent, bool autorecovery) : QDialog(parent) {
|
||||
setWindowTitle("Loading...");
|
||||
setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
|
||||
|
||||
QVBoxLayout* layout = new QVBoxLayout();
|
||||
setLayout(layout);
|
||||
|
||||
layout->addWidget(new QLabel("Loading '" + project_url.mid(project_url.lastIndexOf('/')+1) + "'..."));
|
||||
layout->addWidget(new QLabel("Loading '" + project_url.mid(project_url.lastIndexOf('/')+1) + "'..."));
|
||||
|
||||
bar = new QProgressBar();
|
||||
bar->setValue(0);
|
||||
bar->setValue(0);
|
||||
layout->addWidget(bar);
|
||||
|
||||
cancel_button = new QPushButton("Cancel");
|
||||
connect(cancel_button, SIGNAL(clicked(bool)), this, SLOT(cancel()));
|
||||
cancel_button = new QPushButton("Cancel");
|
||||
connect(cancel_button, SIGNAL(clicked(bool)), this, SLOT(cancel()));
|
||||
|
||||
hboxLayout = new QHBoxLayout();
|
||||
hboxLayout = new QHBoxLayout();
|
||||
hboxLayout->addStretch();
|
||||
hboxLayout->addWidget(cancel_button);
|
||||
hboxLayout->addStretch();
|
||||
|
||||
layout->addLayout(hboxLayout);
|
||||
|
||||
update();
|
||||
update();
|
||||
|
||||
lt = new LoadThread(this, autorecovery);
|
||||
QObject::connect(lt, SIGNAL(success()), this, SLOT(thread_done()));
|
||||
lt = new LoadThread(this, autorecovery);
|
||||
QObject::connect(lt, SIGNAL(success()), this, SLOT(thread_done()));
|
||||
QObject::connect(lt, SIGNAL(error()), this, SLOT(die()));
|
||||
QObject::connect(lt, SIGNAL(report_progress(int)), bar, SLOT(setValue(int)));
|
||||
lt->start();
|
||||
QObject::connect(lt, SIGNAL(report_progress(int)), bar, SLOT(setValue(int)));
|
||||
lt->start();
|
||||
}
|
||||
|
||||
void LoadDialog::cancel() {
|
||||
lt->cancel();
|
||||
lt->wait();
|
||||
lt->cancel();
|
||||
lt->wait();
|
||||
die();
|
||||
}
|
||||
|
||||
@@ -56,5 +57,5 @@ void LoadDialog::die() {
|
||||
}
|
||||
|
||||
void LoadDialog::thread_done() {
|
||||
accept();
|
||||
accept();
|
||||
}
|
||||
|
||||
+200
-81
@@ -1,5 +1,4 @@
|
||||
#include "newsequencedialog.h"
|
||||
#include "ui_newsequencedialog.h"
|
||||
|
||||
#include "panels/panels.h"
|
||||
#include "panels/project.h"
|
||||
@@ -8,82 +7,70 @@
|
||||
#include "project/clip.h"
|
||||
#include "panels/timeline.h"
|
||||
#include "playback/playback.h"
|
||||
#include "project/media.h"
|
||||
|
||||
#include <QVariant>
|
||||
#include <QVBoxLayout>
|
||||
#include <QComboBox>
|
||||
#include <QGroupBox>
|
||||
#include <QGridLayout>
|
||||
#include <QSpinBox>
|
||||
#include <QLabel>
|
||||
#include <QLineEdit>
|
||||
#include <QDialogButtonBox>
|
||||
|
||||
extern "C" {
|
||||
#include <libavcodec/avcodec.h>
|
||||
}
|
||||
|
||||
NewSequenceDialog::NewSequenceDialog(QWidget *parent) :
|
||||
NewSequenceDialog::NewSequenceDialog(QWidget *parent, Media *existing) :
|
||||
QDialog(parent),
|
||||
existing_sequence(NULL),
|
||||
ui(new Ui::NewSequenceDialog)
|
||||
existing_item(existing)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
setup_ui();
|
||||
|
||||
ui->frame_rate_combobox->addItem("10 FPS", 10.0);
|
||||
ui->frame_rate_combobox->addItem("12.5 FPS", 12.5);
|
||||
ui->frame_rate_combobox->addItem("15 FPS", 15.0);
|
||||
ui->frame_rate_combobox->addItem("23.976 FPS", 23.976);
|
||||
ui->frame_rate_combobox->addItem("24 FPS", 24.0);
|
||||
ui->frame_rate_combobox->addItem("25 FPS", 25.0);
|
||||
ui->frame_rate_combobox->addItem("29.97 FPS", 29.97);
|
||||
ui->frame_rate_combobox->addItem("30 FPS", 30.0);
|
||||
ui->frame_rate_combobox->addItem("50 FPS", 50.0);
|
||||
ui->frame_rate_combobox->addItem("59.94 FPS", 59.94);
|
||||
ui->frame_rate_combobox->addItem("60 FPS", 60.0);
|
||||
ui->frame_rate_combobox->setCurrentIndex(6);
|
||||
if (existing != NULL) {
|
||||
existing_sequence = existing->to_sequence();
|
||||
setWindowTitle("Editing \"" + existing_sequence->name + "\"");
|
||||
|
||||
ui->audio_frequency_combobox->addItem("22050 Hz", 22050);
|
||||
ui->audio_frequency_combobox->addItem("24000 Hz", 24000);
|
||||
ui->audio_frequency_combobox->addItem("32000 Hz", 32000);
|
||||
ui->audio_frequency_combobox->addItem("44100 Hz", 44100);
|
||||
ui->audio_frequency_combobox->addItem("48000 Hz", 48000);
|
||||
ui->audio_frequency_combobox->addItem("88200 Hz", 88200);
|
||||
ui->audio_frequency_combobox->addItem("96000 Hz", 96000);
|
||||
ui->audio_frequency_combobox->setCurrentIndex(4);
|
||||
}
|
||||
|
||||
NewSequenceDialog::~NewSequenceDialog()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void NewSequenceDialog::set_sequence_name(const QString& s) {
|
||||
ui->lineEdit->setText(s);
|
||||
}
|
||||
|
||||
void NewSequenceDialog::showEvent(QShowEvent *) {
|
||||
if (existing_sequence != NULL) {
|
||||
ui->width_numeric->setValue(existing_sequence->width);
|
||||
ui->height_numeric->setValue(existing_sequence->height);
|
||||
width_numeric->setValue(existing_sequence->width);
|
||||
height_numeric->setValue(existing_sequence->height);
|
||||
int comp_rate = qRound(existing_sequence->frame_rate*100);
|
||||
for (int i=0;i<ui->frame_rate_combobox->count();i++) {
|
||||
if (qRound(ui->frame_rate_combobox->itemData(i).toDouble()*100) == comp_rate) {
|
||||
ui->frame_rate_combobox->setCurrentIndex(i);
|
||||
for (int i=0;i<frame_rate_combobox->count();i++) {
|
||||
if (qRound(frame_rate_combobox->itemData(i).toDouble()*100) == comp_rate) {
|
||||
frame_rate_combobox->setCurrentIndex(i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
ui->lineEdit->setText(existing_sequence->name);
|
||||
for (int i=0;i<ui->audio_frequency_combobox->count();i++) {
|
||||
if (ui->audio_frequency_combobox->itemData(i) == existing_sequence->audio_frequency) {
|
||||
ui->audio_frequency_combobox->setCurrentIndex(i);
|
||||
lineEdit->setText(existing_sequence->name);
|
||||
for (int i=0;i<audio_frequency_combobox->count();i++) {
|
||||
if (audio_frequency_combobox->itemData(i) == existing_sequence->audio_frequency) {
|
||||
audio_frequency_combobox->setCurrentIndex(i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
existing_sequence = NULL;
|
||||
setWindowTitle("New Sequence");
|
||||
}
|
||||
}
|
||||
|
||||
void NewSequenceDialog::on_buttonBox_accepted() {
|
||||
NewSequenceDialog::~NewSequenceDialog()
|
||||
{}
|
||||
|
||||
void NewSequenceDialog::set_sequence_name(const QString& s) {
|
||||
lineEdit->setText(s);
|
||||
}
|
||||
|
||||
void NewSequenceDialog::create() {
|
||||
if (existing_sequence == NULL) {
|
||||
Sequence* s = new Sequence();
|
||||
|
||||
s->name = ui->lineEdit->text();
|
||||
s->width = ui->width_numeric->value();
|
||||
s->height = ui->height_numeric->value();
|
||||
s->frame_rate = ui->frame_rate_combobox->currentData().toDouble();
|
||||
s->audio_frequency = ui->audio_frequency_combobox->currentData().toInt();
|
||||
s->name = lineEdit->text();
|
||||
s->width = width_numeric->value();
|
||||
s->height = height_numeric->value();
|
||||
s->frame_rate = frame_rate_combobox->currentData().toDouble();
|
||||
s->audio_frequency = audio_frequency_combobox->currentData().toInt();
|
||||
s->audio_layout = AV_CH_LAYOUT_STEREO;
|
||||
|
||||
ComboAction* ca = new ComboAction();
|
||||
@@ -92,14 +79,14 @@ void NewSequenceDialog::on_buttonBox_accepted() {
|
||||
} else {
|
||||
ComboAction* ca = new ComboAction();
|
||||
|
||||
double multiplier = ui->frame_rate_combobox->currentData().toDouble() / existing_sequence->frame_rate;
|
||||
double multiplier = frame_rate_combobox->currentData().toDouble() / existing_sequence->frame_rate;
|
||||
|
||||
EditSequenceCommand* esc = new EditSequenceCommand(existing_item, existing_sequence);
|
||||
esc->name = ui->lineEdit->text();
|
||||
esc->width = ui->width_numeric->value();
|
||||
esc->height = ui->height_numeric->value();
|
||||
esc->frame_rate = ui->frame_rate_combobox->currentData().toDouble();
|
||||
esc->audio_frequency = ui->audio_frequency_combobox->currentData().toInt();
|
||||
esc->name = lineEdit->text();
|
||||
esc->width = width_numeric->value();
|
||||
esc->height = height_numeric->value();
|
||||
esc->frame_rate = frame_rate_combobox->currentData().toDouble();
|
||||
esc->audio_frequency = audio_frequency_combobox->currentData().toInt();
|
||||
esc->audio_layout = AV_CH_LAYOUT_STEREO;
|
||||
ca->append(esc);
|
||||
|
||||
@@ -112,51 +99,183 @@ void NewSequenceDialog::on_buttonBox_accepted() {
|
||||
|
||||
undo_stack.push(ca);
|
||||
}
|
||||
|
||||
accept();
|
||||
}
|
||||
|
||||
void NewSequenceDialog::on_comboBox_currentIndexChanged(int index)
|
||||
void NewSequenceDialog::preset_changed(int index)
|
||||
{
|
||||
switch (index) {
|
||||
case 0: // FILM 4K
|
||||
ui->width_numeric->setValue(4096);
|
||||
ui->height_numeric->setValue(2160);
|
||||
|
||||
width_numeric->setValue(4096);
|
||||
height_numeric->setValue(2160);
|
||||
break;
|
||||
case 1: // TV 4K
|
||||
ui->width_numeric->setValue(3840);
|
||||
ui->height_numeric->setValue(2160);
|
||||
width_numeric->setValue(3840);
|
||||
height_numeric->setValue(2160);
|
||||
break;
|
||||
case 2: // 1080p
|
||||
ui->width_numeric->setValue(1920);
|
||||
ui->height_numeric->setValue(1080);
|
||||
width_numeric->setValue(1920);
|
||||
height_numeric->setValue(1080);
|
||||
break;
|
||||
case 3: // 720p
|
||||
ui->width_numeric->setValue(1280);
|
||||
ui->height_numeric->setValue(720);
|
||||
width_numeric->setValue(1280);
|
||||
height_numeric->setValue(720);
|
||||
break;
|
||||
case 4: // 480p
|
||||
ui->width_numeric->setValue(640);
|
||||
ui->height_numeric->setValue(480);
|
||||
width_numeric->setValue(640);
|
||||
height_numeric->setValue(480);
|
||||
break;
|
||||
case 5: // 360p
|
||||
ui->width_numeric->setValue(640);
|
||||
ui->height_numeric->setValue(360);
|
||||
width_numeric->setValue(640);
|
||||
height_numeric->setValue(360);
|
||||
break;
|
||||
case 6: // 240p
|
||||
ui->width_numeric->setValue(320);
|
||||
ui->height_numeric->setValue(240);
|
||||
width_numeric->setValue(320);
|
||||
height_numeric->setValue(240);
|
||||
break;
|
||||
case 7: // 144p
|
||||
ui->width_numeric->setValue(192);
|
||||
ui->height_numeric->setValue(144);
|
||||
width_numeric->setValue(192);
|
||||
height_numeric->setValue(144);
|
||||
break;
|
||||
case 8: // NTSC (480i)
|
||||
ui->width_numeric->setValue(720);
|
||||
ui->height_numeric->setValue(480);
|
||||
width_numeric->setValue(720);
|
||||
height_numeric->setValue(480);
|
||||
break;
|
||||
case 9: // PAL (576i)
|
||||
ui->width_numeric->setValue(720);
|
||||
ui->height_numeric->setValue(576);
|
||||
width_numeric->setValue(720);
|
||||
height_numeric->setValue(576);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void NewSequenceDialog::setup_ui() {
|
||||
QVBoxLayout* verticalLayout = new QVBoxLayout(this);
|
||||
|
||||
QWidget* widget = new QWidget(this);
|
||||
|
||||
QHBoxLayout* horizontalLayout_2 = new QHBoxLayout(widget);
|
||||
horizontalLayout_2->setContentsMargins(0, 0, 0, 0);
|
||||
|
||||
horizontalLayout_2->addWidget(new QLabel("Preset:"));
|
||||
|
||||
preset_combobox = new QComboBox(widget);
|
||||
|
||||
preset_combobox->addItem("Film 4K");
|
||||
preset_combobox->addItem("TV 4K (Ultra HD/2160p)");
|
||||
preset_combobox->addItem("1080p");
|
||||
preset_combobox->addItem("720p");
|
||||
preset_combobox->addItem("480p");
|
||||
preset_combobox->addItem("360p");
|
||||
preset_combobox->addItem("240p");
|
||||
preset_combobox->addItem("144p");
|
||||
preset_combobox->addItem("NTSC (480i)");
|
||||
preset_combobox->addItem("PAL (576i)");
|
||||
preset_combobox->addItem("Custom");
|
||||
preset_combobox->setCurrentIndex(2);
|
||||
|
||||
horizontalLayout_2->addWidget(preset_combobox);
|
||||
|
||||
verticalLayout->addWidget(widget);
|
||||
|
||||
QGroupBox* groupBox = new QGroupBox(this);
|
||||
groupBox->setTitle("Video");
|
||||
|
||||
QGridLayout* gridLayout = new QGridLayout(groupBox);
|
||||
|
||||
height_numeric = new QSpinBox(groupBox);
|
||||
height_numeric->setMaximum(9999);
|
||||
height_numeric->setValue(1080);
|
||||
|
||||
gridLayout->addWidget(height_numeric, 1, 2, 1, 2);
|
||||
|
||||
width_numeric = new QSpinBox(groupBox);
|
||||
width_numeric->setMaximum(9999);
|
||||
width_numeric->setValue(1920);
|
||||
|
||||
gridLayout->addWidget(width_numeric, 0, 2, 1, 2);
|
||||
|
||||
gridLayout->addWidget(new QLabel("Width:"), 0, 0, 1, 1);
|
||||
|
||||
gridLayout->addWidget(new QLabel("Pixel Aspect Ratio:"), 4, 0, 1, 1);
|
||||
|
||||
gridLayout->addWidget(new QLabel("Interlacing:"), 6, 0, 1, 1);
|
||||
|
||||
gridLayout->addWidget(new QLabel("Height:"), 1, 0, 1, 2);
|
||||
|
||||
par_combobox = new QComboBox(groupBox);
|
||||
par_combobox->addItem("Square Pixels (1.0)");
|
||||
|
||||
gridLayout->addWidget(par_combobox, 4, 2, 1, 2);
|
||||
|
||||
interlacing_combobox = new QComboBox(groupBox);
|
||||
interlacing_combobox->addItem("None (Progressive)");
|
||||
interlacing_combobox->addItem("Upper Field First");
|
||||
interlacing_combobox->addItem("Lower Field First");
|
||||
|
||||
gridLayout->addWidget(interlacing_combobox, 6, 2, 1, 2);
|
||||
|
||||
frame_rate_combobox = new QComboBox(groupBox);
|
||||
frame_rate_combobox->addItem("10 FPS", 10.0);
|
||||
frame_rate_combobox->addItem("12.5 FPS", 12.5);
|
||||
frame_rate_combobox->addItem("15 FPS", 15.0);
|
||||
frame_rate_combobox->addItem("23.976 FPS", 23.976);
|
||||
frame_rate_combobox->addItem("24 FPS", 24.0);
|
||||
frame_rate_combobox->addItem("25 FPS", 25.0);
|
||||
frame_rate_combobox->addItem("29.97 FPS", 29.97);
|
||||
frame_rate_combobox->addItem("30 FPS", 30.0);
|
||||
frame_rate_combobox->addItem("50 FPS", 50.0);
|
||||
frame_rate_combobox->addItem("59.94 FPS", 59.94);
|
||||
frame_rate_combobox->addItem("60 FPS", 60.0);
|
||||
frame_rate_combobox->setCurrentIndex(6);
|
||||
|
||||
gridLayout->addWidget(frame_rate_combobox, 2, 2, 1, 2);
|
||||
|
||||
gridLayout->addWidget(new QLabel("Frame Rate:"), 2, 0, 1, 1);
|
||||
|
||||
verticalLayout->addWidget(groupBox);
|
||||
|
||||
QGroupBox* groupBox_2 = new QGroupBox(this);
|
||||
groupBox_2->setTitle("Audio");
|
||||
|
||||
QGridLayout* gridLayout_2 = new QGridLayout(groupBox_2);
|
||||
|
||||
gridLayout_2->addWidget(new QLabel("Sample Rate: "), 0, 0, 1, 1);
|
||||
|
||||
audio_frequency_combobox = new QComboBox(groupBox_2);
|
||||
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);
|
||||
audio_frequency_combobox->setCurrentIndex(4);
|
||||
|
||||
gridLayout_2->addWidget(audio_frequency_combobox, 0, 1, 1, 1);
|
||||
|
||||
verticalLayout->addWidget(groupBox_2);
|
||||
|
||||
QWidget* widget_2 = new QWidget(this);
|
||||
QHBoxLayout* horizontalLayout = new QHBoxLayout(widget_2);
|
||||
horizontalLayout->setContentsMargins(0, 0, 0, 0);
|
||||
|
||||
horizontalLayout->addWidget(new QLabel("Name:"));
|
||||
|
||||
lineEdit = new QLineEdit(widget_2);
|
||||
|
||||
horizontalLayout->addWidget(lineEdit);
|
||||
|
||||
verticalLayout->addWidget(widget_2);
|
||||
|
||||
QDialogButtonBox* buttonBox = new QDialogButtonBox(this);
|
||||
buttonBox->setOrientation(Qt::Horizontal);
|
||||
buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::Ok);
|
||||
buttonBox->setCenterButtons(true);
|
||||
|
||||
verticalLayout->addWidget(buttonBox);
|
||||
|
||||
connect(preset_combobox, SIGNAL(currentIndexChanged(int)), this, SLOT(preset_changed(int)));
|
||||
connect(buttonBox, SIGNAL(accepted()), this, SLOT(create()));
|
||||
connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
|
||||
}
|
||||
|
||||
+20
-13
@@ -5,32 +5,39 @@
|
||||
|
||||
class Project;
|
||||
class Media;
|
||||
class QComboBox;
|
||||
class QSpinBox;
|
||||
class QLineEdit;
|
||||
struct Sequence;
|
||||
|
||||
namespace Ui {
|
||||
class NewSequenceDialog;
|
||||
}
|
||||
|
||||
class NewSequenceDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit NewSequenceDialog(QWidget *parent = 0);
|
||||
explicit NewSequenceDialog(QWidget *parent = 0, Media* existing = 0);
|
||||
~NewSequenceDialog();
|
||||
Sequence* existing_sequence;
|
||||
Media* existing_item;
|
||||
|
||||
void set_sequence_name(const QString& s);
|
||||
|
||||
protected:
|
||||
void showEvent(QShowEvent *);
|
||||
|
||||
private slots:
|
||||
void on_buttonBox_accepted();
|
||||
void on_comboBox_currentIndexChanged(int index);
|
||||
void create();
|
||||
void preset_changed(int index);
|
||||
|
||||
private:
|
||||
Ui::NewSequenceDialog *ui;
|
||||
Sequence* existing_sequence;
|
||||
Media* existing_item;
|
||||
|
||||
void setup_ui();
|
||||
|
||||
QComboBox* preset_combobox;
|
||||
QSpinBox* height_numeric;
|
||||
QSpinBox* width_numeric;
|
||||
QComboBox* par_combobox;
|
||||
QComboBox* interlacing_combobox;
|
||||
QComboBox* frame_rate_combobox;
|
||||
QComboBox* audio_frequency_combobox;
|
||||
QLineEdit* lineEdit;
|
||||
};
|
||||
|
||||
#endif // NEWSEQUENCEDIALOG_H
|
||||
|
||||
@@ -1,370 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>NewSequenceDialog</class>
|
||||
<widget class="QDialog" name="NewSequenceDialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>298</width>
|
||||
<height>341</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>New Sequence</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QWidget" name="widget" native="true">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Preset: </string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="comboBox">
|
||||
<property name="currentIndex">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Film 4K</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>TV 4K (Ultra HD/2160p)</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>1080p</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>720p</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>480p</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>360p</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>240p</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>144p</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>NTSC (480i)</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>PAL (576i)</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Custom</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="title">
|
||||
<string>Video</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="1" column="2" colspan="2">
|
||||
<widget class="QSpinBox" name="height_numeric">
|
||||
<property name="maximum">
|
||||
<number>9999</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>1080</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2" colspan="2">
|
||||
<widget class="QSpinBox" name="width_numeric">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>9999</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>1920</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Width: </string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Pixel Aspect Ratio: </string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="0">
|
||||
<widget class="QLabel" name="label_7">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Interlacing:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0" colspan="2">
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>Height: </string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="2" colspan="2">
|
||||
<widget class="QComboBox" name="par_combobox">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Square Pixels (1.0)</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="2" colspan="2">
|
||||
<widget class="QComboBox" name="interlacing_combobox">
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>None (Progressive)</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Upper Field First</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Lower Field First</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="2" colspan="2">
|
||||
<widget class="QComboBox" name="frame_rate_combobox"/>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_8">
|
||||
<property name="text">
|
||||
<string>Frame Rate:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox_2">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Audio</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_6">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Sample Rate: </string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QComboBox" name="audio_frequency_combobox"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QWidget" name="widget_2" native="true">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_9">
|
||||
<property name="text">
|
||||
<string>Name: </string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="lineEdit">
|
||||
<property name="text">
|
||||
<string>Sequence 01</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
||||
</property>
|
||||
<property name="centerButtons">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<tabstops>
|
||||
<tabstop>comboBox</tabstop>
|
||||
<tabstop>width_numeric</tabstop>
|
||||
<tabstop>height_numeric</tabstop>
|
||||
<tabstop>frame_rate_combobox</tabstop>
|
||||
<tabstop>par_combobox</tabstop>
|
||||
<tabstop>interlacing_combobox</tabstop>
|
||||
<tabstop>audio_frequency_combobox</tabstop>
|
||||
<tabstop>lineEdit</tabstop>
|
||||
</tabstops>
|
||||
<resources/>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>accepted()</signal>
|
||||
<receiver>NewSequenceDialog</receiver>
|
||||
<slot>accept()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>248</x>
|
||||
<y>254</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>157</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>rejected()</signal>
|
||||
<receiver>NewSequenceDialog</receiver>
|
||||
<slot>reject()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>316</x>
|
||||
<y>260</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>286</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
</ui>
|
||||
+148
-57
@@ -1,83 +1,174 @@
|
||||
#include "preferencesdialog.h"
|
||||
#include "ui_preferencesdialog.h"
|
||||
|
||||
#include "io/config.h"
|
||||
|
||||
#include <QMenuBar>
|
||||
#include <QAction>
|
||||
#include <QVBoxLayout>
|
||||
#include <QTabWidget>
|
||||
#include <QLineEdit>
|
||||
#include <QLabel>
|
||||
#include <QComboBox>
|
||||
#include <QGroupBox>
|
||||
#include <QRadioButton>
|
||||
#include <QDialogButtonBox>
|
||||
#include <QTreeWidget>
|
||||
#include <QVector>
|
||||
|
||||
KeySequenceEditor::KeySequenceEditor(QAction* a)
|
||||
: QKeySequenceEdit(0), action(a) {
|
||||
setKeySequence(action->shortcut());
|
||||
connect(this, SIGNAL(editingFinished()), this, SLOT(set_action_shortcut()));
|
||||
KeySequenceEditor::KeySequenceEditor(QWidget* parent, QAction* a)
|
||||
: QKeySequenceEdit(parent), action(a) {
|
||||
setKeySequence(action->shortcut());
|
||||
//connect(this, SIGNAL(editingFinished()), this, SLOT(set_action_shortcut()));
|
||||
}
|
||||
|
||||
void KeySequenceEditor::set_action_shortcut() {
|
||||
action->setShortcut(keySequence());
|
||||
action->setShortcut(keySequence());
|
||||
}
|
||||
|
||||
PreferencesDialog::PreferencesDialog(QWidget *parent) :
|
||||
QDialog(parent),
|
||||
ui(new Ui::PreferencesDialog)
|
||||
QDialog(parent)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
setWindowTitle("Preferences");
|
||||
setup_ui();
|
||||
|
||||
ui->accurateSeekButton->setChecked(!config.fast_seeking);
|
||||
ui->fastSeekButton->setChecked(config.fast_seeking);
|
||||
ui->recordingComboBox->setCurrentIndex(config.recording_mode - 1);
|
||||
ui->imgSeqFormatEdit->setText(config.img_seq_formats);
|
||||
accurateSeekButton->setChecked(!config.fast_seeking);
|
||||
fastSeekButton->setChecked(config.fast_seeking);
|
||||
recordingComboBox->setCurrentIndex(config.recording_mode - 1);
|
||||
imgSeqFormatEdit->setText(config.img_seq_formats);
|
||||
}
|
||||
|
||||
PreferencesDialog::~PreferencesDialog() {
|
||||
delete ui;
|
||||
PreferencesDialog::~PreferencesDialog() {}
|
||||
|
||||
void PreferencesDialog::setup_kbd_shortcut_worker(QMenu* menu, QTreeWidgetItem* parent) {
|
||||
QList<QAction*> actions = menu->actions();
|
||||
for (int i=0;i<actions.size();i++) {
|
||||
QAction* a = actions.at(i);
|
||||
|
||||
if (!a->isSeparator()) {
|
||||
QTreeWidgetItem* item = new QTreeWidgetItem();
|
||||
item->setText(0, a->text().replace("&", ""));
|
||||
|
||||
parent->addChild(item);
|
||||
|
||||
if (a->menu() != NULL) {
|
||||
setup_kbd_shortcut_worker(a->menu(), item);
|
||||
} else {
|
||||
key_shortcut_items.append(item);
|
||||
key_shortcut_actions.append(a);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void PreferencesDialog::setup_kbd_shortcuts(QMenuBar* menubar) {
|
||||
ui->treeWidget->clear();
|
||||
QList<QMenu*> menus = menubar->findChildren<QMenu*>();
|
||||
QList<QAction*> menus = menubar->actions();
|
||||
|
||||
// caching for parent-child pairing
|
||||
QVector<QTreeWidgetItem*> added_action_items;
|
||||
QVector<QAction*> added_actions;
|
||||
for (int i=0;i<menus.size();i++) {
|
||||
QMenu* menu = menus.at(i)->menu();
|
||||
|
||||
for (int i=0;i<menus.size();i++) {
|
||||
QMenu* menu = menus.at(i);
|
||||
QTreeWidgetItem* item = NULL;
|
||||
if (menu->parent() != menubar) {
|
||||
for (int j=0;j<added_actions.size();j++) {
|
||||
if (added_actions.at(j)->menu() == menu) {
|
||||
item = added_action_items.at(j);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (menu->parent() == menubar || item == NULL) {
|
||||
item = new QTreeWidgetItem();
|
||||
item->setText(0, menu->title().replace("&", ""));
|
||||
ui->treeWidget->addTopLevelItem(item);
|
||||
}
|
||||
for (int j=0;j<menu->actions().size();j++) {
|
||||
QAction* action = menu->actions().at(j);
|
||||
if (!action->isSeparator()) {
|
||||
QTreeWidgetItem* child = new QTreeWidgetItem();
|
||||
child->setText(0, action->text().replace("&", ""));
|
||||
item->addChild(child);
|
||||
QTreeWidgetItem* item = new QTreeWidgetItem();
|
||||
item->setText(0, menu->title().replace("&", ""));
|
||||
|
||||
added_actions.append(action);
|
||||
added_action_items.append(child);
|
||||
}
|
||||
}
|
||||
}
|
||||
for (int i=0;i<added_action_items.size();i++) {
|
||||
if (added_actions.at(i)->menu() == NULL) {
|
||||
KeySequenceEditor* editor = new KeySequenceEditor(added_actions.at(i));
|
||||
ui->treeWidget->setItemWidget(added_action_items.at(i), 1, editor);
|
||||
}
|
||||
}
|
||||
keyboard_tree->addTopLevelItem(item);
|
||||
|
||||
setup_kbd_shortcut_worker(menu, item);
|
||||
}
|
||||
|
||||
for (int i=0;i<key_shortcut_items.size();i++) {
|
||||
KeySequenceEditor* editor = new KeySequenceEditor(keyboard_tree, key_shortcut_actions.at(i));
|
||||
keyboard_tree->setItemWidget(key_shortcut_items.at(i), 1, editor);
|
||||
key_shortcut_fields.append(editor);
|
||||
}
|
||||
}
|
||||
|
||||
void PreferencesDialog::on_buttonBox_accepted() {
|
||||
config.recording_mode = ui->recordingComboBox->currentIndex() + 1;
|
||||
config.img_seq_formats = ui->imgSeqFormatEdit->text();
|
||||
config.fast_seeking = ui->fastSeekButton->isChecked();
|
||||
void PreferencesDialog::save() {
|
||||
config.recording_mode = recordingComboBox->currentIndex() + 1;
|
||||
config.img_seq_formats = imgSeqFormatEdit->text();
|
||||
config.fast_seeking = fastSeekButton->isChecked();
|
||||
|
||||
// save keyboard shortcuts
|
||||
for (int i=0;i<key_shortcut_fields.size();i++) {
|
||||
key_shortcut_fields.at(i)->set_action_shortcut();
|
||||
}
|
||||
|
||||
accept();
|
||||
}
|
||||
|
||||
void PreferencesDialog::setup_ui() {
|
||||
QVBoxLayout* verticalLayout = new QVBoxLayout(this);
|
||||
verticalLayout->setObjectName(QStringLiteral("verticalLayout"));
|
||||
QTabWidget* tabWidget = new QTabWidget(this);
|
||||
tabWidget->setObjectName(QStringLiteral("tabWidget"));
|
||||
|
||||
QTabWidget* tab = new QTabWidget();
|
||||
QGridLayout* gridLayout_2 = new QGridLayout(tab);
|
||||
|
||||
gridLayout_2->setObjectName(QStringLiteral("gridLayout_2"));
|
||||
|
||||
gridLayout_2->addWidget(new QLabel("Image sequence formats:"), 0, 0, 1, 1);
|
||||
|
||||
imgSeqFormatEdit = new QLineEdit(tab);
|
||||
|
||||
gridLayout_2->addWidget(imgSeqFormatEdit, 0, 1, 1, 1);
|
||||
|
||||
gridLayout_2->addWidget(new QLabel("Audio Recording:"), 1, 0, 1, 1);
|
||||
|
||||
recordingComboBox = new QComboBox(tab);
|
||||
recordingComboBox->addItem("Mono");
|
||||
recordingComboBox->addItem("Stereo");
|
||||
recordingComboBox->setObjectName(QStringLiteral("recordingComboBox"));
|
||||
|
||||
gridLayout_2->addWidget(recordingComboBox, 1, 1, 1, 1);
|
||||
|
||||
tabWidget->addTab(tab, "General");
|
||||
QWidget* tab_2 = new QWidget();
|
||||
tabWidget->addTab(tab_2, "Behavior");
|
||||
QWidget* tab_4 = new QWidget();
|
||||
QVBoxLayout* verticalLayout_2 = new QVBoxLayout(tab_4);
|
||||
verticalLayout_2->setObjectName(QStringLiteral("verticalLayout_2"));
|
||||
QGroupBox* groupBox = new QGroupBox(tab_4);
|
||||
groupBox->setTitle("Seeking");
|
||||
groupBox->setObjectName(QStringLiteral("groupBox"));
|
||||
QVBoxLayout* verticalLayout_3 = new QVBoxLayout(groupBox);
|
||||
verticalLayout_3->setObjectName(QStringLiteral("verticalLayout_3"));
|
||||
accurateSeekButton = new QRadioButton(groupBox);
|
||||
accurateSeekButton->setText("Accurate Seeking\nAlways show the correct frame (visual may pause briefly as correct frame is retrieved)");
|
||||
accurateSeekButton->setObjectName(QStringLiteral("accurateSeekButton"));
|
||||
|
||||
verticalLayout_3->addWidget(accurateSeekButton);
|
||||
|
||||
fastSeekButton = new QRadioButton(groupBox);
|
||||
fastSeekButton->setText("Fast Seeking\nSeek quickly (may briefly show inaccurate frames when seeking - doesn't affect playback/export)");
|
||||
fastSeekButton->setObjectName(QStringLiteral("fastSeekButton"));
|
||||
|
||||
verticalLayout_3->addWidget(fastSeekButton);
|
||||
|
||||
verticalLayout_2->addWidget(groupBox);
|
||||
|
||||
tabWidget->addTab(tab_4, "Playback");
|
||||
QWidget* tab_3 = new QWidget();
|
||||
QHBoxLayout* horizontalLayout = new QHBoxLayout(tab_3);
|
||||
horizontalLayout->setContentsMargins(0, 0, 0, 0);
|
||||
|
||||
keyboard_tree = new QTreeWidget();
|
||||
QTreeWidgetItem* tree_header = keyboard_tree->headerItem();
|
||||
tree_header->setText(0, "Action");
|
||||
tree_header->setText(1, "Shortcut");
|
||||
horizontalLayout->addWidget(keyboard_tree);
|
||||
|
||||
tabWidget->addTab(tab_3, "Keyboard");
|
||||
|
||||
verticalLayout->addWidget(tabWidget);
|
||||
|
||||
QDialogButtonBox* buttonBox = new QDialogButtonBox(this);
|
||||
buttonBox->setObjectName(QStringLiteral("buttonBox"));
|
||||
buttonBox->setOrientation(Qt::Horizontal);
|
||||
buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::Ok);
|
||||
|
||||
verticalLayout->addWidget(buttonBox);
|
||||
|
||||
connect(buttonBox, SIGNAL(accepted()), this, SLOT(save()));
|
||||
connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
|
||||
|
||||
tabWidget->setCurrentIndex(2);
|
||||
}
|
||||
|
||||
+30
-18
@@ -4,36 +4,48 @@
|
||||
#include <QDialog>
|
||||
#include <QKeySequenceEdit>
|
||||
class QMenuBar;
|
||||
class QLineEdit;
|
||||
class QComboBox;
|
||||
class QRadioButton;
|
||||
class QTreeWidget;
|
||||
class QTreeWidgetItem;
|
||||
class QMenu;
|
||||
|
||||
namespace Ui {
|
||||
class PreferencesDialog;
|
||||
}
|
||||
class KeySequenceEditor : public QKeySequenceEdit {
|
||||
Q_OBJECT
|
||||
public:
|
||||
KeySequenceEditor(QWidget *parent, QAction* a);
|
||||
void set_action_shortcut();
|
||||
private:
|
||||
QAction* action;
|
||||
};
|
||||
|
||||
class PreferencesDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit PreferencesDialog(QWidget *parent = 0);
|
||||
~PreferencesDialog();
|
||||
explicit PreferencesDialog(QWidget *parent = 0);
|
||||
~PreferencesDialog();
|
||||
|
||||
void setup_kbd_shortcuts(QMenuBar* menu);
|
||||
void setup_kbd_shortcuts(QMenuBar* menu);
|
||||
|
||||
private slots:
|
||||
void on_buttonBox_accepted();
|
||||
void save();
|
||||
|
||||
private:
|
||||
Ui::PreferencesDialog *ui;
|
||||
};
|
||||
void setup_ui();
|
||||
void setup_kbd_shortcut_worker(QMenu* menu, QTreeWidgetItem* parent);
|
||||
|
||||
class KeySequenceEditor : public QKeySequenceEdit {
|
||||
Q_OBJECT
|
||||
public:
|
||||
KeySequenceEditor(QAction* a);
|
||||
private slots:
|
||||
void set_action_shortcut();
|
||||
private:
|
||||
QAction* action;
|
||||
QLineEdit* imgSeqFormatEdit;
|
||||
QComboBox* recordingComboBox;
|
||||
QRadioButton* accurateSeekButton;
|
||||
QRadioButton* fastSeekButton;
|
||||
QTreeWidget* keyboard_tree;
|
||||
|
||||
QVector<QAction*> key_shortcut_actions;
|
||||
QVector<QTreeWidgetItem*> key_shortcut_items;
|
||||
QVector<KeySequenceEditor*> key_shortcut_fields;
|
||||
};
|
||||
|
||||
#endif // PREFERENCESDIALOG_H
|
||||
|
||||
@@ -1,179 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>PreferencesDialog</class>
|
||||
<widget class="QDialog" name="PreferencesDialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>693</width>
|
||||
<height>491</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Dialog</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QTabWidget" name="tabWidget">
|
||||
<property name="currentIndex">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="tab">
|
||||
<attribute name="title">
|
||||
<string>General</string>
|
||||
</attribute>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Image sequence formats:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLineEdit" name="imgSeqFormatEdit"/>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>Audio Recording:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QComboBox" name="recordingComboBox">
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Mono</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Stereo</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tab_2">
|
||||
<attribute name="title">
|
||||
<string>Behavior</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tab_4">
|
||||
<attribute name="title">
|
||||
<string>Playback</string>
|
||||
</attribute>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="title">
|
||||
<string>Seeking</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
<item>
|
||||
<widget class="QRadioButton" name="accurateSeekButton">
|
||||
<property name="text">
|
||||
<string>Accurate Seeking
|
||||
Always show the correct frame (visual may pause briefly as correct frame is retrieved)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="fastSeekButton">
|
||||
<property name="text">
|
||||
<string>Fast Seeking
|
||||
Seek quickly (may briefly show inaccurate frames when seeking - doesn't affect playback/export)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tab_3">
|
||||
<attribute name="title">
|
||||
<string>Keyboard</string>
|
||||
</attribute>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QTreeWidget" name="treeWidget">
|
||||
<column>
|
||||
<property name="text">
|
||||
<string notr="true">Action</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Shortcut</string>
|
||||
</property>
|
||||
</column>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>accepted()</signal>
|
||||
<receiver>PreferencesDialog</receiver>
|
||||
<slot>accept()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>248</x>
|
||||
<y>254</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>157</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>rejected()</signal>
|
||||
<receiver>PreferencesDialog</receiver>
|
||||
<slot>reject()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>316</x>
|
||||
<y>260</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>286</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
</ui>
|
||||
Reference in New Issue
Block a user