aboutsummaryrefslogtreecommitdiff
path: root/sword2/driver/d_sound.cpp
AgeCommit message (Collapse)Author
2005-05-12Whitespace: "(type *)something" instead of "(type *) something", becauseTorbjörn Andersson
that's how we write it in most other places. svn-id: r18069
2005-05-11Moved some more stuff to namespace Audio (enough for tonight)Max Horn
svn-id: r18040
2005-05-10Moved class SoundMixer to Audio::Mixer (didn't call the namespace 'Sound' ↵Max Horn
because we already have many classes with that name) svn-id: r18039
2005-05-10Moved class File and the MD5 stuff to namespace CommonMax Horn
svn-id: r18037
2005-05-05Fixed some doxygen warningsMax Horn
svn-id: r17923
2005-05-02Cleanup. Most of is simply moves the credits code out of Logic and intoTorbjörn Andersson
Screen. I've also added an unused "splash screen" function that displays the image that used to be shown by CacheNewCluster() while copying a data file from CD to hard disk. ScummVM doesn't do that, but it's a nice image that I wish we could do something useful with, and it's easier to have the code here for reference than having to dig through old revisions of the resource manager. svn-id: r17894
2005-03-12PlayingSoundHandle -> SoundHandle; also, turned the handle activity check ↵Max Horn
into a mixer method svn-id: r17106
2005-03-09changing AudioDataType -> SoundType, so now the constant names match the ↵Max Horn
name of the data type / the SoundMixer method names svn-id: r17052
2005-02-27Got rid of all the .h files but one in the 'driver' directory. They wereTorbjörn Andersson
either very small or, in the case of driver96.h, a disorganized jumbles. svn-id: r16952
2005-02-21basically the same change as for bs1; don't keep the mutex locked while ↵Robert Göffringmann
loading mp3, ogg or wave data. it blocks the playing thread for too long. Also added index caching for the speech and music clusters to reduce seeks. svn-id: r16849
2005-02-19This is the second part of the BS2 restructuring. There are two newTorbjörn Andersson
classes: Screen and Mouse. Screen handles most of the drawing, except the mouse cursor and in-game menus. The old Graphics class is no more. I've also fixed some "reverse stereo" regressions from the first part of the restructuring. I'm not sure what the next step will be, but hopefully it will be smaller than this one was. svn-id: r16812
2005-02-18Forgot to check if preFetchCompSpeech() could find the speech file. Now itTorbjörn Andersson
will work even if the file is missing. (This only affects the cutscene player.) svn-id: r16806
2005-02-08Now there are two file handles for the music: one for each CD. This is notTorbjörn Andersson
the same thing as one for each music stream. If both music streams are playing music from the same CD, they will both take turns at using the same file handle. The only case where both file handles are used is when music from one CD is fading in while music from the other CD is fading out. Which of course can only happen if you play the game from hard disk. If the game has to ask for the other CD, it kills the music immediately. The reason for doing this is that there was some concern about whether having two file handles open to the same file was portable or not. I don't think that question was ever fully answered, so I avoid the situation. svn-id: r16753
2005-02-07Fixed crash that would happen if the game tried to play music from CD1 andTorbjörn Andersson
CD2 at the same time. There will eventually be a better fix for this, I hope. svn-id: r16750
2005-01-28Began what I hope is the final major restructuring of the BS2 engine.Torbjörn Andersson
In this first step, I have moved all opcode functions into functions.cpp, instead of having them scattered all over the place. To get things to compile again, I had to rewrite the overly complicated sound effects handling. It's much simpler now. The next step will be to move any non-trivial code out of the opcode functions and into the appropriate object. This, I hope, will make it easier to create well-separated objects, instead of the current mess. I also want to tear down the artificial boundary between the main directory and the "driver" directory. We already have a cross-platform layer; there's no need to have yet another one. (Actually, the rewriting of the sound effects code took one first step in this direction.) At the final stage, I'd like to get rid of the "drivers" directory completely, but I'll probably need some help with that if I want to preserve the CVS history of the code. Things will probably be a bit bumpy along the way, but I seem to have reached a point of relative stability again, which is why I'm commiting this now. svn-id: r16668
2005-01-17Updated copyright header, as discussed on the mailing list.Torbjörn Andersson
svn-id: r16580
2005-01-11Use Fingolfin's new WAV code.Torbjörn Andersson
svn-id: r16540
2005-01-10system.h was being included in tons of places, without any good reason; ↵Max Horn
reduced this (total dependencies on system.h went down from 193 to 85 files) svn-id: r16527
2005-01-09Mark some places which probably should use loadWAVFromStream(); maybe some ↵Max Horn
of the engine maintainers can look into using it svn-id: r16503
2005-01-01Updated copyright year.Torbjörn Andersson
svn-id: r16397
2004-12-27Use the mixer to handle sound volumesMax Horn
svn-id: r16349
2004-12-27Use the same volume ranges as most of the rest of ScummVM (i.e. 0-255)Max Horn
svn-id: r16333
2004-12-27Added 'sound types' to the mixer - for now, only plain (for the premixer), ↵Max Horn
SFX and music; volume is now controlled based on the sound type svn-id: r16330
2004-12-11Fix dumb CE compilerNicolas Bacca
svn-id: r16026
2004-11-28Changed parameter order of SoundMixer::playInputStream to match that of playRawMax Horn
svn-id: r15950
2004-11-27AudioStream::read() has been removed quite some time ago, now making sure ↵Max Horn
that change is reflected everywhere svn-id: r15911
2004-10-17Doxygen fixMax Horn
svn-id: r15594
2004-10-12Migration to the newer form of setupPremix().Torbjörn Andersson
svn-id: r15532
2004-10-12CleanupTorbjörn Andersson
svn-id: r15526
2004-09-28Rename remaining OSystem methods to match our coding guidelinesMax Horn
svn-id: r15332
2004-09-04Fix compileTravis Howell
svn-id: r14898
2004-09-04Fixed a glitch in the music fade-out code.Torbjörn Andersson
svn-id: r14888
2004-09-04Added support for compressed music. I'm sure there are some glitches stillTorbjörn Andersson
to fix, but it should work well enough for now. In this rewrite of the music code, I removed the "save/restore music state" function, since it just complicated things for a very small gain. It wasn't in the original engine, and I added it just for the credits, so that the previously playing music could be resumed afterwards. I might re-add it later, but probably not. svn-id: r14887
2004-08-28Cleanup. Removed the original DipMusic() code. If anyone wants toTorbjörn Andersson
implement it - personally I don't see the need - they can get it from CVS. svn-id: r14819
2004-08-27Use the same code for opening the music clusters as for opening the speechTorbjörn Andersson
clusters. (No, that doesn't mean compressed music is support yet. This is just a tiny little step closer.) svn-id: r14794
2004-08-26Explicitly cast value to uint32, since there was a report about compilationTorbjörn Andersson
problems. Perhaps this will fix it? svn-id: r14762
2004-08-25The original speech clusters are now decoded through a custom AudioStreamTorbjörn Andersson
class, so they are handled the same way as the compressed clusters. The next step will be to migrate the music playback to use the same class, which means the fade-in/out logic needs to be separated from the decoding. Once this is done, adding support for compressed music should be a piece of cake. svn-id: r14740
2004-08-23Fixed the bug that caused Vorbis and FLAC to misbehave with compressedTorbjörn Andersson
speech. (Apparently it was just an accident that MP3 worked.) Unfortunately I had to change the file format of the compressed files to include both the compressed and uncompressed size, but since the tool to create these files has only lived as an item in the patch tracker, no one should have exptected it to be the final, working version, right? Right. svn-id: r14698
2004-08-22Experimental (i.e. slightly broken) code for handling compressed speech.Torbjörn Andersson
The equally experimental compression tool is in patch #854561. Support for compressed music will require some restructuring first. svn-id: r14684
2004-07-17Allowing both music streams to share the same rate converter only workedTorbjörn Andersson
by accident, and could cause bad noises during music cross-fades. This wasn't a problem in 0.6.0 since all music is sampled at 22050 Hz, which is the most likely output sample rate for ScummVM, so the converter didn't actually have to do anything. Now, however, the output sample rate could be anything. I've given the music streams one converter each. In BS1, which uses similar music code, it was already necessary to do this since some of its music is sampled at 11025 Hz. svn-id: r14237
2004-06-12CleanupTorbjörn Andersson
svn-id: r13956
2004-05-01Simplified the handling of sound effects. It's not necessary for the driverTorbjörn Andersson
to keep its own copy of the sound data. It could be even further simplified (I don't really see any reason for having two different sound queues), but I seem to have reached a point of stability here and I don't want to jinx it by making further changes yet. svn-id: r13705
2004-04-23Major revamping of the BS2 memory manager and, some small changes to theTorbjörn Andersson
resource manager. All new code! All new bugs! svn-id: r13603
2004-03-13Fixed a slight logic error in the music fading. At this point the codeTorbjörn Andersson
should only check if the music is fading, not in which direction. (Also made a minor cleanup.) svn-id: r13235
2004-02-28renamed more OSystem methods to follow our naming scheme; renamed ↵Max Horn
NewGuiColor to OverlayColor; fixed some calls to error() in the SDL backend svn-id: r13087
2004-02-15Proper handling of BS2 cutscene lead-outs, plus some other minor fixes.Torbjörn Andersson
svn-id: r12907
2004-02-05Removed some of the #includes from sword2.hTorbjörn Andersson
svn-id: r12739
2004-01-29Renamed the 'pan' effect of the mixer to 'balance', since that is what we ↵Max Horn
actually do; applied patch #886786 which corrects a bug in the balance code svn-id: r12665
2004-01-16Made a separate function out of the code that retrieves information aboutTorbjörn Andersson
an in-memory WAV file. At the moment it's only used in one place, which is a bit silly, but I hope to use it for the cutscene player to figure out when to start the lead-out music. (To do that I'll need to know how long the cutscene is, though. I haven't looked into how to find that out yet.) svn-id: r12424
2004-01-14I accidentally introduced a bug when I changed the fading that would causeTorbjörn Andersson
fading-up music to distort and eventually deteriorate into white noise. This was because I allowed _fade to be set on channels that weren't playing and because I only checked _fade for equality when deciding when to stop the fading. It should work much better now, I think. svn-id: r12392