AudioDecoder::AudioDecoder (shared_ptr<const AudioContent> content)
: _audio_content (content)
+ , _ignore_audio (false)
{
BOOST_FOREACH (AudioStreamPtr i, content->audio_streams ()) {
_streams[i] = shared_ptr<AudioDecoderStream> (new AudioDecoderStream (_audio_content, i, this));
void
AudioDecoder::audio (AudioStreamPtr stream, shared_ptr<const AudioBuffers> data, ContentTime time)
{
+ if (_ignore_audio) {
+ return;
+ }
+
if (_streams.find (stream) == _streams.end ()) {
/* This method can be called with an unknown stream during the following sequence:
i->second->seek (t, accurate);
}
}
+
+/** Set this player never to produce any audio data */
+void
+AudioDecoder::set_ignore_audio ()
+{
+ _ignore_audio = true;
+}
*/
ContentAudio get_audio (AudioStreamPtr stream, Frame time, Frame length, bool accurate);
+ void set_ignore_audio ();
+
protected:
void audio (AudioStreamPtr stream, boost::shared_ptr<const AudioBuffers>, ContentTime);
void flush ();
boost::shared_ptr<const AudioContent> _audio_content;
/** An AudioDecoderStream object to manage each stream in _audio_content */
std::map<AudioStreamPtr, boost::shared_ptr<AudioDecoderStream> > _streams;
+ bool _ignore_audio;
};
#endif
, _playlist (playlist)
, _have_valid_pieces (false)
, _ignore_video (false)
+ , _ignore_audio (false)
, _always_burn_subtitles (false)
{
_film_changed_connection = _film->Changed.connect (bind (&Player::film_changed, this, _1));
vd->set_ignore_video ();
}
+ shared_ptr<AudioDecoder> ad = dynamic_pointer_cast<AudioDecoder> (decoder);
+ if (ad && _ignore_audio) {
+ ad->set_ignore_audio ();
+ }
+
_pieces.push_back (shared_ptr<Piece> (new Piece (i, decoder, frc.get ())));
}
_ignore_video = true;
}
+/** Set this player never to produce any audio data */
+void
+Player::set_ignore_audio ()
+{
+ _ignore_audio = true;
+}
+
/** Set whether or not this player should always burn text subtitles into the image,
* regardless of the content settings.
* @param burn true to always burn subtitles, false to obey content settings.
void set_video_container_size (dcp::Size);
void set_ignore_video ();
+ void set_ignore_audio ();
void set_enable_subtitles (bool enable);
void set_always_burn_subtitles (bool burn);
/** true if the player should ignore all video; i.e. never produce any */
bool _ignore_video;
+ /** true if the player should ignore all audio; i.e. never produce any */
+ bool _ignore_audio;
/** true if the player should always burn subtitles into the video regardless
of content settings
*/
in the preview.
*/
_player->set_always_burn_subtitles (true);
+ _player->set_ignore_audio ();
_film_connection = _film->Changed.connect (boost::bind (&FilmViewer::film_changed, this, _1));