Max Horn
56dea320e2
Fix (?) looping in IFF FORM-8SVX data
...
svn-id: r47469
2010-01-23 13:33:08 +00:00
Max Horn
2c71e7b76d
cleanup
...
svn-id: r47468
2010-01-23 13:32:45 +00:00
Max Horn
90d503c74a
Clarify that all blocks of raw audio data are assumed to come from malloc()
...
svn-id: r47438
2010-01-22 14:14:28 +00:00
Max Horn
a8c8763da5
cleanup, typos
...
svn-id: r47437
2010-01-22 14:13:10 +00:00
Filippos Karapetis
6bbca6ee24
Fixed typos (thanks to salty-horse)
...
svn-id: r47435
2010-01-22 12:37:06 +00:00
Johannes Schickel
57a4c0b910
Mark Audio::FLAG_LOOP as deprecated.
...
svn-id: r47432
2010-01-22 08:38:53 +00:00
Max Horn
31e39d221b
cleanup
...
svn-id: r47406
2010-01-20 12:44:37 +00:00
Max Horn
7ea3f6e3ed
The Shorten audio decoder doesn't seem to use looping, so use the non-deprecated version of makeRawMemoryStream
...
svn-id: r47398
2010-01-19 23:51:38 +00:00
Max Horn
dc5e08e623
Move raw audio flags from sound/mixer.h to sound/raw.h
...
svn-id: r47395
2010-01-19 22:30:33 +00:00
Max Horn
68826c27da
Get rid of Mixer::playRaw for good
...
svn-id: r47394
2010-01-19 22:19:43 +00:00
Torbjörn Andersson
428f8d6955
Fixed some cppcheck warnings.
...
svn-id: r47393
2010-01-19 20:41:51 +00:00
Max Horn
b227c660c6
Remove loop start/end params from Mixer::playRaw; convert some code from Mixer::playRaw to Mixer::playInputStream
...
svn-id: r47375
2010-01-19 11:20:58 +00:00
Max Horn
f0a0ed8f9e
Get rid of Mixer::FLAG_REVERSE_STEREO; also change SCUMM's iMuse Digital emulation to reverse stereo again, as it once seems to have been intended
...
svn-id: r47374
2010-01-19 11:19:53 +00:00
Max Horn
557bb394de
Get rid of Mixer::FLAG_AUTOFREE.
...
Also fix several recently introduced new/delete vs. malloc/free mismatches.
svn-id: r47369
2010-01-19 00:56:29 +00:00
Max Horn
69be747621
Move raw audio streams to new header sound/raw.h
...
svn-id: r47368
2010-01-19 00:54:06 +00:00
Max Horn
349fcd1d71
Rename 'Linear' audio streams to 'raw'
...
svn-id: r47367
2010-01-19 00:52:41 +00:00
Johannes Schickel
9593b72483
Fix SubSeekableAudioStream for stereo streams.
...
svn-id: r47352
2010-01-17 23:10:38 +00:00
Johannes Schickel
9458b8a81d
Update debug message.
...
svn-id: r47351
2010-01-17 23:09:40 +00:00
Johannes Schickel
62a2ede60b
Fix SubSeekableAudioStream regression from r47226 (i.e. length was calculated as start - end instead of end - start).
...
svn-id: r47350
2010-01-17 22:52:21 +00:00
Max Horn
7ec2da968c
Switch most AudioStream factories to use DisposeAfterUse::Flag
...
svn-id: r47334
2010-01-16 21:36:08 +00:00
Johannes Schickel
f1439b4fa7
Fix QueuingAudioStreamImpl::endOfStream implementation. This fixes cut off speech in COMI for me.
...
svn-id: r47316
2010-01-15 23:16:43 +00:00
Johannes Schickel
0d995c5920
Rename all "Adlib" uses to "AdLib" to match the real name of the sound card / company.
...
Check this for reference:
http://en.wikipedia.org/wiki/Ad_Lib,_Inc .
http://www.crossfire-designs.de/images/articles/soundcards/adlib.jpg (note the upper left of the card)
This commit does not touch "adlib" and "ADLIB" uses!
Also it does not update all the SCUMM detection entries, which still use "Adlib".
svn-id: r47279
2010-01-12 21:07:56 +00:00
Willem Jan Palenstijn
e4aed638b0
Fix loop alignment check
...
svn-id: r47264
2010-01-12 12:58:48 +00:00
Max Horn
590481b12d
Improve support for negative Timestamps, and add + and - operators
...
svn-id: r47244
2010-01-11 10:17:55 +00:00
Johannes Schickel
27957570bf
Typo.
...
svn-id: r47230
2010-01-10 15:43:42 +00:00
Johannes Schickel
bfed78a5db
Add some more comments.
...
svn-id: r47229
2010-01-10 15:42:22 +00:00
Johannes Schickel
59471e3f43
Fix missing type forward declaration in voc.h.
...
svn-id: r47228
2010-01-10 15:30:31 +00:00
Johannes Schickel
6ca0570fe3
- Add a SubLoopingAudioStream, which loops a nested part of a stream and thus features the same looping capabilites as LinearMemoryStream and LinearDiskStream.
...
- Remove custom looping code from LinearMemoryStream and LinearDiskStream.
- Adapt various client code to the changes.
svn-id: r47226
2010-01-10 15:20:14 +00:00
Max Horn
a44c6e4323
Add Mixer::getElapsedTime() method returning a Timestamp, thus offering a higher precision than Mixer::getSoundElapsedTime(). Convert some video code to use it.
...
svn-id: r47213
2010-01-09 22:37:10 +00:00
Max Horn
4a832ceb01
Fix Timestamp::addMsecs; some cleanup
...
svn-id: r47212
2010-01-09 22:36:32 +00:00
Johannes Schickel
9c2fa534d1
Implement some safer handling of the "Extended" block in VOC files.
...
svn-id: r47203
2010-01-09 18:51:25 +00:00
Max Horn
be8371fb07
Replace AppendableAudioStream by QueuingAudioStream
...
svn-id: r47189
2010-01-09 00:19:13 +00:00
Willem Jan Palenstijn
229c53d485
Use DisposeAfterUse::Flag
...
svn-id: r47187
2010-01-08 23:05:00 +00:00
Johannes Schickel
b8727aefcc
Fix LinearMemoryStream::seek, when the stream was created without request to dispose the memory itself.
...
svn-id: r47184
2010-01-08 22:14:55 +00:00
Max Horn
f720d99b0a
Switch Mixer::playInputStream to use DisposeAfterUse::Flag
...
svn-id: r47182
2010-01-08 22:09:43 +00:00
Max Horn
474d49946f
Rename QueuedAudioStream to QueuingAudioStream
...
svn-id: r47179
2010-01-08 22:06:04 +00:00
Max Horn
95726dfe50
Move Mohawk's QueuedAudioStream to sound/ (with some tweaks)
...
svn-id: r47177
2010-01-08 22:04:30 +00:00
Johannes Schickel
271956f2d7
Add some warning inside makeLoopingAudioStream, in case the give start time is after the given end time.
...
svn-id: r47162
2010-01-08 16:38:51 +00:00
Johannes Schickel
616e4626f5
Since AudioStream looping is no longer handled by the Mixer, drop Mixer::playAudioStreamLooping. (There's Audio::makeLoopingAudioStream).
...
svn-id: r47160
2010-01-08 16:27:29 +00:00
Johannes Schickel
e976b11995
Add another makeLoopingAudioStream factory for transparently looping a certain interval of a SeekableAudioStream.
...
svn-id: r47159
2010-01-08 16:25:51 +00:00
Johannes Schickel
a5adbb851a
Fix use of getRate in VorbisInputStream's constructor. (Thanks to cyx for spotting this)
...
svn-id: r47144
2010-01-07 23:50:18 +00:00
Johannes Schickel
a15cc002bb
Cleanup.
...
svn-id: r47139
2010-01-07 20:13:02 +00:00
Johannes Schickel
bd651c6c3d
Fix a little bug in LoopingAudioStream::readBuffer.
...
svn-id: r47138
2010-01-07 19:34:19 +00:00
Johannes Schickel
127213f706
Remove setNumLoops and getNumPlayedLoops from AudioStream.
...
svn-id: r47137
2010-01-07 17:45:38 +00:00
Johannes Schickel
aa2f55ddc6
Remove the deprecated FLAC, Vorbis and MP3 factories.
...
svn-id: r47134
2010-01-07 17:14:44 +00:00
Johannes Schickel
b47725540f
Cleanup.
...
svn-id: r47133
2010-01-07 17:04:32 +00:00
Johannes Schickel
a597e5fef9
Make VagStream a RewindableAudioStream.
...
svn-id: r47132
2010-01-07 17:04:01 +00:00
Johannes Schickel
d5fe29c3c9
Make makeWAVStream return a RewindableAudioStream.
...
svn-id: r47129
2010-01-07 16:34:56 +00:00
Johannes Schickel
ca5e137945
Create a wrapper makeLoopingAudioStream to reduce code duplcation.
...
svn-id: r47128
2010-01-07 16:18:03 +00:00
Johannes Schickel
2e9bae44c5
Let ADPCM streams subclass RewindableAudioStreams and thus allow them to be looped with the new looping code.
...
svn-id: r47127
2010-01-07 16:08:41 +00:00
Max Horn
4f463e288e
Get rid of calculatePlayTime, instead store playtimes as Timestamps
...
svn-id: r47122
2010-01-07 15:25:14 +00:00
Max Horn
32ec5746be
Add Timestamp::totalNumberOfFrames() method, clarify some comments
...
svn-id: r47120
2010-01-07 15:12:20 +00:00
Max Horn
423094cd5f
Fix warning
...
svn-id: r47119
2010-01-07 15:11:46 +00:00
Johannes Schickel
c57549184b
Add important note for engine authors about SubSeekableAudioStream.
...
svn-id: r47114
2010-01-07 14:25:16 +00:00
Johannes Schickel
6abc10c6ea
Add a playInputStreamLooping for RewindableAudioStream to Mixer.
...
svn-id: r47113
2010-01-07 14:23:42 +00:00
Johannes Schickel
e00f36f9c7
Cleanup.
...
svn-id: r47112
2010-01-07 14:22:57 +00:00
Johannes Schickel
b80779824f
- Strip custom looping code out of FLAC, Vorbis and MP3 streams
...
- Adapt the legacy make*Stream factories to use the new AudioStream subclasses
- Change return value of make*Stream back to AudioStream *
svn-id: r47111
2010-01-07 14:22:24 +00:00
Johannes Schickel
49e53ade00
Switch Mixer back to use only one Channel implementation. (partial revert of r47031 + r47034).
...
svn-id: r47110
2010-01-07 14:21:13 +00:00
Johannes Schickel
aa92e004f5
First step of a slight revision of the new AudioStream looping API:
...
- Create a RewinadableAudioStream, for streams which can only be reset to the start
- Create a LoopableAudioStream, which loops a whole RewindableAudioStream
- Make SeekableAudioStream a subclass of RewindableAudioStream
- Create a SubSeekableAudioStream, which allows of limiting the range of an SeekableAudioStream to be played.
- Adapt AudioCD code.
svn-id: r47109
2010-01-07 14:20:36 +00:00
Johannes Schickel
b6fb8b349a
Fix FLAC's getLength implementation.
...
svn-id: r47093
2010-01-06 20:25:19 +00:00
Johannes Schickel
f32aeb01bf
Add a constructor to Timestamp, which allows for specifying seconds + start frames directly.
...
svn-id: r47091
2010-01-06 20:24:56 +00:00
Johannes Schickel
8c79b6f6ee
Adapt FLAC and Vorbis to use calculateSampleOffset in their seek implementation.
...
svn-id: r47085
2010-01-06 16:11:21 +00:00
Max Horn
dd76e2bda0
Rename some Timestamp methods: getNumberOfFrames -> numberOfFrames and getFramerate -> framerate
...
svn-id: r47083
2010-01-06 15:56:04 +00:00
Johannes Schickel
297a955579
- Simplify Audio::calculateSampleOffset.
...
- Made Audio::calculateSampleOffset accessable from outside audiostream.cpp.
- Adapt KYRA's AUDStream to use Audio::calculateSampleOffset.
svn-id: r47082
2010-01-06 15:40:49 +00:00
Johannes Schickel
e72707b04e
- Add some functionallity to query the seconds and number of frames stored in a Timestamp.
...
- Add tests for these
svn-id: r47081
2010-01-06 15:33:54 +00:00
Johannes Schickel
84f3034406
- Move openStreamFile from AudioStream to SeekableAudioStream.
...
- Fix documentation of openStreamFile.
svn-id: r47080
2010-01-06 15:23:33 +00:00
Max Horn
1c6ccf8000
Add more comparision operators to Timestamp
...
svn-id: r47071
2010-01-06 12:15:05 +00:00
Max Horn
5b635fd610
Change the way Timestamp stores its data.
...
Instead of storing milliseconds and frames (which causes rounding errors,
and causes ambiguity in how a given time is stored), we now do things
differently: We store a number of seconds, and frames. To make sure that
we can still handle milliseconds accurately, though, we change the
framerate to the least common multiple of the original framerate and
1000. So 60 becomes 6000, and 44100 becomes 441000. There are no visible
changes for client code, except for the increased accuracy.
svn-id: r47070
2010-01-06 12:09:14 +00:00
Johannes Schickel
789f2ce255
The current AIFF stream implementations returns a SeekableAudioStream, reflect that in its factory method.
...
svn-id: r47067
2010-01-06 00:02:49 +00:00
Johannes Schickel
8638d6ce61
Change the AudioStream::openStreamFile API to return SeekableAudioStreams and remove parameter for depreacted loop support. (We could consider moving this to SeekableAudioStream).
...
svn-id: r47065
2010-01-06 00:01:57 +00:00
Johannes Schickel
81a94a0644
- Put the new factories for MP3, Vorbis and FLAC in place.
...
- Marked the loop factories with loop related parameters as deprecated.
svn-id: r47061
2010-01-05 23:59:28 +00:00
Johannes Schickel
e38b7b3cc5
Properly initialize _pos in LoopingChannel.
...
svn-id: r47055
2010-01-05 22:02:04 +00:00
Johannes Schickel
7591a09365
Implement Timestamp::operator== as equality in time.
...
svn-id: r47054
2010-01-05 22:01:05 +00:00
Johannes Schickel
2d3a06f805
Cleanup.
...
svn-id: r47052
2010-01-05 22:00:06 +00:00
Robin Watts
61c413e114
Update ARM version of rate filler code in line with LordHoto's change
...
in revision 47014.
svn-id: r47051
2010-01-05 21:56:13 +00:00
Johannes Schickel
083cab5157
Cleanup.
...
svn-id: r47046
2010-01-05 21:10:58 +00:00
Johannes Schickel
caa3db4659
- Initial implementation of looping of SeekableAudioStreams in Mixer.
...
- Adapted AudioCD code to use this for audio CD emulation.
svn-id: r47045
2010-01-05 21:10:34 +00:00
Johannes Schickel
920dac2f9d
Remove unsafe getTotalPlayTime from AudioStream.
...
svn-id: r47037
2010-01-05 20:14:28 +00:00
Johannes Schickel
e9a94ecb9b
Add a "getLength" function to SeekableAudioStream.
...
svn-id: r47036
2010-01-05 20:13:31 +00:00
Johannes Schickel
7d126de793
Add some basic documentation to the new Channel interface.
...
svn-id: r47034
2010-01-05 19:52:50 +00:00
Johannes Schickel
7d5b2b118a
- Do not calculate left/right channel volume every SimpleChannel::mix call anymore, but do it once
...
- Notify a channel, when it's channel volume type changed from inside MixerImpl::setVolumeForSoundType
svn-id: r47033
2010-01-05 19:52:32 +00:00
Johannes Schickel
4ebcd1c61c
Get rid of public variables in Channel.
...
svn-id: r47032
2010-01-05 19:52:12 +00:00
Johannes Schickel
63bccc213b
Create a generic Channel interface for the default Mixer implementation.
...
svn-id: r47031
2010-01-05 19:51:48 +00:00
Johannes Schickel
50888f5b65
- Fix a bug in Channel::pause for recursive pausing.
...
- Fix bug in Channel:getElapsedTime, when called while the channel is paused.
svn-id: r47029
2010-01-05 18:32:26 +00:00
Johannes Schickel
d485d0c295
Oops somehow I must have missed CopyRateConverter::flow, in r47014.
...
svn-id: r47016
2010-01-05 02:48:38 +00:00
Johannes Schickel
5b9f267e71
Use the return value of RateConverter::flow to calculate the decoded samples and not the upper bound "len". (This should only be a difference when the audio stream has no more samples left)
...
svn-id: r47015
2010-01-05 02:42:55 +00:00
Johannes Schickel
2ef2064f44
Make RateConverter::flow return the number of sample pairs written, like it's documented in the .cpp file.
...
svn-id: r47014
2010-01-05 02:42:35 +00:00
Johannes Schickel
f5c3bd887e
- Add a new SeekableAudioStream interface. Soon to be used to replace audio stream specific looping code by generic code in Mixer...
...
- Adapted some existing AudioStreams to implement that interface (not tested!)
svn-id: r47013
2010-01-05 02:27:24 +00:00
Max Horn
645f73cb18
Switch Channel::getElapsedTime() to use a Timestamp for its computations
...
svn-id: r46995
2010-01-04 22:48:52 +00:00
Max Horn
4ae9412a3a
Make some improvements for Audio::Timestamp.
...
* Add convertToFramerate() method
* Add framerate() method
* Add operator == and !=
* Improve frameDiff() to work for two timestamps with distinct framerates
* Improve Doxygen comments
svn-id: r46994
2010-01-04 22:48:28 +00:00
Johannes Schickel
b2355cac9f
- Remove unsafe default constructor of Audio::Timestamp.
...
- Add an assert which prevents the _frameRate from being 0 in the Audio::Timestamp constructor.
svn-id: r46958
2010-01-03 22:41:35 +00:00
Torbjörn Andersson
72eb9ec9ea
Fixed a bunch of cppcheck warnings. Mostly about checking if a pointer is null
...
before freeing it, which isn't necessary.
svn-id: r46941
2010-01-03 19:37:43 +00:00
Willem Jan Palenstijn
13a242838f
SCI/new music code: Don't stop notes when looping for a hold
...
svn-id: r46897
2010-01-02 20:20:36 +00:00
Johannes Schickel
137744c40c
This time properly fix getTotalPlayTime for looped FLAC, MP3 and VORBIS audio streams.
...
svn-id: r46863
2010-01-01 22:57:08 +00:00
Johannes Schickel
2e9d5a5f41
Mention in documentation of AudioStream::setNumLoops, that this function also resets the number of loops played counter.
...
svn-id: r46862
2010-01-01 22:56:18 +00:00
Johannes Schickel
6109275750
Properly reset _numPlayedLoops in setNumLoops in all AudioStream implementations implementing setNumLoops.
...
svn-id: r46861
2010-01-01 22:55:38 +00:00
Martin Kiewitz
f3cd114c5c
init _numPlayedLoops inside LinearMemoryStream
...
svn-id: r46857
2010-01-01 22:16:53 +00:00
Johannes Schickel
bba2c8ce95
Fix getTotalPlayTime for MP3, FLAC, Vorbis and LinearMemoryStream after the latest loop related changes.
...
svn-id: r46838
2010-01-01 16:57:23 +00:00
Eugene Sandulenko
622dd0d16d
Implemented setNumLoops() for common audio streams.
...
Implemented getNumPlayedLoops() for common audio streams.
Requested by m_kriewitz.
svn-id: r46836
2010-01-01 16:28:22 +00:00
Eugene Sandulenko
5ebadb10d4
Extend doxygen comment for setNumLoops()
...
svn-id: r46832
2010-01-01 15:35:12 +00:00