{Video,Audio}Frame -> Frame.
authorCarl Hetherington <cth@carlh.net>
Tue, 26 May 2015 15:47:39 +0000 (16:47 +0100)
committerCarl Hetherington <cth@carlh.net>
Tue, 26 May 2015 21:32:11 +0000 (22:32 +0100)
19 files changed:
src/lib/analyse_audio_job.h
src/lib/audio_decoder.cc
src/lib/audio_decoder.h
src/lib/content_audio.h
src/lib/content_video.h
src/lib/image_decoder.h
src/lib/player.cc
src/lib/player.h
src/lib/types.h
src/lib/util.h
src/lib/video_content.cc
src/lib/video_content.h
src/lib/video_decoder.cc
src/lib/video_decoder.h
src/tools/dcpomatic.cc
src/tools/dcpomatic_batch.cc
test/audio_decoder_test.cc
test/ffmpeg_decoder_sequential_test.cc
test/seek_zero_test.cc

index 0f9605eedddba6c386fc472dafd4a644cda5b5bc..ec61c0d3981a83ba246d7cd152be745d69d96001 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2012-2014 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2012-2015 Carl Hetherington <cth@carlh.net>
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
@@ -53,7 +53,7 @@ private:
        std::vector<AudioPoint> _current;
 
        float _overall_peak;
-       AudioFrame _overall_peak_frame;
+       Frame _overall_peak_frame;
 
        boost::shared_ptr<AudioAnalysis> _analysis;
 
index f6133947a0e4ad7e6ef57d38cd063102eb682411..a310650c526e20a71fa1fbc6823f6de024ad0186 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2012-2014 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2012-2015 Carl Hetherington <cth@carlh.net>
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
@@ -55,11 +55,11 @@ AudioDecoder::reset_decoded_audio ()
 }
 
 shared_ptr<ContentAudio>
