Commit graph

782 commits

Author SHA1 Message Date
Christoph Oelckers
dcef3681d4 - cleaned up the includes in timidity.cpp. 2019-09-24 23:12:38 +02:00
Christoph Oelckers
d557f609cf - cleanup of the TimidityMIDIDevice(GUS) backend code to eliminate the storage in global variables and to remove the dependencies on core ZDoom code.
The organization here is now the same as for the Timidity++ device, i.e. it is the device owning the instruments to give better control over their lifecycle.
2019-09-24 23:08:56 +02:00
Christoph Oelckers
fea0f77905 - removed some ZDoomd dependencies from Timidity(GUS) backend
* use std::string instead of FString
* replaced the single use of clamp with std::min/std::max.
* copied MAKE_ID macro into the source.
* use snprintf instead of mysnprintf
* use std::runtime_error instead of I_Error to abort on failed memory allocations.
2019-09-24 11:07:32 +02:00
Christoph Oelckers
66c9f0902b Merge commit '115d1cb182168bb2c8c29a3650dfc33b08e3e6cb' 2019-09-23 15:21:43 +02:00
alexey.lysiuk
7ec33b6b92 - fixed crash when setting sound pitch on non-existing channel
This applies to a lack of free channels, -nosound command line switch, missing OpenAL library, sound initialization failures, ...

https://forum.zdoom.org/viewtopic.php?t=65926
2019-09-23 15:42:03 +03:00
Christoph Oelckers
115d1cb182 - made the Timidity++ backend a library, now that it has no dependencies on GZDoom anymore. 2019-09-23 14:27:43 +02:00
Christoph Oelckers
56e4c8f213 - handled the final piece where Timidity++ had a direct dependency on GZDoom - the error logging function.
This is npw a function pointer so that a simple stdout printout can be used as default, but allows to override it.
Also added the missing timidity_file.h header.
2019-09-23 14:14:32 +02:00
Christoph Oelckers
98329311b4 - moved the CVars out of the Timidity++ backend. 2019-09-23 13:58:16 +02:00
Christoph Oelckers
cf6d0c3127 - implemented an abstract sound font reader interface for Timidity++.
The only dependency left on the main GZDoom code are the CVars, which will be dealt with next.
2019-09-23 13:53:28 +02:00
Christoph Oelckers
16ab52c5f3 - thinned out the FSoundFontReader interface a bit more by moving the file open code into the FSoundFontReader class itself. 2019-09-23 12:45:26 +02:00
Christoph Oelckers
2cf8cc47df - moved the instrument set maintenance out of the Timidity++ library into the player class.
This removes the dependency on the sound font manager from the low level library, reducing the direct dependencies to FileReader and SoundFontReader.
2019-09-23 11:27:57 +02:00
Christoph Oelckers
df7a4bb0d9 - removed a few dependencies of the Timidity++ code from the main GZDoom code base.
The big issues, i.e. FileReader and SoundFontReader still need to be handled to make this a standalone library.
2019-09-23 10:18:19 +02:00
Christoph Oelckers
b3a9884eb1 - gave libopen the same treatment and made it its own subproject 2019-09-23 10:03:18 +02:00
Christoph Oelckers
84cc7cbdd2 - made libadl its own library subproject.
This is to improve compile times because the MSVC compiler tends to become slow with large lists of source files in a single project.
This new project is still our stripped down copy of libadl, not the original, because that project contains a large amount of baggage we do not need.
2019-09-23 10:03:17 +02:00
Christoph Oelckers
76ee658be4 Made several classes trivially copyable,
Many had leftover non-default constructors/ assignment operators, and some were initialized, even though the initialized data was never used.

