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>
|
||||
+15
-13
@@ -12,6 +12,7 @@
|
||||
#include "ui/sourcetable.h"
|
||||
#include "ui/viewerwidget.h"
|
||||
#include "ui/sourceiconview.h"
|
||||
#include "ui/timelineheader.h"
|
||||
|
||||
#include "panels/panels.h"
|
||||
#include "panels/project.h"
|
||||
@@ -29,8 +30,6 @@
|
||||
#include "playback/audio.h"
|
||||
#include "playback/playback.h"
|
||||
|
||||
#include "ui_timeline.h"
|
||||
|
||||
#include "debug.h"
|
||||
|
||||
#include <QStyleFactory>
|
||||
@@ -45,6 +44,9 @@
|
||||
#include <QStatusBar>
|
||||
#include <QMenu>
|
||||
#include <QMenuBar>
|
||||
#include <QLayout>
|
||||
#include <QApplication>
|
||||
#include <QPushButton>
|
||||
|
||||
MainWindow* mainWindow;
|
||||
|
||||
@@ -273,8 +275,8 @@ void MainWindow::show_about() {
|
||||
|
||||
void MainWindow::delete_slot()
|
||||
{
|
||||
if (panel_timeline->ui->headers->hasFocus()) {
|
||||
panel_timeline->ui->headers->delete_markers();
|
||||
if (panel_timeline->headers->hasFocus()) {
|
||||
panel_timeline->headers->delete_markers();
|
||||
} else if (panel_timeline->focused()) {
|
||||
panel_timeline->delete_selection(sequence->selections, false);
|
||||
} else if (panel_effect_controls->is_focused()) {
|
||||
@@ -649,41 +651,41 @@ void MainWindow::setup_menus() {
|
||||
|
||||
pointer_tool_action = tools_menu->addAction("Pointer Tool", this, SLOT(menu_click_button()), QKeySequence("V"));
|
||||
pointer_tool_action->setCheckable(true);
|
||||
pointer_tool_action->setData(reinterpret_cast<quintptr>(panel_timeline->ui->toolArrowButton));
|
||||
pointer_tool_action->setData(reinterpret_cast<quintptr>(panel_timeline->toolArrowButton));
|
||||
|
||||
edit_tool_action = tools_menu->addAction("Edit Tool", this, SLOT(menu_click_button()), QKeySequence("X"));
|
||||
edit_tool_action->setCheckable(true);
|
||||
edit_tool_action->setData(reinterpret_cast<quintptr>(panel_timeline->ui->toolEditButton));
|
||||
edit_tool_action->setData(reinterpret_cast<quintptr>(panel_timeline->toolEditButton));
|
||||
|
||||
ripple_tool_action = tools_menu->addAction("Ripple Tool", this, SLOT(menu_click_button()), QKeySequence("B"));
|
||||
ripple_tool_action->setCheckable(true);
|
||||
ripple_tool_action->setData(reinterpret_cast<quintptr>(panel_timeline->ui->toolRippleButton));
|
||||
ripple_tool_action->setData(reinterpret_cast<quintptr>(panel_timeline->toolRippleButton));
|
||||
|
||||
razor_tool_action = tools_menu->addAction("Razor Tool", this, SLOT(menu_click_button()), QKeySequence("C"));
|
||||
razor_tool_action->setCheckable(true);
|
||||
razor_tool_action->setData(reinterpret_cast<quintptr>(panel_timeline->ui->toolRazorButton));
|
||||
razor_tool_action->setData(reinterpret_cast<quintptr>(panel_timeline->toolRazorButton));
|
||||
|
||||
slip_tool_action = tools_menu->addAction("Slip Tool", this, SLOT(menu_click_button()), QKeySequence("Y"));
|
||||
slip_tool_action->setCheckable(true);
|
||||
slip_tool_action->setData(reinterpret_cast<quintptr>(panel_timeline->ui->toolSlipButton));
|
||||
slip_tool_action->setData(reinterpret_cast<quintptr>(panel_timeline->toolSlipButton));
|
||||
|
||||
slide_tool_action = tools_menu->addAction("Slide Tool", this, SLOT(menu_click_button()), QKeySequence("U"));
|
||||
slide_tool_action->setCheckable(true);
|
||||
slide_tool_action->setData(reinterpret_cast<quintptr>(panel_timeline->ui->toolSlideButton));
|
||||
slide_tool_action->setData(reinterpret_cast<quintptr>(panel_timeline->toolSlideButton));
|
||||
|
||||
hand_tool_action = tools_menu->addAction("Hand Tool", this, SLOT(menu_click_button()), QKeySequence("H"));
|
||||
hand_tool_action->setCheckable(true);
|
||||
hand_tool_action->setData(reinterpret_cast<quintptr>(panel_timeline->ui->toolHandButton));
|
||||
hand_tool_action->setData(reinterpret_cast<quintptr>(panel_timeline->toolHandButton));
|
||||
|
||||
transition_tool_action = tools_menu->addAction("Transition Tool", this, SLOT(menu_click_button()), QKeySequence("T"));
|
||||
transition_tool_action->setCheckable(true);
|
||||
transition_tool_action->setData(reinterpret_cast<quintptr>(panel_timeline->ui->toolTransitionButton));
|
||||
transition_tool_action->setData(reinterpret_cast<quintptr>(panel_timeline->toolTransitionButton));
|
||||
|
||||
tools_menu->addSeparator();
|
||||
|
||||
snap_toggle = tools_menu->addAction("Enable Snapping", this, SLOT(menu_click_button()), QKeySequence("S"));
|
||||
snap_toggle->setCheckable(true);
|
||||
snap_toggle->setData(reinterpret_cast<quintptr>(panel_timeline->ui->snappingButton));
|
||||
snap_toggle->setData(reinterpret_cast<quintptr>(panel_timeline->snappingButton));
|
||||
|
||||
tools_menu->addSeparator();
|
||||
|
||||
|
||||
@@ -187,13 +187,7 @@ HEADERS += \
|
||||
project/sourcescommon.h \
|
||||
ui/keyframenavigator.h
|
||||
|
||||
FORMS += \
|
||||
panels/timeline.ui \
|
||||
dialogs/aboutdialog.ui \
|
||||
dialogs/newsequencedialog.ui \
|
||||
dialogs/exportdialog.ui \
|
||||
dialogs/preferencesdialog.ui \
|
||||
dialogs/demonotice.ui
|
||||
FORMS +=
|
||||
|
||||
win32 {
|
||||
RC_FILE = icons/resources.rc
|
||||
@@ -223,8 +217,6 @@ unix:!mac:target.path = $$PREFIX/bin
|
||||
effects.files = $$PWD/effects/*.frag $$PWD/effects/*.xml $$PWD/effects/*.vert
|
||||
unix:!mac:effects.path = $$PREFIX/share/olive-editor/effects
|
||||
|
||||
INSTALLS += target effects
|
||||
|
||||
unix:!mac {
|
||||
metainfo.files = $$PWD/packaging/linux/org.olivevideoeditor.Olive.appdata.xml
|
||||
metainfo.path = $$PREFIX/share/metainfo
|
||||
@@ -248,5 +240,5 @@ unix:!mac {
|
||||
icon512.path = $$PREFIX/share/icons/hicolor/512x512/apps
|
||||
icon1024.files = $$PWD/packaging/linux/icons/1024x1024/org.olivevideoeditor.Olive.png
|
||||
icon1024.path = $$PREFIX/share/icons/hicolor/1024x1024/apps
|
||||
INSTALLS += metainfo desktop mime icon16 icon32 icon48 icon64 icon128 icon256 icon512 icon1024
|
||||
}
|
||||
INSTALLS += target effects metainfo desktop mime icon16 icon32 icon48 icon64 icon128 icon256 icon512 icon1024
|
||||
}
|
||||
|
||||
+1
-4
@@ -295,10 +295,7 @@ void Project::open_properties() {
|
||||
break;
|
||||
case MEDIA_TYPE_SEQUENCE:
|
||||
{
|
||||
NewSequenceDialog nsd(this);
|
||||
Sequence* s = item->to_sequence();
|
||||
nsd.existing_sequence = s;
|
||||
nsd.existing_item = item;
|
||||
NewSequenceDialog nsd(this, item);
|
||||
nsd.exec();
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -27,10 +27,6 @@ class SourcesCommon;
|
||||
#define LOAD_TYPE_VERSION 69
|
||||
#define LOAD_TYPE_URL 70
|
||||
|
||||
namespace Ui {
|
||||
class Project;
|
||||
}
|
||||
|
||||
extern QString autorecovery_filename;
|
||||
extern QString project_url;
|
||||
extern QStringList recent_projects;
|
||||
|
||||
+309
-128
@@ -1,5 +1,4 @@
|
||||
#include "timeline.h"
|
||||
#include "ui_timeline.h"
|
||||
|
||||
#include "panels/panels.h"
|
||||
#include "panels/project.h"
|
||||
@@ -19,6 +18,9 @@
|
||||
#include "project/transition.h"
|
||||
#include "project/footage.h"
|
||||
#include "io/clipboard.h"
|
||||
#include "ui/timelineheader.h"
|
||||
#include "ui/resizablescrollbar.h"
|
||||
#include "ui/audiomonitor.h"
|
||||
#include "debug.h"
|
||||
|
||||
#include <QTime>
|
||||
@@ -31,6 +33,9 @@
|
||||
#include <QInputDialog>
|
||||
#include <QMessageBox>
|
||||
#include <QCheckBox>
|
||||
#include <QPushButton>
|
||||
#include <QHBoxLayout>
|
||||
#include <QSplitter>
|
||||
|
||||
long refactor_frame_number(long framenumber, double source_frame_rate, double target_frame_rate) {
|
||||
return qRound(((double)framenumber/source_frame_rate)*target_frame_rate);
|
||||
@@ -70,55 +75,39 @@ Timeline::Timeline(QWidget *parent) :
|
||||
transition_tool_post_clip(-1),
|
||||
hand_moving(false),
|
||||
block_repaints(false),
|
||||
ui(new Ui::Timeline),
|
||||
last_frame(0),
|
||||
scroll(0)
|
||||
{
|
||||
setup_ui();
|
||||
|
||||
default_track_height = (QGuiApplication::primaryScreen()->logicalDotsPerInch() / 96) * TRACK_DEFAULT_HEIGHT;
|
||||
|
||||
ui->setupUi(this);
|
||||
headers->viewer = panel_sequence_viewer;
|
||||
|
||||
ui->headers->viewer = panel_sequence_viewer;
|
||||
video_area->bottom_align = true;
|
||||
video_area->scrollBar = videoScrollbar;
|
||||
audio_area->scrollBar = audioScrollbar;
|
||||
|
||||
/* --- TEMPORARY ---
|
||||
* I feel like the rolling edit tool is unnecessary, but just
|
||||
* in case I change my mind, I'm leaving all the functionality
|
||||
* intact and only hiding the UI to get to it. Still deciding
|
||||
* on this one but the pointer tool literally does the same
|
||||
* functionality.
|
||||
*/
|
||||
ui->toolRollingButton->setVisible(false);
|
||||
ui->toolRollingButton->setEnabled(false);
|
||||
/* --- */
|
||||
tool_buttons.append(toolArrowButton);
|
||||
tool_buttons.append(toolEditButton);
|
||||
tool_buttons.append(toolRippleButton);
|
||||
tool_buttons.append(toolRazorButton);
|
||||
tool_buttons.append(toolSlipButton);
|
||||
tool_buttons.append(toolSlideButton);
|
||||
tool_buttons.append(toolTransitionButton);
|
||||
tool_buttons.append(toolHandButton);
|
||||
|
||||
ui->video_area->bottom_align = true;
|
||||
ui->video_area->scrollBar = ui->videoScrollbar;
|
||||
ui->audio_area->scrollBar = ui->audioScrollbar;
|
||||
toolArrowButton->click();
|
||||
|
||||
tool_buttons.append(ui->toolArrowButton);
|
||||
tool_buttons.append(ui->toolEditButton);
|
||||
tool_buttons.append(ui->toolRippleButton);
|
||||
tool_buttons.append(ui->toolRazorButton);
|
||||
tool_buttons.append(ui->toolSlipButton);
|
||||
tool_buttons.append(ui->toolRollingButton);
|
||||
tool_buttons.append(ui->toolSlideButton);
|
||||
tool_buttons.append(ui->toolTransitionButton);
|
||||
tool_buttons.append(ui->toolHandButton);
|
||||
|
||||
ui->toolArrowButton->click();
|
||||
|
||||
connect(ui->horizontalScrollBar, SIGNAL(valueChanged(int)), this, SLOT(setScroll(int)));
|
||||
connect(ui->videoScrollbar, SIGNAL(valueChanged(int)), ui->video_area, SLOT(setScroll(int)));
|
||||
connect(ui->audioScrollbar, SIGNAL(valueChanged(int)), ui->audio_area, SLOT(setScroll(int)));
|
||||
connect(ui->horizontalScrollBar, SIGNAL(resize_move(double)), this, SLOT(resize_move(double)));
|
||||
connect(horizontalScrollBar, SIGNAL(valueChanged(int)), this, SLOT(setScroll(int)));
|
||||
connect(videoScrollbar, SIGNAL(valueChanged(int)), video_area, SLOT(setScroll(int)));
|
||||
connect(audioScrollbar, SIGNAL(valueChanged(int)), audio_area, SLOT(setScroll(int)));
|
||||
connect(horizontalScrollBar, SIGNAL(resize_move(double)), this, SLOT(resize_move(double)));
|
||||
|
||||
update_sequence();
|
||||
}
|
||||
|
||||
Timeline::~Timeline()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
Timeline::~Timeline() {}
|
||||
|
||||
void Timeline::previous_cut() {
|
||||
if (sequence->playhead > 0) {
|
||||
@@ -159,7 +148,7 @@ void Timeline::toggle_show_all() {
|
||||
showing_all = !showing_all;
|
||||
if (showing_all) {
|
||||
old_zoom = zoom;
|
||||
set_zoom_value((double) (ui->timeline_area->width() - 200) / (double) sequence->getEndFrame());
|
||||
set_zoom_value((double) (timeline_area->width() - 200) / (double) sequence->getEndFrame());
|
||||
} else {
|
||||
set_zoom_value(old_zoom);
|
||||
}
|
||||
@@ -398,12 +387,12 @@ void Timeline::update_sequence() {
|
||||
for (int i=0;i<tool_buttons.count();i++) {
|
||||
tool_buttons[i]->setEnabled(!null_sequence);
|
||||
}
|
||||
ui->snappingButton->setEnabled(!null_sequence);
|
||||
ui->pushButton_4->setEnabled(!null_sequence);
|
||||
ui->pushButton_5->setEnabled(!null_sequence);
|
||||
ui->recordButton->setEnabled(!null_sequence);
|
||||
ui->addButton->setEnabled(!null_sequence);
|
||||
ui->headers->setEnabled(!null_sequence);
|
||||
snappingButton->setEnabled(!null_sequence);
|
||||
zoomInButton->setEnabled(!null_sequence);
|
||||
zoomOutButton->setEnabled(!null_sequence);
|
||||
recordButton->setEnabled(!null_sequence);
|
||||
addButton->setEnabled(!null_sequence);
|
||||
headers->setEnabled(!null_sequence);
|
||||
|
||||
if (null_sequence) {
|
||||
setWindowTitle("Timeline: <none>");
|
||||
@@ -418,7 +407,7 @@ int Timeline::get_snap_range() {
|
||||
}
|
||||
|
||||
bool Timeline::focused() {
|
||||
return (sequence != NULL && (ui->headers->hasFocus() || ui->video_area->hasFocus() || ui->audio_area->hasFocus()));
|
||||
return (sequence != NULL && (headers->hasFocus() || video_area->hasFocus() || audio_area->hasFocus()));
|
||||
}
|
||||
|
||||
void Timeline::repaint_timeline() {
|
||||
@@ -426,19 +415,19 @@ void Timeline::repaint_timeline() {
|
||||
bool draw = true;
|
||||
|
||||
if (sequence != NULL
|
||||
&& !ui->horizontalScrollBar->isSliderDown()
|
||||
&& !ui->horizontalScrollBar->is_resizing()
|
||||
&& !horizontalScrollBar->isSliderDown()
|
||||
&& !horizontalScrollBar->is_resizing()
|
||||
&& panel_sequence_viewer->playing
|
||||
&& !zoom_just_changed) {
|
||||
// auto scroll
|
||||
if (config.autoscroll == AUTOSCROLL_PAGE_SCROLL) {
|
||||
int playhead_x = panel_timeline->getTimelineScreenPointFromFrame(sequence->playhead);
|
||||
if (playhead_x < 0 || playhead_x > (ui->editAreas->width() - ui->videoScrollbar->width())) {
|
||||
ui->horizontalScrollBar->setValue(getScreenPointFromFrame(zoom, sequence->playhead));
|
||||
if (playhead_x < 0 || playhead_x > (editAreas->width() - videoScrollbar->width())) {
|
||||
horizontalScrollBar->setValue(getScreenPointFromFrame(zoom, sequence->playhead));
|
||||
draw = false;
|
||||
}
|
||||
} else if (config.autoscroll == AUTOSCROLL_SMOOTH_SCROLL) {
|
||||
if (center_scroll_to_playhead(ui->horizontalScrollBar, zoom, sequence->playhead)) {
|
||||
if (center_scroll_to_playhead(horizontalScrollBar, zoom, sequence->playhead)) {
|
||||
draw = false;
|
||||
}
|
||||
}
|
||||
@@ -447,15 +436,15 @@ void Timeline::repaint_timeline() {
|
||||
zoom_just_changed = false;
|
||||
|
||||
if (draw) {
|
||||
ui->headers->update();
|
||||
ui->video_area->update();
|
||||
ui->audio_area->update();
|
||||
headers->update();
|
||||
video_area->update();
|
||||
audio_area->update();
|
||||
|
||||
if (sequence != NULL) {
|
||||
set_sb_max();
|
||||
|
||||
if (last_frame != sequence->playhead) {
|
||||
ui->audio_monitor->update();
|
||||
audio_monitor->update();
|
||||
last_frame = sequence->playhead;
|
||||
}
|
||||
}
|
||||
@@ -573,13 +562,13 @@ void Timeline::delete_selection(QVector<Selection>& selections, bool ripple_dele
|
||||
void Timeline::set_zoom_value(double v) {
|
||||
zoom = v;
|
||||
zoom_just_changed = true;
|
||||
ui->headers->update_zoom(zoom);
|
||||
headers->update_zoom(zoom);
|
||||
|
||||
repaint_timeline();
|
||||
|
||||
// TODO find a way to gradually move towards target_scroll instead of just centering it?
|
||||
if (!ui->horizontalScrollBar->is_resizing())
|
||||
center_scroll_to_playhead(ui->horizontalScrollBar, zoom, sequence->playhead);
|
||||
if (!horizontalScrollBar->is_resizing())
|
||||
center_scroll_to_playhead(horizontalScrollBar, zoom, sequence->playhead);
|
||||
}
|
||||
|
||||
void Timeline::set_zoom(bool in) {
|
||||
@@ -602,13 +591,11 @@ QVector<int> Timeline::get_tracks_of_linked_clips(int i) {
|
||||
return tracks;
|
||||
}
|
||||
|
||||
void Timeline::on_pushButton_4_clicked()
|
||||
{
|
||||
void Timeline::zoom_in() {
|
||||
set_zoom(true);
|
||||
}
|
||||
|
||||
void Timeline::on_pushButton_5_clicked()
|
||||
{
|
||||
void Timeline::zoom_out() {
|
||||
set_zoom(false);
|
||||
}
|
||||
|
||||
@@ -623,7 +610,7 @@ bool Timeline::is_clip_selected(Clip* clip, bool containing) {
|
||||
return false;
|
||||
}
|
||||
|
||||
void Timeline::on_snappingButton_toggled(bool checked) {
|
||||
void Timeline::snapping_clicked(bool checked) {
|
||||
snapping = checked;
|
||||
}
|
||||
|
||||
@@ -1445,59 +1432,7 @@ int Timeline::getTimelineScreenPointFromFrame(long frame) {
|
||||
return getScreenPointFromFrame(zoom, frame) - scroll;
|
||||
}
|
||||
|
||||
void Timeline::on_toolArrowButton_clicked() {
|
||||
decheck_tool_buttons(sender());
|
||||
ui->timeline_area->setCursor(Qt::ArrowCursor);
|
||||
tool = TIMELINE_TOOL_POINTER;
|
||||
creating = false;
|
||||
}
|
||||
|
||||
void Timeline::on_toolEditButton_clicked() {
|
||||
decheck_tool_buttons(sender());
|
||||
ui->timeline_area->setCursor(Qt::IBeamCursor);
|
||||
tool = TIMELINE_TOOL_EDIT;
|
||||
creating = false;
|
||||
}
|
||||
|
||||
void Timeline::on_toolRippleButton_clicked() {
|
||||
decheck_tool_buttons(sender());
|
||||
ui->timeline_area->setCursor(Qt::ArrowCursor);
|
||||
tool = TIMELINE_TOOL_RIPPLE;
|
||||
creating = false;
|
||||
}
|
||||
|
||||
void Timeline::on_toolRollingButton_clicked() {
|
||||
decheck_tool_buttons(sender());
|
||||
ui->timeline_area->setCursor(Qt::ArrowCursor);
|
||||
tool = TIMELINE_TOOL_ROLLING;
|
||||
creating = false;
|
||||
}
|
||||
|
||||
void Timeline::on_toolRazorButton_clicked()
|
||||
{
|
||||
decheck_tool_buttons(sender());
|
||||
ui->timeline_area->setCursor(Qt::IBeamCursor);
|
||||
tool = TIMELINE_TOOL_RAZOR;
|
||||
creating = false;
|
||||
}
|
||||
|
||||
void Timeline::on_toolSlipButton_clicked()
|
||||
{
|
||||
decheck_tool_buttons(sender());
|
||||
ui->timeline_area->setCursor(Qt::ArrowCursor);
|
||||
tool = TIMELINE_TOOL_SLIP;
|
||||
creating = false;
|
||||
}
|
||||
|
||||
void Timeline::on_toolSlideButton_clicked()
|
||||
{
|
||||
decheck_tool_buttons(sender());
|
||||
ui->timeline_area->setCursor(Qt::ArrowCursor);
|
||||
tool = TIMELINE_TOOL_SLIDE;
|
||||
creating = false;
|
||||
}
|
||||
|
||||
void Timeline::on_addButton_clicked() {
|
||||
void Timeline::add_btn_click() {
|
||||
QMenu add_menu(this);
|
||||
|
||||
QAction* titleMenuItem = new QAction(&add_menu);
|
||||
@@ -1527,23 +1462,23 @@ void Timeline::on_addButton_clicked() {
|
||||
noiseMenuItem->setData(ADD_OBJ_NOISE);
|
||||
add_menu.addAction(noiseMenuItem);
|
||||
|
||||
connect(&add_menu, SIGNAL(triggered(QAction*)), this, SLOT(addMenuItem(QAction*)));
|
||||
connect(&add_menu, SIGNAL(triggered(QAction*)), this, SLOT(add_menu_item(QAction*)));
|
||||
|
||||
add_menu.exec(QCursor::pos());
|
||||
}
|
||||
|
||||
void Timeline::addMenuItem(QAction* action) {
|
||||
void Timeline::add_menu_item(QAction* action) {
|
||||
creating = true;
|
||||
creating_object = action->data().toInt();
|
||||
}
|
||||
|
||||
void Timeline::setScroll(int s) {
|
||||
scroll = s;
|
||||
ui->headers->set_scroll(s);
|
||||
headers->set_scroll(s);
|
||||
repaint_timeline();
|
||||
}
|
||||
|
||||
void Timeline::on_recordButton_clicked() {
|
||||
void Timeline::record_btn_click() {
|
||||
if (project_url.isEmpty()) {
|
||||
QMessageBox::critical(this, "Unsaved Project", "You must save this project before you can record audio in it.", QMessageBox::Ok);
|
||||
} else {
|
||||
@@ -1552,7 +1487,7 @@ void Timeline::on_recordButton_clicked() {
|
||||
}
|
||||
}
|
||||
|
||||
void Timeline::on_toolTransitionButton_clicked() {
|
||||
void Timeline::transition_tool_click() {
|
||||
creating = false;
|
||||
|
||||
QMenu transition_menu(this);
|
||||
@@ -1579,7 +1514,7 @@ void Timeline::on_toolTransitionButton_clicked() {
|
||||
|
||||
connect(&transition_menu, SIGNAL(triggered(QAction*)), this, SLOT(transition_menu_select(QAction*)));
|
||||
|
||||
ui->toolTransitionButton->setChecked(false);
|
||||
toolTransitionButton->setChecked(false);
|
||||
|
||||
transition_menu.exec(QCursor::pos());
|
||||
}
|
||||
@@ -1594,9 +1529,9 @@ void Timeline::transition_menu_select(QAction* a) {
|
||||
}
|
||||
|
||||
decheck_tool_buttons(sender());
|
||||
ui->timeline_area->setCursor(Qt::CrossCursor);
|
||||
timeline_area->setCursor(Qt::CrossCursor);
|
||||
tool = TIMELINE_TOOL_TRANSITION;
|
||||
ui->toolTransitionButton->setChecked(true);
|
||||
toolTransitionButton->setChecked(true);
|
||||
}
|
||||
|
||||
void Timeline::resize_move(double z) {
|
||||
@@ -1604,7 +1539,242 @@ void Timeline::resize_move(double z) {
|
||||
}
|
||||
|
||||
void Timeline::set_sb_max() {
|
||||
ui->headers->set_scrollbar_max(ui->horizontalScrollBar, sequence->getEndFrame(), ui->editAreas->width() - getScreenPointFromFrame(zoom, 200));
|
||||
headers->set_scrollbar_max(horizontalScrollBar, sequence->getEndFrame(), editAreas->width() - getScreenPointFromFrame(zoom, 200));
|
||||
}
|
||||
|
||||
void Timeline::setup_ui() {
|
||||
QWidget* dockWidgetContents = new QWidget();
|
||||
|
||||
QHBoxLayout* horizontalLayout = new QHBoxLayout(dockWidgetContents);
|
||||
horizontalLayout->setSpacing(0);
|
||||
horizontalLayout->setContentsMargins(0, 0, 0, 0);
|
||||
|
||||
QWidget* tool_buttons = new QWidget(dockWidgetContents);
|
||||
tool_buttons->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Minimum);
|
||||
|
||||
QVBoxLayout* tool_buttons_layout = new QVBoxLayout(tool_buttons);
|
||||
tool_buttons_layout->setSpacing(4);
|
||||
tool_buttons_layout->setContentsMargins(0, 0, 0, 0);
|
||||
|
||||
toolArrowButton = new QPushButton(tool_buttons);
|
||||
QIcon arrow_icon;
|
||||
arrow_icon.addFile(QStringLiteral(":/icons/arrow.png"), QSize(), QIcon::Normal, QIcon::Off);
|
||||
arrow_icon.addFile(QStringLiteral(":/icons/arrow-disabled.png"), QSize(), QIcon::Disabled, QIcon::Off);
|
||||
toolArrowButton->setIcon(arrow_icon);
|
||||
toolArrowButton->setCheckable(true);
|
||||
toolArrowButton->setToolTip("Pointer Tool (V)");
|
||||
toolArrowButton->setProperty("tool", TIMELINE_TOOL_POINTER);
|
||||
connect(toolArrowButton, SIGNAL(clicked(bool)), this, SLOT(set_tool()));
|
||||
tool_buttons_layout->addWidget(toolArrowButton);
|
||||
|
||||
toolEditButton = new QPushButton(tool_buttons);
|
||||
QIcon icon1;
|
||||
icon1.addFile(QStringLiteral(":/icons/beam.png"), QSize(), QIcon::Normal, QIcon::Off);
|
||||
icon1.addFile(QStringLiteral(":/icons/beam-disabled.png"), QSize(), QIcon::Disabled, QIcon::Off);
|
||||
toolEditButton->setIcon(icon1);
|
||||
toolEditButton->setCheckable(true);
|
||||
toolEditButton->setToolTip("Edit Tool (X)");
|
||||
toolEditButton->setProperty("tool", TIMELINE_TOOL_EDIT);
|
||||
connect(toolEditButton, SIGNAL(clicked(bool)), this, SLOT(set_tool()));
|
||||
tool_buttons_layout->addWidget(toolEditButton);
|
||||
|
||||
toolRippleButton = new QPushButton(tool_buttons);
|
||||
QIcon icon2;
|
||||
icon2.addFile(QStringLiteral(":/icons/ripple.png"), QSize(), QIcon::Normal, QIcon::Off);
|
||||
icon2.addFile(QStringLiteral(":/icons/ripple-disabled.png"), QSize(), QIcon::Disabled, QIcon::Off);
|
||||
toolRippleButton->setIcon(icon2);
|
||||
toolRippleButton->setCheckable(true);
|
||||
toolRippleButton->setToolTip("Ripple Tool (B)");
|
||||
toolRippleButton->setProperty("tool", TIMELINE_TOOL_RIPPLE);
|
||||
connect(toolRippleButton, SIGNAL(clicked(bool)), this, SLOT(set_tool()));
|
||||
tool_buttons_layout->addWidget(toolRippleButton);
|
||||
|
||||
toolRazorButton = new QPushButton(tool_buttons);
|
||||
QIcon icon4;
|
||||
icon4.addFile(QStringLiteral(":/icons/razor.png"), QSize(), QIcon::Normal, QIcon::Off);
|
||||
icon4.addFile(QStringLiteral(":/icons/razor-disabled.png"), QSize(), QIcon::Disabled, QIcon::Off);
|
||||
toolRazorButton->setIcon(icon4);
|
||||
toolRazorButton->setCheckable(true);
|
||||
toolRazorButton->setToolTip("Razor Tool (C)");
|
||||
toolRazorButton->setProperty("tool", TIMELINE_TOOL_RAZOR);
|
||||
connect(toolRazorButton, SIGNAL(clicked(bool)), this, SLOT(set_tool()));
|
||||
tool_buttons_layout->addWidget(toolRazorButton);
|
||||
|
||||
toolSlipButton = new QPushButton(tool_buttons);
|
||||
QIcon icon5;
|
||||
icon5.addFile(QStringLiteral(":/icons/slip.png"), QSize(), QIcon::Normal, QIcon::On);
|
||||
icon5.addFile(QStringLiteral(":/icons/slip-disabled.png"), QSize(), QIcon::Disabled, QIcon::On);
|
||||
toolSlipButton->setIcon(icon5);
|
||||
toolSlipButton->setCheckable(true);
|
||||
toolSlipButton->setToolTip("Slip Tool (Y)");
|
||||
toolSlipButton->setProperty("tool", TIMELINE_TOOL_SLIP);
|
||||
connect(toolSlipButton, SIGNAL(clicked(bool)), this, SLOT(set_tool()));
|
||||
tool_buttons_layout->addWidget(toolSlipButton);
|
||||
|
||||
toolSlideButton = new QPushButton(tool_buttons);
|
||||
QIcon icon6;
|
||||
icon6.addFile(QStringLiteral(":/icons/slide.png"), QSize(), QIcon::Normal, QIcon::On);
|
||||
icon6.addFile(QStringLiteral(":/icons/slide-disabled.png"), QSize(), QIcon::Disabled, QIcon::On);
|
||||
toolSlideButton->setIcon(icon6);
|
||||
toolSlideButton->setCheckable(true);
|
||||
toolSlideButton->setToolTip("Slide Tool (U)");
|
||||
toolSlideButton->setProperty("tool", TIMELINE_TOOL_SLIDE);
|
||||
connect(toolSlideButton, SIGNAL(clicked(bool)), this, SLOT(set_tool()));
|
||||
tool_buttons_layout->addWidget(toolSlideButton);
|
||||
|
||||
toolHandButton = new QPushButton(tool_buttons);
|
||||
QIcon icon7;
|
||||
icon7.addFile(QStringLiteral(":/icons/hand.png"), QSize(), QIcon::Normal, QIcon::On);
|
||||
icon7.addFile(QStringLiteral(":/icons/hand-disabled.png"), QSize(), QIcon::Disabled, QIcon::On);
|
||||
toolHandButton->setIcon(icon7);
|
||||
toolHandButton->setCheckable(true);
|
||||
toolHandButton->setToolTip("Hand Tool (H)");
|
||||
toolHandButton->setProperty("tool", TIMELINE_TOOL_HAND);
|
||||
connect(toolHandButton, SIGNAL(clicked(bool)), this, SLOT(set_tool()));
|
||||
tool_buttons_layout->addWidget(toolHandButton);
|
||||
|
||||
toolTransitionButton = new QPushButton(tool_buttons);
|
||||
QIcon icon8;
|
||||
icon8.addFile(QStringLiteral(":/icons/transition-tool.png"), QSize(), QIcon::Normal, QIcon::On);
|
||||
icon8.addFile(QStringLiteral(":/icons/transition-tool-disabled.png"), QSize(), QIcon::Disabled, QIcon::On);
|
||||
toolTransitionButton->setIcon(icon8);
|
||||
toolTransitionButton->setCheckable(true);
|
||||
toolTransitionButton->setToolTip("Transition Tool (T)");
|
||||
connect(toolTransitionButton, SIGNAL(clicked(bool)), this, SLOT(transition_tool_click()));
|
||||
tool_buttons_layout->addWidget(toolTransitionButton);
|
||||
|
||||
snappingButton = new QPushButton(tool_buttons);
|
||||
QIcon icon9;
|
||||
icon9.addFile(QStringLiteral(":/icons/magnet.png"), QSize(), QIcon::Normal, QIcon::On);
|
||||
icon9.addFile(QStringLiteral(":/icons/magnet-disabled.png"), QSize(), QIcon::Disabled, QIcon::On);
|
||||
snappingButton->setIcon(icon9);
|
||||
snappingButton->setCheckable(true);
|
||||
snappingButton->setChecked(true);
|
||||
snappingButton->setToolTip("Snapping (S)");
|
||||
connect(snappingButton, SIGNAL(toggled(bool)), this, SLOT(snapping_clicked(bool)));
|
||||
tool_buttons_layout->addWidget(snappingButton);
|
||||
|
||||
zoomInButton = new QPushButton(tool_buttons);
|
||||
QIcon icon10;
|
||||
icon10.addFile(QStringLiteral(":/icons/zoomin.png"), QSize(), QIcon::Normal, QIcon::On);
|
||||
icon10.addFile(QStringLiteral(":/icons/zoomin-disabled.png"), QSize(), QIcon::Disabled, QIcon::On);
|
||||
zoomInButton->setIcon(icon10);
|
||||
zoomInButton->setToolTip("Zoom In (=)");
|
||||
connect(zoomInButton, SIGNAL(clicked(bool)), this, SLOT(zoom_in()));
|
||||
tool_buttons_layout->addWidget(zoomInButton);
|
||||
|
||||
zoomOutButton = new QPushButton(tool_buttons);
|
||||
QIcon icon11;
|
||||
icon11.addFile(QStringLiteral(":/icons/zoomout.png"), QSize(), QIcon::Normal, QIcon::On);
|
||||
icon11.addFile(QStringLiteral(":/icons/zoomout-disabled.png"), QSize(), QIcon::Disabled, QIcon::On);
|
||||
zoomOutButton->setIcon(icon11);
|
||||
zoomOutButton->setToolTip("Zoom Out (-)");
|
||||
connect(zoomOutButton, SIGNAL(clicked(bool)), this, SLOT(zoom_out()));
|
||||
tool_buttons_layout->addWidget(zoomOutButton);
|
||||
|
||||
recordButton = new QPushButton(tool_buttons);
|
||||
QIcon icon12;
|
||||
icon12.addFile(QStringLiteral(":/icons/record.png"), QSize(), QIcon::Normal, QIcon::On);
|
||||
icon12.addFile(QStringLiteral(":/icons/record-disabled.png"), QSize(), QIcon::Disabled, QIcon::On);
|
||||
recordButton->setIcon(icon12);
|
||||
recordButton->setToolTip("Record audio");
|
||||
connect(recordButton, SIGNAL(clicked(bool)), this, SLOT(record_btn_click()));
|
||||
|
||||
tool_buttons_layout->addWidget(recordButton);
|
||||
|
||||
addButton = new QPushButton(tool_buttons);
|
||||
QIcon icon13;
|
||||
icon13.addFile(QStringLiteral(":/icons/add-button.png"), QSize(), QIcon::Normal, QIcon::On);
|
||||
icon13.addFile(QStringLiteral(":/icons/add-button-disabled.png"), QSize(), QIcon::Disabled, QIcon::On);
|
||||
addButton->setIcon(icon13);
|
||||
addButton->setToolTip("Add title, solid, bars, etc.");
|
||||
connect(addButton, SIGNAL(clicked()), this, SLOT(add_btn_click()));
|
||||
tool_buttons_layout->addWidget(addButton);
|
||||
|
||||
tool_buttons_layout->addStretch();
|
||||
|
||||
horizontalLayout->addWidget(tool_buttons);
|
||||
|
||||
timeline_area = new QWidget(dockWidgetContents);
|
||||
QSizePolicy sizePolicy2(QSizePolicy::Minimum, QSizePolicy::Minimum);
|
||||
sizePolicy2.setHorizontalStretch(1);
|
||||
sizePolicy2.setVerticalStretch(0);
|
||||
sizePolicy2.setHeightForWidth(timeline_area->sizePolicy().hasHeightForWidth());
|
||||
timeline_area->setSizePolicy(sizePolicy2);
|
||||
QVBoxLayout* timeline_area_layout = new QVBoxLayout(timeline_area);
|
||||
timeline_area_layout->setSpacing(0);
|
||||
timeline_area_layout->setContentsMargins(0, 0, 0, 0);
|
||||
headers = new TimelineHeader(timeline_area);
|
||||
|
||||
timeline_area_layout->addWidget(headers);
|
||||
|
||||
editAreas = new QWidget(timeline_area);
|
||||
QHBoxLayout* editAreaLayout = new QHBoxLayout(editAreas);
|
||||
editAreaLayout->setSpacing(0);
|
||||
editAreaLayout->setContentsMargins(0, 0, 0, 0);
|
||||
QSplitter* splitter = new QSplitter(editAreas);
|
||||
splitter->setOrientation(Qt::Vertical);
|
||||
QWidget* videoContainer = new QWidget(splitter);
|
||||
QHBoxLayout* videoContainerLayout = new QHBoxLayout(videoContainer);
|
||||
videoContainerLayout->setSpacing(0);
|
||||
videoContainerLayout->setObjectName(QStringLiteral("horizontalLayout_2"));
|
||||
videoContainerLayout->setContentsMargins(0, 0, 0, 0);
|
||||
video_area = new TimelineWidget(videoContainer);
|
||||
video_area->setObjectName(QStringLiteral("video_area"));
|
||||
video_area->setFocusPolicy(Qt::ClickFocus);
|
||||
|
||||
videoContainerLayout->addWidget(video_area);
|
||||
|
||||
videoScrollbar = new QScrollBar(videoContainer);
|
||||
videoScrollbar->setObjectName(QStringLiteral("videoScrollbar"));
|
||||
videoScrollbar->setMaximum(0);
|
||||
videoScrollbar->setSingleStep(20);
|
||||
videoScrollbar->setPageStep(1826);
|
||||
videoScrollbar->setOrientation(Qt::Vertical);
|
||||
|
||||
videoContainerLayout->addWidget(videoScrollbar);
|
||||
|
||||
splitter->addWidget(videoContainer);
|
||||
|
||||
QWidget* audioContainer = new QWidget(splitter);
|
||||
QHBoxLayout* audioContainerLayout = new QHBoxLayout(audioContainer);
|
||||
audioContainerLayout->setSpacing(0);
|
||||
audioContainerLayout->setContentsMargins(0, 0, 0, 0);
|
||||
audio_area = new TimelineWidget(audioContainer);
|
||||
audio_area->setObjectName(QStringLiteral("audio_area"));
|
||||
audio_area->setFocusPolicy(Qt::ClickFocus);
|
||||
|
||||
audioContainerLayout->addWidget(audio_area);
|
||||
|
||||
audioScrollbar = new QScrollBar(audioContainer);
|
||||
audioScrollbar->setMaximum(0);
|
||||
audioScrollbar->setOrientation(Qt::Vertical);
|
||||
|
||||
audioContainerLayout->addWidget(audioScrollbar);
|
||||
|
||||
splitter->addWidget(audioContainer);
|
||||
|
||||
editAreaLayout->addWidget(splitter);
|
||||
|
||||
timeline_area_layout->addWidget(editAreas);
|
||||
|
||||
horizontalScrollBar = new ResizableScrollBar(timeline_area);
|
||||
horizontalScrollBar->setObjectName(QStringLiteral("horizontalScrollBar"));
|
||||
horizontalScrollBar->setMaximum(0);
|
||||
horizontalScrollBar->setSingleStep(20);
|
||||
horizontalScrollBar->setPageStep(1826);
|
||||
horizontalScrollBar->setOrientation(Qt::Horizontal);
|
||||
|
||||
timeline_area_layout->addWidget(horizontalScrollBar);
|
||||
|
||||
horizontalLayout->addWidget(timeline_area);
|
||||
|
||||
audio_monitor = new AudioMonitor(dockWidgetContents);
|
||||
audio_monitor->setMinimumSize(QSize(50, 0));
|
||||
|
||||
horizontalLayout->addWidget(audio_monitor);
|
||||
|
||||
setWidget(dockWidgetContents);
|
||||
}
|
||||
|
||||
void move_clip(ComboAction* ca, Clip *c, long iin, long iout, long iclip_in, int itrack, bool verify_transitions) {
|
||||
@@ -1625,9 +1795,20 @@ void move_clip(ComboAction* ca, Clip *c, long iin, long iout, long iclip_in, int
|
||||
}
|
||||
}
|
||||
|
||||
void Timeline::on_toolHandButton_clicked() {
|
||||
decheck_tool_buttons(sender());
|
||||
ui->timeline_area->setCursor(Qt::OpenHandCursor);
|
||||
tool = TIMELINE_TOOL_HAND;
|
||||
void Timeline::set_tool() {
|
||||
QPushButton* button = static_cast<QPushButton*>(sender());
|
||||
decheck_tool_buttons(button);
|
||||
tool = button->property("tool").toInt();
|
||||
creating = false;
|
||||
switch (tool) {
|
||||
case TIMELINE_TOOL_EDIT:
|
||||
case TIMELINE_TOOL_RAZOR:
|
||||
timeline_area->setCursor(Qt::IBeamCursor);
|
||||
break;
|
||||
case TIMELINE_TOOL_HAND:
|
||||
timeline_area->setCursor(Qt::OpenHandCursor);
|
||||
break;
|
||||
default:
|
||||
timeline_area->setCursor(Qt::ArrowCursor);
|
||||
}
|
||||
}
|
||||
|
||||
+39
-38
@@ -24,6 +24,11 @@ class ComboAction;
|
||||
class Effect;
|
||||
class Media;
|
||||
class Transition;
|
||||
class TimelineHeader;
|
||||
class TimelineWidget;
|
||||
class ResizableScrollBar;
|
||||
class AudioMonitor;
|
||||
class QScrollBar;
|
||||
struct EffectMeta;
|
||||
struct Sequence;
|
||||
struct Clip;
|
||||
@@ -63,10 +68,6 @@ struct Ghost {
|
||||
Transition* transition;
|
||||
};
|
||||
|
||||
namespace Ui {
|
||||
class Timeline;
|
||||
}
|
||||
|
||||
class Timeline : public QDockWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
@@ -188,7 +189,19 @@ public:
|
||||
|
||||
bool block_repaints;
|
||||
|
||||
Ui::Timeline *ui;
|
||||
TimelineHeader* headers;
|
||||
AudioMonitor* audio_monitor;
|
||||
ResizableScrollBar* horizontalScrollBar;
|
||||
|
||||
QPushButton* toolArrowButton;
|
||||
QPushButton* toolEditButton;
|
||||
QPushButton* toolRippleButton;
|
||||
QPushButton* toolRazorButton;
|
||||
QPushButton* toolSlipButton;
|
||||
QPushButton* toolSlideButton;
|
||||
QPushButton* toolHandButton;
|
||||
QPushButton* toolTransitionButton;
|
||||
QPushButton* snappingButton;
|
||||
|
||||
void resizeEvent(QResizeEvent *event);
|
||||
public slots:
|
||||
@@ -199,42 +212,17 @@ public slots:
|
||||
void split_at_playhead();
|
||||
|
||||
private slots:
|
||||
|
||||
void on_pushButton_4_clicked();
|
||||
|
||||
void on_pushButton_5_clicked();
|
||||
|
||||
void on_snappingButton_toggled(bool checked);
|
||||
|
||||
void on_toolSlideButton_clicked();
|
||||
|
||||
void on_toolArrowButton_clicked();
|
||||
|
||||
void on_toolEditButton_clicked();
|
||||
|
||||
void on_toolRippleButton_clicked();
|
||||
|
||||
void on_toolRollingButton_clicked();
|
||||
|
||||
void on_toolRazorButton_clicked();
|
||||
|
||||
void on_toolSlipButton_clicked();
|
||||
|
||||
void on_addButton_clicked();
|
||||
|
||||
void addMenuItem(QAction*);
|
||||
|
||||
void zoom_in();
|
||||
void zoom_out();
|
||||
void snapping_clicked(bool checked);
|
||||
void add_btn_click();
|
||||
void add_menu_item(QAction*);
|
||||
void setScroll(int);
|
||||
|
||||
void on_recordButton_clicked();
|
||||
|
||||
void on_toolTransitionButton_clicked();
|
||||
|
||||
void record_btn_click();
|
||||
void transition_tool_click();
|
||||
void transition_menu_select(QAction*);
|
||||
|
||||
void resize_move(double d);
|
||||
|
||||
void on_toolHandButton_clicked();
|
||||
void set_tool();
|
||||
|
||||
private:
|
||||
void set_zoom_value(double v);
|
||||
@@ -245,7 +233,20 @@ private:
|
||||
int scroll;
|
||||
void set_sb_max();
|
||||
|
||||
void setup_ui();
|
||||
|
||||
int default_track_height;
|
||||
|
||||
QWidget* timeline_area;
|
||||
TimelineWidget* video_area;
|
||||
TimelineWidget* audio_area;
|
||||
QWidget* editAreas;
|
||||
QScrollBar* videoScrollbar;
|
||||
QScrollBar* audioScrollbar;
|
||||
QPushButton* zoomInButton;
|
||||
QPushButton* zoomOutButton;
|
||||
QPushButton* recordButton;
|
||||
QPushButton* addButton;
|
||||
};
|
||||
|
||||
#endif // TIMELINE_H
|
||||
|
||||
@@ -1,538 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>Timeline</class>
|
||||
<widget class="QDockWidget" name="Timeline">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>901</width>
|
||||
<height>592</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Timeline</string>
|
||||
</property>
|
||||
<widget class="QWidget" name="dockWidgetContents">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<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="QFrame" name="frame">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Maximum" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<property name="spacing">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<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="QPushButton" name="toolArrowButton">
|
||||
<property name="toolTip">
|
||||
<string>Pointer Tool (V)</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../icons/icons.qrc">
|
||||
<normaloff>:/icons/arrow.png</normaloff>
|
||||
<disabledoff>:/icons/arrow-disabled.png</disabledoff>:/icons/arrow.png</iconset>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="toolEditButton">
|
||||
<property name="toolTip">
|
||||
<string>Edit Tool (X)</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../icons/icons.qrc">
|
||||
<normaloff>:/icons/beam.png</normaloff>
|
||||
<disabledoff>:/icons/beam-disabled.png</disabledoff>:/icons/beam.png</iconset>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="toolRippleButton">
|
||||
<property name="toolTip">
|
||||
<string>Ripple Tool (B)</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../icons/icons.qrc">
|
||||
<normaloff>:/icons/ripple.png</normaloff>
|
||||
<disabledoff>:/icons/ripple-disabled.png</disabledoff>:/icons/ripple.png</iconset>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="toolRollingButton">
|
||||
<property name="toolTip">
|
||||
<string>Rolling Tool (N)</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../icons/icons.qrc">
|
||||
<normaloff>:/icons/rolling.png</normaloff>
|
||||
<disabledoff>:/icons/rolling-disabled.png</disabledoff>:/icons/rolling.png</iconset>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="toolRazorButton">
|
||||
<property name="toolTip">
|
||||
<string>Razor Tool (C)</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../icons/icons.qrc">
|
||||
<normaloff>:/icons/razor.png</normaloff>
|
||||
<disabledoff>:/icons/razor-disabled.png</disabledoff>:/icons/razor.png</iconset>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="toolSlipButton">
|
||||
<property name="toolTip">
|
||||
<string>Slip Tool (Y)</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset>
|
||||
<normalon>:/icons/slip.png</normalon>
|
||||
<disabledon>:/icons/slip-disabled.png</disabledon>
|
||||
</iconset>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="toolSlideButton">
|
||||
<property name="toolTip">
|
||||
<string>Slide Tool (U)</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset>
|
||||
<normalon>:/icons/slide.png</normalon>
|
||||
<disabledon>:/icons/slide-disabled.png</disabledon>
|
||||
</iconset>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="toolHandButton">
|
||||
<property name="toolTip">
|
||||
<string>Hand Tool (H)</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset>
|
||||
<normalon>:/icons/hand.png</normalon>
|
||||
<disabledon>:/icons/hand-disabled.png</disabledon>
|
||||
</iconset>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="toolTransitionButton">
|
||||
<property name="toolTip">
|
||||
<string>Transition Tool (T)</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset>
|
||||
<normalon>:/icons/transition-tool.png</normalon>
|
||||
<disabledon>:/icons/transition-tool-disabled.png</disabledon>
|
||||
</iconset>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="snappingButton">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset>
|
||||
<normalon>:/icons/magnet.png</normalon>
|
||||
<disabledon>:/icons/magnet-disabled.png</disabledon>
|
||||
</iconset>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton_4">
|
||||
<property name="toolTip">
|
||||
<string>Zoom In (=)</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset>
|
||||
<normalon>:/icons/zoomin.png</normalon>
|
||||
<disabledon>:/icons/zoomin-disabled.png</disabledon>
|
||||
</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton_5">
|
||||
<property name="toolTip">
|
||||
<string>Zoom Out (-)</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset>
|
||||
<normalon>:/icons/zoomout.png</normalon>
|
||||
<disabledon>:/icons/zoomout-disabled.png</disabledon>
|
||||
</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="recordButton">
|
||||
<property name="toolTip">
|
||||
<string>Record audio</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset>
|
||||
<normalon>:/icons/record.png</normalon>
|
||||
<disabledon>:/icons/record-disabled.png</disabledon>
|
||||
</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="addButton">
|
||||
<property name="toolTip">
|
||||
<string>Add title, solid, bars, etc.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset>
|
||||
<normalon>:/icons/add-button.png</normalon>
|
||||
<disabledon>:/icons/add-button-disabled.png</disabledon>
|
||||
</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QWidget" name="timeline_area" native="true">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
|
||||
<horstretch>1</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<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="TimelineHeader" name="headers" native="true">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QWidget" name="editAreas" native="true">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<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="QSplitter" name="splitter">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<widget class="QWidget" name="videoContainer" native="true">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<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="TimelineWidget" name="video_area" native="true">
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::ClickFocus</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QScrollBar" name="videoScrollbar">
|
||||
<property name="maximum">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<number>20</number>
|
||||
</property>
|
||||
<property name="pageStep">
|
||||
<number>1826</number>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="audioContainer" native="true">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<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="TimelineWidget" name="audio_area" native="true">
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::ClickFocus</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QScrollBar" name="audioScrollbar">
|
||||
<property name="maximum">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<number>20</number>
|
||||
</property>
|
||||
<property name="pageStep">
|
||||
<number>1826</number>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="ResizableScrollBar" name="horizontalScrollBar">
|
||||
<property name="maximum">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<number>20</number>
|
||||
</property>
|
||||
<property name="pageStep">
|
||||
<number>1826</number>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="AudioMonitor" name="audio_monitor" native="true">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>50</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>TimelineHeader</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>ui/timelineheader.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>TimelineWidget</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>ui/timelinewidget.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>AudioMonitor</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>ui/audiomonitor.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>ResizableScrollBar</class>
|
||||
<extends>QScrollBar</extends>
|
||||
<header>ui/resizablescrollbar.h</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources>
|
||||
<include location="../icons/icons.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
||||
+9
-2
@@ -11,11 +11,12 @@
|
||||
#include "project/media.h"
|
||||
#include "project/undo.h"
|
||||
#include "ui/audiomonitor.h"
|
||||
#include "ui_timeline.h"
|
||||
#include "playback/playback.h"
|
||||
#include "ui/viewerwidget.h"
|
||||
#include "ui/viewercontainer.h"
|
||||
#include "ui/labelslider.h"
|
||||
#include "ui/timelineheader.h"
|
||||
#include "ui/resizablescrollbar.h"
|
||||
#include "debug.h"
|
||||
|
||||
#define FRAMES_IN_ONE_MINUTE 1798 // 1800 - 2
|
||||
@@ -31,6 +32,8 @@ extern "C" {
|
||||
#include <QPainter>
|
||||
#include <QStringList>
|
||||
#include <QTimer>
|
||||
#include <QHBoxLayout>
|
||||
#include <QPushButton>
|
||||
|
||||
Viewer::Viewer(QWidget *parent) :
|
||||
QDockWidget(parent),
|
||||
@@ -466,7 +469,6 @@ void Viewer::setup_ui() {
|
||||
horizontalScrollBar->setOrientation(Qt::Horizontal);
|
||||
layout->addWidget(horizontalScrollBar);
|
||||
|
||||
|
||||
QWidget* lower_controls = new QWidget(contents);
|
||||
|
||||
QHBoxLayout* lower_control_layout = new QHBoxLayout(lower_controls);
|
||||
@@ -492,6 +494,7 @@ void Viewer::setup_ui() {
|
||||
goToStartIcon.addFile(QStringLiteral(":/icons/prev.png"), QSize(), QIcon::Normal, QIcon::Off);
|
||||
goToStartIcon.addFile(QStringLiteral(":/icons/prev-disabled.png"), QSize(), QIcon::Disabled, QIcon::Off);
|
||||
btnSkipToStart->setIcon(goToStartIcon);
|
||||
connect(btnSkipToStart, SIGNAL(clicked(bool)), this, SLOT(go_to_start()));
|
||||
playback_control_layout->addWidget(btnSkipToStart);
|
||||
|
||||
btnRewind = new QPushButton(playback_controls);
|
||||
@@ -499,6 +502,7 @@ void Viewer::setup_ui() {
|
||||
rewindIcon.addFile(QStringLiteral(":/icons/rew.png"), QSize(), QIcon::Normal, QIcon::Off);
|
||||
rewindIcon.addFile(QStringLiteral(":/icons/rew-disabled.png"), QSize(), QIcon::Disabled, QIcon::Off);
|
||||
btnRewind->setIcon(rewindIcon);
|
||||
connect(btnRewind, SIGNAL(clicked(bool)), this, SLOT(previous_frame()));
|
||||
playback_control_layout->addWidget(btnRewind);
|
||||
|
||||
btnPlay = new QPushButton(playback_controls);
|
||||
@@ -506,6 +510,7 @@ void Viewer::setup_ui() {
|
||||
playIcon.addFile(QStringLiteral(":/icons/play.png"), QSize(), QIcon::Normal, QIcon::Off);
|
||||
playIcon.addFile(QStringLiteral(":/icons/play-disabled.png"), QSize(), QIcon::Disabled, QIcon::Off);
|
||||
btnPlay->setIcon(playIcon);
|
||||
connect(btnPlay, SIGNAL(clicked(bool)), this, SLOT(toggle_play()));
|
||||
playback_control_layout->addWidget(btnPlay);
|
||||
|
||||
btnFastForward = new QPushButton(playback_controls);
|
||||
@@ -513,6 +518,7 @@ void Viewer::setup_ui() {
|
||||
ffIcon.addFile(QStringLiteral(":/icons/ff.png"), QSize(), QIcon::Normal, QIcon::On);
|
||||
ffIcon.addFile(QStringLiteral(":/icons/ff-disabled.png"), QSize(), QIcon::Disabled, QIcon::Off);
|
||||
btnFastForward->setIcon(ffIcon);
|
||||
connect(btnFastForward, SIGNAL(clicked(bool)), this, SLOT(next_frame()));
|
||||
playback_control_layout->addWidget(btnFastForward);
|
||||
|
||||
btnSkipToEnd = new QPushButton(playback_controls);
|
||||
@@ -520,6 +526,7 @@ void Viewer::setup_ui() {
|
||||
nextIcon.addFile(QStringLiteral(":/icons/next.png"), QSize(), QIcon::Normal, QIcon::Off);
|
||||
nextIcon.addFile(QStringLiteral(":/icons/next-disabled.png"), QSize(), QIcon::Disabled, QIcon::Off);
|
||||
btnSkipToEnd->setIcon(nextIcon);
|
||||
connect(btnSkipToEnd, SIGNAL(clicked(bool)), this, SLOT(go_to_end()));
|
||||
playback_control_layout->addWidget(btnSkipToEnd);
|
||||
|
||||
lower_control_layout->addWidget(playback_controls);
|
||||
|
||||
+5
-5
@@ -42,14 +42,9 @@ public:
|
||||
void set_zoom(bool in);
|
||||
|
||||
// playback functions
|
||||
void go_to_start();
|
||||
void previous_frame();
|
||||
void next_frame();
|
||||
void seek(long p);
|
||||
void toggle_play();
|
||||
void play();
|
||||
void pause();
|
||||
void go_to_end();
|
||||
bool playing;
|
||||
long playhead_start;
|
||||
qint64 start_msecs;
|
||||
@@ -75,6 +70,11 @@ public:
|
||||
|
||||
public slots:
|
||||
void play_wake();
|
||||
void go_to_start();
|
||||
void previous_frame();
|
||||
void toggle_play();
|
||||
void next_frame();
|
||||
void go_to_end();
|
||||
|
||||
private slots:
|
||||
void on_btnSkipToStart_clicked();
|
||||
|
||||
+55
-54
@@ -7,9 +7,10 @@
|
||||
#include "panels/panels.h"
|
||||
#include "panels/timeline.h"
|
||||
#include "panels/viewer.h"
|
||||
#include "ui_timeline.h"
|
||||
#include "ui/audiomonitor.h"
|
||||
#include "debug.h"
|
||||
|
||||
#include <QApplication>
|
||||
#include <QAudioOutput>
|
||||
#include <QAudioInput>
|
||||
#include <QtMath>
|
||||
@@ -43,49 +44,49 @@ bool is_audio_device_set() {
|
||||
void init_audio() {
|
||||
stop_audio();
|
||||
|
||||
QAudioFormat audio_format;
|
||||
audio_format.setSampleRate(config.audio_rate);
|
||||
audio_format.setChannelCount(2);
|
||||
audio_format.setSampleSize(16);
|
||||
audio_format.setCodec("audio/pcm");
|
||||
audio_format.setByteOrder(QAudioFormat::LittleEndian);
|
||||
audio_format.setSampleType(QAudioFormat::SignedInt);
|
||||
QAudioFormat audio_format;
|
||||
audio_format.setSampleRate(config.audio_rate);
|
||||
audio_format.setChannelCount(2);
|
||||
audio_format.setSampleSize(16);
|
||||
audio_format.setCodec("audio/pcm");
|
||||
audio_format.setByteOrder(QAudioFormat::LittleEndian);
|
||||
audio_format.setSampleType(QAudioFormat::SignedInt);
|
||||
|
||||
QAudioDeviceInfo info(QAudioDeviceInfo::defaultOutputDevice());
|
||||
QList<QAudioDeviceInfo> devs = QAudioDeviceInfo::availableDevices(QAudio::AudioOutput);
|
||||
dout << "[INFO] Found the following audio devices:";
|
||||
for (int i=0;i<devs.size();i++) {
|
||||
dout << " " << devs.at(i).deviceName();
|
||||
}
|
||||
if (info.isNull() && devs.size() > 0) {
|
||||
dout << "[WARNING] Default audio returned NULL, attempting to use first device found...";
|
||||
info = devs.at(0);
|
||||
}
|
||||
dout << "[INFO] Using audio device" << info.deviceName();
|
||||
QAudioDeviceInfo info(QAudioDeviceInfo::defaultOutputDevice());
|
||||
QList<QAudioDeviceInfo> devs = QAudioDeviceInfo::availableDevices(QAudio::AudioOutput);
|
||||
dout << "[INFO] Found the following audio devices:";
|
||||
for (int i=0;i<devs.size();i++) {
|
||||
dout << " " << devs.at(i).deviceName();
|
||||
}
|
||||
if (info.isNull() && devs.size() > 0) {
|
||||
dout << "[WARNING] Default audio returned NULL, attempting to use first device found...";
|
||||
info = devs.at(0);
|
||||
}
|
||||
dout << "[INFO] Using audio device" << info.deviceName();
|
||||
|
||||
if (!info.isFormatSupported(audio_format)) {
|
||||
qWarning() << "[WARNING] Audio format is not supported by backend, using nearest";
|
||||
audio_format = info.nearestFormat(audio_format);
|
||||
}
|
||||
if (!info.isFormatSupported(audio_format)) {
|
||||
qWarning() << "[WARNING] Audio format is not supported by backend, using nearest";
|
||||
audio_format = info.nearestFormat(audio_format);
|
||||
}
|
||||
|
||||
audio_output = new QAudioOutput(info, audio_format);
|
||||
audio_output->moveToThread(QApplication::instance()->thread());
|
||||
audio_output->setNotifyInterval(5);
|
||||
audio_output = new QAudioOutput(info, audio_format);
|
||||
audio_output->moveToThread(QApplication::instance()->thread());
|
||||
audio_output->setNotifyInterval(5);
|
||||
|
||||
// connect
|
||||
audio_io_device = audio_output->start();
|
||||
if (audio_io_device == NULL) {
|
||||
dout << "[WARNING] Received NULL audio device. No compatible audio output was found.";
|
||||
} else {
|
||||
audio_device_set = true;
|
||||
// connect
|
||||
audio_io_device = audio_output->start();
|
||||
if (audio_io_device == NULL) {
|
||||
dout << "[WARNING] Received NULL audio device. No compatible audio output was found.";
|
||||
} else {
|
||||
audio_device_set = true;
|
||||
|
||||
// start sender thread
|
||||
audio_thread = new AudioSenderThread();
|
||||
QObject::connect(audio_output, SIGNAL(notify()), audio_thread, SLOT(notifyReceiver()));
|
||||
audio_thread->start(QThread::TimeCriticalPriority);
|
||||
// start sender thread
|
||||
audio_thread = new AudioSenderThread();
|
||||
QObject::connect(audio_output, SIGNAL(notify()), audio_thread, SLOT(notifyReceiver()));
|
||||
audio_thread->start(QThread::TimeCriticalPriority);
|
||||
|
||||
clear_audio_ibuffer();
|
||||
}
|
||||
clear_audio_ibuffer();
|
||||
}
|
||||
}
|
||||
|
||||
void stop_audio() {
|
||||
@@ -100,12 +101,12 @@ void stop_audio() {
|
||||
|
||||
void clear_audio_ibuffer() {
|
||||
memset(audio_ibuffer, 0, audio_ibuffer_size);
|
||||
audio_ibuffer_read = 0;
|
||||
audio_ibuffer_read = 0;
|
||||
}
|
||||
|
||||
int get_buffer_offset_from_frame(double framerate, long frame) {
|
||||
if (frame >= audio_ibuffer_frame) {
|
||||
return qFloor(((double) (frame - audio_ibuffer_frame)/framerate)*audio_output->format().sampleRate())*av_get_bytes_per_sample(AV_SAMPLE_FMT_S16)*av_get_channel_layout_nb_channels(AV_CH_LAYOUT_STEREO);
|
||||
return qFloor(((double) (frame - audio_ibuffer_frame)/framerate)*audio_output->format().sampleRate())*av_get_bytes_per_sample(AV_SAMPLE_FMT_S16)*av_get_channel_layout_nb_channels(AV_CH_LAYOUT_STEREO);
|
||||
} else {
|
||||
dout << "[WARNING] Invalid values passed to get_buffer_offset_from_frame";
|
||||
return 0;
|
||||
@@ -135,7 +136,7 @@ void AudioSenderThread::run() {
|
||||
cond.wait(&lock);
|
||||
if (close) {
|
||||
break;
|
||||
} else if (panel_sequence_viewer->playing || panel_footage_viewer->playing || audio_scrub) {
|
||||
} else if (panel_sequence_viewer->playing || panel_footage_viewer->playing || audio_scrub) {
|
||||
int written_bytes = 0;
|
||||
|
||||
int adjusted_read_index = audio_ibuffer_read%audio_ibuffer_size;
|
||||
@@ -147,7 +148,7 @@ void AudioSenderThread::run() {
|
||||
written_bytes += send_audio_to_output(0, audio_ibuffer_size);
|
||||
}
|
||||
|
||||
audio_scrub = false;
|
||||
audio_scrub = false;
|
||||
}
|
||||
}
|
||||
lock.unlock();
|
||||
@@ -163,26 +164,26 @@ int AudioSenderThread::send_audio_to_output(int offset, int max) {
|
||||
// TODO make this work for the footage viewer - currently, enabling it causes crash due to an ASSERT
|
||||
Sequence* s = NULL;
|
||||
/*if (panel_footage_viewer->playing) {
|
||||
s = panel_footage_viewer->seq;
|
||||
s = panel_footage_viewer->seq;
|
||||
}*/
|
||||
if (panel_sequence_viewer->playing) {
|
||||
s = panel_sequence_viewer->seq;
|
||||
}
|
||||
if (s != NULL) {
|
||||
if (panel_timeline->ui->audio_monitor->sample_cache_offset == -1) {
|
||||
panel_timeline->ui->audio_monitor->sample_cache_offset = s->playhead;
|
||||
if (panel_sequence_viewer->playing) {
|
||||
s = panel_sequence_viewer->seq;
|
||||
}
|
||||
if (s != NULL) {
|
||||
if (panel_timeline->audio_monitor->sample_cache_offset == -1) {
|
||||
panel_timeline->audio_monitor->sample_cache_offset = s->playhead;
|
||||
}
|
||||
int channel_count = av_get_channel_layout_nb_channels(s->audio_layout);
|
||||
long sample_cache_playhead = panel_timeline->ui->audio_monitor->sample_cache_offset + (panel_timeline->ui->audio_monitor->sample_cache.size()/channel_count);
|
||||
int channel_count = av_get_channel_layout_nb_channels(s->audio_layout);
|
||||
long sample_cache_playhead = panel_timeline->audio_monitor->sample_cache_offset + (panel_timeline->audio_monitor->sample_cache.size()/channel_count);
|
||||
int next_buffer_offset, buffer_offset_adjusted, i;
|
||||
int buffer_offset = get_buffer_offset_from_frame(s->frame_rate, sample_cache_playhead);
|
||||
int buffer_offset = get_buffer_offset_from_frame(s->frame_rate, sample_cache_playhead);
|
||||
if (samples.size() != channel_count) samples.resize(channel_count);
|
||||
samples.fill(0);
|
||||
|
||||
// TODO: I don't like this, but i'm not sure if there's a smarter way to do it
|
||||
while (buffer_offset < audio_ibuffer_limit) {
|
||||
sample_cache_playhead++;
|
||||
next_buffer_offset = qMin(get_buffer_offset_from_frame(s->frame_rate, sample_cache_playhead), audio_ibuffer_limit);
|
||||
next_buffer_offset = qMin(get_buffer_offset_from_frame(s->frame_rate, sample_cache_playhead), audio_ibuffer_limit);
|
||||
while (buffer_offset < next_buffer_offset) {
|
||||
for (i=0;i<samples.size();i++) {
|
||||
buffer_offset_adjusted = buffer_offset%audio_ibuffer_size;
|
||||
@@ -190,7 +191,7 @@ int AudioSenderThread::send_audio_to_output(int offset, int max) {
|
||||
buffer_offset += 2;
|
||||
}
|
||||
}
|
||||
panel_timeline->ui->audio_monitor->sample_cache.append(samples);
|
||||
panel_timeline->audio_monitor->sample_cache.append(samples);
|
||||
buffer_offset = next_buffer_offset;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,11 +14,11 @@
|
||||
#include "panels/effectcontrols.h"
|
||||
#include "panels/viewer.h"
|
||||
#include "project/undo.h"
|
||||
#include "ui_timeline.h"
|
||||
#include "mainwindow.h"
|
||||
#include "ui/viewerwidget.h"
|
||||
#include "dialogs/stabilizerdialog.h"
|
||||
#include "project/media.h"
|
||||
#include "ui/resizablescrollbar.h"
|
||||
#include "debug.h"
|
||||
|
||||
#include "project/effect.h"
|
||||
@@ -361,7 +361,7 @@ void TimelineWidget::wheelEvent(QWheelEvent *event) {
|
||||
if (config.scroll_zooms != shift) {
|
||||
panel_timeline->set_zoom(in);
|
||||
} else {
|
||||
QScrollBar* bar = alt ? scrollBar : panel_timeline->ui->horizontalScrollBar;
|
||||
QScrollBar* bar = alt ? scrollBar : panel_timeline->horizontalScrollBar;
|
||||
|
||||
int step = bar->singleStep();
|
||||
if (in) step = -step;
|
||||
@@ -1638,7 +1638,7 @@ void TimelineWidget::mouseMoveEvent(QMouseEvent *event) {
|
||||
}
|
||||
} else if (panel_timeline->hand_moving) {
|
||||
panel_timeline->block_repaints = true;
|
||||
panel_timeline->ui->horizontalScrollBar->setValue(panel_timeline->ui->horizontalScrollBar->value() + panel_timeline->drag_x_start - event->pos().x());
|
||||
panel_timeline->horizontalScrollBar->setValue(panel_timeline->horizontalScrollBar->value() + panel_timeline->drag_x_start - event->pos().x());
|
||||
scrollBar->setValue(scrollBar->value() + panel_timeline->drag_y_start - event->pos().y());
|
||||
panel_timeline->block_repaints = false;
|
||||
|
||||
|
||||
+534
-533
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user