-AudioDecoder::get_audio (AudioFrame frame, AudioFrame length, bool accurate)
+AudioDecoder::get_audio (Frame frame, Frame length, bool accurate)
 {
        shared_ptr<ContentAudio> dec;
 
-       AudioFrame const end = frame + length - 1;
+       Frame const end = frame + length - 1;
                
        if (frame < _decoded_audio.frame || end > (_decoded_audio.frame + length * 4)) {
                /* Either we have no decoded data, or what we do have is a long way from what we want: seek */
@@ -69,7 +69,7 @@ AudioDecoder::get_audio (AudioFrame frame, AudioFrame length, bool accurate)
        /* Offset of the data that we want from the start of _decoded_audio.audio
           (to be set up shortly)
        */
-       AudioFrame decoded_offset = 0;
+       Frame decoded_offset = 0;
        
        /* Now enough pass() calls will either:
         *  (a) give us what we want, or
@@ -90,16 +90,16 @@ AudioDecoder::get_audio (AudioFrame frame, AudioFrame length, bool accurate)
        /* The amount of data available in _decoded_audio.audio starting from `frame'.  This could be -ve
           if pass() returned true before we got enough data.
        */
-       AudioFrame const available = _decoded_audio.audio->frames() - decoded_offset;
+       Frame const available = _decoded_audio.audio->frames() - decoded_offset;
 
        /* We will return either that, or the requested amount, whichever is smaller */
-       AudioFrame const to_return = max ((AudioFrame) 0, min (available, length));
+       Frame const to_return = max ((Frame) 0, min (available, length));
 
        /* Copy our data to the output */
        shared_ptr<AudioBuffers> out (new AudioBuffers (_decoded_audio.audio->channels(), to_return));
        out->copy_from (_decoded_audio.audio.get(), to_return, decoded_offset, 0);
 
-       AudioFrame const remaining = max ((AudioFrame) 0, available - to_return);
+       Frame const remaining = max ((Frame) 0, available - to_return);
 
        /* Clean up decoded; first, move the data after what we just returned to the start of the buffer */
        _decoded_audio.audio->move (decoded_offset + to_return, 0, remaining);
@@ -131,12 +131,12 @@ AudioDecoder::audio (shared_ptr<const AudioBuffers> data, ContentTime time)
                data = _processor->run (data);
        }
 
-       AudioFrame const frame_rate = _audio_content->resampled_audio_frame_rate ();
+       Frame const frame_rate = _audio_content->resampled_audio_frame_rate ();
 
        if (_seek_reference) {
                /* We've had an accurate seek and now we're seeing some data */
                ContentTime const delta = time - _seek_reference.get ();
-               AudioFrame const delta_frames = delta.frames (frame_rate);
+               Frame const delta_frames = delta.frames (frame_rate);
                if (delta_frames > 0) {
                        /* This data comes after the seek time.  Pad the data with some silence. */
                        shared_ptr<AudioBuffers> padded (new AudioBuffers (data->channels(), data->frames() + delta_frames));
@@ -146,8 +146,8 @@ AudioDecoder::audio (shared_ptr<const AudioBuffers> data, ContentTime time)
                        time -= delta;
                } else if (delta_frames < 0) {
                        /* This data comes before the seek time.  Throw some data away */
-                       AudioFrame const to_discard = min (-delta_frames, static_cast<AudioFrame> (data->frames()));
-                       AudioFrame const to_keep = data->frames() - to_discard;
+                       Frame const to_discard = min (-delta_frames, static_cast<Frame> (data->frames()));
+                       Frame const to_keep = data->frames() - to_discard;
                        if (to_keep == 0) {
                                /* We have to throw all this data away, so keep _seek_reference and
                                   try again next time some data arrives.
index f8438df524cdbdfabb4bcfe6ddc91145db5f60aa..99e9092b30619c02f394f12ad0ab32be47bcb3c0 100644 (file)
@@ -50,7 +50,7 @@ public:
         *  @param accurate true to try hard to return frames from exactly `frame', false if we don't mind nearby frames.
         *  @return Time-stamped audio data which may or may not be from the location (and of the length) requested.
         */
-       boost::shared_ptr<ContentAudio> get_audio (AudioFrame time, AudioFrame length, bool accurate);
+       boost::shared_ptr<ContentAudio> get_audio (Frame time, Frame length, bool accurate);
        
 protected:
 
@@ -63,7 +63,7 @@ protected:
        boost::shared_ptr<const AudioContent> _audio_content;
        boost::shared_ptr<Resampler> _resampler;
        boost::shared_ptr<AudioProcessor> _processor;
-       boost::optional<AudioFrame> _audio_position;
+       boost::optional<Frame> _audio_position;
        /** Currently-available decoded audio data */
        ContentAudio _decoded_audio;
        /** The time of an accurate seek after which we have not yet received any actual
index 535c0b4913c7c0a2c157a94c40aeb69101620d6b..f704fac58fa691faa92ab69f91bddf9bfd9e3f1b 100644 (file)
@@ -34,11 +34,11 @@ public:
                , frame (0)
        {}
                
-       ContentAudio (boost::shared_ptr<AudioBuffers> a, AudioFrame f)
+       ContentAudio (boost::shared_ptr<AudioBuffers> a, Frame f)
                : audio (a)
                , frame (f)
        {}
 
        boost::shared_ptr<AudioBuffers> audio;
-       AudioFrame frame;
+       Frame frame;
 };
index 4c0bdb655d7ea222bef72e6d2b454e725d72ffd7..cdf0f9cddddb30ae7b70219b7fe5984ac977ed62 100644 (file)
@@ -33,7 +33,7 @@ public:
                , part (PART_WHOLE)
        {}
 
-       ContentVideo (boost::shared_ptr<const ImageProxy> i, Eyes e, Part p, VideoFrame f)
+       ContentVideo (boost::shared_ptr<const ImageProxy> i, Eyes e, Part p, Frame f)
                : image (i)
                , eyes (e)
                , part (p)
@@ -43,7 +43,7 @@ public:
        boost::shared_ptr<const ImageProxy> image;
        Eyes eyes;
        Part part;
-       VideoFrame frame;
+       Frame frame;
 };
 
 #endif
index ec90051daf8e43c45a565d69d9ad43f212636c52..0453f7e7e8c6b447947bc0f61cf8e51ba68fe1a6 100644 (file)
@@ -40,6 +40,6 @@ private:
        
        boost::shared_ptr<const ImageContent> _image_content;
        boost::shared_ptr<ImageProxy> _image;
-       VideoFrame _video_position;
+       Frame _video_position;
 };
 
index d5098fed7c455bcb900b0b59d4d3a499ac770cba..be00aebc7d7657449a88cf94666693c439a5d3f9 100644 (file)
@@ -397,7 +397,7 @@ Player::get_audio (DCPTime time, DCPTime length, bool accurate)
                setup_pieces ();
        }
 
-       AudioFrame const length_frames = length.frames (_film->audio_frame_rate ());
+       Frame const length_frames = length.frames (_film->audio_frame_rate ());
 
        shared_ptr<AudioBuffers> audio (new AudioBuffers (_film->audio_channels(), length_frames));
        audio->make_silent ();
@@ -423,7 +423,7 @@ Player::get_audio (DCPTime time, DCPTime length, bool accurate)
 
                /* The time that we should request from the content */
                DCPTime request = time - DCPTime::from_seconds (content->audio_delay() / 1000.0);
-               AudioFrame request_frames = length_frames;
+               Frame request_frames = length_frames;
                DCPTime offset;
                if (request < DCPTime ()) {
                        /* We went off the start of the content, so we will need to offset
@@ -437,7 +437,7 @@ Player::get_audio (DCPTime time, DCPTime length, bool accurate)
                        request = DCPTime ();
                }
 
-               AudioFrame const content_frame = dcp_to_content_audio (*i, request);
+               Frame const content_frame = dcp_to_content_audio (*i, request);
 
                /* Audio from this piece's decoder (which might be more or less than what we asked for) */
                shared_ptr<ContentAudio> all = decoder->get_audio (content_frame, request_frames, accurate);
@@ -472,14 +472,14 @@ Player::get_audio (DCPTime time, DCPTime length, bool accurate)
                        all->audio.get(),
                        content_frame - all->frame,
                        offset.frames (_film->audio_frame_rate()),
-                       min (AudioFrame (all->audio->frames()), request_frames)
+                       min (Frame (all->audio->frames()), request_frames)
                        );
        }
 
        return audio;
 }
 
-VideoFrame
+Frame
 Player::dcp_to_content_video (shared_ptr<const Piece> piece, DCPTime t) const
 {
        /* s is the offset of t from the start position of this content */
@@ -492,7 +492,7 @@ Player::dcp_to_content_video (shared_ptr<const Piece> piece, DCPTime t) const
 }
 
 DCPTime
-Player::content_video_to_dcp (shared_ptr<const Piece> piece, VideoFrame f) const
+Player::content_video_to_dcp (shared_ptr<const Piece> piece, Frame f) const
 {
        DCPTime t = DCPTime::from_frames (f * piece->frc.factor (), _film->video_frame_rate()) - piece->content->trim_start () + piece->content->position ();
        if (t < DCPTime ()) {
@@ -502,7 +502,7 @@ Player::content_video_to_dcp (shared_ptr<const Piece> piece, VideoFrame f) const
        return t;
 }
 
-AudioFrame
+Frame
 Player::dcp_to_content_audio (shared_ptr<const Piece> piece, DCPTime t) const
 {
        /* s is the offset of t from the start position of this content */
index d8b13ee7bca6e82e444934285bf02b8e87ab5334..a5194a1699ab6abc6c3ed5788d52314fac383951 100644 (file)
@@ -116,9 +116,9 @@ private:
        void film_changed (Film::Property);
        std::list<PositionImage> transform_image_subtitles (std::list<ImageSubtitle>) const;
        void update_subtitle_from_text ();
-       VideoFrame dcp_to_content_video (boost::shared_ptr<const Piece> piece, DCPTime t) const;
-       DCPTime content_video_to_dcp (boost::shared_ptr<const Piece> piece, VideoFrame f) const;
-       AudioFrame dcp_to_content_audio (boost::shared_ptr<const Piece> piece, DCPTime t) const;
+       Frame dcp_to_content_video (boost::shared_ptr<const Piece> piece, DCPTime t) const;
+       DCPTime content_video_to_dcp (boost::shared_ptr<const Piece> piece, Frame f) const;
+       Frame dcp_to_content_audio (boost::shared_ptr<const Piece> piece, DCPTime t) const;
        ContentTime dcp_to_content_subtitle (boost::shared_ptr<const Piece> piece, DCPTime t) const;
        boost::shared_ptr<PlayerVideo> black_player_video_frame (DCPTime) const;
 
index e7017a2950c7b79fdfe20ee89d724badf53f4a23..655aeba095ae29b3cea1a24e89abb39730a40113 100644 (file)
@@ -55,8 +55,7 @@ typedef std::vector<boost::shared_ptr<AudioContent> > AudioContentList;
 typedef std::vector<boost::shared_ptr<SubtitleContent> > SubtitleContentList;
 typedef std::vector<boost::shared_ptr<FFmpegContent> > FFmpegContentList;
 
-typedef int64_t VideoFrame;
-typedef int64_t AudioFrame;
+typedef int64_t Frame;
 
 enum VideoFrameType
 {
index 5413e4814e372f72fef41b43020330209c2d973e..51770c288695fd064d9d4fc73574664fe7146fb7 100644 (file)
@@ -101,7 +101,6 @@ extern FFmpegSubtitlePeriod subtitle_period (AVSubtitle const &);
 extern void set_backtrace_file (boost::filesystem::path);
 extern dcp::FrameInfo read_frame_info (FILE* file, int frame, Eyes eyes);
 extern void write_frame_info (FILE* file, int frame, Eyes eyes, dcp::FrameInfo info);
-extern int64_t video_frames_to_audio_frames (VideoFrame v, float audio_sample_rate, float frames_per_second);
 extern std::map<std::string, std::string> split_get_request (std::string url);
 extern std::string video_mxf_filename (boost::shared_ptr<dcp::PictureMXF> mxf);
 extern std::string audio_mxf_filename (boost::shared_ptr<dcp::SoundMXF> mxf);
index 9f3d7829163b7e05deeb48e268b27fec3e801e22..db9a2a5e8a6cfb6a39985e43e36e2416decb70ea 100644 (file)
@@ -483,7 +483,7 @@ VideoContent::set_video_frame_rate (float r)
 }
 
 optional<float>
-VideoContent::fade (VideoFrame f) const
+VideoContent::fade (Frame f) const
 {
        DCPOMATIC_ASSERT (f >= 0);
        
@@ -491,7 +491,7 @@ VideoContent::fade (VideoFrame f) const
                return float (f) / _fade_in.frames (video_frame_rate ());
        }
 
-       VideoFrame fade_out_start = ContentTime (video_length() - fade_out()).frames (video_frame_rate ());
+       Frame fade_out_start = ContentTime (video_length() - fade_out()).frames (video_frame_rate ());
        if (f >= fade_out_start) {
                return 1 - float (f - fade_out_start) / fade_out().frames (video_frame_rate ());
        }
index ccc61b1f9eba3f15b7cc4521609642545874be45..72bad21f8dd987b089e185529771e21a313466a6 100644 (file)
@@ -155,7 +155,7 @@ public:
 
        ContentTime dcp_time_to_content_time (DCPTime) const;
 
-       boost::optional<float> fade (VideoFrame) const;
+       boost::optional<float> fade (Frame) const;
 
        void scale_and_crop_to_fit_width ();
        void scale_and_crop_to_fit_height ();
index 31dc3cdc204836e821b385b0280d2c13f2defb31..078e78c6f2c44d321cce2b67e56ff876ca9aec16 100644 (file)
@@ -49,7 +49,7 @@ VideoDecoder::VideoDecoder (shared_ptr<const VideoContent> c)
 }
 
 list<ContentVideo>
-VideoDecoder::decoded_video (VideoFrame frame)
+VideoDecoder::decoded_video (Frame frame)
 {
        list<ContentVideo> output;
        
@@ -68,7 +68,7 @@ VideoDecoder::decoded_video (VideoFrame frame)
  *  @return Frames; there may be none (if there is no video there), 1 for 2D or 2 for 3D.
  */
 list<ContentVideo>
-VideoDecoder::get_video (VideoFrame frame, bool accurate)
+VideoDecoder::get_video (Frame frame, bool accurate)
 {
        /* At this stage, if we have get_video()ed before, _decoded_video will contain the last frame that this
           method returned (and possibly a few more).  If the requested frame is not in _decoded_video and it is not the next
@@ -130,7 +130,7 @@ VideoDecoder::get_video (VideoFrame frame, bool accurate)
 
 /** Fill _decoded_video from `from' up to, but not including, `to' */
 void
-VideoDecoder::fill_2d (VideoFrame from, VideoFrame to)
+VideoDecoder::fill_2d (Frame from, Frame to)
 {
        if (to == 0) {
                /* Already OK */
@@ -147,7 +147,7 @@ VideoDecoder::fill_2d (VideoFrame from, VideoFrame to)
                filler_part = _decoded_video.back().part;
        }
 
-       VideoFrame filler_frame = from;
+       Frame filler_frame = from;
        
        while (filler_frame < to) {
 
@@ -164,7 +164,7 @@ VideoDecoder::fill_2d (VideoFrame from, VideoFrame to)
 
 /** Fill _decoded_video from `from' up to, but not including, `to' */
 void
-VideoDecoder::fill_3d (VideoFrame from, VideoFrame to, Eyes eye)
+VideoDecoder::fill_3d (Frame from, Frame to, Eyes eye)
 {
        if (to == 0 && eye == EYES_LEFT) {
                /* Already OK */
@@ -192,7 +192,7 @@ VideoDecoder::fill_3d (VideoFrame from, VideoFrame to, Eyes eye)
                }
        }
 
-       VideoFrame filler_frame = from;
+       Frame filler_frame = from;
        Eyes filler_eye = _decoded_video.empty() ? EYES_LEFT : _decoded_video.back().eyes;
 
        if (_decoded_video.empty ()) {
@@ -232,7 +232,7 @@ VideoDecoder::fill_3d (VideoFrame from, VideoFrame to, Eyes eye)
        
 /** Called by subclasses when they have a video frame ready */
 void
-VideoDecoder::video (shared_ptr<const ImageProxy> image, VideoFrame frame)
+VideoDecoder::video (shared_ptr<const ImageProxy> image, Frame frame)
 {
        if (_ignore_video) {
                return;
@@ -275,8 +275,8 @@ VideoDecoder::video (shared_ptr<const ImageProxy> image, VideoFrame frame)
           and the things we are about to push.
        */
 
-       boost::optional<VideoFrame> from;
-       boost::optional<VideoFrame> to;
+       boost::optional<Frame> from;
+       boost::optional<Frame> to;
        
        if (_decoded_video.empty() && _last_seek_time && _last_seek_accurate) {
                from = _last_seek_time->frames (_video_content->video_frame_rate ());
index 5381fb21ec72a83717ca9b6f7e3368532cb3d48b..5266604c58c54fa94e5132af1146c7440d6c255f 100644 (file)
@@ -43,7 +43,7 @@ class VideoDecoder : public virtual Decoder
 public:
        VideoDecoder (boost::shared_ptr<const VideoContent> c);
 
-       std::list<ContentVideo> get_video (VideoFrame frame, bool accurate);
+       std::list<ContentVideo> get_video (Frame frame, bool accurate);
 
        boost::shared_ptr<const VideoContent> video_content () const {
                return _video_content;
@@ -60,10 +60,10 @@ protected:
        friend struct video_decoder_fill_test2;
 
        void seek (ContentTime time, bool accurate);
-       void video (boost::shared_ptr<const ImageProxy>, VideoFrame frame);
-       std::list<ContentVideo> decoded_video (VideoFrame frame);
-       void fill_2d (VideoFrame from, VideoFrame to);
-       void fill_3d (VideoFrame from, VideoFrame to, Eyes);
+       void video (boost::shared_ptr<const ImageProxy>, Frame frame);
+       std::list<ContentVideo> decoded_video (Frame frame);
+       void fill_2d (Frame from, Frame to);
+       void fill_3d (Frame from, Frame to, Eyes);
 
        boost::shared_ptr<const VideoContent> _video_content;
        std::list<ContentVideo> _decoded_video;
index c7532869e923ba99e948e39a5d0802f346e0ff4b..e3e52d09153346bb4f60e66a0fdc2ff0f9dd3756 100644 (file)
@@ -147,10 +147,10 @@ enum {
        ID_add_file
 };
 
-class Frame : public wxFrame
+class DOMFrame : public wxFrame
 {
 public:
-       Frame (wxString const & title)
+       DOMFrame (wxString const & title)
                : wxFrame (NULL, -1, title)
                , _hints_dialog (0)
                , _servers_list_dialog (0)
@@ -184,30 +184,30 @@ public:
                setup_menu (bar);
                SetMenuBar (bar);
 
-               _config_changed_connection = Config::instance()->Changed.connect (boost::bind (&Frame::config_changed, this));
+               _config_changed_connection = Config::instance()->Changed.connect (boost::bind (&DOMFrame::config_changed, this));
                config_changed ();
 
-               Bind (wxEVT_COMMAND_MENU_SELECTED, boost::bind (&Frame::file_new, this),                ID_file_new);
-               Bind (wxEVT_COMMAND_MENU_SELECTED, boost::bind (&Frame::file_open, this),               ID_file_open);
-               Bind (wxEVT_COMMAND_MENU_SELECTED, boost::bind (&Frame::file_save, this),               ID_file_save);
-               Bind (wxEVT_COMMAND_MENU_SELECTED, boost::bind (&Frame::file_properties, this),         ID_file_properties);
-               Bind (wxEVT_COMMAND_MENU_SELECTED, boost::bind (&Frame::file_history, this, _1),        ID_file_history, ID_file_history + HISTORY_SIZE);
-               Bind (wxEVT_COMMAND_MENU_SELECTED, boost::bind (&Frame::file_exit, this),               wxID_EXIT);
-               Bind (wxEVT_COMMAND_MENU_SELECTED, boost::bind (&Frame::edit_preferences, this),        wxID_PREFERENCES);
-               Bind (wxEVT_COMMAND_MENU_SELECTED, boost::bind (&Frame::content_scale_to_fit_width, this), ID_content_scale_to_fit_width);
-               Bind (wxEVT_COMMAND_MENU_SELECTED, boost::bind (&Frame::content_scale_to_fit_height, this), ID_content_scale_to_fit_height);
-               Bind (wxEVT_COMMAND_MENU_SELECTED, boost::bind (&Frame::jobs_make_dcp, this),           ID_jobs_make_dcp);
-               Bind (wxEVT_COMMAND_MENU_SELECTED, boost::bind (&Frame::jobs_make_kdms, this),          ID_jobs_make_kdms);
-               Bind (wxEVT_COMMAND_MENU_SELECTED, boost::bind (&Frame::jobs_send_dcp_to_tms, this),    ID_jobs_send_dcp_to_tms);
-               Bind (wxEVT_COMMAND_MENU_SELECTED, boost::bind (&Frame::jobs_show_dcp, this),           ID_jobs_show_dcp);
-               Bind (wxEVT_COMMAND_MENU_SELECTED, boost::bind (&Frame::tools_hints, this),             ID_tools_hints);
-               Bind (wxEVT_COMMAND_MENU_SELECTED, boost::bind (&Frame::tools_encoding_servers, this),  ID_tools_encoding_servers);
-               Bind (wxEVT_COMMAND_MENU_SELECTED, boost::bind (&Frame::tools_check_for_updates, this), ID_tools_check_for_updates);
-               Bind (wxEVT_COMMAND_MENU_SELECTED, boost::bind (&Frame::tools_restore_default_preferences, this), ID_tools_restore_default_preferences);
-               Bind (wxEVT_COMMAND_MENU_SELECTED, boost::bind (&Frame::help_about, this),              wxID_ABOUT);
-               Bind (wxEVT_COMMAND_MENU_SELECTED, boost::bind (&Frame::help_report_a_problem, this),   ID_help_report_a_problem);
-
-               Bind (wxEVT_CLOSE_WINDOW, boost::bind (&Frame::close, this, _1));
+               Bind (wxEVT_COMMAND_MENU_SELECTED, boost::bind (&DOMFrame::file_new, this),                ID_file_new);
+               Bind (wxEVT_COMMAND_MENU_SELECTED, boost::bind (&DOMFrame::file_open, this),               ID_file_open);
+               Bind (wxEVT_COMMAND_MENU_SELECTED, boost::bind (&DOMFrame::file_save, this),               ID_file_save);
+               Bind (wxEVT_COMMAND_MENU_SELECTED, boost::bind (&DOMFrame::file_properties, this),         ID_file_properties);
+               Bind (wxEVT_COMMAND_MENU_SELECTED, boost::bind (&DOMFrame::file_history, this, _1),        ID_file_history, ID_file_history + HISTORY_SIZE);
+               Bind (wxEVT_COMMAND_MENU_SELECTED, boost::bind (&DOMFrame::file_exit, this),               wxID_EXIT);
+               Bind (wxEVT_COMMAND_MENU_SELECTED, boost::bind (&DOMFrame::edit_preferences, this),        wxID_PREFERENCES);
+               Bind (wxEVT_COMMAND_MENU_SELECTED, boost::bind (&DOMFrame::content_scale_to_fit_width, this), ID_content_scale_to_fit_width);
+               Bind (wxEVT_COMMAND_MENU_SELECTED, boost::bind (&DOMFrame::content_scale_to_fit_height, this), ID_content_scale_to_fit_height);
+               Bind (wxEVT_COMMAND_MENU_SELECTED, boost::bind (&DOMFrame::jobs_make_dcp, this),           ID_jobs_make_dcp);
+               Bind (wxEVT_COMMAND_MENU_SELECTED, boost::bind (&DOMFrame::jobs_make_kdms, this),          ID_jobs_make_kdms);
+               Bind (wxEVT_COMMAND_MENU_SELECTED, boost::bind (&DOMFrame::jobs_send_dcp_to_tms, this),    ID_jobs_send_dcp_to_tms);
+               Bind (wxEVT_COMMAND_MENU_SELECTED, boost::bind (&DOMFrame::jobs_show_dcp, this),           ID_jobs_show_dcp);
+               Bind (wxEVT_COMMAND_MENU_SELECTED, boost::bind (&DOMFrame::tools_hints, this),             ID_tools_hints);
+               Bind (wxEVT_COMMAND_MENU_SELECTED, boost::bind (&DOMFrame::tools_encoding_servers, this),  ID_tools_encoding_servers);
+               Bind (wxEVT_COMMAND_MENU_SELECTED, boost::bind (&DOMFrame::tools_check_for_updates, this), ID_tools_check_for_updates);
+               Bind (wxEVT_COMMAND_MENU_SELECTED, boost::bind (&DOMFrame::tools_restore_default_preferences, this), ID_tools_restore_default_preferences);
+               Bind (wxEVT_COMMAND_MENU_SELECTED, boost::bind (&DOMFrame::help_about, this),              wxID_ABOUT);
+               Bind (wxEVT_COMMAND_MENU_SELECTED, boost::bind (&DOMFrame::help_report_a_problem, this),   ID_help_report_a_problem);
+
+               Bind (wxEVT_CLOSE_WINDOW, boost::bind (&DOMFrame::close, this, _1));
 
                /* Use a panel as the only child of the Frame so that we avoid
                   the dark-grey background on Windows.
@@ -228,10 +228,10 @@ public:
 
                set_menu_sensitivity ();
 
-               _film_editor->FileChanged.connect (bind (&Frame::file_changed, this, _1));
+               _film_editor->FileChanged.connect (bind (&DOMFrame::file_changed, this, _1));
                file_changed ("");
 
-               JobManager::instance()->ActiveJobsChanged.connect (boost::bind (&Frame::set_menu_sensitivity, this));
+               JobManager::instance()->ActiveJobsChanged.connect (boost::bind (&DOMFrame::set_menu_sensitivity, this));
 
                overall_panel->SetSizer (main_sizer);
 
@@ -825,7 +825,7 @@ private:
                */
                Config::drop ();
 
-               _frame = new Frame (_("DCP-o-matic"));
+               _frame = new DOMFrame (_("DCP-o-matic"));
                SetTopWindow (_frame);
                _frame->Maximize ();
                _frame->Show ();
@@ -943,7 +943,7 @@ private:
                }
        }
 
-       Frame* _frame;
+       DOMFrame* _frame;
        shared_ptr<wxTimer> _timer;
        string _film_to_load;
        string _film_to_create;
index ae2f3a2c59d7bf8d8e148190e5cc17477521d157..60c5e697d42ab8e396c977e46971d089e275b707 100644 (file)
@@ -57,10 +57,10 @@ setup_menu (wxMenuBar* m)
        m->Append (help, _("&Help"));
 }
 
-class Frame : public wxFrame
+class DOMFrame : public wxFrame
 {
 public:
-       Frame (wxString const & title)
+       DOMFrame (wxString const & title)
                : wxFrame (NULL, -1, title)
                , _sizer (new wxBoxSizer (wxVERTICAL))
        {
@@ -68,9 +68,9 @@ public:
                setup_menu (bar);
                SetMenuBar (bar);
 
-               Bind (wxEVT_COMMAND_MENU_SELECTED, boost::bind (&Frame::file_add_film, this), ID_file_add_film);
-               Bind (wxEVT_COMMAND_MENU_SELECTED, boost::bind (&Frame::file_quit, this),     ID_file_quit);
-               Bind (wxEVT_COMMAND_MENU_SELECTED, boost::bind (&Frame::help_about, this),    ID_help_about);
+               Bind (wxEVT_COMMAND_MENU_SELECTED, boost::bind (&DOMFrame::file_add_film, this), ID_file_add_film);
+               Bind (wxEVT_COMMAND_MENU_SELECTED, boost::bind (&DOMFrame::file_quit, this),     ID_file_quit);
+               Bind (wxEVT_COMMAND_MENU_SELECTED, boost::bind (&DOMFrame::help_about, this),    ID_help_about);
 
                wxPanel* panel = new wxPanel (this);
                wxSizer* s = new wxBoxSizer (wxHORIZONTAL);
@@ -82,15 +82,15 @@ public:
 
                wxSizer* buttons = new wxBoxSizer (wxHORIZONTAL);
                wxButton* add = new wxButton (panel, wxID_ANY, _("Add Film..."));
-               add->Bind (wxEVT_COMMAND_BUTTON_CLICKED, boost::bind (&Frame::add_film, this));
+               add->Bind (wxEVT_COMMAND_BUTTON_CLICKED, boost::bind (&DOMFrame::add_film, this));
                buttons->Add (add, 1, wxALL, 6);
 
                _sizer->Add (buttons, 0, wxALL, 6);
 
                panel->SetSizer (_sizer);
 
-               Bind (wxEVT_CLOSE_WINDOW, boost::bind (&Frame::close, this, _1));
-               Bind (wxEVT_SIZE, boost::bind (&Frame::sized, this, _1));
+               Bind (wxEVT_CLOSE_WINDOW, boost::bind (&DOMFrame::close, this, _1));
+               Bind (wxEVT_SIZE, boost::bind (&DOMFrame::sized, this, _1));
        }
 
 private:
@@ -220,7 +220,7 @@ class App : public wxApp
                */
                Config::drop ();
 
-               Frame* f = new Frame (_("DCP-o-matic Batch Converter"));
+               DOMFrame* f = new DOMFrame (_("DCP-o-matic Batch Converter"));
                SetTopWindow (f);
                f->Maximize ();
                f->Show ();
index b1f672356415f9c62b38db16bfdd9f955da12c72..e31689d3f33f469daf51b06a9e54266184fd0c82 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2014 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2014-2015 Carl Hetherington <cth@carlh.net>
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
@@ -42,8 +42,8 @@ public:
 
        bool pass (PassReason)
        {
-               AudioFrame const N = min (
-                       AudioFrame (2000),
+               Frame const N = min (
+                       Frame (2000),
                        _audio_content->audio_length().frames (_audio_content->resampled_audio_frame_rate ()) - _position
                        );
 
@@ -67,7 +67,7 @@ public:
        }
 
 private:
-       AudioFrame _position;
+       Frame _position;
 };
 
 class TestAudioContent : public AudioContent
@@ -113,7 +113,7 @@ shared_ptr<TestAudioContent> content;
 shared_ptr<TestAudioDecoder> decoder;
 
 static shared_ptr<ContentAudio>
-get (AudioFrame from, AudioFrame length)
+get (Frame from, Frame length)
 {
        decoder->seek (ContentTime::from_frames (from, content->resampled_audio_frame_rate ()), true);
        shared_ptr<ContentAudio> ca = decoder->get_audio (from, length, true);
@@ -122,7 +122,7 @@ get (AudioFrame from, AudioFrame length)
 }
 
 static void
-check (AudioFrame from, AudioFrame length)
+check (Frame from, Frame length)
 {
        shared_ptr<ContentAudio> ca = get (from, length);
        for (int i = 0; i < content->audio_channels(); ++i) {
@@ -148,8 +148,8 @@ BOOST_AUTO_TEST_CASE (audio_decoder_get_audio_test)
 
        /* Read off the end */
 
-       AudioFrame const from = content->resampled_audio_frame_rate() * 61;
-       AudioFrame const length = content->resampled_audio_frame_rate() * 4;
+       Frame const from = content->resampled_audio_frame_rate() * 61;
+       Frame const length = content->resampled_audio_frame_rate() * 4;
        shared_ptr<ContentAudio> ca = get (from, length);
        
        for (int i = 0; i < content->audio_channels(); ++i) {
index c5f43173ea57b55ada9eb972c2da0cdd8845a008..5511576521f59ce7fc5557ef55015c2f66d2e051 100644 (file)
@@ -54,11 +54,11 @@ test (boost::filesystem::path file, float fps, int gaps)
 
        BOOST_CHECK_CLOSE (decoder.video_content()->video_frame_rate(), fps, 0.01);
        
-       VideoFrame const N = decoder.video_content()->video_length().frames (decoder.video_content()->video_frame_rate ());
+       Frame const N = decoder.video_content()->video_length().frames (decoder.video_content()->video_frame_rate ());
 #ifdef DCPOMATIC_DEBUG 
        decoder.test_gaps = 0;
 #endif 
-       for (VideoFrame i = 0; i < N; ++i) {
+       for (Frame i = 0; i < N; ++i) {
                list<ContentVideo> v;
                v = decoder.get_video (i, true);
                BOOST_CHECK_EQUAL (v.size(), 1);
index 2a1a061360e328fefc6721aeb09f1c9d3b7fedbc..f00180c89106ea14eef59e291731ffda20e6e65f 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2013-2014 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2013-2015 Carl Hetherington <cth@carlh.net>
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
@@ -57,7 +57,7 @@ BOOST_AUTO_TEST_CASE (seek_zero_test)
                video_delay = ContentTime ();
        }
 
-       VideoFrame const first_frame = video_delay.round_up (content->video_frame_rate ()).frames (content->video_frame_rate ());
+       Frame const first_frame = video_delay.round_up (content->video_frame_rate ()).frames (content->video_frame_rate ());
 
        FFmpegDecoder decoder (content, film->log());
        list<ContentVideo> a = decoder.get_video (first_frame, true);