In case of FCycler this even caused a default setting to be overwritten when used inside FDynamicLight.
2019-09-09 09:52:33 +02:00
Jan Engelhardt
f16c09badb Make the build work with fluidsynth 2.x. 2019-08-31 21:47:53 +03:00
Vitaly Novichkov
1a070d12a1 GME update with bug-fixes
- True fix for infinite loops [please verify!]
- True fix for KSS silence
- Fix for HES distorted and unstable/random tempo
2019-08-25 15:38:39 +03:00
Christoph Oelckers
48f2105cd1 - moved a few CCMDs from i_sound.cpp to s_sound.cpp. 2019-08-23 21:57:56 +02:00
Christoph Oelckers
66db894866 - split off all music code from s_sound.cpp 2019-08-23 17:15:19 +02:00
Christoph Oelckers
1595bf30c6 Revert "- removed a few redundant includes"
This reverts commit 7cd5bd9773.

This commit was only meant for testing, not for publishing
2019-08-23 08:31:49 +02:00
Christoph Oelckers
7cd5bd9773 - removed a few redundant includes 2019-08-22 21:15:06 +02:00
Christoph Oelckers
13d031196b - removed redundant include. 2019-08-21 21:07:00 +02:00
Christoph Oelckers
5c4e8783e9 - removed the internal WildMidi player object cleanup code.
This was solely meant for the original WildMidi player but got seriously in the way of how this code gets used by GZDoom. In GZDoom the player object is owned by the MIDI devive which should be the only instance which is allowed to destroy it.
2019-08-18 16:12:52 +02:00
Christoph Oelckers
a239675fb5 - fixed incorrect write barrier in sound sequence code. 2019-08-09 08:42:36 +02:00
Major Cooke
15eabfd055 Added A_SoundPitch and an optional pitch parameter to A_PlaySound and S_Sound.
- Note: Because sound channels are not in zscript, there's no way to modify a sound made by S_Sound.
2019-07-24 20:15:24 +02:00
Christoph Oelckers
7346288bf5 - moved some more files. 2019-07-14 21:09:49 +02:00
Christoph Oelckers
7351a76404 - move sound files to sound folder. 2019-07-14 17:48:55 +02:00
Christoph Oelckers
f50e402e92 - sorted sound backend code into subdirectories. 2019-07-14 16:07:18 +02:00
alexey.lysiuk
1aeef146e0 - fixed linking without DYN_FLUIDSYNTH defined
Undefined symbols for architecture x86_64:
  "CreateFluidSynthMIDIDevice(char const*, int)", referenced from:
      MIDIStreamer::CreateMIDIDevice(EMidiDevice, int) in music_midistream.o
2019-07-07 11:39:57 +03:00
Christoph Oelckers
5df8919b90 Merge branch 'master' into userlights 2019-07-07 08:11:09 +02:00
Christoph Oelckers
1b1069dc78 - made the class definitions of the MIDI devices private to the implementations. 2019-06-27 09:56:08 +02:00
Christoph Oelckers
1081338af2 - removed a few obsolete definitions from basictypes.h 2019-06-26 22:13:12 +02:00
Edoardo Prezioso
74e69567ef - Fixed a buffer overflow with Timidity++ when playing Sigil e5m5 music.
See https://forum.zdoom.org/viewtopic.php?f=2&t=64910 .
2019-06-02 21:20:19 +02:00
Christoph Oelckers
f221a2bdb4 - fixed allocation mismatch in WildMidi. 2019-04-19 17:46:25 +02:00
alexey.lysiuk
a3554bda70 - replaced all usages of insecure vsprintf() function 2019-03-04 17:35:38 +02:00
nashmuhandes
407983749a Added a master volume setting. 2019-02-27 14:17:45 -05:00
Christoph Oelckers
e091369a38 - removed FCriticalSection and replaced all of its uses with std::mutex.
There's really no need for a non-standard solution here anymore with C++11.
This also fixes an unreleased lock in the WildMidi code.
2019-02-22 20:24:24 +01:00
Christoph Oelckers
868ac5adf8 - switched the Windows backend to use the Windows Unicode API.
With localization for non-Latin languages on the support list the multibyte API doesn't cut it anymore. It neither can handle system text output outside the local code page nor can an ANSI window receive text input outside its own code page.
Similar problems exist for file names. With the multibyte API it is impossible to handle any file containing characters outside the active local code page.

