Commit graph

56 commits

Author SHA1 Message Date
Christoph Oelckers
43dff3021b - fixed: The OpenAL backend ignored PlaySound's 'volume' parameter. 2015-11-25 13:00:56 +01:00
Marrub
9e1a82a830 fix menus muting themselves when the volume is changed 2015-07-10 08:45:15 +00:00
Edoardo Prezioso
346fcf584c - Fixed C++11 warnings from recent commits. 2015-04-27 15:22:09 +02:00
Christoph Oelckers
aecff68a4d - cleanup of sound system startup and menu handling:
* added global functions that check whether FMod and OpenAL are present, without initializing the sound backend.
* make sound init code more fault tolerant. It will now try to switch between FMod and OpenAL if the currently active one cannot be found but the other one can.
* added 'ifoption' checks for sound backend to menu code.
* only show sound backends which are present and hide the options for the ones which are not.
2015-04-26 12:13:21 +02:00
Christoph Oelckers
6bb79be85c - got rid of std::auto_ptr, courtesy of Blzut3's patch. 2015-04-25 17:50:57 +02:00
Christoph Oelckers
d880783784 - make OpenAL and the decoder libraries delay loaded so that ZDoom can still start without them being present.
This required the addition of a few exception handlers so to avoid #ifdef overuse I also added some #defines for non-Windows systems that allow using __try and __except directly in the code without #ifdef'ing them out.
2015-04-25 12:25:10 +02:00
Christoph Oelckers
12118550d2 - fixed some warnings in OpenAL code. 2015-04-25 10:34:47 +02:00
Christoph Oelckers
dccd35ef29 - uncoupled OpenAL music updates from UpdateSounds.
UpdateSounds will not be called during screen wipes and the entire setup of this function suggests that this is not advisable at all.
The OpenAL stream updates were done deep inside this function implicitly.
This caused music to stop while a wipe was in progress. So in order to allow uninterrupted music playback during screen wipes the music updates need to be handled separately from sound updates and be called both in the main loop and the wipe loop.

