Commit graph

16368 commits

Author SHA1 Message Date
Christoph Oelckers
08d2ac0eee - moved the sound system's sound stream for the music out of the song objects.
It is now being handled by the controlling code.
While of no benefit for GZDoom itself, this finally allows to separate the entire music code into a separate, engine independent project that merely provides streamed music data when not playing on a hardware device (WinMM Midi or CD Audio.)
The tight coupling of the music code with the sound backend made this nearly impossible before
2020-01-05 12:56:39 +01:00
Christoph Oelckers
fce866054e - reordering code a bit to see where the stream must be started. 2020-01-05 12:56:37 +01:00
Christoph Oelckers
e3bb9332d0 - a bit of cleanup - moving internal class declarations into the sources.
Now i_musicinterns.h doesn't bleed the entire implementation everywhere anymore.
2020-01-05 12:56:35 +01:00
Christoph Oelckers
0f7886326d - renamed the configuration file. 2020-01-05 12:56:33 +01:00
Christoph Oelckers
e76f590df8 - moved all configuration code to zmusic project.
The CVARs are now just getting forwarded without any own logic.
2020-01-05 12:56:30 +01:00
Christoph Oelckers
5d73f09ebf - first state of music configuration refactor.
# Conflicts:
#	src/sound/music/midi_cvars.cpp
2020-01-05 12:56:28 +01:00
Christoph Oelckers
d44d3b353d - did a bit of reordering on I_RegisterSong.
The way CDDA was treated as an afterthought made handling of stream songs somewhat problematic, because the state could be unclear.
CDDA is an easily identifiable format so it should be tested first.
2020-01-05 12:33:51 +01:00
Christoph Oelckers
eccff92420 - moved MIDI format detection and source creation into zmusic project. 2020-01-05 12:33:48 +01:00
Christoph Oelckers
4db555626f - configuration key enums. Not used yet. 2020-01-05 12:32:50 +01:00
Christoph Oelckers
531a5a8857 - moved the stream sources to zmusic project.
# Conflicts:
#	src/CMakeLists.txt
2020-01-05 12:32:47 +01:00
Christoph Oelckers
09993ca39b - removed ZDoom dependencies from music_libsndfile.cpp
# Conflicts:
#	src/sound/musicformats/music_libsndfile.cpp
2020-01-05 12:32:43 +01:00
Christoph Oelckers
f3f2ec5cb1 - moved the sound decoding code to the zmusic project.
Since this gets used by both the sound backend and the music code it needs to be in a place accessible to both.

# Conflicts:
#	src/CMakeLists.txt

# Conflicts:
#	libraries/zmusic/decoder/mpg123_decoder.cpp
#	libraries/zmusic/decoder/sndfile_decoder.cpp
#	src/CMakeLists.txt
2020-01-05 12:29:15 +01:00
Christoph Oelckers
fb3b6a0407 - XA, too. 2020-01-05 11:53:06 +01:00
Christoph Oelckers
3837cf8f0f - ... and the raw OPL format. 2020-01-05 11:53:04 +01:00
Christoph Oelckers
182f48c2c4 - gave music_gme.cpp the treatment.
# Conflicts:
#	src/sound/musicformats/music_gme.cpp
2020-01-05 11:53:00 +01:00
Christoph Oelckers
e3d9c6a19e - dependency cleanup in music_dumb.cpp.
# Conflicts:
#	src/sound/musicformats/music_dumb.cpp

# Conflicts:
#	src/sound/musicformats/music_dumb.cpp
2020-01-05 11:50:07 +01:00
Christoph Oelckers
b5ebe264ab - consolidated the different file access interfaces in the backends into one shared version.
This was getting a bit unwieldy. The include path setup is not perfect yet, that's work for later.
(It's about time we're getting C++20 with modules so that this include path madness can be put to an end.)
2020-01-05 11:46:28 +01:00
Christoph Oelckers
c56bf30cc2 - uncoupled the stream sources from the low level implementation. The entire setup had the stream sources depend on the SoundStream class, severely limiting reusability. This was changed that there is one SoundStream class that uses the StreamSources as mere data source that has no knowledge and no connection to the underlying system, similar to how the MIDI system works. With this there are only 3 top level music classes left - MIDIStreamer, StreamSong and CDSong.
Also made the decode_vorbis function in DUMB a function pointer so that the library does not depend on high level code and can just ignore the vorbis case if no supported.
2020-01-05 11:46:24 +01:00
Christoph Oelckers
5743a56ef4 - created a new zmusic library which will eventually contain all the music playback code.
Currently all it contains are the MIDI sources and the MIDI devices, the rest needs to be reworked first.

