Commit graph

167 commits

Author SHA1 Message Date
Christoph Oelckers
5e975ac9f6 - extended $mididevice to add an optional parameter, which has the following meaning for the different MIDI devices:
* OPL: specify the core to use for playing this song
* FluidSynth: specify a soundfont that should be used for playing the song.
* WildMidi: specify a config file that should be used for playing the song.
* Timidity++: specify an executable that should be used for playing the song. At least under Windows this allows using Timidity++ with different configs if the executable and each single config are placed in different directories.
* GUS: currently not operational, but should later also specify the config. This will need some work, because right now this is initialized only when the sound system is initialized.
* all other: no function.

These options should mainly be for end users who want to fine-tune how to play the music.
2015-12-31 23:03:53 +01:00
Christoph Oelckers
1e0366f98f - fixed: $musicalias must be resolved before comparing for equality with the currently playing music. 2015-11-25 13:27:35 +01:00
Christoph Oelckers
13fb76db21 - changed lump reader setup for music so that for uncompressed data it opens a new FILE instead of caching the lump.
This reinstates behavior of pre-OpenAL versions but still uses the FileReader interface to keep the simplified code of the OpenAL branch.
2015-04-26 23:28:05 +02:00
Christoph Oelckers
4294b94728 - since Wads.ReopenLumpNum already performs caching on the lump data it is not really necessary anymore to maintain a separate musiccache, so this code can be removed. 2015-04-26 22:09:19 +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
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
Christoph Oelckers
1f2a431d15 Merge branch 'master' into openal 2015-04-24 09:21:06 +02:00
Randy Heit
a7ff9478a7 Fixed: S_PrecacheLevel() could create orphan channels
- S_PrecacheLevel() must also mark currently playing sounds as
  used. If we don't, the sound could be unloaded and the underlying
  channel stopped without triggering a channel callback. That would leave
  the code in s_sound.cpp thinking the sound is still playing even though
  it isn't.
- Added an invalid channel check to FMODSoundRenderer::StopChannel() so
  that orphan channels passed to it will be returned at least when
  S_StopAllChannels() is called.
2015-04-22 20:33:08 -05:00
Braden Obrzut
98b2475fb8 - Fixed: Loading music from an external file was broken. 2015-03-25 17:28:05 -04:00
Christoph Oelckers
c249157876 Merge branch 'master' into openal 2015-03-24 17:59:08 +01:00
Christoph Oelckers
c4f932022c - added 'listsoundchannels' CCMD for debugging. 2015-02-07 16:44:24 +01:00
Chris Robinson
a8348b13de Merge remote-tracking branch 'zdoom/master' into openal
Conflicts:
	output_sdl/CMakeLists.txt
	src/namedef.h
2015-01-15 13:08:05 -08:00
Edward Richardson
16e0f79fd7 Fix alt-tabbed desync with demos
- Fixed: Stop the game timer if the window looses focus
2014-11-11 02:18:52 +13:00
Christoph Oelckers
ef5707d73b - added a compatibility option for stopping sounds when the owning actor is destroyed. 2014-10-25 12:12:06 +02:00
Chris Robinson
b8e3f99ce6 Merge remote-tracking branch 'zdoom/master' into openal
Conflicts:
	src/s_sound.cpp
2014-09-22 18:24:55 -07:00
Christoph Oelckers
1b13e6be98 -. fixed:S_LoadSound passed the wrong value for the lump size parameter to LoadSoundVoc. 2014-09-15 11:24:48 +02:00
Chris Robinson
77cce303ef Fix merge conflict properly 2014-09-09 15:11:26 -07:00
Randy Heit
449a17c2f4 Correctly assign the sample rate for all Blood SFX formats
- Blood can do 44100 Hz sounds!
2014-07-29 21:09:29 -05:00
Chris Robinson
6e64545725 Simplify some branching 2014-06-28 01:32:06 -07:00
Chris Robinson
a630c47e6a Remove a redundant call 2014-06-27 22:09:03 -07:00
Chris Robinson
d55dfcdb1d Pass the correct size to LoadSoundVoc 2014-06-27 22:05:11 -07:00
Chris Robinson
1a40c95f84 Rename some FMOD references to be generic sound system
Since they relates to other sound backends as well, there's no need to single
out FMOD in these places.
2014-06-26 16:58:18 -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
Randy Heit
23e21cc85e - Fixed: S_IsChannelUsed() is declared as static, so it should be defined
as such, too.
2013-07-01 22:02:46 -05:00
Randy Heit
1b9c71b252 - Added S_ChangeSoundVolume() to change the volume of an already playing sound, accessible
through the new ACS function SoundVolume.

