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.
* 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.
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.
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.
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.
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.
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.
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
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.
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