, _subtitle_offset (0)
, _subtitle_scale (1)
, _length (0)
- , _audio_channels (0)
, _audio_sample_rate (0)
, _has_subtitles (false)
, _frames_per_second (0)
, _dirty (false)
{}
+ FilmState (FilmState const & o)
+ : _directory (o._directory)
+ , _name (o._name)
+ , _use_dci_name (o._use_dci_name)
+ , _content (o._content)
+ , _dcp_content_type (o._dcp_content_type)
+ , _format (o._format)
+ , _crop (o._crop)
+ , _filters (o._filters)
+ , _scaler (o._scaler)
+ , _dcp_frames (o._dcp_frames)
+ , _dcp_trim_action (o._dcp_trim_action)
+ , _dcp_ab (o._dcp_ab)
+ , _audio_stream (o._audio_stream)
+ , _audio_gain (o._audio_gain)
+ , _audio_delay (o._audio_delay)
+ , _still_duration (o._still_duration)
+ , _subtitle_stream (o._subtitle_stream)
+ , _with_subtitles (o._with_subtitles)
+ , _subtitle_offset (o._subtitle_offset)
+ , _subtitle_scale (o._subtitle_scale)
+ , _audio_language (o._audio_language)
+ , _subtitle_language (o._subtitle_language)
+ , _territory (o._territory)
+ , _rating (o._rating)
+ , _studio (o._studio)
+ , _facility (o._facility)
+ , _package_type (o._package_type)
+ , _thumbs (o._thumbs)
+ , _size (o._size)
+ , _length (o._length)
+ , _audio_sample_rate (o._audio_sample_rate)
+ , _content_digest (o._content_digest)
+ , _has_subtitles (o._has_subtitles)
+ , _audio_streams (o._audio_streams)
+ , _subtitle_streams (o._subtitle_streams)
+ , _frames_per_second (o._frames_per_second)
+ , _dirty (o._dirty)
+ {}
+
+ virtual ~FilmState () {}
+
std::string file (std::string f) const;
std::string dir (std::string d) const;
std::string thumb_base (int) const;
int thumb_frame (int) const;
- int target_sample_rate () const;
+ int target_audio_sample_rate () const;
void write_metadata () const;
void read_metadata ();
return _dirty;
}
+ int audio_channels () const;
+
enum Property {
NONE,
NAME,
THUMBS,
SIZE,
LENGTH,
- AUDIO_CHANNELS,
AUDIO_SAMPLE_RATE,
HAS_SUBTITLES,
AUDIO_STREAMS,
return _dcp_ab;
}
- int audio_stream () const {
+ int audio_stream_index () const {
return _audio_stream;
}
+ AudioStream audio_stream () const {
+ assert (_audio_stream < int (_audio_streams.size()));
+ return _audio_streams[_audio_stream];
+ }
+
float audio_gain () const {
return _audio_gain;
}
return _still_duration;
}
- int subtitle_stream () const {
+ int subtitle_stream_index () const {
return _subtitle_stream;
}
+ SubtitleStream subtitle_stream () const {
+ assert (_subtitle_stream < int (_subtitle_streams.size()));
+ return _subtitle_streams[_subtitle_stream];
+ }
+
bool with_subtitles () const {
return _with_subtitles;
}
return _length;
}
- int audio_channels () const {
- return _audio_channels;
- }
-
int audio_sample_rate () const {
return _audio_sample_rate;
}
return _has_subtitles;
}
- std::vector<Stream> audio_streams () const {
+ std::vector<AudioStream> audio_streams () const {
return _audio_streams;
}
- std::vector<Stream> subtitle_streams () const {
+ std::vector<SubtitleStream> subtitle_streams () const {
return _subtitle_streams;
}
return _frames_per_second;
}
-
+
/* SET */
void set_directory (std::string);
void set_name (std::string);
void set_use_dci_name (bool);
- void set_content (std::string);
+ virtual void set_content (std::string);
void set_dcp_content_type (DCPContentType const *);
void set_format (Format const *);
void set_crop (Crop);
void set_audio_sample_rate (int);
void set_content_digest (std::string);
void set_has_subtitles (bool);
- void set_audio_streams (std::vector<Stream>);
- void set_subtitle_streams (std::vector<Stream>);
+ void set_audio_streams (std::vector<AudioStream>);
+ void set_subtitle_streams (std::vector<SubtitleStream>);
void set_frames_per_second (float);
/** Emitted when some property has changed */
has the specified filters and post-processing.
*/
bool _dcp_ab;
- /** The decoder's stream ID to use for audio, or -1 if there is none */
+ /** An index into our _audio_streams vector for the stream to use for audio, or -1 if there is none */
int _audio_stream;
/** Gain to apply to audio in dB */
float _audio_gain;
int _audio_delay;
/** Duration to make still-sourced films (in seconds) */
int _still_duration;
- /** The decoder's stream ID to use for subtitles, or -1 if there are none */
+ /** An index into our _subtitle_streams vector for the stream to use for subtitles, or -1 if there is none */
int _subtitle_stream;
/** True if subtitles should be shown for this film */
bool _with_subtitles;
Size _size;
/** Length of the source in frames */
int _length;
- /** Number of audio channels */
- int _audio_channels;
/** Sample rate of the source audio, in Hz */
int _audio_sample_rate;
/** MD5 digest of our content file */
/** true if the source has subtitles */
bool _has_subtitles;
/** the audio streams that the source has */
- std::vector<Stream> _audio_streams;
+ std::vector<AudioStream> _audio_streams;
/** the subtitle streams that the source has */
- std::vector<Stream> _subtitle_streams;
+ std::vector<SubtitleStream> _subtitle_streams;
/** Frames per second of the source */
float _frames_per_second;