Time -> DCPTime.
authorCarl Hetherington <cth@carlh.net>
Fri, 13 Dec 2013 10:06:18 +0000 (10:06 +0000)
committerCarl Hetherington <cth@carlh.net>
Fri, 13 Dec 2013 10:06:18 +0000 (10:06 +0000)
51 files changed:
src/lib/analyse_audio_job.cc
src/lib/analyse_audio_job.h
src/lib/audio_content.cc
src/lib/audio_content.h
src/lib/audio_merger.h
src/lib/content.cc
src/lib/content.h
src/lib/decoder.h
src/lib/ffmpeg_content.cc
src/lib/ffmpeg_content.h
src/lib/ffmpeg_decoder.cc
src/lib/ffmpeg_decoder.h
src/lib/film.cc
src/lib/film.h
src/lib/image_content.cc
src/lib/image_content.h
src/lib/image_decoder.cc
src/lib/image_decoder.h
src/lib/job.cc
src/lib/player.cc
src/lib/player.h
src/lib/playlist.cc
src/lib/playlist.h
src/lib/sndfile_content.cc
src/lib/sndfile_content.h
src/lib/sndfile_decoder.cc
src/lib/sndfile_decoder.h
src/lib/subtitle_decoder.cc
src/lib/subtitle_decoder.h
src/lib/timer.cc
src/lib/timer.h
src/lib/types.h
src/lib/video_content.cc
src/lib/video_content.h
src/tools/server_test.cc
src/wx/audio_plot.cc
src/wx/film_editor.cc
src/wx/film_editor.h
src/wx/film_viewer.cc
src/wx/film_viewer.h
src/wx/timecode.cc
src/wx/timecode.h
src/wx/timeline.cc
src/wx/timeline.h
src/wx/timeline_dialog.cc
src/wx/timeline_dialog.h
src/wx/timing_panel.cc
src/wx/timing_panel.h
test/ffmpeg_seek_test.cc
test/long_ffmpeg_seek_test.cc
test/play_test.cc

index 8186f9de49b9d89baa81c04d7f454f876b8de963..3f84bf16d7cc819240b8695a3628f962cd013ab0 100644 (file)
@@ -81,7 +81,7 @@ AnalyseAudioJob::run ()
 }
 
 void