I think that the OpenAL music updating should be offloaded to a separate thread but at least it's working now without causing interruptions during wipes.
2015-04-25 10:26:14 +02:00
Chris Robinson
4b68891de7 Rename 'near', because microsoft 2014-09-14 11:15:32 -07:00
Chris Robinson
d43226631d Set reverb density based on the environment size 2014-07-15 23:04:53 -07:00
Chris Robinson
90fa215da2 Replace another std::vector with a TArray 2014-06-28 23:30:58 -07:00
Chris Robinson
ae95a2d5cf Fix creating effect map entries
TMap apparently doesn't clear the memory for new entries like std::map...
2014-06-28 05:41:11 -07:00
Chris Robinson
7f3be7bf14 Show the name of unsupported sound formats with OpenAL 2014-06-28 01:25:25 -07:00
Chris Robinson
afcada4a3b Remove an unused field 2014-06-28 00:46:45 -07:00
Chris Robinson
7908116fef Use a separate function to update an openal stream's volume 2014-06-28 00:37:12 -07:00
Chris Robinson
c73d97af44 Use TArray and TMap instead of std::vector and std::map 2014-06-28 00:33:15 -07:00
Chris Robinson
6f8545e694 Use a TArray for SoundDecoder::readAll 2014-06-27 21:51:05 -07:00
Chris Robinson
0adfdf31dd Fix calling SetPosition when not playing 2014-06-25 21:50:52 -07:00
Chris Robinson
a6900b48ba Use AL_SOFT_deferred_updates to sync updates when availeble 2014-06-25 21:48:13 -07:00
Chris Robinson
c6bb52c866 Get the length from sounds when possible 2014-06-25 21:14:35 -07:00
Chris Robinson
fd25ec2a62 Implement GetPosition for OpenAL streams, and display it in the stats 2014-06-25 20:03:24 -07:00
Chris Robinson
7f5b538110 Implement SetPosition for OpenAL streams 2014-06-25 04:59:18 -07:00
Chris Robinson
9c12abeb2d Better report the amount buffered in an OpenAL stream 2014-06-25 04:53:08 -07:00
Chris Robinson
0017e1e6e8 Use a FileReader to handle music resources and audio decoding
Instead of the previous method where there'd be a filename and offset, and/or a
memory pointer, this uses a class to access resource data regardless of its
underlying form.
2014-06-25 04:25:36 -07:00
Chris Robinson
075c5d872d Always use the pitch multiplier when underwater 2014-06-22 22:22:45 -07:00
Chris Robinson
b2f9430fb1 Use the correct diffusion value for reverb
I don't know what the Density and Diffusion values correspond to, but
EnvDiffusion is the actual diffusion setting.
2014-06-22 19:38:47 -07:00
Chris Robinson
a434af92ee Handle sounds marked as 'area sounds'
Note, the area radius is 128 units for it to actually do something, unlike FMOD
where it's only 32.
2014-06-22 19:35:09 -07:00
Chris Robinson
845e369b87 Don't set a room rolloff factor
The reverb engine already handles an initial attenuation based on the
attenuation of the dry path.
2014-06-20 05:03:20 -07:00
Chris Robinson
f0c9aae670 Rework manual rolloff handling
For distance models OpenAL doesn't handle, alter the source's distance to get
the appropriate attenuation instead of the source's gain.
2014-06-20 04:38:48 -07:00
Chris Robinson
ef7ce41d07 Don't purge sources in an initial state 2014-06-20 01:17:48 -07:00
Chris Robinson
fb07f7ef07 Cast OpenAL IDs to/from void* 2014-06-20 01:12:47 -07:00
Chris Robinson
906b828d87 Partially implement OpenALSoundRenderer::SetInactive 2014-06-20 00:41:19 -07:00
Chris Robinson
42fdc3c059 Use structs to store available extensions 2014-06-19 23:49:46 -07:00
Chris Robinson
0f234fb36d Remove an unused function 2014-06-19 23:10:36 -07:00
Chris Robinson
9f493fca5f Move the generic DecodeSample implementation to the base class 2014-06-19 22:42:12 -07:00
Chris Robinson
a661797aa8 Be less noisey about loop points 2014-06-19 22:31:19 -07:00
Chris Robinson
73d8659f23 Remove an unnecessary cast 2014-06-19 22:21:05 -07:00
Chris Robinson
07a50c604e Use the correct formatter type 2014-06-19 22:13:20 -07:00
Chris Robinson
e39165655d Don't call the sfx volume cvar callback in the OpenALSoundRenderer constructor
I_InitSound already does that after creating it.
2014-06-19 21:51:16 -07:00
Chris Robinson
14618cbf30 Remove use of SDL_sound 2014-06-19 04:33:00 -07:00
Chris Robinson
b38589e2dc Implement and use a libsndfile decoder 2014-06-19 04:13:42 -07:00
Chris Robinson
b94a2949e5 Don't use air absorption for being underwater 2014-06-18 23:41:45 -07:00
Chris Robinson
0e21057a2a Merge remote-tracking branch 'origin/openal' into openal
Conflicts:
	src/sound/fmodsound.cpp
	src/sound/oalsound.cpp
	src/sound/oalsound.h
2014-06-15 09:59:24 -07:00
Chris Robinson
160e70f8f2 Fix getting the actual device name 2014-06-15 09:27:00 -07:00
Braden Obrzut
2142e857a9 - Applied VoidMage's OpenAL patch. 2013-10-23 19:41:58 -04:00
Chris Robinson
665d685a44 Implement GetStats for OpenAL streams 2013-06-30 20:31:41 -07:00
Chris Robinson
c4492f88ee Make sure streams are "pumped" 2013-06-30 08:04:41 -07:00
Chris Robinson
ba3cc38d09 Support float stream callbacks with AL_EXT_FLOAT32 2013-06-30 08:04:08 -07:00
Chris Robinson
69af01d629 Use SDL_sound when available to decode files 2013-06-30 07:45:57 -07:00
Chris Robinson
99209c4a2a Remove an unnecessary function 2013-06-30 04:47:10 -07:00