diff options
Diffstat (limited to 'video/video_decoder.h')
-rw-r--r-- | video/video_decoder.h | 44 |
1 files changed, 43 insertions, 1 deletions
diff --git a/video/video_decoder.h b/video/video_decoder.h index ac6586d8dd..99161d6f97 100644 --- a/video/video_decoder.h +++ b/video/video_decoder.h @@ -407,6 +407,21 @@ public: */ bool addStreamFileTrack(const Common::String &baseName); + /** + * Set the internal audio track. + * + * Has no effect if the container does not support this. + * @see supportsAudioTrackSwitching() + * + * @param index The index of the track, whose meaning is dependent on the container + */ + bool setAudioTrack(int index); + + /** + * Get the number of internal audio tracks. + */ + uint getAudioTrackCount() const; + protected: /** * An abstract representation of a track in a movie. Since tracks here are designed @@ -612,7 +627,7 @@ protected: */ class AudioTrack : public Track { public: - AudioTrack() {} + AudioTrack(); virtual ~AudioTrack() {} TrackType getTrackType() const { return kTrackTypeAudio; } @@ -662,6 +677,11 @@ protected: */ virtual Audio::Mixer::SoundType getSoundType() const { return Audio::Mixer::kPlainSoundType; } + /** + * Mute the track + */ + void setMute(bool mute); + protected: void pauseIntern(bool shouldPause); @@ -674,6 +694,7 @@ protected: Audio::SoundHandle _handle; byte _volume; int8 _balance; + bool _muted; }; /** @@ -833,6 +854,25 @@ protected: */ virtual bool seekIntern(const Audio::Timestamp &time); + /** + * Does this video format support switching between audio tracks? + * + * Returning true implies this format supports multiple audio tracks, + * can switch tracks, and defaults to playing the first found audio + * track. + */ + virtual bool supportsAudioTrackSwitching() const { return false; } + + /** + * Get the audio track for the given index. + * + * This is used only if supportsAudioTrackSwitching() returns true. + * + * @param index The index of the track, whose meaning is dependent on the container + * @return The audio track for the index, or 0 if not found + */ + virtual AudioTrack *getAudioTrack(int index) { return 0; } + private: // Tracks owned by this VideoDecoder TrackList _tracks; @@ -865,6 +905,8 @@ private: uint32 _pauseStartTime; byte _audioVolume; int8 _audioBalance; + + AudioTrack *_mainAudioTrack; }; } // End of namespace Video |