-AnalyseAudioJob::audio (shared_ptr<const AudioBuffers> b, Time)
+AnalyseAudioJob::audio (shared_ptr<const AudioBuffers> b, DCPTime)
 {
        for (int i = 0; i < b->frames(); ++i) {
                for (int j = 0; j < b->channels(); ++j) {
index 3d4881983b5234572ce40a47455c5b849a620328..2e93ef500ffcd05542f558d74ae4587a53f0fc9d 100644 (file)
@@ -33,7 +33,7 @@ public:
        void run ();
 
 private:
-       void audio (boost::shared_ptr<const AudioBuffers>, Time);
+       void audio (boost::shared_ptr<const AudioBuffers>, DCPTime);
 
        boost::weak_ptr<AudioContent> _content;
        OutputAudioFrame _done;
index 0c458668118f91659e4261674a174e6fe2089183..de743571bf218b7e747b7792b46a057aa0965918 100644 (file)
@@ -39,7 +39,7 @@ int const AudioContentProperty::AUDIO_GAIN = 203;
 int const AudioContentProperty::AUDIO_DELAY = 204;
 int const AudioContentProperty::AUDIO_MAPPING = 205;
 
-AudioContent::AudioContent (shared_ptr<const Film> f, Time s)
+AudioContent::AudioContent (shared_ptr<const Film> f, DCPTime s)
        : Content (f, s)
        , _audio_gain (0)
        , _audio_delay (0)
@@ -157,7 +157,7 @@ AudioContent::technical_summary () const
  *  the `controlling' video content is active.
  */
 AudioContent::Frame
-AudioContent::time_to_content_audio_frames (Time t, Time at) const
+AudioContent::time_to_content_audio_frames (DCPTime t, DCPTime at) const
 {
        shared_ptr<const Film> film = _film.lock ();
        assert (film);
index 10114e10d606e1f13f9920f83898ff59f51d50af..e1b38bd97003c8c19b456b082e763750dc17ae25 100644 (file)
@@ -43,7 +43,7 @@ class AudioContent : public virtual Content
 public:
        typedef int64_t Frame;
        
-       AudioContent (boost::shared_ptr<const Film>, Time);
+       AudioContent (boost::shared_ptr<const Film>, DCPTime);
        AudioContent (boost::shared_ptr<const Film>, boost::filesystem::path);
        AudioContent (boost::shared_ptr<const Film>, boost::shared_ptr<const cxml::Node>);
        AudioContent (boost::shared_ptr<const Film>, std::vector<boost::shared_ptr<Content> >);
@@ -74,7 +74,7 @@ public:
                return _audio_delay;
        }
 
-       Frame time_to_content_audio_frames (Time, Time) const;
+       Frame time_to_content_audio_frames (DCPTime, DCPTime) const;
        
 private:
        /** Gain to apply to audio in dB */
index 6ad33fb37c898ad267083854fad35ecd3fcf961a..2a1cc761b1f141aef886d3de88fb09957ec44b15 100644 (file)
@@ -102,7 +102,7 @@ public:
        }
 
        void
-       clear (Time t)
+       clear (DCPTime t)
        {
                _last_pull = t;
                _buffers.reset (new AudioBuffers (_buffers->channels(), 0));
index f09012765a7cbe7616d1e2ae40a870981b74604a..7db349617ec031964648b19f0c3387a332b12b55 100644 (file)
@@ -54,7 +54,7 @@ Content::Content (shared_ptr<const Film> f)
 
 }
 
-Content::Content (shared_ptr<const Film> f, Time p)
+Content::Content (shared_ptr<const Film> f, DCPTime p)
        : _film (f)
        , _position (p)
        , _trim_start (0)
@@ -83,9 +83,9 @@ Content::Content (shared_ptr<const Film> f, shared_ptr<const cxml::Node> node)
                _paths.push_back ((*i)->content ());
        }
        _digest = node->string_child ("Digest");
-       _position = node->number_child<Time> ("Position");
-       _trim_start = node->number_child<Time> ("TrimStart");
-       _trim_end = node->number_child<Time> ("TrimEnd");
+       _position = node->number_child<DCPTime> ("Position");
+       _trim_start = node->number_child<DCPTime> ("TrimStart");
+       _trim_end = node->number_child<DCPTime> ("TrimEnd");
 }
 
 Content::Content (shared_ptr<const Film> f, vector<shared_ptr<Content> > c)
@@ -146,7 +146,7 @@ Content::signal_changed (int p)
 }
 
 void
-Content::set_position (Time p)
+Content::set_position (DCPTime p)
 {
        {
                boost::mutex::scoped_lock lm (_mutex);
@@ -157,7 +157,7 @@ Content::set_position (Time p)
 }
 
 void
-Content::set_trim_start (Time t)
+Content::set_trim_start (DCPTime t)
 {
        {
                boost::mutex::scoped_lock lm (_mutex);
@@ -168,7 +168,7 @@ Content::set_trim_start (Time t)
 }
 
 void
-Content::set_trim_end (Time t)
+Content::set_trim_end (DCPTime t)
 {
        {
                boost::mutex::scoped_lock lm (_mutex);
@@ -200,7 +200,7 @@ Content::technical_summary () const
        return String::compose ("%1 %2 %3", path_summary(), digest(), position());
 }
 
-Time
+DCPTime
 Content::length_after_trim () const
 {
        return full_length() - trim_start() - trim_end();
@@ -210,7 +210,7 @@ Content::length_after_trim () const
  *  @return true if this time is trimmed by our trim settings.
  */
 bool
-Content::trimmed (Time t) const
+Content::trimmed (DCPTime t) const
 {
        return (t < trim_start() || t > (full_length() - trim_end ()));
 }
index 9cf6d866ab04906b3288188792c66f9403b8592e..1eee02e01463e434bd65acd3a1bac53bd7f72170 100644 (file)
@@ -49,7 +49,7 @@ class Content : public boost::enable_shared_from_this<Content>, public boost::no
 {
 public:
        Content (boost::shared_ptr<const Film>);
-       Content (boost::shared_ptr<const Film>, Time);
+       Content (boost::shared_ptr<const Film>, DCPTime);
        Content (boost::shared_ptr<const Film>, boost::filesystem::path);
        Content (boost::shared_ptr<const Film>, boost::shared_ptr<const cxml::Node>);
        Content (boost::shared_ptr<const Film>, std::vector<boost::shared_ptr<Content> >);
@@ -60,7 +60,7 @@ public:
        virtual std::string technical_summary () const;
        virtual std::string information () const = 0;
        virtual void as_xml (xmlpp::Node *) const;
-       virtual Time full_length () const = 0;
+       virtual DCPTime full_length () const = 0;
        virtual std::string identifier () const;
 
        boost::shared_ptr<Content> clone () const;
@@ -92,41 +92,41 @@ public:
                return _digest;
        }
 
-       void set_position (Time);
+       void set_position (DCPTime);
 
-       /** Time that this content starts; i.e. the time that the first
+       /** DCPTime that this content starts; i.e. the time that the first
         *  bit of the content (trimmed or not) will happen.
         */
-       Time position () const {
+       DCPTime position () const {
                boost::mutex::scoped_lock lm (_mutex);
                return _position;
        }
 
-       void set_trim_start (Time);
+       void set_trim_start (DCPTime);
 
-       Time trim_start () const {
+       DCPTime trim_start () const {
                boost::mutex::scoped_lock lm (_mutex);
                return _trim_start;
        }
 
-       void set_trim_end (Time);
+       void set_trim_end (DCPTime);
        
-       Time trim_end () const {
+       DCPTime trim_end () const {
                boost::mutex::scoped_lock lm (_mutex);
                return _trim_end;
        }
        
-       Time end () const {
+       DCPTime end () const {
                return position() + length_after_trim() - 1;
        }
 
-       Time length_after_trim () const;
+       DCPTime length_after_trim () const;
        
        void set_change_signals_frequent (bool f) {
                _change_signals_frequent = f;
        }
 
-       bool trimmed (Time) const;
+       bool trimmed (DCPTime) const;
 
        boost::signals2::signal<void (boost::weak_ptr<Content>, int, bool)> Changed;
 
@@ -145,9 +145,9 @@ protected:
        
 private:
        std::string _digest;
-       Time _position;
-       Time _trim_start;
-       Time _trim_end;
+       DCPTime _position;
+       DCPTime _trim_start;
+       DCPTime _trim_end;
        bool _change_signals_frequent;
 };
 
index 908d3aae51c3948803199af980ae4f7bb1e1f157..aa36d41b496341ea7d8d66b8436171b11231e5b9 100644 (file)
@@ -50,7 +50,7 @@ public:
         *  time.  Pass accurate = true to try harder to get close to
         *  the request.
         */
-       virtual void seek (Time time, bool accurate) = 0;
+       virtual void seek (DCPTime time, bool accurate) = 0;
 
        virtual bool done () const = 0;
 
index b6df2e9295ea68340b770f1edda7151168548514..65a8d24f1ce3f073f697b4e364495246511d78e6 100644 (file)
@@ -445,7 +445,7 @@ FFmpegSubtitleStream::as_xml (xmlpp::Node* root) const
        FFmpegStream::as_xml (root);
 }
 
-Time
+DCPTime
 FFmpegContent::full_length () const
 {
        shared_ptr<const Film> film = _film.lock ();
index 7ff159b852b4cb69df4004b1f6a813ad2131e182..ba73c0f9b23cdf00d0812417fd1e70a0f11ef2d8 100644 (file)
@@ -134,7 +134,7 @@ public:
        std::string technical_summary () const;
        std::string information () const;
        void as_xml (xmlpp::Node *) const;
-       Time full_length () const;
+       DCPTime full_length () const;
 
        std::string identifier () const;
        
index ed0574c6140ac24021b17b56e88a14a11f27b7de..2cb18c557e62a59c0bc731458a360649f686ebe8 100644 (file)
@@ -351,7 +351,7 @@ FFmpegDecoder::minimal_run (boost::function<bool (int)> finished)
 }
 
 bool
-FFmpegDecoder::seek_overrun_finished (Time seek) const
+FFmpegDecoder::seek_overrun_finished (DCPTime seek) const
 {
        return (
                _video_position >= _ffmpeg_content->time_to_content_video_frames (seek) ||
@@ -366,7 +366,7 @@ FFmpegDecoder::seek_final_finished (int n, int done) const
 }
 
 void
-FFmpegDecoder::seek_and_flush (Time t)
+FFmpegDecoder::seek_and_flush (DCPTime t)
 {
        int64_t const initial_v = ((_ffmpeg_content->time_to_content_video_frames (t) / _ffmpeg_content->video_frame_rate()) - _video_pts_offset) /
                av_q2d (_format_context->streams[_video_stream]->time_base);
@@ -394,15 +394,15 @@ FFmpegDecoder::seek_and_flush (Time t)
 }
 
 void
-FFmpegDecoder::seek (Time time, bool accurate)
+FFmpegDecoder::seek (DCPTime time, bool accurate)
 {
        /* If we are doing an accurate seek, our initial shot will be 200ms (200 being
           a number plucked from the air) earlier than we want to end up.  The loop below
           will hopefully then step through to where we want to be.
        */
 
-       Time pre_roll = accurate ? (0.2 * TIME_HZ) : 0;
-       Time initial_seek = time - pre_roll;
+       DCPTime pre_roll = accurate ? (0.2 * TIME_HZ) : 0;
+       DCPTime initial_seek = time - pre_roll;
        if (initial_seek < 0) {
                initial_seek = 0;
        }
@@ -625,8 +625,8 @@ FFmpegDecoder::decode_subtitle_packet ()
        double const packet_time = static_cast<double> (sub.pts) / AV_TIME_BASE;
        
        /* hence start time for this sub */
-       Time const from = (packet_time + (double (sub.start_display_time) / 1e3)) * TIME_HZ;
-       Time const to = (packet_time + (double (sub.end_display_time) / 1e3)) * TIME_HZ;
+       DCPTime const from = (packet_time + (double (sub.start_display_time) / 1e3)) * TIME_HZ;
+       DCPTime const to = (packet_time + (double (sub.end_display_time) / 1e3)) * TIME_HZ;
 
        AVSubtitleRect const * rect = sub.rects[0];
 
index f54ee2496fa0479fcdcea793e576568bd1452073..06e0ef8a551a37804caaeea9b415868ac596d2f6 100644 (file)
@@ -52,7 +52,7 @@ public:
        ~FFmpegDecoder ();
 
        void pass ();
-       void seek (Time time, bool);
+       void seek (DCPTime time, bool);
        bool done () const;
 
 private:
@@ -74,7 +74,7 @@ private:
        void maybe_add_subtitle ();
        boost::shared_ptr<AudioBuffers> deinterleave_audio (uint8_t** data, int size);
 
-       bool seek_overrun_finished (Time) const;
+       bool seek_overrun_finished (DCPTime) const;
        bool seek_final_finished (int, int) const;
        int minimal_run (boost::function<bool (int)>);
        void seek_and_flush (int64_t);
index b61991a45ca4a60dfc3bbcc1c2676b78611ebdf2..8e93667d5e54ad1ccb7474257e6536ce97a1bd27 100644 (file)
@@ -842,7 +842,7 @@ Film::move_content_later (shared_ptr<Content> c)
        _playlist->move_later (c);
 }
 
-Time
+DCPTime
 Film::length () const
 {
        return _playlist->length ();
@@ -867,7 +867,7 @@ Film::content_paths_valid () const
 }
 
 FrameRateChange
-Film::active_frame_rate_change (Time t) const
+Film::active_frame_rate_change (DCPTime t) const
 {
        return _playlist->active_frame_rate_change (t, video_frame_rate ());
 }
@@ -891,24 +891,24 @@ Film::playlist_changed ()
 }      
 
 OutputAudioFrame
-Film::time_to_audio_frames (Time t) const
+Film::time_to_audio_frames (DCPTime t) const
 {
        return t * audio_frame_rate () / TIME_HZ;
 }
 
 OutputVideoFrame
-Film::time_to_video_frames (Time t) const
+Film::time_to_video_frames (DCPTime t) const
 {
        return t * video_frame_rate () / TIME_HZ;
 }
 
-Time
+DCPTime
 Film::audio_frames_to_time (OutputAudioFrame f) const
 {
        return f * TIME_HZ / audio_frame_rate ();
 }
 
-Time
+DCPTime
 Film::video_frames_to_time (OutputVideoFrame f) const
 {
        return f * TIME_HZ / video_frame_rate ();
index 6573bd5b706369637914750685c7ba42afbcc898..a0ace99811005d5b93bffcffa6d7cbb039f7a539 100644 (file)
@@ -103,19 +103,19 @@ public:
 
        OutputAudioFrame audio_frame_rate () const;
 
-       OutputAudioFrame time_to_audio_frames (Time) const;
-       OutputVideoFrame time_to_video_frames (Time) const;
-       Time video_frames_to_time (OutputVideoFrame) const;
-       Time audio_frames_to_time (OutputAudioFrame) const;
+       OutputAudioFrame time_to_audio_frames (DCPTime) const;
+       OutputVideoFrame time_to_video_frames (DCPTime) const;
+       DCPTime video_frames_to_time (OutputVideoFrame) const;
+       DCPTime audio_frames_to_time (OutputAudioFrame) const;
 
        /* Proxies for some Playlist methods */
 
        ContentList content () const;
-       Time length () const;
+       DCPTime length () const;
        bool has_subtitles () const;
        OutputVideoFrame best_video_frame_rate () const;
        bool content_paths_valid () const;
-       FrameRateChange active_frame_rate_change (Time) const;
+       FrameRateChange active_frame_rate_change (DCPTime) const;
 
        libdcp::KDM
        make_kdm (
index 8eba33f3af20e2a780abac3f97b5ce24a8332992..0f952607159f99e4da16b6990f7efac0a32a541b 100644 (file)
@@ -120,7 +120,7 @@ ImageContent::set_video_length (VideoContent::Frame len)
        signal_changed (ContentProperty::LENGTH);
 }
 
-Time
+DCPTime
 ImageContent::full_length () const
 {
        shared_ptr<const Film> film = _film.lock ();
index 47c5a20e3486298e2e49d307a0136a21a4b80243..88c178faad35578cc5e7143f334c9feb1d22dbef 100644 (file)
@@ -41,7 +41,7 @@ public:
        std::string summary () const;
        std::string technical_summary () const;
        void as_xml (xmlpp::Node *) const;
-       Time full_length () const;
+       DCPTime full_length () const;
 
        std::string identifier () const;
        
index bf3bc344b9e90b7e8b0d8d5413fd12d13b70722a..723690247c1ee380f9cffa08f1cd6547501f5393 100644 (file)
@@ -77,7 +77,7 @@ ImageDecoder::pass ()
 }
 
 void
-ImageDecoder::seek (Time time, bool)
+ImageDecoder::seek (DCPTime time, bool)
 {
        _video_position = _video_content->time_to_content_video_frames (time);
 }
index 1f5f0b9d2310c463ea3f9bf4124b01a7b63c8d0c..346fffdf78d5a14d977ae9b3c41afd0c3b30762c 100644 (file)
@@ -37,7 +37,7 @@ public:
        /* Decoder */
 
        void pass ();
-       void seek (Time, bool);
+       void seek (DCPTime, bool);
        bool done () const;
 
 private:
index 9981934ec93767d1286ff459acbe3845de9af821..05a90524c9818615112b77464da5a56bd154ec69 100644 (file)
@@ -198,7 +198,7 @@ Job::set_state (State s)
        }
 }
 
-/** @return Time (in seconds) that this sub-job has been running */
+/** @return DCPTime (in seconds) that this sub-job has been running */
 int
 Job::elapsed_time () const
 {
index 184c9811f5f6be2f40ebd5e71dc4dc4a330533fc..be22ae2421f54c6508aac35db80db0d2fd2c329f 100644 (file)
@@ -100,10 +100,10 @@ public:
        
        shared_ptr<Content> content;
        shared_ptr<Decoder> decoder;
-       /** Time of the last video we emitted relative to the start of the DCP */
-       Time video_position;
-       /** Time of the last audio we emitted relative to the start of the DCP */
-       Time audio_position;
+       /** DCPTime of the last video we emitted relative to the start of the DCP */
+       DCPTime video_position;
+       /** DCPTime of the last audio we emitted relative to the start of the DCP */
+       DCPTime audio_position;
 
        IncomingVideo repeat_video;
        int repeat_to_do;
@@ -146,7 +146,7 @@ Player::pass ()
                setup_pieces ();
        }
 
-       Time earliest_t = TIME_MAX;
+       DCPTime earliest_t = TIME_MAX;
        shared_ptr<Piece> earliest;
        enum {
                VIDEO,
@@ -218,7 +218,7 @@ Player::pass ()
        }
 
        if (_audio) {
-               boost::optional<Time> audio_done_up_to;
+               boost::optional<DCPTime> audio_done_up_to;
                for (list<shared_ptr<Piece> >::iterator i = _pieces.begin(); i != _pieces.end(); ++i) {
                        if ((*i)->decoder->done ()) {
                                continue;
@@ -230,7 +230,7 @@ Player::pass ()
                }
 
                if (audio_done_up_to) {
-                       TimedAudioBuffers<Time> tb = _audio_merger.pull (audio_done_up_to.get ());
+                       TimedAudioBuffers<DCPTime> tb = _audio_merger.pull (audio_done_up_to.get ());
                        Audio (tb.audio, tb.time);
                        _audio_position += _film->audio_frames_to_time (tb.audio->frames ());
                }
@@ -241,7 +241,7 @@ Player::pass ()
 
 /** @param extra Amount of extra time to add to the content frame's time (for repeat) */
 void
-Player::process_video (weak_ptr<Piece> weak_piece, shared_ptr<const Image> image, Eyes eyes, bool same, VideoContent::Frame frame, Time extra)
+Player::process_video (weak_ptr<Piece> weak_piece, shared_ptr<const Image> image, Eyes eyes, bool same, VideoContent::Frame frame, DCPTime extra)
 {
        /* Keep a note of what came in so that we can repeat it if required */
        _last_incoming_video.weak_piece = weak_piece;
@@ -264,12 +264,12 @@ Player::process_video (weak_ptr<Piece> weak_piece, shared_ptr<const Image> image
                return;
        }
 
-       Time const relative_time = (frame * frc.factor() * TIME_HZ / _film->video_frame_rate());
+       DCPTime const relative_time = (frame * frc.factor() * TIME_HZ / _film->video_frame_rate());
        if (content->trimmed (relative_time)) {
                return;
        }
 
-       Time const time = content->position() + relative_time + extra - content->trim_start ();
+       DCPTime const time = content->position() + relative_time + extra - content->trim_start ();
        float const ratio = content->ratio() ? content->ratio()->ratio() : content->video_size_after_crop().ratio();
        libdcp::Size const image_size = fit_ratio_within (ratio, _video_container_size);
 
@@ -333,13 +333,13 @@ Player::process_audio (weak_ptr<Piece> weak_piece, shared_ptr<const AudioBuffers
                frame = ro.second;
        }
        
-       Time const relative_time = _film->audio_frames_to_time (frame);
+       DCPTime const relative_time = _film->audio_frames_to_time (frame);
 
        if (content->trimmed (relative_time)) {
                return;
        }
 
-       Time time = content->position() + (content->audio_delay() * TIME_HZ / 1000) + relative_time - content->trim_start ();
+       DCPTime time = content->position() + (content->audio_delay() * TIME_HZ / 1000) + relative_time - content->trim_start ();
        
        /* Remap channels */
        shared_ptr<AudioBuffers> dcp_mapped (new AudioBuffers (_film->audio_channels(), audio->frames()));
@@ -374,7 +374,7 @@ Player::process_audio (weak_ptr<Piece> weak_piece, shared_ptr<const AudioBuffers
 void
 Player::flush ()
 {
-       TimedAudioBuffers<Time> tb = _audio_merger.flush ();
+       TimedAudioBuffers<DCPTime> tb = _audio_merger.flush ();
        if (tb.audio) {
                Audio (tb.audio, tb.time);
                _audio_position += _film->audio_frames_to_time (tb.audio->frames ());
@@ -395,7 +395,7 @@ Player::flush ()
  *  @return true on error
  */
 void
-Player::seek (Time t, bool accurate)
+Player::seek (DCPTime t, bool accurate)
 {
        if (!_have_valid_pieces) {
                setup_pieces ();
@@ -412,8 +412,8 @@ Player::seek (Time t, bool accurate)
                }
 
                /* s is the offset of t from the start position of this content */
-               Time s = t - vc->position ();
-               s = max (static_cast<Time> (0), s);
+               DCPTime s = t - vc->position ();
+               s = max (static_cast<DCPTime> (0), s);
                s = min (vc->length_after_trim(), s);
 
                /* Hence set the piece positions to the `global' time */
@@ -613,7 +613,7 @@ Player::film_changed (Film::Property p)
 }
 
 void
-Player::process_subtitle (weak_ptr<Piece> weak_piece, shared_ptr<Image> image, dcpomatic::Rect<double> rect, Time from, Time to)
+Player::process_subtitle (weak_ptr<Piece> weak_piece, shared_ptr<Image> image, dcpomatic::Rect<double> rect, DCPTime from, DCPTime to)
 {
        _in_subtitle.piece = weak_piece;
        _in_subtitle.image = image;
index 11cc99e7793005630a5e9ce1014e5827bdf55ed4..364d66249ca693cf50fb8325a165d64fdbf68a8b 100644 (file)
@@ -50,7 +50,7 @@ public:
        Eyes eyes;
        bool same;
        VideoContent::Frame frame;
-       Time extra;
+       DCPTime extra;
 };
 
 /** A wrapper for an Image which contains some pending operations; these may
@@ -84,9 +84,9 @@ public:
        void disable_audio ();
 
        bool pass ();
-       void seek (Time, bool);
+       void seek (DCPTime, bool);
 
-       Time video_position () const {
+       DCPTime video_position () const {
                return _video_position;
        }
 
@@ -101,10 +101,10 @@ public:
         *  Fourth parameter is true if the image is the same as the last one that was emitted.
         *  Fifth parameter is the time.
         */
-       boost::signals2::signal<void (boost::shared_ptr<PlayerImage>, Eyes, ColourConversion, bool, Time)> Video;
+       boost::signals2::signal<void (boost::shared_ptr<PlayerImage>, Eyes, ColourConversion, bool, DCPTime)> Video;
        
        /** Emitted when some audio data is ready */
-       boost::signals2::signal<void (boost::shared_ptr<const AudioBuffers>, Time)> Audio;
+       boost::signals2::signal<void (boost::shared_ptr<const AudioBuffers>, DCPTime)> Audio;
 
        /** Emitted when something has changed such that if we went back and emitted
         *  the last frame again it would look different.  This is not emitted after
@@ -118,13 +118,13 @@ private:
        friend class PlayerWrapper;
        friend class Piece;
 
-       void process_video (boost::weak_ptr<Piece>, boost::shared_ptr<const Image>, Eyes, bool, VideoContent::Frame, Time);
+       void process_video (boost::weak_ptr<Piece>, boost::shared_ptr<const Image>, Eyes, bool, VideoContent::Frame, DCPTime);
        void process_audio (boost::weak_ptr<Piece>, boost::shared_ptr<const AudioBuffers>, AudioContent::Frame);
-       void process_subtitle (boost::weak_ptr<Piece>, boost::shared_ptr<Image>, dcpomatic::Rect<double>, Time, Time);
+       void process_subtitle (boost::weak_ptr<Piece>, boost::shared_ptr<Image>, dcpomatic::Rect<double>, DCPTime, DCPTime);
        void setup_pieces ();
        void playlist_changed ();
        void content_changed (boost::weak_ptr<Content>, int, bool);
-       void do_seek (Time, bool);
+       void do_seek (DCPTime, bool);
        void flush ();
        void emit_black ();
        void emit_silence (OutputAudioFrame);
@@ -143,11 +143,11 @@ private:
        std::list<boost::shared_ptr<Piece> > _pieces;
 
        /** The time after the last video that we emitted */
-       Time _video_position;
+       DCPTime _video_position;
        /** The time after the last audio that we emitted */
-       Time _audio_position;
+       DCPTime _audio_position;
 
-       AudioMerger<Time, AudioContent::Frame> _audio_merger;
+       AudioMerger<DCPTime, AudioContent::Frame> _audio_merger;
 
        libdcp::Size _video_container_size;
        boost::shared_ptr<PlayerImage> _black_frame;
@@ -157,15 +157,15 @@ private:
                boost::weak_ptr<Piece> piece;
                boost::shared_ptr<Image> image;
                dcpomatic::Rect<double> rect;
-               Time from;
-               Time to;
+               DCPTime from;
+               DCPTime to;
        } _in_subtitle;
 
        struct {
                boost::shared_ptr<Image> image;
                Position<int> position;
-               Time from;
-               Time to;
+               DCPTime from;
+               DCPTime to;
        } _out_subtitle;
 
 #ifdef DCPOMATIC_DEBUG
index 581235adca4c9d7ebfe163863c586d5fda06715c..9fc62f8be6e5345a1bebecca6d3cd9293e6712a2 100644 (file)
@@ -81,7 +81,7 @@ Playlist::maybe_sequence_video ()
        _sequencing_video = true;
        
        ContentList cl = _content;
-       Time next = 0;
+       DCPTime next = 0;
        for (ContentList::iterator i = _content.begin(); i != _content.end(); ++i) {
                if (!dynamic_pointer_cast<VideoContent> (*i)) {
                        continue;
@@ -254,10 +254,10 @@ Playlist::best_dcp_frame_rate () const
        return best->dcp;
 }
 
-Time
+DCPTime
 Playlist::length () const
 {
-       Time len = 0;
+       DCPTime len = 0;
        for (ContentList::const_iterator i = _content.begin(); i != _content.end(); ++i) {
                len = max (len, (*i)->end() + 1);
        }
@@ -279,10 +279,10 @@ Playlist::reconnect ()
        }
 }
 
-Time
+DCPTime
 Playlist::video_end () const
 {
-       Time end = 0;
+       DCPTime end = 0;
        for (ContentList::const_iterator i = _content.begin(); i != _content.end(); ++i) {
                if (dynamic_pointer_cast<const VideoContent> (*i)) {
                        end = max (end, (*i)->end ());
@@ -293,7 +293,7 @@ Playlist::video_end () const
 }
 
 FrameRateChange
-Playlist::active_frame_rate_change (Time t, int dcp_video_frame_rate) const
+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);
@@ -331,7 +331,7 @@ Playlist::content () const
 void
 Playlist::repeat (ContentList c, int n)
 {
-       pair<Time, Time> range (TIME_MAX, 0);
+       pair<DCPTime, DCPTime> range (TIME_MAX, 0);
        for (ContentList::iterator i = c.begin(); i != c.end(); ++i) {
                range.first = min (range.first, (*i)->position ());
                range.second = max (range.second, (*i)->position ());
@@ -339,7 +339,7 @@ Playlist::repeat (ContentList c, int n)
                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 ();
@@ -372,7 +372,7 @@ Playlist::move_earlier (shared_ptr<Content> c)
                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 ());
@@ -399,7 +399,7 @@ Playlist::move_later (shared_ptr<Content> c)
                return;
        }
 
-       Time const p = (*next)->position ();
+       DCPTime const p = (*next)->position ();
        (*next)->set_position (c->position ());
        c->set_position (p + c->length_after_trim ());
        sort (_content.begin(), _content.end(), ContentSorter ());
index d3cf50a27b605c7b6cab2be544d45e1fbbb3a1db..a985bf93da07669795394e468d4c682c2d2ea3e2 100644 (file)
@@ -71,11 +71,11 @@ public:
 
        std::string video_identifier () const;
 
-       Time length () const;
+       DCPTime length () const;
        
        int best_dcp_frame_rate () const;
-       Time video_end () const;
-       FrameRateChange active_frame_rate_change (Time, int dcp_frame_rate) const;
+       DCPTime video_end () const;
+       FrameRateChange active_frame_rate_change (DCPTime, int dcp_frame_rate) const;
 
        void set_sequence_video (bool);
        void maybe_sequence_video ();
index 89db865d530b2d721cff9d0b82a392d16ec792a8..1c872cf96ef165d6685c8fe01caadbce36ba2509 100644 (file)
@@ -141,7 +141,7 @@ SndfileContent::as_xml (xmlpp::Node* node) const
        _audio_mapping.as_xml (node->add_child("AudioMapping"));
 }
 
-Time
+DCPTime
 SndfileContent::full_length () const
 {
        shared_ptr<const Film> film = _film.lock ();
index 701ff16b24bd0dbbdf2d75e5708e2be3c7ce9e45..c88764c1b22808e953d696d55f3cc50d2ce017de 100644 (file)
@@ -44,7 +44,7 @@ public:
        std::string technical_summary () const;
        std::string information () const;
        void as_xml (xmlpp::Node *) const;
-       Time full_length () const;
+       DCPTime full_length () const;
 
        /* AudioContent */
        int audio_channels () const {
index 0cca25257f538f0a25e650d054e0df3610671e62..b5a7f139bbf586722ced1bcb1892aa762b1b5fb1 100644 (file)
@@ -120,7 +120,7 @@ SndfileDecoder::done () const
 }
 
 void
-SndfileDecoder::seek (Time t, bool accurate)
+SndfileDecoder::seek (DCPTime t, bool accurate)
 {
        /* XXX */
 }
index c3db1c294a6f805d97290aa2ccd83172d2a4e0ad..470cab956d783bba23ff07371b904e1b9b54772c 100644 (file)
@@ -30,7 +30,7 @@ public:
        ~SndfileDecoder ();
 
        void pass ();
-       void seek (Time, bool);
+       void seek (DCPTime, bool);
        bool done () const;
 
        int audio_channels () const;
index c06f3d718a812e9403266e3ccf91f5c494fa69b8..8dbc01dc246da5f12e5f454d930b79f96420fcd7 100644 (file)
@@ -33,7 +33,7 @@ SubtitleDecoder::SubtitleDecoder (shared_ptr<const Film> f)
  *  Image may be 0 to say that there is no current subtitle.
  */
 void
-SubtitleDecoder::subtitle (shared_ptr<Image> image, dcpomatic::Rect<double> rect, Time from, Time to)
+SubtitleDecoder::subtitle (shared_ptr<Image> image, dcpomatic::Rect<double> rect, DCPTime from, DCPTime to)
 {
        Subtitle (image, rect, from, to);
 }
index eeeadbd3f65fdda2f9ee46b90c9745f2ce713f8f..8a2a0c1b2548d65002c13356ce1d9f8e59cdd197 100644 (file)
@@ -23,7 +23,7 @@
 #include "types.h"
 
 class Film;
-class TimedSubtitle;
+class DCPTimedSubtitle;
 class Image;
 
 class SubtitleDecoder : public virtual Decoder
@@ -31,8 +31,8 @@ class SubtitleDecoder : public virtual Decoder
 public:
        SubtitleDecoder (boost::shared_ptr<const Film>);
 
-       boost::signals2::signal<void (boost::shared_ptr<Image>, dcpomatic::Rect<double>, Time, Time)> Subtitle;
+       boost::signals2::signal<void (boost::shared_ptr<Image>, dcpomatic::Rect<double>, DCPTime, DCPTime)> Subtitle;
 
 protected:
-       void subtitle (boost::shared_ptr<Image>, dcpomatic::Rect<double>, Time, Time);
+       void subtitle (boost::shared_ptr<Image>, dcpomatic::Rect<double>, DCPTime, DCPTime);
 };
index 69a7e3aa94b29e4988051f6ca61898d996b94f09..a20a08b072de8b0a0d7aca9f9a6c3aaf79bc018c 100644 (file)
 using namespace std;
 
 /** @param n Name to use when giving output */
-PeriodTimer::PeriodTimer (string n)
+PeriodDCPTimer::PeriodDCPTimer (string n)
        : _name (n)
 {
        gettimeofday (&_start, 0);
 }
 
-/** Destroy PeriodTimer and output the time elapsed since its construction */
-PeriodTimer::~PeriodTimer ()
+/** Destroy PeriodDCPTimer and output the time elapsed since its construction */
+PeriodDCPTimer::~PeriodDCPTimer ()
 {
        struct timeval stop;
        gettimeofday (&stop, 0);
@@ -48,7 +48,7 @@ PeriodTimer::~PeriodTimer ()
 /** @param n Name to use when giving output.
  *  @param s Initial state.
  */
-StateTimer::StateTimer (string n, string s)
+StateDCPTimer::StateDCPTimer (string n, string s)
        : _name (n)
 {
        struct timeval t;
@@ -59,7 +59,7 @@ StateTimer::StateTimer (string n, string s)
 
 /** @param s New state that the caller is in */
 void
-StateTimer::set_state (string s)
+StateDCPTimer::set_state (string s)
 {
        double const last = _time;
        struct timeval t;
@@ -74,8 +74,8 @@ StateTimer::set_state (string s)
        _state = s;
 }
 
-/** Destroy StateTimer and generate a summary of the state timings on cout */
-StateTimer::~StateTimer ()
+/** Destroy StateDCPTimer and generate a summary of the state timings on cout */
+StateDCPTimer::~StateDCPTimer ()
 {
        if (_state.empty ()) {
                return;
index 4a5aa12de331c0fe5b024144bc18923e76ccc8eb..8ec392aa63a212dc708356d819f58d1676393e2e 100644 (file)
 #include <map>
 #include <sys/time.h>
 
-/** @class PeriodTimer
+/** @class PeriodDCPTimer
  *  @brief A class to allow timing of a period within the caller.
  *
  *  On destruction, it will output the time since its construction.
  */
-class PeriodTimer
+class PeriodDCPTimer
 {
 public:
-       PeriodTimer (std::string n);
-       ~PeriodTimer ();
+       PeriodDCPTimer (std::string n);
+       ~PeriodDCPTimer ();
        
 private:
 
@@ -48,19 +48,19 @@ private:
        struct timeval _start;
 };
 
-/** @class StateTimer
+/** @class StateDCPTimer
  *  @brief A class to allow measurement of the amount of time a program
  *  spends in one of a set of states.
  *
  *  Once constructed, the caller can call set_state() whenever
- *  its state changes. When StateTimer is destroyed, it will
+ *  its state changes. When StateDCPTimer is destroyed, it will
  *  output (to cout) a summary of the time spent in each state.
  */
-class StateTimer
+class StateDCPTimer
 {
 public:
-       StateTimer (std::string n, std::string s);
-       ~StateTimer ();
+       StateDCPTimer (std::string n, std::string s);
+       ~StateDCPTimer ();
 
        void set_state (std::string s);
 
index 448b6c154bac00faae280e78a5c927f1bf1ea5a9..1ab6a94d4244f18c38ca291e3e546e40ed703f56 100644 (file)
@@ -38,9 +38,10 @@ class AudioBuffers;
  */
 #define SERVER_LINK_VERSION 1
 
-typedef int64_t Time;
+typedef int64_t DCPTime;
 #define TIME_MAX INT64_MAX
-#define TIME_HZ         ((Time) 96000)
+#define TIME_HZ         ((DCPTime) 96000)
+typedef int64_t ContentTime;
 typedef int64_t OutputAudioFrame;
 typedef int    OutputVideoFrame;
 typedef std::vector<boost::shared_ptr<Content> > ContentList;
index c61a2455fcae9e8a8f7ed5545a6562e5a79308bf..ebec8b6dbe3ce3f40d1ee184d461d0e494af3f6e 100644 (file)
@@ -59,7 +59,7 @@ VideoContent::VideoContent (shared_ptr<const Film> f)
        setup_default_colour_conversion ();
 }
 
-VideoContent::VideoContent (shared_ptr<const Film> f, Time s, VideoContent::Frame len)
+VideoContent::VideoContent (shared_ptr<const Film> f, DCPTime s, VideoContent::Frame len)
        : Content (f, s)
        , _video_length (len)
        , _video_frame_rate (0)
@@ -355,7 +355,7 @@ VideoContent::video_size_after_crop () const
  *  is that of the next complete frame which starts after `t'.
  */
 VideoContent::Frame
-VideoContent::time_to_content_video_frames (Time t) const
+VideoContent::time_to_content_video_frames (DCPTime t) const
 {
        shared_ptr<const Film> film = _film.lock ();
        assert (film);
index effca5c61c314c50c4328d02adb5db7ce92dd48e..f008143fa2a7460aa6b37abc09e1b7fd9269b1e6 100644 (file)
@@ -43,7 +43,7 @@ public:
        typedef int Frame;
 
        VideoContent (boost::shared_ptr<const Film>);
-       VideoContent (boost::shared_ptr<const Film>, Time, VideoContent::Frame);
+       VideoContent (boost::shared_ptr<const Film>, DCPTime, VideoContent::Frame);
        VideoContent (boost::shared_ptr<const Film>, boost::filesystem::path);
        VideoContent (boost::shared_ptr<const Film>, boost::shared_ptr<const cxml::Node>);
        VideoContent (boost::shared_ptr<const Film>, std::vector<boost::shared_ptr<Content> >);
@@ -123,7 +123,7 @@ public:
        libdcp::Size video_size_after_3d_split () const;
        libdcp::Size video_size_after_crop () const;
 
-       VideoContent::Frame time_to_content_video_frames (Time) const;
+       VideoContent::Frame time_to_content_video_frames (DCPTime) const;
 
 protected:
        void take_from_video_examiner (boost::shared_ptr<VideoExaminer>);
index f0a44954ff2ee2ed88d9dcaef2de1044a7f42f09..3c40139b80560d85ec948d5ca5b5fbf7dd6eb8e4 100644 (file)
@@ -47,7 +47,7 @@ static shared_ptr<FileLog> log_ (new FileLog ("servomatictest.log"));
 static int frame = 0;
 
 void
-process_video (shared_ptr<PlayerImage> image, Eyes eyes, ColourConversion conversion, Time)
+process_video (shared_ptr<PlayerImage> image, Eyes eyes, ColourConversion conversion, DCPTime)
 {
        shared_ptr<DCPVideoFrame> local  (new DCPVideoFrame (image->image(), frame, eyes, conversion, film->video_frame_rate(), 250000000, log_));
        shared_ptr<DCPVideoFrame> remote (new DCPVideoFrame (image->image(), frame, eyes, conversion, film->video_frame_rate(), 250000000, log_));
index f78885772ce033e682a1e9d178d85c93441b2b45..96de34d406744960db60c4aa072a0673699c9c2d 100644 (file)
@@ -145,7 +145,7 @@ AudioPlot::paint ()
        gc->SetPen (*wxLIGHT_GREY_PEN);
        gc->StrokePath (grid);
 
-       gc->DrawText (_("Time"), data_width, _height - _y_origin + db_label_height / 2);
+       gc->DrawText (_("DCPTime"), data_width, _height - _y_origin + db_label_height / 2);
        
        if (_type_visible[AudioPoint::PEAK]) {
                for (int c = 0; c < MAX_AUDIO_CHANNELS; ++c) {
index 564b90d28ab63295e675f594c71981d6a2297faf..14982e0d302c46ecbcd77ecd915f574095fc3493 100644 (file)
@@ -279,7 +279,7 @@ FilmEditor::make_content_panel ()
                b->Add (_content_earlier, 1, wxEXPAND);
                _content_later = new wxButton (_content_panel, wxID_DOWN);
                b->Add (_content_later, 1, wxEXPAND);
-               _content_timeline = new wxButton (_content_panel, wxID_ANY, _("Timeline..."));
+               _content_timeline = new wxButton (_content_panel, wxID_ANY, _("DCPTimeline..."));
                b->Add (_content_timeline, 1, wxEXPAND | wxLEFT | wxRIGHT);
 
                s->Add (b, 0, wxALL, 4);
@@ -936,7 +936,7 @@ FilmEditor::content_timeline_clicked ()
                _timeline_dialog = 0;
        }
        
-       _timeline_dialog = new TimelineDialog (this, _film);
+       _timeline_dialog = new DCPTimelineDialog (this, _film);
        _timeline_dialog->Show ();
 }
 
index 23c87e6784510288c54c8e9e96484b520e05bccc..dadb583ae07b028f1c8324b1a0f30db6513c426e 100644 (file)
@@ -33,9 +33,9 @@ class wxNotebook;
 class wxListCtrl;
 class wxListEvent;
 class Film;
-class TimelineDialog;
+class DCPTimelineDialog;
 class Ratio;
-class Timecode;
+class DCPTimecode;
 class FilmEditorPanel;
 class SubtitleContent;
 
@@ -156,5 +156,5 @@ private:
        std::vector<Ratio const *> _ratios;
 
        bool _generally_sensitive;
-       TimelineDialog* _timeline_dialog;
+       DCPTimelineDialog* _timeline_dialog;
 };
index fbca835c2bc2126513b9eb1b0eb49efce3fa1e29..cc2f67b15c06216584b9ce82fff0b47d7d8ff2d6 100644 (file)
@@ -164,7 +164,7 @@ FilmViewer::timer ()
        
        fetch_next_frame ();
 
-       Time const len = _film->length ();
+       DCPTime const len = _film->length ();
 
        if (len) {
                int const new_slider_position = 4096 * _player->video_position() / len;
@@ -275,7 +275,7 @@ FilmViewer::check_play_state ()
 }
 
 void
-FilmViewer::process_video (shared_ptr<PlayerImage> image, Eyes eyes, Time t)
+FilmViewer::process_video (shared_ptr<PlayerImage> image, Eyes eyes, DCPTime t)
 {
        if (eyes == EYES_RIGHT) {
                return;
@@ -288,7 +288,7 @@ FilmViewer::process_video (shared_ptr<PlayerImage> image, Eyes eyes, Time t)
 }
 
 void
-FilmViewer::set_position_text (Time t)
+FilmViewer::set_position_text (DCPTime t)
 {
        if (!_film) {
                _frame_number->SetLabel ("0");
@@ -371,7 +371,7 @@ FilmViewer::back_clicked ()
           We want to see the one before it, so we need to go back 2.
        */
 
-       Time p = _player->video_position() - _film->video_frames_to_time (2);
+       DCPTime p = _player->video_position() - _film->video_frames_to_time (2);
        if (p < 0) {
                p = 0;
        }
index c99c7344047448b088115a9e085bb5eb389937fa..0e5c49c6d8ad91968e439a011ebea6844f7b2472 100644 (file)
@@ -59,7 +59,7 @@ private:
        void slider_moved ();
        void play_clicked ();
        void timer ();
-       void process_video (boost::shared_ptr<PlayerImage>, Eyes, Time);
+       void process_video (boost::shared_ptr<PlayerImage>, Eyes, DCPTime);
        void calculate_sizes ();
        void check_play_state ();
        void fetch_current_frame_again ();
@@ -68,7 +68,7 @@ private:
        void back_clicked ();
        void forward_clicked ();
        void player_changed (bool);
-       void set_position_text (Time);
+       void set_position_text (DCPTime);
 
        boost::shared_ptr<Film> _film;
        boost::shared_ptr<Player> _player;
index 033bd2bd01e97f29965829c8c28c20bd37fa2a3b..b23ff2a39203842feac9805fb811d7b0e351bbfd 100644 (file)
@@ -26,7 +26,7 @@ using std::string;
 using std::cout;
 using boost::lexical_cast;
 
-Timecode::Timecode (wxWindow* parent)
+DCPTimecode::DCPTimecode (wxWindow* parent)
        : wxPanel (parent)
 {
        wxClientDC dc (parent);
@@ -69,11 +69,11 @@ Timecode::Timecode (wxWindow* parent)
 
        _fixed = add_label_to_sizer (_sizer, this, wxT ("42"), false);
        
-       _hours->Bind      (wxEVT_COMMAND_TEXT_UPDATED,   boost::bind (&Timecode::changed, this));
-       _minutes->Bind    (wxEVT_COMMAND_TEXT_UPDATED,   boost::bind (&Timecode::changed, this));
-       _seconds->Bind    (wxEVT_COMMAND_TEXT_UPDATED,   boost::bind (&Timecode::changed, this));
-       _frames->Bind     (wxEVT_COMMAND_TEXT_UPDATED,   boost::bind (&Timecode::changed, this));
-       _set_button->Bind (wxEVT_COMMAND_BUTTON_CLICKED, boost::bind (&Timecode::set_clicked, this));
+       _hours->Bind      (wxEVT_COMMAND_TEXT_UPDATED,   boost::bind (&DCPTimecode::changed, this));
+       _minutes->Bind    (wxEVT_COMMAND_TEXT_UPDATED,   boost::bind (&DCPTimecode::changed, this));
+       _seconds->Bind    (wxEVT_COMMAND_TEXT_UPDATED,   boost::bind (&DCPTimecode::changed, this));
+       _frames->Bind     (wxEVT_COMMAND_TEXT_UPDATED,   boost::bind (&DCPTimecode::changed, this));
+       _set_button->Bind (wxEVT_COMMAND_BUTTON_CLICKED, boost::bind (&DCPTimecode::set_clicked, this));
 
        _set_button->Enable (false);
 
@@ -83,7 +83,7 @@ Timecode::Timecode (wxWindow* parent)
 }
 
 void
-Timecode::set (Time t, int fps)
+DCPTimecode::set (DCPTime t, int fps)
 {
        int const h = t / (3600 * TIME_HZ);
        t -= h * 3600 * TIME_HZ;
@@ -101,10 +101,10 @@ Timecode::set (Time t, int fps)
        _fixed->SetLabel (wxString::Format ("%02d:%02d:%02d.%02d", h, m, s, f));
 }
 
-Time
-Timecode::get (int fps) const
+DCPTime
+DCPTimecode::get (int fps) const
 {
-       Time t = 0;
+       DCPTime t = 0;
        string const h = wx_to_std (_hours->GetValue ());
        t += lexical_cast<int> (h.empty() ? "0" : h) * 3600 * TIME_HZ;
        string const m = wx_to_std (_minutes->GetValue());
@@ -118,20 +118,20 @@ Timecode::get (int fps) const
 }
 
 void
-Timecode::changed ()
+DCPTimecode::changed ()
 {
        _set_button->Enable (true);
 }
 
 void
-Timecode::set_clicked ()
+DCPTimecode::set_clicked ()
 {
        Changed ();
        _set_button->Enable (false);
 }
 
 void
-Timecode::set_editable (bool e)
+DCPTimecode::set_editable (bool e)
 {
        _editable->Show (e);
        _fixed->Show (!e);
index 5b094e39f0c2c3cf6d67d36eba70a804acf73017..6a8bf03df3d19a33206b68098bb9790e34a0345b 100644 (file)
 #include <wx/wx.h>
 #include "lib/types.h"
 
-class Timecode : public wxPanel
+class DCPTimecode : public wxPanel
 {
 public:
-       Timecode (wxWindow *);
+       DCPTimecode (wxWindow *);
 
-       void set (Time, int);
-       Time get (int) const;
+       void set (DCPTime, int);
+       DCPTime get (int) const;
 
        void set_editable (bool);
 
index 0ac9a1d4bb6d513e6fa3bedbfe96eeae66441777..9d2aee76c00f7660d424a5ef9c5275e5514a1cd2 100644 (file)
@@ -39,7 +39,7 @@ using boost::optional;
 class View : public boost::noncopyable
 {
 public:
-       View (Timeline& t)
+       View (DCPTimeline& t)
                : _timeline (t)
        {
 
@@ -64,12 +64,12 @@ public:
 protected:
        virtual void do_paint (wxGraphicsContext *) = 0;
        
-       int time_x (Time t) const
+       int time_x (DCPTime t) const
        {
                return _timeline.tracks_position().x + t * _timeline.pixels_per_time_unit();
        }
        
-       Timeline& _timeline;
+       DCPTimeline& _timeline;
 
 private:
        dcpomatic::Rect<int> _last_paint_bbox;
@@ -80,7 +80,7 @@ private:
 class ContentView : public View
 {
 public:
-       ContentView (Timeline& tl, shared_ptr<Content> c)
+       ContentView (DCPTimeline& tl, shared_ptr<Content> c)
                : View (tl)
                , _content (c)
                , _track (0)
@@ -139,8 +139,8 @@ private:
                        return;
                }
 
-               Time const position = cont->position ();
-               Time const len = cont->length_after_trim ();
+               DCPTime const position = cont->position ();
+               DCPTime const len = cont->length_after_trim ();
 
                wxColour selected (colour().Red() / 2, colour().Green() / 2, colour().Blue() / 2);
 
@@ -203,7 +203,7 @@ private:
 class AudioContentView : public ContentView
 {
 public:
-       AudioContentView (Timeline& tl, shared_ptr<Content> c)
+       AudioContentView (DCPTimeline& tl, shared_ptr<Content> c)
                : ContentView (tl, c)
        {}
        
@@ -222,7 +222,7 @@ private:
 class VideoContentView : public ContentView
 {
 public:
-       VideoContentView (Timeline& tl, shared_ptr<Content> c)
+       VideoContentView (DCPTimeline& tl, shared_ptr<Content> c)
                : ContentView (tl, c)
        {}
 
@@ -243,10 +243,10 @@ private:
        }
 };
 
-class TimeAxisView : public View
+class DCPTimeAxisView : public View
 {
 public:
-       TimeAxisView (Timeline& tl, int y)
+       DCPTimeAxisView (DCPTimeline& tl, int y)
                : View (tl)
                , _y (y)
        {}
@@ -291,7 +291,7 @@ private:
                path.AddLineToPoint (_timeline.width(), _y);
                gc->StrokePath (path);
 
-               Time t = 0;
+               DCPTime t = 0;
                while ((t * _timeline.pixels_per_time_unit()) < _timeline.width()) {
                        wxGraphicsPath path = gc->CreatePath ();
                        path.MoveToPoint (time_x (t), _y - 4);
@@ -326,11 +326,11 @@ private:
 };
 
 
-Timeline::Timeline (wxWindow* parent, FilmEditor* ed, shared_ptr<Film> film)
+DCPTimeline::DCPTimeline (wxWindow* parent, FilmEditor* ed, shared_ptr<Film> film)
        : wxPanel (parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxFULL_REPAINT_ON_RESIZE)
        , _film_editor (ed)
        , _film (film)
-       , _time_axis_view (new TimeAxisView (*this, 32))
+       , _time_axis_view (new DCPTimeAxisView (*this, 32))
        , _tracks (0)
        , _pixels_per_time_unit (0)
        , _left_down (false)
@@ -343,22 +343,22 @@ Timeline::Timeline (wxWindow* parent, FilmEditor* ed, shared_ptr<Film> film)
        SetDoubleBuffered (true);
 #endif 
 
-       Bind (wxEVT_PAINT,      boost::bind (&Timeline::paint,       this));
-       Bind (wxEVT_LEFT_DOWN,  boost::bind (&Timeline::left_down,   this, _1));
-       Bind (wxEVT_LEFT_UP,    boost::bind (&Timeline::left_up,     this, _1));
-       Bind (wxEVT_RIGHT_DOWN, boost::bind (&Timeline::right_down,  this, _1));
-       Bind (wxEVT_MOTION,     boost::bind (&Timeline::mouse_moved, this, _1));
-       Bind (wxEVT_SIZE,       boost::bind (&Timeline::resized,     this));
+       Bind (wxEVT_PAINT,      boost::bind (&DCPTimeline::paint,       this));
+       Bind (wxEVT_LEFT_DOWN,  boost::bind (&DCPTimeline::left_down,   this, _1));
+       Bind (wxEVT_LEFT_UP,    boost::bind (&DCPTimeline::left_up,     this, _1));
+       Bind (wxEVT_RIGHT_DOWN, boost::bind (&DCPTimeline::right_down,  this, _1));
+       Bind (wxEVT_MOTION,     boost::bind (&DCPTimeline::mouse_moved, this, _1));
+       Bind (wxEVT_SIZE,       boost::bind (&DCPTimeline::resized,     this));
 
        playlist_changed ();
 
        SetMinSize (wxSize (640, tracks() * track_height() + 96));
 
-       _playlist_connection = film->playlist()->Changed.connect (bind (&Timeline::playlist_changed, this));
+       _playlist_connection = film->playlist()->Changed.connect (bind (&DCPTimeline::playlist_changed, this));
 }
 
 void
-Timeline::paint ()
+DCPTimeline::paint ()
 {
        wxPaintDC dc (this);
 
@@ -377,7 +377,7 @@ Timeline::paint ()
 }
 
 void
-Timeline::playlist_changed ()
+DCPTimeline::playlist_changed ()
 {
        ensure_ui_thread ();
        
@@ -406,7 +406,7 @@ Timeline::playlist_changed ()
 }
 
 void
-Timeline::assign_tracks ()
+DCPTimeline::assign_tracks ()
 {
        for (ViewList::iterator i = _views.begin(); i != _views.end(); ++i) {
                shared_ptr<ContentView> cv = dynamic_pointer_cast<ContentView> (*i);
@@ -465,13 +465,13 @@ Timeline::assign_tracks ()
 }
 
 int
-Timeline::tracks () const
+DCPTimeline::tracks () const
 {
        return _tracks;
 }
 
 void
-Timeline::setup_pixels_per_time_unit ()
+DCPTimeline::setup_pixels_per_time_unit ()
 {
        shared_ptr<const Film> film = _film.lock ();
        if (!film) {
@@ -482,7 +482,7 @@ Timeline::setup_pixels_per_time_unit ()
 }
 
 shared_ptr<View>
-Timeline::event_to_view (wxMouseEvent& ev)
+DCPTimeline::event_to_view (wxMouseEvent& ev)
 {
        ViewList::iterator i = _views.begin();
        Position<int> const p (ev.GetX(), ev.GetY());
@@ -498,7 +498,7 @@ Timeline::event_to_view (wxMouseEvent& ev)
 }
 
 void
-Timeline::left_down (wxMouseEvent& ev)
+DCPTimeline::left_down (wxMouseEvent& ev)
 {
        shared_ptr<View> view = event_to_view (ev);
        shared_ptr<ContentView> content_view = dynamic_pointer_cast<ContentView> (view);
@@ -539,7 +539,7 @@ Timeline::left_down (wxMouseEvent& ev)
 }
 
 void
-Timeline::left_up (wxMouseEvent& ev)
+DCPTimeline::left_up (wxMouseEvent& ev)
 {
        _left_down = false;
 
@@ -551,7 +551,7 @@ Timeline::left_up (wxMouseEvent& ev)
 }
 
 void
-Timeline::mouse_moved (wxMouseEvent& ev)
+DCPTimeline::mouse_moved (wxMouseEvent& ev)
 {
        if (!_left_down) {
                return;
@@ -561,7 +561,7 @@ Timeline::mouse_moved (wxMouseEvent& ev)
 }
 
 void
-Timeline::right_down (wxMouseEvent& ev)
+DCPTimeline::right_down (wxMouseEvent& ev)
 {
        shared_ptr<View> view = event_to_view (ev);
        shared_ptr<ContentView> cv = dynamic_pointer_cast<ContentView> (view);
@@ -578,7 +578,7 @@ Timeline::right_down (wxMouseEvent& ev)
 }
 
 void
-Timeline::set_position_from_event (wxMouseEvent& ev)
+DCPTimeline::set_position_from_event (wxMouseEvent& ev)
 {
        wxPoint const p = ev.GetPosition();
 
@@ -597,13 +597,13 @@ Timeline::set_position_from_event (wxMouseEvent& ev)
                return;
        }
        
-       Time new_position = _down_view_position + (p.x - _down_point.x) / _pixels_per_time_unit;
+       DCPTime new_position = _down_view_position + (p.x - _down_point.x) / _pixels_per_time_unit;
        
        if (_snap) {
                
                bool first = true;
-               Time nearest_distance = TIME_MAX;
-               Time nearest_new_position = TIME_MAX;
+               DCPTime nearest_distance = TIME_MAX;
+               DCPTime nearest_new_position = TIME_MAX;
                
                /* Find the nearest content edge; this is inefficient */
                for (ViewList::iterator i = _views.begin(); i != _views.end(); ++i) {
@@ -614,7 +614,7 @@ Timeline::set_position_from_event (wxMouseEvent& ev)
                        
                        {
                                /* Snap starts to ends */
-                               Time const d = abs (cv->content()->end() - new_position);
+                               DCPTime const d = abs (cv->content()->end() - new_position);
                                if (first || d < nearest_distance) {
                                        nearest_distance = d;
                                        nearest_new_position = cv->content()->end();
@@ -623,7 +623,7 @@ Timeline::set_position_from_event (wxMouseEvent& ev)
                        
                        {
                                /* Snap ends to starts */
-                               Time const d = abs (cv->content()->position() - (new_position + _down_view->content()->length_after_trim()));
+                               DCPTime const d = abs (cv->content()->position() - (new_position + _down_view->content()->length_after_trim()));
                                if (d < nearest_distance) {
                                        nearest_distance = d;
                                        nearest_new_position = cv->content()->position() - _down_view->content()->length_after_trim ();
@@ -653,25 +653,25 @@ Timeline::set_position_from_event (wxMouseEvent& ev)
 }
 
 void
-Timeline::force_redraw (dcpomatic::Rect<int> const & r)
+DCPTimeline::force_redraw (dcpomatic::Rect<int> const & r)
 {
        RefreshRect (wxRect (r.x, r.y, r.width, r.height), false);
 }
 
 shared_ptr<const Film>
-Timeline::film () const
+DCPTimeline::film () const
 {
        return _film.lock ();
 }
 
 void
-Timeline::resized ()
+DCPTimeline::resized ()
 {
        setup_pixels_per_time_unit ();
 }
 
 void
-Timeline::clear_selection ()
+DCPTimeline::clear_selection ()
 {
        for (ViewList::iterator i = _views.begin(); i != _views.end(); ++i) {
                shared_ptr<ContentView> cv = dynamic_pointer_cast<ContentView> (*i);
@@ -681,8 +681,8 @@ Timeline::clear_selection ()
        }
 }
 
-Timeline::ContentViewList
-Timeline::selected_views () const
+DCPTimeline::ContentViewList
+DCPTimeline::selected_views () const
 {
        ContentViewList sel;
        
@@ -697,7 +697,7 @@ Timeline::selected_views () const
 }
 
 ContentList
-Timeline::selected_content () const
+DCPTimeline::selected_content () const
 {
        ContentList sel;
        ContentViewList views = selected_views ();
index ef1d10797c6e75d114c9d55d7b5d97ff40777279..b3ee77fff84644a14eb2158ab38fd64778b19a6d 100644 (file)
@@ -29,12 +29,12 @@ class Film;
 class View;
 class ContentView;
 class FilmEditor;
-class TimeAxisView;
+class DCPTimeAxisView;
 
-class Timeline : public wxPanel
+class DCPTimeline : public wxPanel
 {
 public:
-       Timeline (wxWindow *, FilmEditor *, boost::shared_ptr<Film>);
+       DCPTimeline (wxWindow *, FilmEditor *, boost::shared_ptr<Film>);
 
        boost::shared_ptr<const Film> film () const;
 
@@ -94,13 +94,13 @@ private:
        FilmEditor* _film_editor;
        boost::weak_ptr<Film> _film;
        ViewList _views;
-       boost::shared_ptr<TimeAxisView> _time_axis_view;
+       boost::shared_ptr<DCPTimeAxisView> _time_axis_view;
        int _tracks;
        double _pixels_per_time_unit;
        bool _left_down;
        wxPoint _down_point;
        boost::shared_ptr<ContentView> _down_view;
-       Time _down_view_position;
+       DCPTime _down_view_position;
        bool _first_move;
        ContentMenu _menu;
        bool _snap;
index dbf7ae232be2cd5f72dd8a247e98a80fff968fa7..a63c219dbfb43ca3966cd076653f6a9afd18e44c 100644 (file)
@@ -28,8 +28,8 @@ using std::list;
 using std::cout;
 using boost::shared_ptr;
 
-TimelineDialog::TimelineDialog (FilmEditor* ed, shared_ptr<Film> film)
-       : wxDialog (ed, wxID_ANY, _("Timeline"), wxDefaultPosition, wxSize (640, 512), wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER | wxFULL_REPAINT_ON_RESIZE)
+DCPTimelineDialog::DCPTimelineDialog (FilmEditor* ed, shared_ptr<Film> film)
+       : wxDialog (ed, wxID_ANY, _("DCPTimeline"), wxDefaultPosition, wxSize (640, 512), wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER | wxFULL_REPAINT_ON_RESIZE)
        , _timeline (this, ed, film)
 {
        wxBoxSizer* sizer = new wxBoxSizer (wxVERTICAL);
@@ -46,11 +46,11 @@ TimelineDialog::TimelineDialog (FilmEditor* ed, shared_ptr<Film> film)
        sizer->SetSizeHints (this);
 
        _snap->SetValue (_timeline.snap ());
-       _snap->Bind (wxEVT_COMMAND_CHECKBOX_CLICKED, boost::bind (&TimelineDialog::snap_toggled, this));
+       _snap->Bind (wxEVT_COMMAND_CHECKBOX_CLICKED, boost::bind (&DCPTimelineDialog::snap_toggled, this));
 }
 
 void
-TimelineDialog::snap_toggled ()
+DCPTimelineDialog::snap_toggled ()
 {
        _timeline.set_snap (_snap->GetValue ());
 }
index 1e595500303b5b964b0ba54157c67d47f260625b..b64445d9cf88447a8b5638f1d579641864700879 100644 (file)
 
 class Playlist;
 
-class TimelineDialog : public wxDialog
+class DCPTimelineDialog : public wxDialog
 {
 public:
-       TimelineDialog (FilmEditor *, boost::shared_ptr<Film>);
+       DCPTimelineDialog (FilmEditor *, boost::shared_ptr<Film>);
 
 private:
        void snap_toggled ();
        
-       Timeline _timeline;
+       DCPTimeline _timeline;
        wxCheckBox* _snap;
 };
index 79099b1680a5450c71ac469fbaa0ebe9be2a54a1..08334da4bfef8142a8425e6ee88485b0de47bd4f 100644 (file)
@@ -35,19 +35,19 @@ TimingPanel::TimingPanel (FilmEditor* e)
        _sizer->Add (grid, 0, wxALL, 8);
 
        add_label_to_sizer (grid, this, _("Position"), true);
-       _position = new Timecode (this);
+       _position = new DCPTimecode (this);
        grid->Add (_position);
        add_label_to_sizer (grid, this, _("Full length"), true);
-       _full_length = new Timecode (this);
+       _full_length = new DCPTimecode (this);
        grid->Add (_full_length);
        add_label_to_sizer (grid, this, _("Trim from start"), true);
-       _trim_start = new Timecode (this);
+       _trim_start = new DCPTimecode (this);
        grid->Add (_trim_start);
        add_label_to_sizer (grid, this, _("Trim from end"), true);
-       _trim_end = new Timecode (this);
+       _trim_end = new DCPTimecode (this);
        grid->Add (_trim_end);
        add_label_to_sizer (grid, this, _("Play length"), true);
-       _play_length = new Timecode (this);
+       _play_length = new DCPTimecode (this);
        grid->Add (_play_length);
 
        _position->Changed.connect    (boost::bind (&TimingPanel::position_changed, this));
index ab859a1befc1cfb37acdaabee33d88d5bf367156..7fea45eb5c4982ead55940d3cced32f83a978053 100644 (file)
@@ -19,7 +19,7 @@
 
 #include "film_editor_panel.h"
 
-class Timecode;
+class DCPTimecode;
 
 class TimingPanel : public FilmEditorPanel
 {
@@ -36,9 +36,9 @@ private:
        void trim_end_changed ();
        void play_length_changed ();
        
-       Timecode* _position;
-       Timecode* _full_length;
-       Timecode* _trim_start;
-       Timecode* _trim_end;
-       Timecode* _play_length;
+       DCPTimecode* _position;
+       DCPTimecode* _full_length;
+       DCPTimecode* _trim_start;
+       DCPTimecode* _trim_end;
+       DCPTimecode* _play_length;
 };
index 7014bf1b0d7aa3b5c57e75f6d6585d413dd29554..f587d6cc6d91c69b64af555c80c561e7c1b56807 100644 (file)
@@ -31,11 +31,11 @@ using boost::shared_ptr;
 
 #define FFMPEG_SEEK_TEST_DEBUG 1
 
-boost::optional<Time> first_video;
-boost::optional<Time> first_audio;
+boost::optional<DCPTime> first_video;
+boost::optional<DCPTime> first_audio;
 
 static void
-process_video (shared_ptr<PlayerImage>, Eyes, ColourConversion, bool, Time t)
+process_video (shared_ptr<PlayerImage>, Eyes, ColourConversion, bool, DCPTime t)
 {
        if (!first_video) {
                first_video = t;
@@ -43,7 +43,7 @@ process_video (shared_ptr<PlayerImage>, Eyes, ColourConversion, bool, Time t)
 }
 
 static void
-process_audio (shared_ptr<const AudioBuffers>, Time t)
+process_audio (shared_ptr<const AudioBuffers>, DCPTime t)
 {
        if (!first_audio) {
                first_audio = t;
@@ -51,7 +51,7 @@ process_audio (shared_ptr<const AudioBuffers>, Time t)
 }
 
 static string
-print_time (Time t, float fps)
+print_time (DCPTime t, float fps)
 {
        stringstream s;
        s << t << " " << (float(t) / TIME_HZ) << "s " << (float(t) * fps / TIME_HZ) << "f";
@@ -59,7 +59,7 @@ print_time (Time t, float fps)
 }
 
 static void
-check (shared_ptr<Player> p, Time t)
+check (shared_ptr<Player> p, DCPTime t)
 {
        first_video.reset ();
        first_audio.reset ();
index 5f7f6c2f2ea66575663942b43f149f1f74da3b85..5285d448181b6379451001d2a95787c64fcaaaf8 100644 (file)
@@ -31,11 +31,11 @@ using boost::shared_ptr;
 
 #define LONG_FFMPEG_SEEK_TEST_DEBUG 1
 
-boost::optional<Time> first_video;
-boost::optional<Time> first_audio;
+boost::optional<DCPTime> first_video;
+boost::optional<DCPTime> first_audio;
 
 static void
-process_video (shared_ptr<PlayerImage>, Eyes, ColourConversion, bool, Time t)
+process_video (shared_ptr<PlayerImage>, Eyes, ColourConversion, bool, DCPTime t)
 {
        if (!first_video) {
                first_video = t;
@@ -43,7 +43,7 @@ process_video (shared_ptr<PlayerImage>, Eyes, ColourConversion, bool, Time t)
 }
 
 static void
-process_audio (shared_ptr<const AudioBuffers>, Time t)
+process_audio (shared_ptr<const AudioBuffers>, DCPTime t)
 {
        if (!first_audio) {
                first_audio = t;
@@ -51,7 +51,7 @@ process_audio (shared_ptr<const AudioBuffers>, Time t)
 }
 
 static string
-print_time (Time t, float fps)
+print_time (DCPTime t, float fps)
 {
        stringstream s;
        s << t << " " << (float(t) / TIME_HZ) << "s " << (float(t) * fps / TIME_HZ) << "f";
@@ -59,7 +59,7 @@ print_time (Time t, float fps)
 }
 
 static void
-check (shared_ptr<Player> p, Time t)
+check (shared_ptr<Player> p, DCPTime t)
 {
        first_video.reset ();
        first_audio.reset ();
index dfa597431fee6b818d42e195f3676af6bf6229e8..c9486d161dd3cb686d318e0e2f5fe932a6cd2ed7 100644 (file)
@@ -34,7 +34,7 @@ struct Video
 {
        boost::shared_ptr<Content> content;
        boost::shared_ptr<const Image> image;
-       Time time;
+       DCPTime time;
 };
 
 class PlayerWrapper
@@ -46,7 +46,7 @@ public:
                _player->Video.connect (bind (&PlayerWrapper::process_video, this, _1, _2, _5));
        }
 
-       void process_video (shared_ptr<PlayerImage> i, bool, Time t)
+       void process_video (shared_ptr<PlayerImage> i, bool, DCPTime t)
        {
                Video v;
                v.content = _player->_last_video;
@@ -67,7 +67,7 @@ public:
                return v;
        }
 
-       void seek (Time t, bool ac)
+       void seek (DCPTime t, bool ac)
        {
                _player->seek (t, ac);
                _queue.clear ();