Merge master.
authorCarl Hetherington <cth@carlh.net>
Sun, 7 Apr 2013 18:25:33 +0000 (19:25 +0100)
committerCarl Hetherington <cth@carlh.net>
Sun, 7 Apr 2013 18:25:33 +0000 (19:25 +0100)
14 files changed:
1  2 
src/lib/format.cc
src/lib/format.h
src/lib/po/es_ES.po
src/lib/po/fr_FR.po
src/lib/po/it_IT.po
src/lib/po/sv_SE.po
src/lib/util.cc
src/tools/dvdomatic.cc
src/wx/audio_dialog.cc
src/wx/film_editor.cc
src/wx/film_editor.h
src/wx/film_viewer.cc
src/wx/film_viewer.h
wscript

Simple merge
Simple merge
index 153a90085c181f6f410af7097ff8fa57c3a0ee93,73c30434846845d5aa25f6a7f77bb07b5858cfc6..8f6a065635315776133a5060efa8c8e4a09f12e4
@@@ -126,11 -138,12 +138,12 @@@ msgstr "Desentrelazado por interpolaci�
  msgid "DCP and source have the same rate.\n"
  msgstr "La fuente y el DCP tienen la misma velocidad.\n"
  
- #: src/lib/util.cc:975
- msgid "DCP will run at %1%% of the source speed."
- msgstr "El DCP se reproducirá al %1%% de la velocidad de la fuente."
+ #: src/lib/util.cc:1017
+ #, fuzzy
+ msgid "DCP will run at %1%% of the source speed.\n"
 -msgstr "El DCP se reproducirá al %1%% de la velocidad de la fuente."
++msgstr "El DCP se reproducirá al %1%% de la velocidad de la fuente.\n"
  
- #: src/lib/util.cc:968
+ #: src/lib/util.cc:1010
  msgid "DCP will use every other frame of the source.\n"
  msgstr "El DCP usará fotogramas alternos de la fuente.\n"
  
index 7bd003c08145892df657451c69032205f2f7d2c1,138d073c220c4ecd0e62a6bcbb302bf9f28e1af8..ccdad3fe2b0603b6571c5ed19bd504078435f1df
@@@ -136,11 -136,12 +136,12 @@@ msgstr "Désentrelacement cubique inter
  msgid "DCP and source have the same rate.\n"
  msgstr "Le DCP et la source ont les mêmes cadences.\n"
  
- #: src/lib/util.cc:1016
- msgid "DCP will run at %1%% of the source speed."
- msgstr "La cadence du DCP sera %1%% par rapport à la source"
+ #: src/lib/util.cc:1017
+ #, fuzzy
+ msgid "DCP will run at %1%% of the source speed.\n"
 -msgstr "La cadence du DCP sera %1%% par rapport à la source"
++msgstr "La cadence du DCP sera %1%% par rapport à la source\n"
  
- #: src/lib/util.cc:1009
+ #: src/lib/util.cc:1010
  msgid "DCP will use every other frame of the source.\n"
  msgstr "Le DCP utilisera une image sur deux de la source.\n"
  
index b4278d93c48cc03f8cb1a2fff65b65441738f8da,c184a393204ddd269d890de02d0f47eb4e065ec9..8e9b7166bb190cee457ae7cf252be0222c8b6955
@@@ -137,11 -137,12 +137,12 @@@ msgstr "Deinterlacciatore cubico interp
  msgid "DCP and source have the same rate.\n"
  msgstr "Il DCP e il sorgente hanno la stessa frequenza.\n"
  
- #: src/lib/util.cc:1016
- msgid "DCP will run at %1%% of the source speed."
- msgstr "Il DCP andrà al %1%% della velocità del sorgente."
+ #: src/lib/util.cc:1017
+ #, fuzzy
+ msgid "DCP will run at %1%% of the source speed.\n"
 -msgstr "Il DCP andrà al %1%% della velocità del sorgente."
++msgstr "Il DCP andrà al %1%% della velocità del sorgente.\n"
  
