From f188128e2577942f030374631d3cf1324a00624a Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Tue, 26 May 2015 16:47:39 +0100 Subject: [PATCH] {Video,Audio}Frame -> Frame. --- src/lib/analyse_audio_job.h | 4 +- src/lib/audio_decoder.cc | 22 +++++----- src/lib/audio_decoder.h | 4 +- src/lib/content_audio.h | 4 +- src/lib/content_video.h | 4 +- src/lib/image_decoder.h | 2 +- src/lib/player.cc | 14 +++---- src/lib/player.h | 6 +-- src/lib/types.h | 3 +- src/lib/util.h | 1 - src/lib/video_content.cc | 4 +- src/lib/video_content.h | 2 +- src/lib/video_decoder.cc | 18 ++++----- src/lib/video_decoder.h | 10 ++--- src/tools/dcpomatic.cc | 56 +++++++++++++------------- src/tools/dcpomatic_batch.cc | 18 ++++----- test/audio_decoder_test.cc | 16 ++++---- test/ffmpeg_decoder_sequential_test.cc | 4 +- test/seek_zero_test.cc | 4 +- 19 files changed, 97 insertions(+), 99 deletions(-) diff --git a/src/lib/analyse_audio_job.h b/src/lib/analyse_audio_job.h index 0f9605eed..ec61c0d39 100644 --- a/src/lib/analyse_audio_job.h +++ b/src/lib/analyse_audio_job.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2012-2014 Carl Hetherington + Copyright (C) 2012-2015 Carl Hetherington 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 _current; float _overall_peak; - AudioFrame _overall_peak_frame; + Frame _overall_peak_frame; boost::shared_ptr _analysis; diff --git a/src/lib/audio_decoder.cc b/src/lib/audio_decoder.cc index f6133947a..a310650c5 100644 --- a/src/lib/audio_decoder.cc +++ b/src/lib/audio_decoder.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2012-2014 Carl Hetherington + Copyright (C) 2012-2015 Carl Hetherington 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 -AudioDecoder::get_audio (AudioFrame frame, AudioFrame length, bool accurate) +AudioDecoder::get_audio (Frame frame, Frame length, bool accurate) { shared_ptr 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 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 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 padded (new AudioBuffers (data->channels(), data->frames() + delta_frames)); @@ -146,8 +146,8 @@ AudioDecoder::audio (shared_ptr 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 (data->frames())); - AudioFrame const to_keep = data->frames() - to_discard; + Frame const to_discard = min (-delta_frames, static_cast (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. diff --git a/src/lib/audio_decoder.h b/src/lib/audio_decoder.h index f8438df52..99e9092b3 100644 --- a/src/lib/audio_decoder.h +++ b/src/lib/audio_decoder.h @@ -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 get_audio (AudioFrame time, AudioFrame length, bool accurate); + boost::shared_ptr get_audio (Frame time, Frame length, bool accurate); protected: @@ -63,7 +63,7 @@ protected: boost::shared_ptr _audio_content; boost::shared_ptr _resampler; boost::shared_ptr _processor; - boost::optional _audio_position; + boost::optional _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 diff --git a/src/lib/content_audio.h b/src/lib/content_audio.h index 535c0b491..f704fac58 100644 --- a/src/lib/content_audio.h +++ b/src/lib/content_audio.h @@ -34,11 +34,11 @@ public: , frame (0) {} - ContentAudio (boost::shared_ptr a, AudioFrame f) + ContentAudio (boost::shared_ptr a, Frame f) : audio (a) , frame (f) {} boost::shared_ptr audio; - AudioFrame frame; + Frame frame; }; diff --git a/src/lib/content_video.h b/src/lib/content_video.h index 4c0bdb655..cdf0f9cdd 100644 --- a/src/lib/content_video.h +++ b/src/lib/content_video.h @@ -33,7 +33,7 @@ public: , part (PART_WHOLE) {} - ContentVideo (boost::shared_ptr i, Eyes e, Part p, VideoFrame f) + ContentVideo (boost::shared_ptr i, Eyes e, Part p, Frame f) : image (i) , eyes (e) , part (p) @@ -43,7 +43,7 @@ public: boost::shared_ptr image; Eyes eyes; Part part; - VideoFrame frame; + Frame frame; }; #endif diff --git a/src/lib/image_decoder.h b/src/lib/image_decoder.h index ec90051da..0453f7e7e 100644 --- a/src/lib/image_decoder.h +++ b/src/lib/image_decoder.h @@ -40,6 +40,6 @@ private: boost::shared_ptr _image_content; boost::shared_ptr _image; - VideoFrame _video_position; + Frame _video_position; }; diff --git a/src/lib/player.cc b/src/lib/player.cc index d5098fed7..be00aebc7 100644 --- a/src/lib/player.cc +++ b/src/lib/player.cc @@ -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 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 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 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 piece, DCPTime t) const } DCPTime -Player::content_video_to_dcp (shared_ptr piece, VideoFrame f) const +Player::content_video_to_dcp (shared_ptr 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 piece, VideoFrame f) const return t; } -AudioFrame +Frame Player::dcp_to_content_audio (shared_ptr piece, DCPTime t) const { /* s is the offset of t from the start position of this content */ diff --git a/src/lib/player.h b/src/lib/player.h index d8b13ee7b..a5194a169 100644 --- a/src/lib/player.h +++ b/src/lib/player.h @@ -116,9 +116,9 @@ private: void film_changed (Film::Property); std::list transform_image_subtitles (std::list) const; void update_subtitle_from_text (); - VideoFrame dcp_to_content_video (boost::shared_ptr piece, DCPTime t) const; - DCPTime content_video_to_dcp (boost::shared_ptr piece, VideoFrame f) const; - AudioFrame dcp_to_content_audio (boost::shared_ptr piece, DCPTime t) const; + Frame dcp_to_content_video (boost::shared_ptr piece, DCPTime t) const; + DCPTime content_video_to_dcp (boost::shared_ptr piece, Frame f) const; + Frame dcp_to_content_audio (boost::shared_ptr piece, DCPTime t) const; ContentTime dcp_to_content_subtitle (boost::shared_ptr piece, DCPTime t) const; boost::shared_ptr black_player_video_frame (DCPTime) const; diff --git a/src/lib/types.h b/src/lib/types.h index e7017a295..655aeba09 100644 --- a/src/lib/types.h +++ b/src/lib/types.h @@ -55,8 +55,7 @@ typedef std::vector > AudioContentList; typedef std::vector > SubtitleContentList; typedef std::vector > FFmpegContentList; -typedef int64_t VideoFrame; -typedef int64_t AudioFrame; +typedef int64_t Frame; enum VideoFrameType { diff --git a/src/lib/util.h b/src/lib/util.h index 5413e4814..51770c288 100644 --- a/src/lib/util.h +++ b/src/lib/util.h @@ -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 split_get_request (std::string url); extern std::string video_mxf_filename (boost::shared_ptr mxf); extern std::string audio_mxf_filename (boost::shared_ptr mxf); diff --git a/src/lib/video_content.cc b/src/lib/video_content.cc index 9f3d78291..db9a2a5e8 100644 --- a/src/lib/video_content.cc +++ b/src/lib/video_content.cc @@ -483,7 +483,7 @@ VideoContent::set_video_frame_rate (float r) } optional -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 ()); } diff --git a/src/lib/video_content.h b/src/lib/video_content.h index ccc61b1f9..72bad21f8 100644 --- a/src/lib/video_content.h +++ b/src/lib/video_content.h @@ -155,7 +155,7 @@ public: ContentTime dcp_time_to_content_time (DCPTime) const; - boost::optional fade (VideoFrame) const; + boost::optional fade (Frame) const; void scale_and_crop_to_fit_width (); void scale_and_crop_to_fit_height (); diff --git a/src/lib/video_decoder.cc b/src/lib/video_decoder.cc index 31dc3cdc2..078e78c6f 100644 --- a/src/lib/video_decoder.cc +++ b/src/lib/video_decoder.cc @@ -49,7 +49,7 @@ VideoDecoder::VideoDecoder (shared_ptr c) } list -VideoDecoder::decoded_video (VideoFrame frame) +VideoDecoder::decoded_video (Frame frame) { list 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 -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 image, VideoFrame frame) +VideoDecoder::video (shared_ptr image, Frame frame) { if (_ignore_video) { return; @@ -275,8 +275,8 @@ VideoDecoder::video (shared_ptr image, VideoFrame frame) and the things we are about to push. */ - boost::optional from; - boost::optional to; + boost::optional from; + boost::optional to; if (_decoded_video.empty() && _last_seek_time && _last_seek_accurate) { from = _last_seek_time->frames (_video_content->video_frame_rate ()); diff --git a/src/lib/video_decoder.h b/src/lib/video_decoder.h index 5381fb21e..5266604c5 100644 --- a/src/lib/video_decoder.h +++ b/src/lib/video_decoder.h @@ -43,7 +43,7 @@ class VideoDecoder : public virtual Decoder public: VideoDecoder (boost::shared_ptr c); - std::list get_video (VideoFrame frame, bool accurate); + std::list get_video (Frame frame, bool accurate); boost::shared_ptr 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, VideoFrame frame); - std::list decoded_video (VideoFrame frame); - void fill_2d (VideoFrame from, VideoFrame to); - void fill_3d (VideoFrame from, VideoFrame to, Eyes); + void video (boost::shared_ptr, Frame frame); + std::list decoded_video (Frame frame); + void fill_2d (Frame from, Frame to); + void fill_3d (Frame from, Frame to, Eyes); boost::shared_ptr _video_content; std::list _decoded_video; diff --git a/src/tools/dcpomatic.cc b/src/tools/dcpomatic.cc index c7532869e..e3e52d091 100644 --- a/src/tools/dcpomatic.cc +++ b/src/tools/dcpomatic.cc @@ -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 _timer; string _film_to_load; string _film_to_create; diff --git a/src/tools/dcpomatic_batch.cc b/src/tools/dcpomatic_batch.cc index ae2f3a2c5..60c5e697d 100644 --- a/src/tools/dcpomatic_batch.cc +++ b/src/tools/dcpomatic_batch.cc @@ -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 (); diff --git a/test/audio_decoder_test.cc b/test/audio_decoder_test.cc index b1f672356..e31689d3f 100644 --- a/test/audio_decoder_test.cc +++ b/test/audio_decoder_test.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2014 Carl Hetherington + Copyright (C) 2014-2015 Carl Hetherington 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 content; shared_ptr decoder; static shared_ptr -get (AudioFrame from, AudioFrame length) +get (Frame from, Frame length) { decoder->seek (ContentTime::from_frames (from, content->resampled_audio_frame_rate ()), true); shared_ptr 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 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 ca = get (from, length); for (int i = 0; i < content->audio_channels(); ++i) { diff --git a/test/ffmpeg_decoder_sequential_test.cc b/test/ffmpeg_decoder_sequential_test.cc index c5f43173e..551157652 100644 --- a/test/ffmpeg_decoder_sequential_test.cc +++ b/test/ffmpeg_decoder_sequential_test.cc @@ -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 v; v = decoder.get_video (i, true); BOOST_CHECK_EQUAL (v.size(), 1); diff --git a/test/seek_zero_test.cc b/test/seek_zero_test.cc index 2a1a06136..f00180c89 100644 --- a/test/seek_zero_test.cc +++ b/test/seek_zero_test.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2013-2014 Carl Hetherington + Copyright (C) 2013-2015 Carl Hetherington 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 a = decoder.get_video (first_frame, true); -- 2.30.2