Merge master.
authorCarl Hetherington <cth@carlh.net>
Mon, 30 Jun 2014 12:57:52 +0000 (13:57 +0100)
committerCarl Hetherington <cth@carlh.net>
Mon, 30 Jun 2014 12:57:52 +0000 (13:57 +0100)
1  2 
ChangeLog
src/lib/playlist.cc
src/wx/film_editor.cc
src/wx/wscript

diff --combined ChangeLog
index cb4d1c3c7d74511b0e682af494b31f1dfc8bb1c6,67a818f3e15cdfca381d510e5c6acfce7f0fb3fd..12d262f4b595944f1ba520248f0aa9335915ba0f
+++ b/ChangeLog
@@@ -1,7 -1,28 +1,32 @@@
 +2014-03-07  Carl Hetherington  <cth@carlh.net>
 +
 +      * Add subtitle view.
 +
+ 2014-06-30  Carl Hetherington  <cth@carlh.net>
+       * Version 1.72.0 released.
+ 2014-06-28  Carl Hetherington  <cth@carlh.net>
+       * Version 1.71.2 released.
+ 2014-06-28  Carl Hetherington  <cth@carlh.net>
+       * Version 1.71.1 released.
+ 2014-06-28  Carl Hetherington  <cth@carlh.net>
+       * Fix crash on analysing audio (and possibly DCP creation) with
+       resampled content.
+ 2014-06-27  Carl Hetherington  <cth@carlh.net>
+       * Version 1.71.0 released.
+ 2014-06-27  Carl Hetherington  <cth@carlh.net>
+       * Fix up/down buttons in content list.
  2014-06-26  Carl Hetherington  <cth@carlh.net>
  
        * Version 1.70.1 released.
