summaryrefslogtreecommitdiff
path: root/src/wx
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2018-09-03 00:14:04 +0100
committerCarl Hetherington <cth@carlh.net>2018-09-03 00:14:04 +0100
commit64b7c2e30a6adc62c373b9dcc7f39310f10ed994 (patch)
tree5f1c7fb5c8ea904d0c1830b700928dca286c34ee /src/wx
parentc6dee8f49138c0246c3f94d16792541cd250672f (diff)
Add basic quality option for x264 export.
Diffstat (limited to 'src/wx')
-rw-r--r--src/wx/export_dialog.cc25
-rw-r--r--src/wx/export_dialog.h3
-rw-r--r--src/wx/table_dialog.cc3
-rw-r--r--src/wx/table_dialog.h2
4 files changed, 31 insertions, 2 deletions
diff --git a/src/wx/export_dialog.cc b/src/wx/export_dialog.cc
index 87a824882..481408578 100644
--- a/src/wx/export_dialog.cc
+++ b/src/wx/export_dialog.cc
@@ -57,6 +57,16 @@ ExportDialog::ExportDialog (wxWindow* parent)
add_spacer ();
_mixdown = new wxCheckBox (this, wxID_ANY, _("Mix audio down to stereo"));
add (_mixdown, false);
+ _x264_crf_label[0] = add (_("Quality"), true);
+ _x264_crf = new wxSlider (this, wxID_ANY, 23, 0, 51, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL | wxSL_LABELS);
+ add (_x264_crf, false);
+ add_spacer ();
+ _x264_crf_label[1] = add (_("0 is best, 51 is worst"), false);
+ wxFont font = _x264_crf_label[1]->GetFont();
+ font.SetStyle(wxFONTSTYLE_ITALIC);
+ font.SetPointSize(font.GetPointSize() - 1);
+ _x264_crf_label[1]->SetFont(font);
+
add (_("Output file"), true);
_file = new FilePickerCtrl (this, _("Select output file"), format_filters[0], false);
add (_file);
@@ -66,6 +76,11 @@ ExportDialog::ExportDialog (wxWindow* parent)
}
_format->SetSelection (0);
+ _x264_crf->Enable (false);
+ for (int i = 0; i < 2; ++i) {
+ _x264_crf_label[i]->Enable (false);
+ }
+
_format->Bind (wxEVT_CHOICE, bind (&ExportDialog::format_changed, this));
_file->Bind (wxEVT_FILEPICKER_CHANGED, bind (&ExportDialog::file_changed, this));
@@ -81,6 +96,10 @@ ExportDialog::format_changed ()
DCPOMATIC_ASSERT (_format->GetSelection() >= 0 && _format->GetSelection() < FORMATS);
_file->SetWildcard (format_filters[_format->GetSelection()]);
_file->SetPath ("");
+ _x264_crf->Enable (_format->GetSelection() == 1);
+ for (int i = 0; i < 2; ++i) {
+ _x264_crf_label[i]->Enable (_format->GetSelection() == 1);
+ }
}
boost::filesystem::path
@@ -104,6 +123,12 @@ ExportDialog::mixdown_to_stereo () const
return _mixdown->GetValue ();
}
+int
+ExportDialog::x264_crf () const
+{
+ return _x264_crf->GetValue ();
+}
+
void
ExportDialog::file_changed ()
{
diff --git a/src/wx/export_dialog.h b/src/wx/export_dialog.h
index c2498d6a1..c6ccc875e 100644
--- a/src/wx/export_dialog.h
+++ b/src/wx/export_dialog.h
@@ -33,6 +33,7 @@ public:
boost::filesystem::path path () const;
FFmpegEncoder::Format format () const;
bool mixdown_to_stereo () const;
+ int x264_crf () const;
private:
void format_changed ();
@@ -40,5 +41,7 @@ private:
wxChoice* _format;
wxCheckBox* _mixdown;
+ wxSlider* _x264_crf;
+ wxStaticText* _x264_crf_label[2];
FilePickerCtrl* _file;
};
diff --git a/src/wx/table_dialog.cc b/src/wx/table_dialog.cc
index f94fb0fe8..240a997d2 100644
--- a/src/wx/table_dialog.cc
+++ b/src/wx/table_dialog.cc
@@ -50,7 +50,7 @@ TableDialog::layout ()
_overall_sizer->SetSizeHints (this);
}
-void
+wxStaticText *
#ifdef DCPOMATIC_OSX
TableDialog::add (wxString text, bool label)
#else
@@ -67,6 +67,7 @@ TableDialog::add (wxString text, bool)
wxStaticText* m = new wxStaticText (this, wxID_ANY, wxT (""));
m->SetLabelMarkup (text);
_table->Add (m, 0, flags, 6);
+ return m;
}
void
diff --git a/src/wx/table_dialog.h b/src/wx/table_dialog.h
index 8969dc561..a5015ee59 100644
--- a/src/wx/table_dialog.h
+++ b/src/wx/table_dialog.h
@@ -35,7 +35,7 @@ protected:
return w;
}
- void add (wxString text, bool label);
+ wxStaticText* add (wxString text, bool label);
void add_spacer ();
void layout ();