SVN r4318 (trunk)
2013-06-01 17:46:50 +00:00
Braden Obrzut
b096c7a82f - Fixed: changemap allowed changing the map in "demo mode."
- Fixed: Crash when using the console at the title screen.

SVN r4182 (trunk)
2013-03-15 21:41:01 +00:00
Randy Heit
ba0e0c2914 - Fixed: Don't start the MAPINFO music just to have it replaced by the saved music when returning to a level in a hub.
SVN r4175 (trunk)
2013-03-08 02:34:26 +00:00
Randy Heit
be0845acf1 - Moved all BorderNeedRefresh and SB_state updating code into separate functions that won't crash if screen is NULL.
SVN r4167 (trunk)
2013-02-27 03:10:25 +00:00
Randy Heit
59638acb7c - Fixed: MUSINFO must be parsed after MAPINFO, since it needs the entries created by MAPINFO.
SVN r3858 (trunk)
2012-08-30 03:00:37 +00:00
Randy Heit
11a0298f33 - Deactivate the master DSP unit when pausing the sound on title maps as well as on regular maps.
SVN r3857 (trunk)
2012-08-28 04:08:48 +00:00
Randy Heit
625482aaeb - Added actors' BounceSound, WallBounceSound, and CrushPainSound to preloading.
- Moved marking of actor sounds for precaching into a virtual Actor function.

SVN r3838 (trunk)
2012-08-22 23:17:49 +00:00
Randy Heit
9d82c7fa0e - Added PrecacheSounds mapinfo option. This takes a list of sounds to preload when the level is
loaded.

SVN r3837 (trunk)
2012-08-22 22:36:06 +00:00
Randy Heit
3ddac32b4f - Because setting a DSP unit inactive completely ceases all processing on it, including timing,
sounds queued up while the Channel Group Target Unit is inactive will all play at the same time
  once the unit is made active. To avoid this, it is now only deactivated when the gamestate is
  GS_LEVEL. Otherwise, it just gets muted. Fixes http://forum.zdoom.org/viewtopic.php?f=2&t=33592 "Strife voices overlap"

SVN r3818 (trunk)
2012-08-10 03:49:50 +00:00
Christoph Oelckers
a2c975bf30 - fixed: stommus CCMD did not clear the last played song so it got restarted if a volume change occured
SVN r3710 (trunk)
2012-06-24 12:38:23 +00:00
Christoph Oelckers
ba9f29531e - fixed: The music name wasn't recorded when a song was started with music volume set to 0.
SVN r3683 (trunk)
2012-06-09 14:41:18 +00:00
Randy Heit
45027e4620 - Added SNDINFO $attenuation command. This multiplies the attenuation passed to S_Sound. e.g.
$attenuation Boom 0
  Will make the "Boom" sound play with 0 attenuation, or in other words, at full volume throughout
  the level.

SVN r3629 (trunk)
2012-05-07 01:16:56 +00:00
Randy Heit
9c1e03a21b - In S_Shutdown(), stop the song and forget traces of it so that people who feel like setting
snd_musicvolume in their atexit don't crash because it tries to restart the song at the new
  volume.