So as of now, everything that may pass along some Unicode text will use the Unicode API with some text conversion functions. The only places where calls to the multibyte API were left are those where known string literals are passed or where the information is not used for anything but comparing it to other return values from the same API.
2019-02-14 22:23:33 +01:00
Christoph Oelckers
979f1df281 Merge remote-tracking branch 'remotes/origin/master' into new_level_refactor
# Conflicts:
#	src/g_level.cpp
#	src/p_user.cpp
2019-02-05 13:49:07 +01:00
alexey.lysiuk
69492b1e27 - fixed ambient sounds "leaking" into reverb environment
Set speed of sound to 343.3 and init scale to 1 according to @kcat suggestion

https://forum.zdoom.org/viewtopic.php?t=63185
https://forum.zdoom.org/viewtopic.php?t=63524
2019-02-05 13:13:52 +02:00
alexey.lysiuk
e400137ffe - fixed compilation of Windows Debug targets
src\sound\mididevices\music_opl_mididevice.cpp(112): error C3861: 'I_DebugPrint': identifier not found
src\sound\mididevices\music_opl_mididevice.cpp(206): error C3861: 'I_DebugPrint': identifier not found
src\sound\mididevices\music_opl_mididevice.cpp(234): error C3861: 'I_DebugPrint': identifier not found
src\sound\mididevices\music_opl_mididevice.cpp(244): error C3861: 'I_DebugPrint': identifier not found
2019-02-01 10:09:36 +02:00
Christoph Oelckers
c77487dab8 - moved the menu.h include from oalsound.h to oalsound.cpp.
The menu is a very 'dirty' header, and forcing it to be pulled in with something entirely unrelated is not good - even though only two files include oalsound.h.
2019-01-31 19:44:04 +01:00
Christoph Oelckers
f6a91e1722 - moved the I_Error prototypes to doomerrors.h to avoid having to include the low level system header for this. 2019-01-31 19:38:04 +01:00
Christoph Oelckers
22939aade7 Merge branch 'master' into new_level_refactor
# Conflicts:
#	src/c_dispatch.cpp
2019-01-27 10:26:23 +01:00
Christoph Oelckers
39f53a4de0 - took the delayed console command execution out of the thinker management.
Doing this intermingled with the thinkers is highly unsafe because there are absolutely no guarantees about order of execution.
Effectively it ran these commands right in the middle of the playsim which could cause all sorts of synchronization issues, because CCMDs are part of the UI, not the playsim.

- pass a const string to AddCommandString.

This function manipulated the input buffer, leading to all sorts of code contortions to make sure that the passed parameter is clean for that.
This function will now create a copy of the passed parameter which it can manipulate without complicating its calling code.

# Conflicts:
#	src/c_dispatch.cpp
2019-01-27 10:24:49 +01:00
Christoph Oelckers
2623fbb54b - deleted unused mus2midi.cpp file. 2019-01-24 20:40:31 +01:00
Christoph Oelckers
1a3df8dfba - moved all shutdown handling for sound related resources to I_ShutdownSound instead of registering separate atterm handlers. 2018-12-19 09:39:06 +01:00
alexey.lysiuk
4a83f4d251 - disable music playback if WinMM stream cannot be opened
https://forum.zdoom.org/viewtopic.php?t=62888
2018-12-14 15:58:08 +02:00
Christoph Oelckers
a3265c2963 - more direct native entry points. 2018-12-04 23:12:16 +01:00
Christoph Oelckers
25ad71a113 - Changed a few allocations into usin TArrays
S_SoundCurve in particular looked like a candidate for leaking memory.
2018-11-30 17:07:42 +01:00