diff options
author | Matthew Hoops | 2012-07-24 13:23:45 -0400 |
---|---|---|
committer | Matthew Hoops | 2012-07-24 13:23:45 -0400 |
commit | 84e0b3a167fb282fb7e29614a9806f665af844c2 (patch) | |
tree | 98c280eef994d20989d13e2f150b57bc4099352b | |
parent | a652f6669e2e9225aee17431784b433397b41ae3 (diff) | |
download | scummvm-rg350-84e0b3a167fb282fb7e29614a9806f665af844c2.tar.gz scummvm-rg350-84e0b3a167fb282fb7e29614a9806f665af844c2.tar.bz2 scummvm-rg350-84e0b3a167fb282fb7e29614a9806f665af844c2.zip |
VIDEO: Add helper functions to easily add an external audio track
-rw-r--r-- | video/video_decoder.cpp | 11 | ||||
-rw-r--r-- | video/video_decoder.h | 5 |
2 files changed, 16 insertions, 0 deletions
diff --git a/video/video_decoder.cpp b/video/video_decoder.cpp index 97f8eec7bb..1461f5dc3d 100644 --- a/video/video_decoder.cpp +++ b/video/video_decoder.cpp @@ -521,6 +521,17 @@ void AdvancedVideoDecoder::addTrack(Track *track) { track->start(); } +bool AdvancedVideoDecoder::addStreamFileTrack(const Common::String &baseName) { + StreamFileAudioTrack *track = new StreamFileAudioTrack(); + + bool result = track->loadFromFile(baseName); + + if (result) + addTrack(track); + + return result; +} + AdvancedVideoDecoder::Track *AdvancedVideoDecoder::getTrack(uint track) { if (track > _tracks.size()) return 0; diff --git a/video/video_decoder.h b/video/video_decoder.h index efc8f7a37d..616d6c4f96 100644 --- a/video/video_decoder.h +++ b/video/video_decoder.h @@ -365,6 +365,11 @@ public: */ virtual Audio::Timestamp getDuration() const; + /** + * Add an audio track from a stream file. + */ + bool addStreamFileTrack(const Common::String &baseName); + // Future API //void setRate(const Common::Rational &rate); //Common::Rational getRate() const; |