Commit graph

398 commits

Author SHA1 Message Date
Christoph Oelckers
995721836b Merge branch 'SpawnParticle' of https://github.com/Edward850/zdoom
Conflicts:
	src/actor.h
2016-01-21 17:04:52 +01:00
Randy Heit
710fa55288 Port recent SMF changes to XMI and HMI:
- Handle SysEx messages instead of ignoring them.
- Don't lose time for unhandled events with delays.
2016-01-20 18:37:05 -06:00
Randy Heit
7f6b421e87 Make sure all unhandled delayed MIDI events generate NOPs
- Looking over the code again, I see that discarded SysEx messages can
  cause the same issue as unhandled meta events, so generalize the
  returning of a NOP for everything.
2016-01-20 18:27:04 -06:00
Edward Richardson
e5c67cee83 Merge branch conflicts fix
- CONFLICT (content): Merge conflict in src/p_acs.cpp
- Updated position variables
2016-01-21 10:49:57 +13:00
Randy Heit
1a356dfa51 Fixed: MIDI meta events were completely discarded, including their delays
(unless the event was for setting the tempo) This left the following
events in the track to happen at the wrong time.
2016-01-20 14:53:56 -06:00
Randy Heit
16781e47ae Use a 64k stream buffer for all streams, not just net streams
- FLACs need a larger buffer than the default to run without starving on
  later versions of FMOD.
2016-01-14 20:41:09 -06:00
Christoph Oelckers
8ded18a96c - changed default frequency for Timidity++ to 44100kHz. 2016-01-05 14:09:34 +01:00
Christoph Oelckers
addd059410 Merge branch 'master' of https://github.com/rheit/zdoom 2015-12-31 23:05:13 +01:00
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
Randy Heit
d8af2e558f Fix potentiol buffer overrun in MUSSong2::Precache() 2015-12-31 15:28:18 -06:00
Christoph Oelckers
1316120fe4 - fixed: The MUS precacher did not handle invalid patches well.
- increased the valid range of patch values for MUS. According to the original MIDI2MUS code it can handle numbers up to 188, not 181, and at least one track from Eternal Doom uses #183.
2015-12-31 14:35:34 +01:00
Christoph Oelckers
c88ed426a8 - oops, this somehow lost the shift operator... 2015-12-30 20:39:38 +01:00
Christoph Oelckers
3c40d71c20 - hopefully fixed the MUS precaching for good.
According to blzut3, it looks like it is a byte followed by a variable length field. It can be any value 0-15 and will be followed by that many bytes one for each bank used. If the bank count is 0 then it is shorthand for using one bank (bank 0).
2015-12-30 20:32:19 +01:00
Christoph Oelckers
be6daf5d78 - changed instrument lookup in MUS files.
Based on evidence from several songs in Eternal Doom the description in all known documents is wrong. The instruments are not stored in a 16-bit word but in an 8-bit byte, followed by some variable size data.

Known variations are:

* second byte is 0 - no additional data follows
* second byte is 1 - a third byte for the 'bank' value follows.
2015-12-30 19:13:28 +01:00
Edoardo Prezioso
a2b377c580 - Fixed Clang errors/warnings on wildMIDI code. 2015-12-30 10:58:52 +01:00
Christoph Oelckers
aff42a6186 - don't look up a lump name in PathExpander if we are only looking for real files. 2015-12-30 10:21:17 +01:00
Christoph Oelckers
1def61e3e3 - allow changing the reverb and resampling mode setting for WildMidi.
- fixed: WildMidi did not initialize the reverb data structures.
- removed the menu option for midi_timiditylike.
2015-12-30 10:14:18 +01:00
Randy Heit
3ec6ad5018 Add SysEx retrieval to the MIDI file reader 2015-12-29 22:39:38 -06:00
Randy Heit
6d2e93254f Fix CreateSMF's SysEx writing
- It was wrong before. It might still be wrong, but at least it doesn't
  look obviously wrong anymore.
