X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Foptions.h;h=0d2c07fd5674117d7afff91179b25885fbe9388a;hb=8d0cf4537624066e9ff2bc7152d792b2bf5e8038;hp=55b066a2d90bb918d53b9a315b62d66fe8020a7b;hpb=2f56f38ce56b36f20d59593f56981e7ed330c484;p=dcpomatic.git diff --git a/src/lib/options.h b/src/lib/options.h index 55b066a2d..0d2c07fd5 100644 --- a/src/lib/options.h +++ b/src/lib/options.h @@ -17,112 +17,27 @@ */ -/** @file src/options.h - * @brief Options for a transcoding operation. - */ - -#include -#include -#include -#include -#include "util.h" +#ifndef DVDOMATIC_OPTIONS_H +#define DVDOMATIC_OPTIONS_H -/** @class EncodeOptions - * @brief EncodeOptions for an encoding operation. - * - * These are settings which may be different, in different circumstances, for - * the same film; ie they are options for a particular operation. +/** @file src/options.h + * @brief Options for a decoding operation. */ -class EncodeOptions -{ -public: - - EncodeOptions (std::string f, std::string e, std::string m) - : padding (0) - , video_skip (0) - , _frame_out_path (f) - , _frame_out_extension (e) - , _multichannel_audio_out_path (m) - {} - - /** @return The path to write video frames to */ - std::string frame_out_path () const { - return _frame_out_path; - } - - /** @param f Source frame index. - * @param t true to return a temporary file path, otherwise a permanent one. - * @return The path to write this video frame to. - */ - std::string frame_out_path (SourceFrame f, bool t) const { - std::stringstream s; - s << _frame_out_path << "/"; - s.width (8); - s << std::setfill('0') << f << _frame_out_extension; - - if (t) { - s << ".tmp"; - } - - return s.str (); - } - - std::string hash_out_path (SourceFrame f, bool t) const { - return frame_out_path (f, t) + ".md5"; - } - - /** @return Path to write multichannel audio data to */ - std::string multichannel_audio_out_path () const { - return _multichannel_audio_out_path; - } - - /** @param c Audio channel index. - * @param t true to return a temporary file path, otherwise a permanent one. - * @return The path to write this audio file to. - */ - std::string multichannel_audio_out_path (int c, bool t) const { - std::stringstream s; - s << _multichannel_audio_out_path << "/" << (c + 1) << ".wav"; - if (t) { - s << ".tmp"; - } - - return s.str (); - } - - Size out_size; ///< size of output images - int padding; ///< number of pixels of padding (in terms of the output size) each side of the image - - /** Range of video frames to encode (in DCP frames) */ - boost::optional > video_range; - /** Range of audio frames to decode (in the DCP's sampling rate) */ - boost::optional > audio_range; - - /** Skip frames such that we don't decode any frame where (index % decode_video_skip) != 0; e.g. - * 1 for every frame, 2 for every other frame, etc. - */ - SourceFrame video_skip; - -private: - /** Path of the directory to write video frames to */ - std::string _frame_out_path; - /** Extension to use for video frame files (including the leading .) */ - std::string _frame_out_extension; - /** Path of the directory to write audio files to */ - std::string _multichannel_audio_out_path; -}; - class DecodeOptions { public: DecodeOptions () - : decode_audio (true) + : decode_video (true) + , decode_audio (true) , decode_subtitles (false) , video_sync (true) {} - + + bool decode_video; bool decode_audio; bool decode_subtitles; bool video_sync; }; + +#endif