# Conflicts:
#	libraries/zmusic/i_module.cpp
#	libraries/zmusic/i_module.h
#	src/CMakeLists.txt
#	src/i_module.cpp
#	src/i_module.h
#	src/sound/music/midi_cvars.cpp
#	src/utility/i_module.cpp
#	src/utility/i_module.h

# Conflicts:
#	src/CMakeLists.txt
#	src/sound/musicformats/music_opl.cpp
2020-01-05 11:46:20 +01:00
Christoph Oelckers
c52b516c6f - more dependency removal, this time from the MIDI devices.
# Conflicts:
#	src/sound/mididevices/music_win_mididevice.cpp

# Conflicts:
#	src/sound/mididevices/music_softsynth_mididevice.cpp
#	src/sound/mididevices/music_timidity_mididevice.cpp
#	src/sound/mididevices/music_timiditypp_mididevice.cpp
#	src/sound/mididevices/music_wavewriter_mididevice.cpp
2020-01-05 02:43:50 +01:00
Christoph Oelckers
d3bfffbdab - removed all dependencies on ZDoom code from the MIDI sources (including TArray and FileReader.) 2020-01-05 02:36:35 +01:00
Christoph Oelckers
4068febc5e - fixed typo. 2020-01-05 02:36:32 +01:00
Christoph Oelckers
5460c72ee9 - moved the stream handling out of the MIDI device into the MIDIStreamer class.
This isn't the final location but this means that the device is merely a data provider, with the sole exception of the Win32 MIDI device whose unwieldy usage requirements unfortunately dictate much of the needed interface here.
2020-01-05 02:36:30 +01:00
Christoph Oelckers
f15be8b270 - split out the MIDIDevice implementation into its own source file. 2020-01-05 02:36:27 +01:00
Christoph Oelckers
447290aa4f - WildMidi also done. 2020-01-05 02:31:56 +01:00
Christoph Oelckers
30f23738b3 - Timidity++ done. 2020-01-05 02:31:53 +01:00
Christoph Oelckers
67b25d88cf - moved the last static variable - def_inst_name into the Instruments class.
With this the GUS device should be fully reentrant.
2020-01-05 02:31:50 +01:00
Christoph Oelckers
e75da52448 - fixed the GUS MIDI device.
The sound font reader may not be deleted because its ownership is transferred to the instrument set.
The gus_patchdir variable was not transferred to the config struct.
2020-01-05 02:31:47 +01:00
Christoph Oelckers
19742b5bc7 - took make_release_only off those subprojects which contain code that still need debugging on occasion.
For these performance on debug builds doesn't really matter anyway.
2020-01-05 02:31:44 +01:00
Christoph Oelckers
08f3a349e8 - work on GUS MIDI device plus some cleanup
This is not tested yet!
2020-01-05 02:31:42 +01:00
Christoph Oelckers
309a45ed48 - Gave OPN device the same treatment
Also made some improvements to the interface.

# Conflicts:
#	src/sound/mididevices/midi_cvars.cpp
2020-01-05 02:31:38 +01:00
alexey.lysiuk
850975cbc4 - fixed compilation on Linux
libraries/oplsynth/oplio.cpp:59:32: error: ‘memset’ was not declared in this scope
src/sound/mididevices/midi_cvars.cpp:43:31: error: expected initializer before ‘GetSystemDirectoryA’
2020-01-05 02:17:59 +01:00
Christoph Oelckers
0954942d6a - fixed compilation on XCode and silenced several warnings in the music code 2020-01-05 02:17:56 +01:00
Christoph Oelckers
f6eedb737b - same treatment for the OPL Midi player.
# Conflicts:
#	src/sound/mididevices/music_opl_mididevice.cpp
2020-01-05 02:17:53 +01:00
Christoph Oelckers
9585ca5984 - missed an 'else'. 2020-01-05 02:16:33 +01:00
Christoph Oelckers
4aca10e062 - cleared FluidSynthMIDIDevice of most ZDoom dependencies.
# Conflicts:
#	src/sound/mididevices/music_fluidsynth_mididevice.cpp