- #: src/lib/util.cc:1009
+ #: src/lib/util.cc:1010
  msgid "DCP will use every other frame of the source.\n"
  msgstr "Il DCP userà ogni altro fotogramma del sorgente.\n"
  
index 9af19206f13280750cffe8c902650e4cb683da14,9f74e1e2a930a03f245a707e24f0eaad8420feb9..a155771a78c36eac85e51409a6941c59f111539a
@@@ -137,11 -138,12 +138,12 @@@ msgstr "Kubiskt interpolerande avfläta
  msgid "DCP and source have the same rate.\n"
  msgstr "DCP och källa har samma bildfrekvens.\n"
  
- #: src/lib/util.cc:1016
- msgid "DCP will run at %1%% of the source speed."
- msgstr "DCP kommer att köras på %1%% av källans hastighet."
+ #: src/lib/util.cc:1017
+ #, fuzzy
+ msgid "DCP will run at %1%% of the source speed.\n"
 -msgstr "DCP kommer att köras på %1%% av källans hastighet."
++msgstr "DCP kommer att köras på %1%% av källans hastighet.\n"
  
- #: src/lib/util.cc:1009
+ #: src/lib/util.cc:1010
  msgid "DCP will use every other frame of the source.\n"
  msgstr "DCP kommer att använda varannan bild från källan.\n"
  
diff --cc src/lib/util.cc
Simple merge
Simple merge
Simple merge
index 07139313953f445102145663a6e47bcfa608b824,eb36ce1ff26087e9fb45ef74bff66709fcc4df18..feb49ed78a394b392f93e118ae604fe3e2948ce9
@@@ -146,8 -148,8 +146,8 @@@ FilmEditor::make_film_panel (
        }
        ++r;
  
-       _frame_rate_description = new wxStaticText (_film_panel, wxID_ANY, wxT (" \n "), wxDefaultPosition, wxDefaultSize);
+       _frame_rate_description = new wxStaticText (_film_panel, wxID_ANY, wxT (" \n \n "), wxDefaultPosition, wxDefaultSize);
 -      grid->Add (video_control (_frame_rate_description), wxGBPosition (r, 0), wxGBSpan (1, 2), wxEXPAND | wxALIGN_CENTER_VERTICAL | wxALL, 6);
 +      grid->Add (_frame_rate_description, wxGBPosition (r, 0), wxGBSpan (1, 2), wxEXPAND | wxALIGN_CENTER_VERTICAL | wxALL, 6);
        wxFont font = _frame_rate_description->GetFont();
        font.SetStyle(wxFONTSTYLE_ITALIC);
        font.SetPointSize(font.GetPointSize() - 1);
