summaryrefslogtreecommitdiff
path: root/src/wx/config_dialog.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2017-05-12 22:54:17 +0100
committerCarl Hetherington <cth@carlh.net>2017-05-12 22:54:17 +0100
commitfe0b4d0512d289caf3bc327a3791edcdd0fa3d0c (patch)
tree9d5b635ea2494af2dddf78efe2ba800d483c2274 /src/wx/config_dialog.cc
parentb6d38b0b7125811b7eb58b55adcd5b8b7aac9266 (diff)
Add default scale-to (#664).
Diffstat (limited to 'src/wx/config_dialog.cc')
-rw-r--r--src/wx/config_dialog.cc31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/wx/config_dialog.cc b/src/wx/config_dialog.cc
index 63ce57823..261ace373 100644
--- a/src/wx/config_dialog.cc
+++ b/src/wx/config_dialog.cc
@@ -515,6 +515,10 @@ private:
_container = new wxChoice (_panel, wxID_ANY);
table->Add (_container);
+ add_label_to_sizer (table, _panel, _("Default scale-to"), true);
+ _scale_to = new wxChoice (_panel, wxID_ANY);
+ table->Add (_scale_to);
+
add_label_to_sizer (table, _panel, _("Default content type"), true);
_dcp_content_type = new wxChoice (_panel, wxID_ANY);
table->Add (_dcp_content_type);
@@ -568,6 +572,14 @@ private:
_container->Bind (wxEVT_CHOICE, boost::bind (&DefaultsPage::container_changed, this));
+ _scale_to->Append (_("Guess from content"));
+
+ for (size_t i = 0; i < ratios.size(); ++i) {
+ _scale_to->Append (std_to_wx (ratios[i]->nickname ()));
+ }
+
+ _scale_to->Bind (wxEVT_CHOICE, boost::bind (&DefaultsPage::scale_to_changed, this));
+
vector<DCPContentType const *> const ct = DCPContentType::all ();
for (size_t i = 0; i < ct.size(); ++i) {
_dcp_content_type->Append (std_to_wx (ct[i]->pretty_name ()));
@@ -598,6 +610,13 @@ private:
if (ratios[i] == config->default_container ()) {
_container->SetSelection (i);
}
+ if (ratios[i] == config->default_scale_to ()) {
+ _scale_to->SetSelection (i + 1);
+ }
+ }
+
+ if (!config->default_scale_to()) {
+ _scale_to->SetSelection (0);
}
vector<DCPContentType const *> const ct = DCPContentType::all ();
@@ -666,6 +685,17 @@ private:
Config::instance()->set_default_container (ratio[_container->GetSelection()]);
}
+ void scale_to_changed ()
+ {
+ int const s = _scale_to->GetSelection ();
+ if (s == 0) {
+ Config::instance()->set_default_scale_to (0);
+ } else {
+ vector<Ratio const *> ratio = Ratio::all ();
+ Config::instance()->set_default_scale_to (ratio[s - 1]);
+ }
+ }
+
void dcp_content_type_changed ()
{
vector<DCPContentType const *> ct = DCPContentType::all ();
@@ -689,6 +719,7 @@ private:
wxDirPickerCtrl* _kdm_directory;
#endif
wxChoice* _container;
+ wxChoice* _scale_to;
wxChoice* _dcp_content_type;
wxChoice* _dcp_audio_channels;
wxChoice* _standard;