Commit Graph

165 Commits

Author SHA1 Message Date
Johannes Schickel
e5e94d4511 Strip trailing whitespaces in our common code base.
svn-id: r51094
2010-07-21 18:17:51 +00:00
Johannes Schickel
5b2a60d049 Rewind the underlying audio stream on LoopingAudioStream creation.
Also mention in the documentation that both LoopingAudioStream and
SubLoopingAudioStream do rewind the underlying in their constructor.

svn-id: r49539
2010-06-09 13:34:15 +00:00
Johannes Schickel
86653687d7 Fix for bug #2969211 "NIPPON: Crash in Intro".
It is not a good idea to supply an SubLoopingAudioStream with the start
and end time to be exactly the same time. Clarify that in the
SubLoopingAudioStream documentation, add an assert in the
SubLoopingAudioStream constructor for that case and also prevent
make8SVXStream from doing so.

svn-id: r48356
2010-03-22 15:54:56 +00:00
Max Horn
7f2259c11f Add assert(!_finished) to QueuingAudioStreamImpl::queueAudioStream
svn-id: r48122
2010-02-23 22:54:23 +00:00
Johannes Schickel
52af1b3884 Formatting.
svn-id: r48023
2010-02-09 22:03:59 +00:00
Johannes Schickel
e7d6d44e86 Be a bit more forgiveful in case the SeekableAudioStream passed to SubLoopingAudioStream does not allow reading the requested sample count at once (i.e. do not tread that as error, unless endOfData() is set).
svn-id: r48022
2010-02-09 22:03:02 +00:00
Johannes Schickel
b097e8635c Stop SubLoopingAudioStream playback, in case reading from the parent stream fails.
svn-id: r48021
2010-02-09 21:52:46 +00:00
Johannes Schickel
6a624df560 Make Audio::convertTimeToStreamPos return a frame-precision based result instead of a sub-frame-precision based result. This fixes the SubLoopingAudioStream tests.
svn-id: r48020
2010-02-09 21:52:27 +00:00
Johannes Schickel
f6aa8d0068 Fix SubLoopingAudioStream's readBuffer implementation.
svn-id: r48018
2010-02-09 21:51:47 +00:00
Johannes Schickel
b431e700d8 Fix bug in LoopingAudioStream::readBuffer, this makes the unit tests complete without any error.
svn-id: r47935
2010-02-06 16:42:15 +00:00
Johannes Schickel
fe35d372da - Rename FlacStream to FLACStream.
- Rename makeFlacStream to makeFLACStream.

svn-id: r47846
2010-02-03 09:42:11 +00:00
Johannes Schickel
3cc0ef6c1c Remove RawMemoryStream.
svn-id: r47717
2010-01-30 15:28:07 +00:00
Johannes Schickel
812603e29e Fix invalid sample position on Timestamp to sample conversion for Stereo streams.
svn-id: r47591
2010-01-27 08:08:33 +00:00
Max Horn
1565f14bc1 Moved audio stream implementations (for MP3, FLAC, etc.) to new dir sound/decoders/
svn-id: r47579
2010-01-26 22:48:45 +00:00
Johannes Schickel
ec14cd6e6a Formatting.
svn-id: r47540
2010-01-25 01:27:14 +00:00
Max Horn
4b996e7de7 Reorder params to Audio::makeRawMemoryStream
svn-id: r47492
2010-01-23 23:55:35 +00:00
Max Horn
f189cc39fc Get rid of FLAG_LOOP
svn-id: r47473
2010-01-23 13:34:59 +00:00
Max Horn
b036392a7b Get rid of deprecated makeRawDiskStream variants; rename deprecated makeRawMemoryStream variant to makeRawMemoryStream_OLD; adapt some code to this change
svn-id: r47472
2010-01-23 13:34:29 +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
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
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
be8371fb07 Replace AppendableAudioStream by QueuingAudioStream
svn-id: r47189
2010-01-09 00:19:13 +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
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
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
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
ca5e137945 Create a wrapper makeLoopingAudioStream to reduce code duplcation.
svn-id: r47128
2010-01-07 16:18:03 +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
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
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
84f3034406 - Move openStreamFile from AudioStream to SeekableAudioStream.
- Fix documentation of openStreamFile.

svn-id: r47080
2010-01-06 15:23:33 +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
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
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
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