# Conflicts:
#	src/sound/mididevices/music_fluidsynth_mididevice.cpp
2020-01-05 02:16:30 +01:00
Christoph Oelckers
726f65e91b - more work on music code
- renamed the FluidSetting functions to ChangeSetting so that they can be used as a generic means to change music player options without overloading the virtual function table for each minor thing.
- pass Printf as a parameter to the MIDI renderer to uncouple it from the main GZDoom code.
- throw exceptions when setting up the renderer fails so that this can be handled consistently for all construction errors here.
- delete FluidSynth handles before the constructor aborts.
2020-01-05 02:14:14 +01:00
drfrag
8b6af8726e Revert "- added dynamic loading of FluidSynth 2.x"
This reverts commit 399bc4cffa9401b6ea4b88ff6d2206e80f835efc.
2020-01-05 02:13:44 +01:00
Christoph Oelckers
9437bcda64 - removed most dependencies on ZDoom code in ADL Midi device. 2020-01-05 02:11:52 +01:00
Christoph Oelckers
f2840d4942 - made the OPL synth backend a separate library.
# Conflicts:
#	src/CMakeLists.txt
#	src/sound/mididevices/music_opl_mididevice.cpp

# Conflicts:
#	libraries/oplsynth/OPL3.cpp
#	libraries/oplsynth/dosbox/opl.cpp
2020-01-05 02:11:51 +01:00
Christoph Oelckers
a63d90034b - cleaned up the dependencies of the OPL interface layer.
This also removes the OPL dumper because I wasn't able to get any non-broken output from it and have no desire to fix such a niche feature.

# Conflicts:
#	src/sound/mididevices/music_opldumper_mididevice.cpp
2020-01-05 02:11:49 +01:00
Christoph Oelckers
01624eddf2 - removed all ZDoom dependencies from the OPL backend code.
# Conflicts:
#	src/sound/oplsynth/opl_mus_player.cpp
2020-01-05 02:11:03 +01:00
Christoph Oelckers
d212c84392 - removed the global current_opl_core variable and pass the needed info as function parameters
because using global variables for this is really bad style!
This also removes the unused OPLMUSDumper class.
2020-01-05 02:02:01 +01:00
Christoph Oelckers
cf105c8720 - gave the Timidity error functions better names and hooked up the WildMidi version. 2020-01-05 01:53:54 +01:00
alexey.lysiuk
2428cc4b1e - fixed compilation with Apple Clang as well
src/utility/basictypes.h:39:23: error: unknown type name 'size_t'; did you mean 'time_t'?
2020-01-05 01:53:50 +01:00
alexey.lysiuk
418ba2372b - fixed compilation with GCC and Clang
libraries/wildmidi/file_io.cpp:68:40: error: use of undeclared identifier 'malloc'
libraries/wildmidi/wildmidi_lib.cpp:672:10: error: use of undeclared identifier 'stricmp'; did you mean 'strcmp'?
libraries/wildmidi/wildmidi_lib.cpp:1011:11: error: use of undeclared identifier 'strnicmp'; did you mean 'strncmp'?
2020-01-05 01:53:48 +01:00
Christoph Oelckers
166e390ad9 - changed MIDI sources so that they do not have to include i_musicinterns.h anymore.
They were already clean of unwanted external references, but including this file made it hard to keep it that way.
This also moves a few useful definitions around to less 'dirty' headers.

# Conflicts:
#	src/rendering/swrenderer/textures/warptexture.cpp

# Conflicts:
#	src/doomtype.h
#	src/sound/midisources/midisource.cpp
#	src/sound/midisources/midisource_smf.cpp
#	src/sound/midisources/midisource_xmi.cpp
2020-01-05 01:53:45 +01:00
Christoph Oelckers
3b5e8f8011 - made WildMidi a library.
# Conflicts:
#	src/CMakeLists.txt
#	src/sound/musicformats/music_xa.cpp
2020-01-05 01:40:41 +01:00
Christoph Oelckers
1816c17ffd - fixed WildMidi. 2020-01-05 01:40:38 +01:00
Christoph Oelckers
f76f3d0e0a - refactoring of WildMidi to have proper instrument management
Not tested yet, it compiles but may not work as-is.

# Conflicts:
#	src/sound/wildmidi/file_io.cpp
2020-01-05 01:40:34 +01:00