@@@ -276,13 -290,23 +268,21 @@@ FilmEditor::make_video_panel (
        grid->Add (_bottom_crop, wxGBPosition (r, 1));
        ++r;
  
+       _scaling_description = new wxStaticText (_video_panel, wxID_ANY, wxT ("\n \n \n \n"), wxDefaultPosition, wxDefaultSize);
+       grid->Add (_scaling_description, wxGBPosition (r, 0), wxGBSpan (1, 2), wxEXPAND | wxALIGN_CENTER_VERTICAL | wxALL, 6);
+       wxFont font = _scaling_description->GetFont();
+       font.SetStyle(wxFONTSTYLE_ITALIC);
+       font.SetPointSize(font.GetPointSize() - 1);
+       _scaling_description->SetFont(font);
+       ++r;
        /* VIDEO-only stuff */
        {
 -              video_control (add_label_to_grid_bag_sizer (grid, _video_panel, _("Filters"), wxGBPosition (r, 0)));
 +              add_label_to_grid_bag_sizer (grid, _video_panel, _("Filters"), wxGBPosition (r, 0));
                wxSizer* s = new wxBoxSizer (wxHORIZONTAL);
                _filters = new wxStaticText (_video_panel, wxID_ANY, _("None"));
 -              video_control (_filters);
                s->Add (_filters, 1, wxEXPAND | wxALIGN_CENTER_VERTICAL | wxTOP | wxBOTTOM | wxRIGHT, 6);
                _filters_button = new wxButton (_video_panel, wxID_ANY, _("Edit..."));
 -              video_control (_filters_button);
                s->Add (_filters_button, 0);
                grid->Add (s, wxGBPosition (r, 1), wxDefaultSpan, wxALIGN_CENTER_VERTICAL);
        }
@@@ -425,21 -422,27 +425,26 @@@ FilmEditor::make_subtitle_panel (
        _subtitle_sizer->Add (grid, 0, wxALL, 8);
  
        _with_subtitles = new wxCheckBox (_subtitle_panel, wxID_ANY, _("With Subtitles"));
 -      video_control (_with_subtitles);
        grid->Add (_with_subtitles, 1);
        
 -      _subtitle_stream = new wxChoice (_subtitle_panel, wxID_ANY);
 -      grid->Add (video_control (_subtitle_stream));
 +      _ffmpeg_subtitle_stream = new wxChoice (_subtitle_panel, wxID_ANY);
 +      grid->Add (_ffmpeg_subtitle_stream);
  
-       add_label_to_sizer (grid, _subtitle_panel, _("Subtitle Offset"));
-       _subtitle_offset = new wxSpinCtrl (_subtitle_panel);
-       grid->Add (_subtitle_offset, 1);
+       {
 -              video_control (add_label_to_sizer (grid, _subtitle_panel, _("Subtitle Offset")));
++              add_label_to_sizer (grid, _subtitle_panel, _("Subtitle Offset"));
+               wxBoxSizer* s = new wxBoxSizer (wxHORIZONTAL);
+               _subtitle_offset = new wxSpinCtrl (_subtitle_panel);
+               s->Add (_subtitle_offset);
 -              video_control (add_label_to_sizer (s, _subtitle_panel, _("pixels")));
++              add_label_to_sizer (s, _subtitle_panel, _("pixels"));
+               grid->Add (s);
+       }
  
        {
 -              video_control (add_label_to_sizer (grid, _subtitle_panel, _("Subtitle Scale")));
 +              add_label_to_sizer (grid, _subtitle_panel, _("Subtitle Scale"));
                wxBoxSizer* s = new wxBoxSizer (wxHORIZONTAL);
                _subtitle_scale = new wxSpinCtrl (_subtitle_panel);
 -              s->Add (video_control (_subtitle_scale));
 -              video_control (add_label_to_sizer (s, _subtitle_panel, _("%")));
 +              s->Add (_subtitle_scale);
 +              add_label_to_sizer (s, _subtitle_panel, _("%"));
                grid->Add (s);
        }
  
@@@ -603,14 -622,37 +608,13 @@@ FilmEditor::film_changed (Film::Propert
                setup_subtitle_control_sensitivity ();
                setup_streams ();
                setup_show_audio_sensitivity ();
-               setup_length ();
 -              setup_frame_rate_description ();
                break;
 -      case Film::TRUST_CONTENT_HEADER:
 -              checked_set (_trust_content_header, _film->trust_content_header ());
 -              break;
 -      case Film::SUBTITLE_STREAMS:
 -              setup_subtitle_control_sensitivity ();
 -              setup_streams ();
 -              break;
 -      case Film::CONTENT_AUDIO_STREAMS:
 -              setup_streams ();
 -              setup_show_audio_sensitivity ();
 -              setup_frame_rate_description ();
 +      case Film::TRUST_CONTENT_HEADERS:
 +              checked_set (_trust_content_headers, _film->trust_content_headers ());
                break;
        case Film::FORMAT:
 -      {
 -              int n = 0;
 -              vector<Format const *>::iterator i = _formats.begin ();
 -              while (i != _formats.end() && *i != _film->format ()) {
 -                      ++i;
 -                      ++n;
 -              }
 -              if (i == _formats.end()) {
 -                      checked_set (_format, -1);
 -              } else {
 -                      checked_set (_format, n);
 -              }
 -              setup_dcp_name ();
 -              setup_scaling_description ();
 +              setup_format ();
                break;
 -      }
        case Film::CROP:
                checked_set (_left_crop, _film->crop().left);
                checked_set (_right_crop, _film->crop().right);
                        }
                }
  
 -              if (_film->source_frame_rate()) {
 -                      _best_dcp_frame_rate->Enable (best_dcp_frame_rate (_film->source_frame_rate ()) != _film->dcp_frame_rate ());
 +              if (_film->video_frame_rate()) {
-                       _frame_rate_description->SetLabel (std_to_wx (FrameRateConversion (_film->video_frame_rate(), _film->dcp_frame_rate()).description));
 +                      _best_dcp_frame_rate->Enable (best_dcp_frame_rate (_film->video_frame_rate ()) != _film->dcp_frame_rate ());
                } else {
-                       _frame_rate_description->SetLabel (wxT (""));
                        _best_dcp_frame_rate->Disable ();
                }
 -
+               setup_frame_rate_description ();
 +              break;
 +      case Film::AUDIO_MAPPING:
 +              _audio_mapping->set_mapping (_film->audio_mapping ());
 +              break;
 +      }
 +}
 +
 +void
 +FilmEditor::film_content_changed (weak_ptr<Content> content, int property)
 +{
 +      if (!_film) {
 +              /* We call this method ourselves (as well as using it as a signal handler)
 +                 so _film can be 0.
 +              */
 +              return;
 +      }
 +              
 +      if (property == FFmpegContentProperty::SUBTITLE_STREAMS) {
 +              setup_subtitle_control_sensitivity ();
 +              setup_streams ();
 +      } else if (property == FFmpegContentProperty::AUDIO_STREAMS) {
 +              setup_streams ();
 +              setup_show_audio_sensitivity ();
 +      } else if (property == VideoContentProperty::VIDEO_LENGTH) {
 +              setup_length ();
 +              boost::shared_ptr<Content> c = content.lock ();
 +              if (c && c == selected_content()) {
 +                      setup_content_information ();
 +              }
 +      } else if (property == FFmpegContentProperty::AUDIO_STREAM) {
 +              if (_film->ffmpeg_audio_stream()) {
 +                      checked_set (_ffmpeg_audio_stream, boost::lexical_cast<string> (_film->ffmpeg_audio_stream()->id));
 +              }
 +              setup_dcp_name ();
 +              setup_audio_details ();
 +              setup_show_audio_sensitivity ();
 +      } else if (property == FFmpegContentProperty::SUBTITLE_STREAM) {
 +              if (_film->ffmpeg_subtitle_stream()) {
 +                      checked_set (_ffmpeg_subtitle_stream, boost::lexical_cast<string> (_film->ffmpeg_subtitle_stream()->id));
 +              }
        }
  }
  