diff --combined src/lib/playlist.cc
index 710b9cc099ea5a9e96f6118f836c9ff1ab8c1cc9,df3e633036f174fe609f192f3f3eba370eed062f..1c65d1326b3d57e74e8b819553388c97bca94570
@@@ -80,20 -80,20 +80,20 @@@ Playlist::maybe_sequence_video (
        _sequencing_video = true;
        
        ContentList cl = _content;
 -      Time next_left = 0;
 -      Time next_right = 0;
 +      DCPTime next_left;
 +      DCPTime next_right;
        for (ContentList::iterator i = _content.begin(); i != _content.end(); ++i) {
                shared_ptr<VideoContent> vc = dynamic_pointer_cast<VideoContent> (*i);
                if (!vc) {
                        continue;
                }
 -      
 +              
                if (vc->video_frame_type() == VIDEO_FRAME_TYPE_3D_RIGHT) {
                        vc->set_position (next_right);
 -                      next_right = vc->end() + 1;
 +                      next_right = vc->end() + DCPTime::delta ();
                } else {
                        vc->set_position (next_left);
 -                      next_left = vc->end() + 1;
 +                      next_left = vc->end() + DCPTime::delta ();
                }
        }
  
@@@ -121,7 -121,7 +121,7 @@@ Playlist::video_identifier () cons
  
  /** @param node <Playlist> node */
  void
 -Playlist::set_from_xml (shared_ptr<const Film> film, shared_ptr<const cxml::Node> node, int version, list<string>& notes)
 +Playlist::set_from_xml (shared_ptr<const Film> film, cxml::ConstNodePtr node, int version, list<string>& notes)
  {
        list<cxml::NodePtr> c = node->node_children ("Content");
        for (list<cxml::NodePtr>::iterator i = c.begin(); i != c.end(); ++i) {
@@@ -186,6 -186,19 +186,6 @@@ Playlist::remove (ContentList c
        Changed ();
  }
  
 -bool
 -Playlist::has_subtitles () const
 -{
 -      for (ContentList::const_iterator i = _content.begin(); i != _content.end(); ++i) {
 -              shared_ptr<const FFmpegContent> fc = dynamic_pointer_cast<FFmpegContent> (*i);
 -              if (fc && !fc->subtitle_streams().empty()) {
 -                      return true;
 -              }
 -      }
 -
 -      return false;
 -}
 -
  class FrameRateCandidate
  {
  public:
@@@ -249,12 -262,12 +249,12 @@@ Playlist::best_dcp_frame_rate () cons
        return best->dcp;
  }
  
 -Time
 +DCPTime
  Playlist::length () const
  {
 -      Time len = 0;
 +      DCPTime len;
        for (ContentList::const_iterator i = _content.begin(); i != _content.end(); ++i) {
 -              len = max (len, (*i)->end() + 1);
 +              len = max (len, (*i)->end() + DCPTime::delta ());
        }
  
        return len;
@@@ -274,10 -287,10 +274,10 @@@ Playlist::reconnect (
        }
  }
  
 -Time
 +DCPTime
  Playlist::video_end () const
  {
 -      Time end = 0;
 +      DCPTime end;
        for (ContentList::const_iterator i = _content.begin(); i != _content.end(); ++i) {
                if (dynamic_pointer_cast<const VideoContent> (*i)) {
                        end = max (end, (*i)->end ());
        return end;
  }
  
 +FrameRateChange
 +Playlist::active_frame_rate_change (DCPTime t, int dcp_video_frame_rate) const
 +{
 +      for (ContentList::const_iterator i = _content.begin(); i != _content.end(); ++i) {
 +              shared_ptr<const VideoContent> vc = dynamic_pointer_cast<const VideoContent> (*i);
 +              if (!vc) {
 +                      continue;
 +              }
 +
 +              if (vc->position() >= t && t < vc->end()) {
 +                      return FrameRateChange (vc->video_frame_rate(), dcp_video_frame_rate);
 +              }
 +      }
 +
 +      return FrameRateChange (dcp_video_frame_rate, dcp_video_frame_rate);
 +}
 +
  void
  Playlist::set_sequence_video (bool s)
  {
@@@ -326,7 -322,7 +326,7 @@@ Playlist::content () cons
  void
  Playlist::repeat (ContentList c, int n)
  {
 -      pair<Time, Time> range (TIME_MAX, 0);
 +      pair<DCPTime, DCPTime> range (DCPTime::max (), DCPTime ());
        for (ContentList::iterator i = c.begin(); i != c.end(); ++i) {
                range.first = min (range.first, (*i)->position ());
                range.second = max (range.second, (*i)->position ());
                range.second = max (range.second, (*i)->end ());
        }
  
 -      Time pos = range.second;
 +      DCPTime pos = range.second;
        for (int i = 0; i < n; ++i) {
                for (ContentList::iterator i = c.begin(); i != c.end(); ++i) {
                        shared_ptr<Content> copy = (*i)->clone ();
@@@ -366,8 -362,9 +366,9 @@@ Playlist::move_earlier (shared_ptr<Cont
        if (previous == _content.end ()) {
                return;
        }
        
 -      Time const p = (*previous)->position ();
 +      DCPTime const p = (*previous)->position ();
        (*previous)->set_position (p + c->length_after_trim ());
        c->set_position (p);
        sort (_content.begin(), _content.end(), ContentSorter ());
@@@ -392,8 -389,25 +393,8 @@@ Playlist::move_later (shared_ptr<Conten
                return;
        }
  
 -      Time const p = (*next)->position ();
 +      DCPTime const p = (*next)->position ();
        (*next)->set_position (c->position ());
-       c->set_position (p + c->length_after_trim ());
+       c->set_position (c->position() + c->length_after_trim ());
        sort (_content.begin(), _content.end(), ContentSorter ());
  }
 -
 -FrameRateChange
 -Playlist::active_frame_rate_change (Time t, int dcp_video_frame_rate) const
 -{
 -      for (ContentList::const_iterator i = _content.begin(); i != _content.end(); ++i) {
 -              shared_ptr<const VideoContent> vc = dynamic_pointer_cast<const VideoContent> (*i);
 -              if (!vc) {
 -                      continue;
 -              }
 -
 -              if (vc->position() >= t && t < vc->end()) {
 -                      return FrameRateChange (vc->video_frame_rate(), dcp_video_frame_rate);
 -              }
 -      }
 -
 -      return FrameRateChange (dcp_video_frame_rate, dcp_video_frame_rate);
 -}
diff --combined src/wx/film_editor.cc
index 002f89604289b108c1635c06ee28711610d3f127,de215a0d294298a484f6407715ef7d9bb9b55933..0c70d4b3efc3d12c092dddda5ab72be55e970b58
@@@ -439,6 -439,9 +439,6 @@@ FilmEditor::film_changed (Film::Propert
                checked_set (_name, _film->name());
                setup_dcp_name ();
                break;
 -      case Film::WITH_SUBTITLES:
 -              setup_dcp_name ();
 -              break;
        case Film::DCP_CONTENT_TYPE:
                checked_set (_dcp_content_type, DCPContentType::as_index (_film->dcp_content_type ()));
                setup_dcp_name ();
@@@ -525,10 -528,12 +525,12 @@@ FilmEditor::film_content_changed (int p
                (*i)->film_content_changed (property);
        }
  
 -      if (property == FFmpegContentProperty::AUDIO_STREAM) {
 +      if (property == FFmpegContentProperty::AUDIO_STREAM || property == SubtitleContentProperty::SUBTITLE_USE) {
                setup_dcp_name ();
        } else if (property == ContentProperty::PATH) {
                setup_content ();
+       } else if (property == ContentProperty::POSITION) {
+               setup_content ();
        }
  }
  
@@@ -612,6 -617,7 +614,6 @@@ FilmEditor::set_film (shared_ptr<Film> 
        film_changed (Film::CONTAINER);
        film_changed (Film::RESOLUTION);
        film_changed (Film::SCALER);
 -      film_changed (Film::WITH_SUBTITLES);
        film_changed (Film::SIGNED);
        film_changed (Film::ENCRYPTED);
        film_changed (Film::J2K_BANDWIDTH);
@@@ -749,6 -755,8 +751,8 @@@ FilmEditor::setup_content (
        _content->DeleteAllItems ();
  
        ContentList content = _film->content ();
+       sort (content.begin(), content.end(), ContentSorter ());
+       
        for (ContentList::iterator i = content.begin(); i != content.end(); ++i) {
                int const t = _content->GetItemCount ();
                bool const valid = (*i)->paths_valid ();
                if (!valid) {
                        s = _("MISSING: ") + s;
                }
-                       
                _content->InsertItem (t, std_to_wx (s));
  
                if ((*i)->summary() == selected_summary) {
@@@ -863,7 -871,7 +867,7 @@@ FilmEditor::setup_content_sensitivity (
  
        _video_panel->Enable    (video_selection.size() > 0 && _generally_sensitive);
        _audio_panel->Enable    (audio_selection.size() > 0 && _generally_sensitive);
 -      _subtitle_panel->Enable (selection.size() == 1 && dynamic_pointer_cast<FFmpegContent> (selection.front()) && _generally_sensitive);
 +      _subtitle_panel->Enable (selection.size() == 1 && dynamic_pointer_cast<SubtitleContent> (selection.front()) && _generally_sensitive);
        _timing_panel->Enable   (selection.size() == 1 && _generally_sensitive);
  }
  
diff --combined src/wx/wscript
index bc21f9d81b22277723133598f748ad13ed05b08f,f26a91cbc5d30dfb16636417841157043f6b8f61..bb530989452cee3e6558a322f85cafb83197bde6
@@@ -38,7 -38,6 +38,7 @@@ sources = ""
            server_dialog.cc
            servers_list_dialog.cc
            subtitle_panel.cc
 +          subtitle_view.cc
            table_dialog.cc
            timecode.cc
            timeline.cc
@@@ -72,8 -71,8 +72,8 @@@ def configure(conf)
      conf.in_msg = 1
      wx_version = conf.check_cfg(package='', path=conf.options.wx_config, args='--version').strip()
      conf.im_msg = 0
-     if wx_version != '3.0.0':
-         conf.fatal('wxwidgets version 3.0.0 is required; %s found' % wx_version)
+     if not wx_version.startswith('3.0.'):
+         conf.fatal('wxwidgets version 3.0.x is required; %s found' % wx_version)
  
  def build(bld):
      if bld.env.BUILD_STATIC: