Merge mxe branch.
[dcpomatic.git] / src / wx / dcp_panel.cc
index 2888bfb66cf4cad13ffffef701faf46e73cc4bcc..527c275a4b10406ec7edad982f033feb556c4f86 100644 (file)
@@ -175,9 +175,8 @@ DCPPanel::DCPPanel (wxNotebook* n, boost::shared_ptr<Film> film)
        _standard->Bind              (wxEVT_CHOICE,  boost::bind (&DCPPanel::standard_changed, this));
        _upload_after_make_dcp->Bind (wxEVT_CHECKBOX, boost::bind (&DCPPanel::upload_after_make_dcp_changed, this));
 
-       vector<DCPContentType const *> const ct = DCPContentType::all ();
-       for (vector<DCPContentType const *>::const_iterator i = ct.begin(); i != ct.end(); ++i) {
-               _dcp_content_type->Append (std_to_wx ((*i)->pretty_name ()));
+       BOOST_FOREACH (DCPContentType const * i, DCPContentType::all()) {
+               _dcp_content_type->Append (std_to_wx (i->pretty_name ()));
        }
 
        _reel_type->Append (_("Single reel"));
@@ -381,6 +380,7 @@ DCPPanel::film_changed (int p)
                checked_set (_frame_rate_spin, _film->video_frame_rate ());
 
                _best_frame_rate->Enable (_film->best_video_frame_rate () != _film->video_frame_rate ());
+               setup_dcp_name ();
                break;
        }
        case Film::AUDIO_CHANNELS:
@@ -445,7 +445,7 @@ void
 DCPPanel::setup_container ()
 {
        int n = 0;
-       vector<Ratio const *> ratios = Ratio::all ();
+       vector<Ratio const *> ratios = Ratio::containers ();
        vector<Ratio const *>::iterator i = ratios.begin ();
        while (i != ratios.end() && *i != _film->container ()) {
                ++i;
@@ -474,7 +474,7 @@ DCPPanel::container_changed ()
 
        int const n = _container->GetSelection ();
        if (n >= 0) {
-               vector<Ratio const *> ratios = Ratio::all ();
+               vector<Ratio const *> ratios = Ratio::containers ();
                DCPOMATIC_ASSERT (n < int (ratios.size()));
                _film->set_container (ratios[n]);
        }
@@ -653,6 +653,11 @@ DCPPanel::make_video_panel ()
                ++r;
        }
 
+       add_label_to_sizer (grid, panel, _("Resolution"), true, wxGBPosition (r, 0));
+       _resolution = new wxChoice (panel, wxID_ANY);
+       grid->Add (_resolution, wxGBPosition (r, 1));
+       ++r;
+
        add_label_to_sizer (grid, panel, _("Frame Rate"), true, wxGBPosition (r, 0));
        {
                _frame_rate_sizer = new wxBoxSizer (wxHORIZONTAL);
@@ -671,11 +676,6 @@ DCPPanel::make_video_panel ()
        grid->Add (_three_d, wxGBPosition (r, 0), wxGBSpan (1, 2));
        ++r;
 
-       add_label_to_sizer (grid, panel, _("Resolution"), true, wxGBPosition (r, 0));
-       _resolution = new wxChoice (panel, wxID_ANY);
-       grid->Add (_resolution, wxGBPosition (r, 1));
-       ++r;
-
        {
                add_label_to_sizer (grid, panel, _("JPEG2000 bandwidth\nfor newly-encoded data"), true, wxGBPosition (r, 0));
                wxSizer* s = new wxBoxSizer (wxHORIZONTAL);
@@ -693,17 +693,15 @@ DCPPanel::make_video_panel ()
        _j2k_bandwidth->Bind    (wxEVT_SPINCTRL,      boost::bind (&DCPPanel::j2k_bandwidth_changed, this));
        /* Also listen to wxEVT_TEXT so that typing numbers directly in is always noticed */
        _j2k_bandwidth->Bind    (wxEVT_TEXT,          boost::bind (&DCPPanel::j2k_bandwidth_changed, this));
-       _resolution->Bind       (wxEVT_CHOICE,       boost::bind (&DCPPanel::resolution_changed, this));
+       _resolution->Bind       (wxEVT_CHOICE,        boost::bind (&DCPPanel::resolution_changed, this));
        _three_d->Bind          (wxEVT_CHECKBOX,      boost::bind (&DCPPanel::three_d_changed, this));
 
-       vector<Ratio const *> const ratio = Ratio::all ();
-       for (vector<Ratio const *>::const_iterator i = ratio.begin(); i != ratio.end(); ++i) {
-               _container->Append (std_to_wx ((*i)->nickname ()));
+       BOOST_FOREACH (Ratio const * i, Ratio::containers()) {
+               _container->Append (std_to_wx(i->container_nickname()));
        }
 
-       list<int> const dfr = Config::instance()->allowed_dcp_frame_rates ();
-       for (list<int>::const_iterator i = dfr.begin(); i != dfr.end(); ++i) {
-               _frame_rate_choice->Append (std_to_wx (boost::lexical_cast<string> (*i)));
+       BOOST_FOREACH (int i, Config::instance()->allowed_dcp_frame_rates()) {
+               _frame_rate_choice->Append (std_to_wx (boost::lexical_cast<string> (i)));
        }
 
        _j2k_bandwidth->SetRange (1, Config::instance()->maximum_j2k_bandwidth() / 1000000);