-       setup_dcp_name ();
 +void
 +FilmEditor::setup_format ()
 +{
 +      int n = 0;
 +      vector<Format const *>::iterator i = _formats.begin ();
 +      while (i != _formats.end() && *i != _film->format ()) {
 +              ++i;
 +              ++n;
 +      }
++      
 +      if (i == _formats.end()) {
 +              checked_set (_format, -1);
 +      } else {
 +              checked_set (_format, n);
 +      }
-       if (_film->format ()) {
-               _format_description->SetLabel (std_to_wx (_film->format()->description ()));
-       } else {
-               _format_description->SetLabel (wxT (""));
-       }
 +      
 -      if (_film->source_frame_rate()) {
 -              d << std_to_wx (FrameRateConversion (_film->source_frame_rate(), _film->dcp_frame_rate()).description);
++      setup_dcp_name ();
++      setup_scaling_description ();
 +}     
 +
 +void
 +FilmEditor::setup_length ()
 +{
 +      stringstream s;
 +      if (_film->video_frame_rate() > 0 && _film->video_length()) {
 +              s << _film->video_length() << " "
 +                << wx_to_std (_("frames")) << "; " << seconds_to_hms (_film->video_length() / _film->video_frame_rate());
 +      } else if (_film->video_length()) {
 +              s << _film->video_length() << " "
 +                << wx_to_std (_("frames"));
 +      } 
 +      _length->SetLabel (std_to_wx (s.str ()));
 +      if (_film->video_length()) {
 +              _trim_start->SetRange (0, _film->video_length());
 +              _trim_end->SetRange (0, _film->video_length());
 +      }
 +}     
 +
+ void
+ FilmEditor::setup_frame_rate_description ()
+ {
+       wxString d;
 -              if (_film->audio_stream() && _film->audio_stream()->sample_rate() != _film->target_audio_sample_rate ()) {
++      if (_film->video_frame_rate()) {
++              d << std_to_wx (FrameRateConversion (_film->video_frame_rate(), _film->dcp_frame_rate()).description);
+ #ifdef HAVE_SWRESAMPLE
 -                              _film->audio_stream()->sample_rate(),
++              if (_film->audio_frame_rate() != _film->target_audio_sample_rate ()) {
+                       d << wxString::Format (
+                               _("Audio will be resampled from %dHz to %dHz\n"),
++                              _film->audio_frame_rate(),
+                               _film->target_audio_sample_rate()
+                               );
+               } else {
+                       d << "\n";
+               }
+ #else
+               d << "\n";
+ #endif                
+       }
+       _frame_rate_description->SetLabel (d);
+ }
  
  /** Called when the format widget has been changed */
  void
@@@ -814,17 -865,12 +838,17 @@@ FilmEditor::dcp_content_type_changed (w
  void
  FilmEditor::set_film (shared_ptr<Film> f)
  {
 -      _film = f;
 -
+       set_things_sensitive (_film != 0);
 +      if (_film == f) {
 +              return;
 +      }
 +      
 +      _film = f;
 +
-       set_things_sensitive (_film != 0);
        if (_film) {
                _film->Changed.connect (bind (&FilmEditor::film_changed, this, _1));
 +              _film->ContentChanged.connect (bind (&FilmEditor::film_content_changed, this, _1, _2));
        }
  
        if (_film) {
@@@ -949,6 -998,68 +973,24 @@@ FilmEditor::audio_delay_changed (wxComm
        _film->set_audio_delay (_audio_delay->GetValue ());
  }
  
 -wxControl *
 -FilmEditor::video_control (wxControl* c)
 -{
 -      _video_controls.push_back (c);
 -      return c;
 -}
 -
 -wxControl *
 -FilmEditor::still_control (wxControl* c)
 -{
 -      _still_controls.push_back (c);
 -      return c;
 -}
 -
 -void
 -FilmEditor::setup_visibility ()
 -{
 -      ContentType c = VIDEO;
 -
 -      if (_film) {
 -              c = _film->content_type ();
 -      }
 -
 -      for (list<wxControl*>::iterator i = _video_controls.begin(); i != _video_controls.end(); ++i) {
 -              (*i)->Show (c == VIDEO);
 -      }
 -
 -      for (list<wxControl*>::iterator i = _still_controls.begin(); i != _still_controls.end(); ++i) {
 -              (*i)->Show (c == STILL);
 -      }
 -
 -      setup_notebook_size ();
 -}
 -
+ void
+ FilmEditor::setup_notebook_size ()
+ {
+       _notebook->InvalidateBestSize ();
+       
+       _film_sizer->Layout ();
+       _film_sizer->SetSizeHints (_film_panel);
+       _video_sizer->Layout ();
+       _video_sizer->SetSizeHints (_video_panel);
+       _audio_sizer->Layout ();
+       _audio_sizer->SetSizeHints (_audio_panel);
+       _subtitle_sizer->Layout ();
+       _subtitle_sizer->SetSizeHints (_subtitle_panel);
+       _notebook->Fit ();
+       Fit ();
+ }
 -void
 -FilmEditor::still_duration_changed (wxCommandEvent &)
 -{
 -      if (!_film) {
 -              return;
 -      }
 -
 -      _film->set_still_duration (_still_duration->GetValue ());
 -}
 -
  void
  FilmEditor::trim_start_changed (wxCommandEvent &)
  {
@@@ -1133,18 -1261,20 +1175,20 @@@ FilmEditor::ffmpeg_subtitle_stream_chan
  void
  FilmEditor::setup_audio_details ()
  {
 -      if (!_film->content_audio_stream()) {
 +      if (!_film->ffmpeg_audio_stream()) {
                _audio->SetLabel (wxT (""));
        } else {
-               stringstream s;
+               wxString s;
 -              if (_film->audio_stream()->channels() == 1) {
 +              if (_film->audio_channels() == 1) {
-                       s << wx_to_std (_("1 channel"));
+                       s << _("1 channel");
                } else {
-                       s << _film->audio_channels() << " " << wx_to_std (_("channels"));
 -                      s << _film->audio_stream()->channels () << " " << _("channels");
++                      s << _film->audio_channels() << " " << _("channels");
                }
-               s << ", " << _film->audio_frame_rate() << wx_to_std (_("Hz"));
-               _audio->SetLabel (std_to_wx (s.str ()));
 -              s << ", " << _film->audio_stream()->sample_rate() << _("Hz");
++              s << ", " << _film->audio_frame_rate() << _("Hz");
+               _audio->SetLabel (s);
        }
+       setup_notebook_size ();
  }
  
  void
@@@ -1194,159 -1341,57 +1238,214 @@@ FilmEditor::setup_show_audio_sensitivit
        _show_audio->Enable (_film && _film->has_audio ());
  }
  
 -              _film->size().width, _film->size().height,
 -              float (_film->size().width) / _film->size().height
 +void
 +FilmEditor::setup_content ()
 +{
 +      string selected_summary;
 +      int const s = _content->GetNextItem (-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
 +      if (s != -1) {
 +              selected_summary = wx_to_std (_content->GetItemText (s));
 +      }
 +      
 +      _content->DeleteAllItems ();
 +
 +      ContentList content = _film->content ();
 +      for (ContentList::iterator i = content.begin(); i != content.end(); ++i) {
 +              int const t = _content->GetItemCount ();
 +              _content->InsertItem (t, std_to_wx ((*i)->summary ()));
 +              if ((*i)->summary() == selected_summary) {
 +                      _content->SetItemState (t, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED);
 +              }
 +      }
 +
 +      if (selected_summary.empty () && !content.empty ()) {
 +              /* Select the first item of content if non was selected before */
 +              _content->SetItemState (0, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED);
 +      }
 +}
 +
 +void
 +FilmEditor::content_add_clicked (wxCommandEvent &)
 +{
 +      wxFileDialog* d = new wxFileDialog (this);
 +      int const r = d->ShowModal ();
 +      d->Destroy ();
 +
 +      if (r != wxID_OK) {
 +              return;
 +      }
 +
 +      boost::filesystem::path p (wx_to_std (d->GetPath()));
 +
 +      if (ImageMagickContent::valid_file (p)) {
 +              _film->add_content (shared_ptr<ImageMagickContent> (new ImageMagickContent (p)));
 +      } else if (SndfileContent::valid_file (p)) {
 +              _film->add_content (shared_ptr<SndfileContent> (new SndfileContent (p)));
 +      } else {
 +              _film->add_content (shared_ptr<FFmpegContent> (new FFmpegContent (p)));
 +      }
 +      
 +}
 +
 +void
 +FilmEditor::content_remove_clicked (wxCommandEvent &)
 +{
 +      shared_ptr<Content> c = selected_content ();
 +      if (c) {
 +              _film->remove_content (c);
 +      }
 +}
 +
 +void
 +FilmEditor::content_activated (wxListEvent& ev)
 +{
 +      ContentList c = _film->content ();
 +      assert (ev.GetIndex() >= 0 && size_t (ev.GetIndex()) < c.size ());
 +
 +      edit_content (c[ev.GetIndex()]);
 +}
 +
 +void
 +FilmEditor::content_edit_clicked (wxCommandEvent &)
 +{
 +      shared_ptr<Content> c = selected_content ();
 +      if (!c) {
 +              return;
 +      }
 +
 +      edit_content (c);
 +}
 +
 +void
 +FilmEditor::edit_content (shared_ptr<Content> c)
 +{
 +      shared_ptr<ImageMagickContent> im = dynamic_pointer_cast<ImageMagickContent> (c);
 +      if (im) {
 +              ImageMagickContentDialog* d = new ImageMagickContentDialog (this, im);
 +              d->ShowModal ();
 +              d->Destroy ();
 +
 +              im->set_video_length (d->video_length() * 24);
 +      }
 +}
 +
 +void
 +FilmEditor::content_earlier_clicked (wxCommandEvent &)
 +{
 +      shared_ptr<Content> c = selected_content ();
 +      if (c) {
 +              _film->move_content_earlier (c);
 +      }
 +}
 +
 +void
 +FilmEditor::content_later_clicked (wxCommandEvent &)
 +{
 +      shared_ptr<Content> c = selected_content ();
 +      if (c) {
 +              _film->move_content_later (c);
 +      }
 +}
 +
 +void
 +FilmEditor::content_selection_changed (wxListEvent &)
 +{
 +        setup_content_button_sensitivity ();
 +      setup_content_information ();
 +}
 +
 +void
 +FilmEditor::setup_content_information ()
 +{
 +      shared_ptr<Content> c = selected_content ();
 +      if (!c) {
 +              _content_information->SetValue (wxT (""));
 +              return;
 +      }
 +
 +      _content_information->SetValue (std_to_wx (c->information ()));
 +}
 +
 +void
 +FilmEditor::setup_content_button_sensitivity ()
 +{
 +        _content_add->Enable (_generally_sensitive);
 +
 +      shared_ptr<Content> selection = selected_content ();
 +
 +        _content_edit->Enable (selection && _generally_sensitive && dynamic_pointer_cast<ImageMagickContent> (selection));
 +        _content_remove->Enable (selection && _generally_sensitive);
 +        _content_earlier->Enable (selection && _generally_sensitive);
 +        _content_later->Enable (selection && _generally_sensitive);
 +}
 +
 +shared_ptr<Content>
 +FilmEditor::selected_content ()
 +{
 +      int const s = _content->GetNextItem (-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
 +      if (s == -1) {
 +              return shared_ptr<Content> ();
 +      }
 +
 +      ContentList c = _film->content ();
 +      if (s < 0 || size_t (s) >= c.size ()) {
 +              return shared_ptr<Content> ();
 +      }
 +      
 +      return c[s];
 +}
++
+ void
+ FilmEditor::setup_scaling_description ()
+ {
+       wxString d;
+       int lines = 0;
+       d << wxString::Format (
+               _("Original video is %dx%d (%.2f:1)\n"),
 -              libdcp::Size const cropped = _film->cropped_size (_film->size ());
++              _film->video_size().width, _film->video_size().height,
++              float (_film->video_size().width) / _film->video_size().height
+               );
+       ++lines;
+       Crop const crop = _film->crop ();
+       if (crop.left || crop.right || crop.top || crop.bottom) {
++              libdcp::Size const cropped = _film->cropped_size (_film->video_size ());
+               d << wxString::Format (
+                       _("Cropped to %dx%d (%.2f:1)\n"),
+                       cropped.width, cropped.height,
+                       float (cropped.width) / cropped.height
+                       );
+               ++lines;
+       }
+       Format const * format = _film->format ();
+       if (format) {
+               int const padding = format->dcp_padding (_film);
+               libdcp::Size scaled = format->dcp_size ();
+               scaled.width -= padding * 2;
+               d << wxString::Format (
+                       _("Scaled to %dx%d (%.2f:1)\n"),
+                       scaled.width, scaled.height,
+                       float (scaled.width) / scaled.height
+                       );
+               ++lines;
+               if (padding) {
+                       d << wxString::Format (
+                               _("Padded with black to %dx%d (%.2f:1)\n"),
+                               format->dcp_size().width, format->dcp_size().height,
+                               float (format->dcp_size().width) / format->dcp_size().height
+                               );
+                       ++lines;
+               }
+       }
+       for (int i = lines; i < 4; ++i) {
+               d << " \n";
+       }
+       _scaling_description->SetLabel (d);
+ }
index bc6b045c409999ae073d518487f88d8b77623c7b,7123620d3753156b0d37382f4945b3fa0f123f7a..0f3d8eb507a5eabc0c6e316f81fd7b03c4f6924c
@@@ -104,15 -99,14 +104,18 @@@ private
        void setup_audio_details ();
        void setup_dcp_name ();
        void setup_show_audio_sensitivity ();
-       void setup_content_button_sensitivity ();
-       void setup_length ();
+       void setup_scaling_description ();
+       void setup_notebook_size ();
+       void setup_frame_rate_description ();
 +      void setup_content ();
 +      void setup_format ();
++      void setup_length ();
 +      void setup_content_information ();
++      void setup_content_button_sensitivity ();
        
 -      wxControl* video_control (wxControl *);
 -      wxControl* still_control (wxControl *);
 -
        void active_jobs_changed (bool);
 +      boost::shared_ptr<Content> selected_content ();
 +      void edit_content (boost::shared_ptr<Content>);
  
        wxNotebook* _notebook;
        wxPanel* _film_panel;
        wxTextCtrl* _name;
        wxStaticText* _dcp_name;
        wxCheckBox* _use_dci_name;
 +      wxListCtrl* _content;
 +      wxButton* _content_add;
 +      wxButton* _content_remove;
 +      wxButton* _content_edit;
 +      wxButton* _content_earlier;
 +      wxButton* _content_later;
 +      wxTextCtrl* _content_information;
        wxButton* _edit_dci_button;
 -      /** The Film's format */
        wxChoice* _format;
 -      /** The Film's content file */
 -      wxFilePickerCtrl* _content;
 -      wxCheckBox* _trust_content_header;
 -      /** The Film's left crop */
 +      wxStaticText* _format_description;
 +      wxCheckBox* _trust_content_headers;
+       wxStaticText* _scaling_description;
        wxSpinCtrl* _left_crop;
 -      /** The Film's right crop */
        wxSpinCtrl* _right_crop;
 -      /** The Film's top crop */
        wxSpinCtrl* _top_crop;
 -      /** The Film's bottom crop */
        wxSpinCtrl* _bottom_crop;
 -      /** Currently-applied filters */
        wxStaticText* _filters;
 -      /** Button to open the filters dialogue */
        wxButton* _filters_button;
 -      /** The Film's scaler */
        wxChoice* _scaler;
 -      wxRadioButton* _use_content_audio;
 -      wxChoice* _audio_stream;
 -      wxRadioButton* _use_external_audio;
 -      wxFilePickerCtrl* _external_audio[MAX_AUDIO_CHANNELS];
 -      /** The Film's audio gain */
        wxSpinCtrl* _audio_gain;
 -      /** A button to open the gain calculation dialogue */
        wxButton* _audio_gain_calculate_button;
        wxButton* _show_audio;
 -      /** The Film's audio delay */
        wxSpinCtrl* _audio_delay;
 +      wxChoice* _ffmpeg_audio_stream;
 +      AudioMappingView* _audio_mapping;
        wxCheckBox* _with_subtitles;
 -      wxChoice* _subtitle_stream;
 +      wxChoice* _ffmpeg_subtitle_stream;
        wxSpinCtrl* _subtitle_offset;
        wxSpinCtrl* _subtitle_scale;
        wxChoice* _colour_lut;
index bd56efd579055347dc0b5522061a98803188d915,4dca5cad85223f17e26ea1cc541fa76c0c2ea76b..f8373d3fdc1f31655d9bea599396c24c4c880a1c
@@@ -267,12 -285,7 +277,7 @@@ FilmViewer::raw_to_display (
                return;
        }
  
-       libdcp::Size old_size;
-       if (_display_frame) {
-               old_size = _display_frame->size();
-       }
 -      boost::shared_ptr<Image> input = _raw_frame;
 +      shared_ptr<Image> input = _raw_frame;
  
        pair<string, string> const s = Filter::ffmpeg_strings (_film->filters());
        if (!s.second.empty ()) {
Simple merge
diff --cc wscript
Simple merge