diff options
author | Paweł Kołodziejski | 2004-01-07 05:17:51 +0000 |
---|---|---|
committer | Paweł Kołodziejski | 2004-01-07 05:17:51 +0000 |
commit | 761371cc66b4b7064f83c075a68efa925d52061c (patch) | |
tree | 64f62cbea8774efd47caa5f49d9be41307490545 /scumm | |
parent | 5f665202d11e5fc8cca9da9d29f0a0e5251e7a0d (diff) | |
download | scummvm-rg350-761371cc66b4b7064f83c075a68efa925d52061c.tar.gz scummvm-rg350-761371cc66b4b7064f83c075a68efa925d52061c.tar.bz2 scummvm-rg350-761371cc66b4b7064f83c075a68efa925d52061c.zip |
added code for ms track position
svn-id: r12204
Diffstat (limited to 'scumm')
-rw-r--r-- | scumm/imuse_digi/dimuse.cpp | 27 | ||||
-rw-r--r-- | scumm/imuse_digi/dimuse.h | 2 |
2 files changed, 23 insertions, 6 deletions
diff --git a/scumm/imuse_digi/dimuse.cpp b/scumm/imuse_digi/dimuse.cpp index 58b71f4694..eab388c72a 100644 --- a/scumm/imuse_digi/dimuse.cpp +++ b/scumm/imuse_digi/dimuse.cpp @@ -223,6 +223,7 @@ void IMuseDigital::startSound(int soundId, const char *soundName, int soundType, int bits = 0, freq = 0, channels = 0, mixerFlags = 0; if (input) { + _track[l].iteration = 1; // ? // Do nothing here, we already have an audio stream } else { if (soundName == NULL) @@ -236,6 +237,9 @@ void IMuseDigital::startSound(int soundId, const char *soundName, int soundType, bits = _sound->getBits(_track[l].soundHandle); channels = _sound->getChannels(_track[l].soundHandle); freq = _sound->getFreq(_track[l].soundHandle); + _track[l].iteration = freq * channels; + if ((bits == 12) || (bits == 16)) + _track[l].iteration *= 2; if (channels == 2) { mixerFlags = SoundMixer::FLAG_STEREO | SoundMixer::FLAG_REVERSE_STEREO; @@ -548,28 +552,39 @@ void IMuseDigital::closeBundleFiles() { // TODO } -int32 IMuseDigital::getCurMusicPosInMs() { - // TODO +int32 IMuseDigital::getPosInMs(int soundId) { + debug(5, "IMuseDigital::getPosInMs(%d)", soundId); + for (int l = 0; l < MAX_DIGITAL_TRACKS; l++) { + if ((_track[l].idSound == soundId) && _track[l].used) { + int32 pos = 1000 * _track[l].trackOffset / _track[l].iteration; + return pos; + } + } + return 0; } +int32 IMuseDigital::getCurMusicPosInMs() { + return getPosInMs(_curMusicId); +} + int32 IMuseDigital::getCurVoiceLipSyncWidth() { - // TODO + int32 pos = getPosInMs(kTalkSoundID); return _scumm->_rnd.getRandomNumber(255); } int32 IMuseDigital::getCurVoiceLipSyncHeight() { - // TODO + int32 pos = getPosInMs(kTalkSoundID); return _scumm->_rnd.getRandomNumber(255); } int32 IMuseDigital::getCurMusicLipSyncWidth() { - // TODO + int32 pos = getPosInMs(_curMusicId); return _scumm->_rnd.getRandomNumber(255); } int32 IMuseDigital::getCurMusicLipSyncHeight() { - // TODO + int32 pos = getPosInMs(_curMusicId); return _scumm->_rnd.getRandomNumber(255); } diff --git a/scumm/imuse_digi/dimuse.h b/scumm/imuse_digi/dimuse.h index cfabb3783f..5b511b1f6b 100644 --- a/scumm/imuse_digi/dimuse.h +++ b/scumm/imuse_digi/dimuse.h @@ -55,6 +55,7 @@ private: int curRegion; int curHookId; int soundGroup; + int iteration; void *soundHandle; int32 pullSize; int mod; @@ -103,6 +104,7 @@ public: void pause(bool pause); void parseScriptCmds(int a, int b, int c, int d, int e, int f, int g, int h); int getSoundStatus(int sound) const; + int32 getPosInMs(int soundId); int32 getCurMusicPosInMs(); int32 getCurVoiceLipSyncWidth(); int32 getCurVoiceLipSyncHeight(); |