progress on stabilization dialog
This commit is contained in:
@@ -3,8 +3,14 @@
|
||||
#include <QVBoxLayout>
|
||||
#include <QCheckBox>
|
||||
#include <QDialogButtonBox>
|
||||
#include <QGroupBox>
|
||||
#include <QLabel>
|
||||
|
||||
#include "ui/labelslider.h"
|
||||
|
||||
StabilizerDialog::StabilizerDialog(QWidget *parent) : QDialog(parent) {
|
||||
setWindowTitle("Stabilizer");
|
||||
|
||||
layout = new QVBoxLayout(this);
|
||||
setLayout(layout);
|
||||
|
||||
@@ -12,9 +18,86 @@ StabilizerDialog::StabilizerDialog(QWidget *parent) : QDialog(parent) {
|
||||
enable_stab->setText("Enable Stabilizer");
|
||||
layout->addWidget(enable_stab);
|
||||
|
||||
analysis = new QGroupBox("Analysis", this);
|
||||
layout->addWidget(analysis);
|
||||
|
||||
analysis_layout = new QGridLayout(analysis);
|
||||
analysis->setLayout(analysis_layout);
|
||||
|
||||
analysis_layout->addWidget(new QLabel("Shakiness:"), 0, 0);
|
||||
|
||||
shakiness_slider = new LabelSlider();
|
||||
shakiness_slider->set_minimum_value(1);
|
||||
shakiness_slider->set_default_value(5);
|
||||
shakiness_slider->set_maximum_value(10);
|
||||
analysis_layout->addWidget(shakiness_slider, 0, 1);
|
||||
|
||||
analysis_layout->addWidget(new QLabel("Accuracy:"), 1, 0);
|
||||
|
||||
accuracy_slider = new LabelSlider();
|
||||
accuracy_slider->set_minimum_value(1);
|
||||
accuracy_slider->set_default_value(15);
|
||||
accuracy_slider->set_maximum_value(15);
|
||||
analysis_layout->addWidget(accuracy_slider, 1, 1);
|
||||
|
||||
analysis_layout->addWidget(new QLabel("Step Size:"), 2, 0);
|
||||
|
||||
stepsize_slider = new LabelSlider();
|
||||
stepsize_slider->set_minimum_value(1);
|
||||
stepsize_slider->set_default_value(6);
|
||||
analysis_layout->addWidget(stepsize_slider, 2, 1);
|
||||
|
||||
analysis_layout->addWidget(new QLabel("Minimum Contrast:"), 3, 0);
|
||||
|
||||
mincontrast_slider = new LabelSlider();
|
||||
mincontrast_slider->set_minimum_value(0);
|
||||
mincontrast_slider->set_default_value(0.3);
|
||||
mincontrast_slider->set_maximum_value(1);
|
||||
analysis_layout->addWidget(mincontrast_slider, 3, 1);
|
||||
|
||||
/*analysis_layout->addWidget(new QLabel("Tripod Mode:"), 4, 0);
|
||||
|
||||
tripod_mode_box = new QCheckBox();
|
||||
analysis_layout->addWidget(tripod_mode_box, 4, 1);*/
|
||||
|
||||
stabilization = new QGroupBox("Stabilization", this);
|
||||
layout->addWidget(stabilization);
|
||||
|
||||
stabilization_layout = new QGridLayout();
|
||||
stabilization->setLayout(stabilization_layout);
|
||||
|
||||
stabilization_layout->addWidget(new QLabel("Smoothing:"), 0, 0);
|
||||
|
||||
smoothing_slider = new LabelSlider();
|
||||
smoothing_slider->set_minimum_value(0);
|
||||
smoothing_slider->set_default_value(10);
|
||||
stabilization_layout->addWidget(smoothing_slider, 0, 1);
|
||||
|
||||
stabilization_layout->addWidget(new QLabel("Gaussian Motion:"), 1, 0);
|
||||
|
||||
gaussian_motion = new QCheckBox();
|
||||
gaussian_motion->setChecked(true);
|
||||
stabilization_layout->addWidget(gaussian_motion, 1, 1);
|
||||
|
||||
stabilization_layout->addWidget(new QLabel("Maximum Movement:"), 2, 0);
|
||||
stabilization_layout->addWidget(new QLabel("Maximum Rotation:"), 3, 0);
|
||||
stabilization_layout->addWidget(new QLabel("Crop:"), 4, 0);
|
||||
stabilization_layout->addWidget(new QLabel("Zoom Behavior:"), 5, 0);
|
||||
stabilization_layout->addWidget(new QLabel("Zoom Speed:"), 6, 0);
|
||||
stabilization_layout->addWidget(new QLabel("Interpolation Quality:"), 7, 0);
|
||||
|
||||
buttons = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this);
|
||||
layout->addWidget(buttons);
|
||||
|
||||
connect(buttons, SIGNAL(accepted()), this, SLOT(accept()));
|
||||
connect(buttons, SIGNAL(rejected()), this, SLOT(reject()));
|
||||
|
||||
connect(enable_stab, SIGNAL(toggled(bool)), this, SLOT(set_all_enabled(bool)));
|
||||
|
||||
set_all_enabled(false);
|
||||
}
|
||||
|
||||
void StabilizerDialog::set_all_enabled(bool e) {
|
||||
analysis->setEnabled(e);
|
||||
stabilization->setEnabled(e);
|
||||
}
|
||||
|
||||
@@ -4,17 +4,34 @@
|
||||
class QVBoxLayout;
|
||||
class QCheckBox;
|
||||
class QDialogButtonBox;
|
||||
class QGroupBox;
|
||||
class QGridLayout;
|
||||
class LabelSlider;
|
||||
|
||||
#include <QDialog>
|
||||
|
||||
class StabilizerDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
StabilizerDialog(QWidget* parent = 0);
|
||||
private slots:
|
||||
void set_all_enabled(bool e);
|
||||
private:
|
||||
QVBoxLayout* layout;
|
||||
QCheckBox* enable_stab;
|
||||
QDialogButtonBox* buttons;
|
||||
QGroupBox* analysis;
|
||||
QGridLayout* analysis_layout;
|
||||
LabelSlider* shakiness_slider;
|
||||
LabelSlider* accuracy_slider;
|
||||
LabelSlider* stepsize_slider;
|
||||
LabelSlider* mincontrast_slider;
|
||||
QCheckBox* tripod_mode_box;
|
||||
QGroupBox* stabilization;
|
||||
QGridLayout* stabilization_layout;
|
||||
LabelSlider* smoothing_slider;
|
||||
QCheckBox* gaussian_motion;
|
||||
};
|
||||
|
||||
#endif // STABILIZERDIALOG_H
|
||||
|
||||
+13
-1
@@ -151,7 +151,19 @@ void TimelineWidget::show_context_menu(const QPoint& pos) {
|
||||
QAction* nestAction = menu.addAction("&Nest");
|
||||
connect(nestAction, SIGNAL(triggered(bool)), mainWindow, SLOT(on_actionNest_triggered()));
|
||||
|
||||
if (selected_clips.size() == 1 && selected_clips.at(0)->media != NULL && selected_clips.at(0)->media->get_type() == MEDIA_TYPE_FOOTAGE) {
|
||||
// stabilizer option
|
||||
int video_clip_count = 0;
|
||||
bool all_video_is_footage = true;
|
||||
for (int i=0;i<selected_clips.size();i++) {
|
||||
if (selected_clips.at(i)->track < 0) {
|
||||
video_clip_count++;
|
||||
if (selected_clips.at(i)->media == NULL
|
||||
|| selected_clips.at(i)->media->get_type() != MEDIA_TYPE_FOOTAGE) {
|
||||
all_video_is_footage = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (video_clip_count == 1 && all_video_is_footage) {
|
||||
QAction* stabilizerAction = menu.addAction("S&tabilizer");
|
||||
connect(stabilizerAction, SIGNAL(triggered(bool)), this, SLOT(show_stabilizer_diag()));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user