SVN r3570 (trunk)
2012-04-19 02:27:10 +00:00
Randy Heit
78d28dedda - Fixed: S_ChangeMusic() would not necessarily restart non-looping songs that had finished playing.
SVN r3462 (trunk)
2012-03-22 21:09:20 +00:00
Randy Heit
540473cbe0 - Fixed: Sound limiting applied even to sounds that were already playing on the same
actor+channel. Since in this case, it's really just restarting the sound, it shouldn't limit
  it. (Since it's already playing, we know the limit wasn't exceeded when it started playing, so
  it shouldn't be exceeded if we restart it now.)


SVN r3355 (trunk)
2012-02-12 02:41:55 +00:00
Randy Heit
68fbd75897 - Fixed compilation with FMOD 4.38+. The removal of hardware voices and EAX was a fairly
major change, so I'm making no provisions for using older FMOD DLLs when compiled with the
  4.38 API. However, sound positioning is still broken like in 4.28, so you are recommended
  to continue building with 4.26. Also, the Freeverb-based DSP unit is no longer present in
  FMOD, so the underwater effect is currently unavailable when using 4.38 until I can figure
  out how to make it work with the SFX Reverb unit instead. (And on that topic, the Freeverb
  DSP was officially only for stereo outputs, so I really shouldn't have been using it in the
  first place.)
- Since I would like to eventually figure out the sound positioning issues with the newer
  FMODs, the following have been added:
  * snd_drawoutput now labels its outputs with the speakers they represent.
  * DCanvas::DrawTextA was added as an alias for DrawText, since the Windows headers #define
    DrawText to a Unicode/non-Unicode variant.
  * The loopsound console command was added to spawn an actor at the player's location and
    have it loop a sound infinitely.
  Hopefully I can figure it out. FMOD's 3D example works, so I assume the problem lies with
  my code, though I don't really know where to begin looking for the problem.

SVN r3350 (trunk)
2012-02-10 00:53:50 +00:00
Christoph Oelckers
163301dcd5 - took all includes of farchive.h out of headers. This file will have to be included explicitly in each source file that needs it.
SVN r3259 (trunk)
2011-07-06 14:20:54 +00:00
Randy Heit
1579fd1c1c - Fixed: Selecting TiMidity++ as a MIDI device without a working timidity.exe, then switching to a different MIDI device would leave music silent until a new song was started.
(The discrepancy between mus_playing.handle and currSong is one which should probably be handled properly at some point.)

SVN r3212 (trunk)
2011-05-20 00:26:22 +00:00
Christoph Oelckers
770a879f6a - fixed: The TouchedActors array in the Dehacked parser was not freed after parsing was done.
- Initialize the alt HUD explicitly in D_DoomMain.
- don't let S_UnloadReverbDef leave a broken list of sound environments behind.
- Added more code to explicitly delete data before initializing it.

SVN r3039 (trunk)
2010-12-15 00:09:31 +00:00
Christoph Oelckers
f0f17e531c - move static AM color initialization into the AM_StaticInit function.
- move D_LoadWadSettings to keysections.cpp.
- made some more data reloadable.
- data structures filled by P_SetupLevel should be cleared before loading the level. They can remain non-empty in case of an error. There's probably more to fix here...
- fixed: MidiDevices and MusicAliases were not cleared before reloading local SNDINFOs.
- fixed signed/unsigned warnings in AddSwitchPair for real (GCC really allows -1u? MSVC prints a warning for that.)


SVN r3036 (trunk)
2010-12-14 00:50:02 +00:00
Christoph Oelckers
2fcf1af21b - added a $musicalias command to SNDINFO that allows remapping of music tracks. Mapping to 'none' means that starting the remapped song will have no effect at all. There's one limitation though: If you load a WAD with the same music name after the one with the SNDINFO lump the mapping will be ignored. This is so that music resources can use this command without interfering with WADs that replace the music with their own.
SVN r3002 (trunk)
2010-11-08 17:24:27 +00:00
Christoph Oelckers
0490c35347 - added Edward-san's improvements for changemus command.
SVN r2902 (trunk)
2010-10-05 22:35:59 +00:00
Christoph Oelckers
5ff3b3f329 - added Gez's VOC loader.
SVN r2901 (trunk)
2010-10-05 22:31:22 +00:00
Christoph Oelckers
5464676603 - cleaned up i_music.cpp.
SVN r2866 (trunk)
2010-09-29 19:29:14 +00:00
Christoph Oelckers
4ca21e8e38 - added Edward-san's 'changemus' submission for printing the currently playing music track.
SVN r2782 (trunk)
2010-09-15 13:49:11 +00:00
Christoph Oelckers
1dd3ecd6e2 - fixed: -nosfx deactivated the entire sound system which also made music inoperable. Changed it so that all it does is block sound effects from being started.
SVN r2621 (trunk)
2010-08-28 13:36:41 +00:00