2015-12-29 17:55:20 -06:00
Randy Heit
545e2f7c69 Slap WildMidi onto snd_listmididevices's output for Windows 2015-12-29 17:55:20 -06:00
Christoph Oelckers
fe2dcfd588 - refactored the GUS/Timidity player's path building code so that it can also be used by WildMidi.
- fixed crash during sound reset - in this case I_ShutdownMusic should not close the WildMidi player.
2015-12-29 20:38:08 +01:00
Edoardo Prezioso
7c82c576a3 - Fixed Linux compiler errors and snd_mididevice.
-- errno.h is required for 'errno';
-- don't use str(n)casecmp and rely on ZDoom CMake handling;
-- add a missing parenthesis around a 'signed char' cast;
-- remove an unneeded GNU_SOURCE redefinition;
-- the non-MSVC side of snd_mididevice was not adapted to the new code, making wildmidi unavailable through the menu.
2015-12-29 10:33:20 +01:00
Randy Heit
afc36544b7 Add a WildMidi softsynth device
- This removes the preceding psuedo MIDI device for WildMidi.
2015-12-28 22:16:35 -06:00
Christoph Oelckers
060a6b2ff2 - shut down WildMidi when exiting.
The pointless error message in WildMidi_Shutdown was removed to keep the rest of the code simple and allowing to call this even when the device never was used.
2015-12-28 21:23:21 +01:00
Christoph Oelckers
a94120b6a4 Merge branch 'master' into WildMidi 2015-12-28 21:01:17 +01:00
Kyle Evans
7c6237e134 <stdlib.h> has replaced <malloc.h> on FreeBSD as well 2015-12-10 21:24:37 -06:00
Christoph Oelckers
724445354c - add the WildMidiMIDIDevice CPP file. 2015-12-01 10:39:22 +01:00
Christoph Oelckers
a03b947729 - WildMidi generally working, some cleanup left to do... 2015-11-28 20:58:14 +01:00
Christoph Oelckers
a55d85c51c - do not wait infinitely for termination of the Timidity++ process. This can lock up the engine indefinitely if the child process fails to exit. 2015-11-27 12:12:08 +01:00
Christoph Oelckers
43dff3021b - fixed: The OpenAL backend ignored PlaySound's 'volume' parameter. 2015-11-25 13:00:56 +01:00
alexey.lysiuk
621116a289 Disabled loading of SDL output plugin for FMOD Ex on OS X
Long path to executable file corrupts stack inside FMOD library
This plugin is not being built for OS X, output through CoreAudio works just fine
2015-09-18 10:53:46 +03:00
Marrub
9e1a82a830 fix menus muting themselves when the volume is changed 2015-07-10 08:45:15 +00:00
Christoph Oelckers
3c1fa3bed9 - fixed some GCC warnings. 2015-04-29 00:19:21 +02:00
Edoardo Prezioso
346fcf584c - Fixed C++11 warnings from recent commits. 2015-04-27 15:22:09 +02:00
Christoph Oelckers
47e7a30cab - reshuffled some stuff to satisfy Linux compilers (hopefully) 2015-04-27 13:19:34 +02:00
Randy Heit
0380ba642b Blur de hur 2015-04-26 20:43:01 -05: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
8e70a9b894 - added a NULL check to FMODStreamCapsule destructor, just to be safe. 2015-04-26 09:58:10 +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
Christoph Oelckers
c91745c714 - some fixes to make OpenAL branch compile with VC++ 2013 and OpenAL support. 2015-04-24 17:42:56 +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
Randy Heit
7ee1853403 Remove OpenAL and Sound Manager output options for FMOD
- OpenAL never actualy worked properly and was removed in later FMODs.
- Sound Manager was deprecated by Apple long ago and is not supported for
  64-bit applications. It was also removed in later FMODs.
2015-04-22 19:09:33 -05:00
Randy Heit
dba76c1aea Disable PCM-8 output when not using DirectSound
- PCM-8 sounds like garbage with WASAPI and WaveOut, so force anything not
  DirectSound to use PCM-16 if PCM-8 is selected.
2015-04-22 18:32:45 -05:00
Christoph Oelckers
0a1d1db0ba - fixed missing #incöudes of version.h for GAMENAME. 2015-04-11 17:40:26 +02:00
Edoardo Prezioso
0c5d55d0a3 - More GAMENAME replacements in strings.
These changes will change only some displayed messages.
2015-04-09 21:16:59 +02:00
Christoph Oelckers
c249157876 Merge branch 'master' into openal 2015-03-24 17:59:08 +01:00