finalized media frame rate change

This commit is contained in:
itsmattkc
2019-01-06 20:26:10 +11:00
parent 320d08cc97
commit a70feb5b0b
6 changed files with 64 additions and 6 deletions
+20
View File
@@ -8,6 +8,7 @@
#include <QTreeWidgetItem>
#include <QGroupBox>
#include <QListWidget>
#include <QSpinBox>
#include "project/footage.h"
#include "project/media.h"
@@ -52,6 +53,16 @@ MediaPropertiesDialog::MediaPropertiesDialog(QWidget *parent, Media *i) :
row++;
if (f->video_tracks.size() > 0) {
// frame conforming
grid->addWidget(new QLabel("Conform to Frame Rate:"), row, 0);
conform_fr = new QDoubleSpinBox();
conform_fr->setMinimum(0.01);
conform_fr->setValue(f->video_tracks.at(0).video_frame_rate * f->speed);
grid->addWidget(conform_fr, row, 1);
row++;
// deinterlacing mode
interlacing_box = new QComboBox();
interlacing_box->addItem("Auto (" + get_interlacing_name(f->video_tracks.at(0).video_auto_interlacing) + ")");
interlacing_box->addItem(get_interlacing_name(VIDEO_PROGRESSIVE));
@@ -109,6 +120,8 @@ void MediaPropertiesDialog::accept() {
}
}
bool refresh_clips = false;
// set interlacing
if (f->video_tracks.size() > 0) {
if (interlacing_box->currentIndex() > 0) {
@@ -116,6 +129,12 @@ void MediaPropertiesDialog::accept() {
} else {
ca->append(new SetInt(&f->video_tracks[0].video_interlacing, f->video_tracks.at(0).video_auto_interlacing));
}
// set frame rate conform
if (!qFuzzyCompare(conform_fr->value(), f->video_tracks.at(0).video_frame_rate)) {
ca->append(new SetDouble(&f->speed, f->speed, conform_fr->value()/f->video_tracks.at(0).video_frame_rate));
refresh_clips = true;
}
}
// set name
@@ -124,6 +143,7 @@ void MediaPropertiesDialog::accept() {
ca->append(mr);
ca->appendPost(new CloseAllClipsCommand());
ca->appendPost(new UpdateFootageTooltip(item));
if (refresh_clips) ca->appendPost(new RefreshClips(item));
undo_stack.push(ca);
+7 -5
View File
@@ -8,18 +8,20 @@ class QComboBox;
class QLineEdit;
class Media;
class QListWidget;
class QDoubleSpinBox;
class MediaPropertiesDialog : public QDialog {
Q_OBJECT
public:
MediaPropertiesDialog(QWidget *parent, Media* i);
MediaPropertiesDialog(QWidget *parent, Media* i);
private:
QComboBox* interlacing_box;
QLineEdit* name_box;
Media* item;
QListWidget* track_list;
QLineEdit* name_box;
Media* item;
QListWidget* track_list;
QDoubleSpinBox* conform_fr;
private slots:
void accept();
void accept();
};
#endif // MEDIAPROPERTIESDIALOG_H