From 4e8588815b2104760eb5f1ddfce79f8216f879ce Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 24 Mar 2018 20:29:48 +0100 Subject: [PATCH 1/5] - split up the advanced sound menu because it became a bit too confusing with all the different MIDI players' options lumped together. There is now a separate MIDI player options menu which is a list of submenus, one for each player (except for OPNMIDI which does not have any options yet. --- wadsrc/static/language.enu | 9 +++ wadsrc/static/menudef.txt | 111 +++++++++++++++++++++++++++---------- 2 files changed, 90 insertions(+), 30 deletions(-) diff --git a/wadsrc/static/language.enu b/wadsrc/static/language.enu index 155ce839d..6feba6fa4 100644 --- a/wadsrc/static/language.enu +++ b/wadsrc/static/language.enu @@ -2143,6 +2143,7 @@ SNDMNU_OPENAL = "OpenAL options"; SNDMNU_RESTART = "Restart sound"; SNDMNU_ADVANCED = "Advanced options"; SNDMNU_MODREPLAYER = "Module replayer options"; +SNDMNU_MIDIPLAYER = "Midi player options"; // OpenAL Options OPENALMNU_TITLE = "OPENAL OPTIONS"; @@ -2167,14 +2168,22 @@ ADVSNDMNU_FLUIDSYNTH = "FluidSynth"; ADVSNDMNU_FLUIDPATCHSET = "Patch set"; ADVSNDMNU_FLUIDGAIN = "Gain"; ADVSNDMNU_REVERB = "Reverb"; +ADVSNDMNU_REVERB_LEVEL = "Reverb Level"; ADVSNDMNU_CHORUS = "Chorus"; ADVSNDMNU_TIMIDITY = "Timidity++"; +ADVSNDMNU_ADLMIDI = "ADLMidi"; +ADVSNDMNU_OPNMIDI = "OPNMidi"; ADVSNDMNU_TIMIDITYEXE = "Path for executable"; ADVSNDMNU_TIMIDITYCONFIG = "Timidity config file"; ADVSNDMNU_TIMIDITYVOLUME = "Relative volume"; ADVSNDMNU_WILDMIDI = "WildMidi"; ADVSNDMNU_WILDMIDICONFIG = "WildMidi config file"; ADVSNDMNU_SELCONFIG = "Select configuration"; +ADVSNDMNU_GLOBAL = "Global"; +ADVSNDMNU_FREEVERB = "Freeverb"; +ADVSNDMNU_GLOBAL_FREEVERB = "Global Freeverb"; +ADVSNDMNU_ADVRESAMPLING = "Advanced Resampling"; +ADVSNDMNU_OPLBANK = "OPL Bank"; // Module Replayer Options MODMNU_TITLE = "MODULE REPLAYER OPTIONS"; diff --git a/wadsrc/static/menudef.txt b/wadsrc/static/menudef.txt index 744e4d4c7..0277fdad0 100644 --- a/wadsrc/static/menudef.txt +++ b/wadsrc/static/menudef.txt @@ -1630,6 +1630,7 @@ OptionMenu SoundOptions protected StaticText " " Submenu "$SNDMNU_ADVANCED", "AdvSoundOptions" + Submenu "$SNDMNU_MIDIPLAYER", "MidiPlayerOptions" Submenu "$SNDMNU_MODREPLAYER", "ModReplayerOptions" StaticText " " Submenu "$OPTMNU_REVERB", "ReverbEdit" @@ -1664,36 +1665,6 @@ OptionMenu AdvSoundOptions protected Title "$ADVSNDMNU_TITLE" Option "$ADVSNDMNU_SAMPLERATE", "snd_samplerate", "SampleRates" Option "$ADVSNDMNU_HRTF", "snd_hrtf", "AutoOffOn" - StaticText " " - StaticText "$ADVSNDMNU_OPLSYNTHESIS", 1 - Slider "$ADVSNDMNU_OPLNUMCHIPS", "opl_numchips", 1, 8, 1, 0 - Option "$ADVSNDMNU_OPLFULLPAN", "opl_fullpan", "OnOff" - Option "$ADVSNDMNU_OPLCORES", "opl_core", "OplCores" - StaticText " " - StaticText "$ADVSNDMNU_GUSEMULATION", 1 - LabeledSubMenu "$ADVSNDMNU_SELCONFIG", "midi_config", "GusConfigMenu" - Slider "$ADVSNDMNU_MIDIVOICES", "midi_voices", 16, 256, 4, 0 - Option "$ADVSNDMNU_DMXGUS", "midi_dmxgus", "OnOff" - Option "$ADVSNDMNU_GUSMEMSIZE", "gus_memsize", "GusMemory" - StaticText " " - StaticText "$ADVSNDMNU_FLUIDSYNTH", 1 - LabeledSubMenu "$ADVSNDMNU_SELCONFIG", "fluid_patchset", "FluidPatchsetMenu" - Slider "$ADVSNDMNU_FLUIDGAIN", "fluid_gain", 0, 10, 0.5, 1 - Option "$ADVSNDMNU_REVERB", "fluid_reverb", "OnOff" - Option "$ADVSNDMNU_CHORUS", "fluid_chorus", "OnOff" - Slider "$ADVSNDMNU_MIDIVOICES", "fluid_voices", 16, 4096, 16, 0 - // Leaving out the more advanced stuff for now. - StaticText " " - StaticText "$ADVSNDMNU_TIMIDITY", 1 - - LabeledSubMenu "$ADVSNDMNU_SELCONFIG", "timidity_config", "TimidityConfigMenu" - // This one needs reworking - //Option "$ADVSNDMNU_REVERB", "timidity_reverb", "OnOff" - Option "$ADVSNDMNU_CHORUS", "timidity_chorus", "OnOff" - StaticText " " - StaticText "$ADVSNDMNU_WILDMIDI", 1 - LabeledSubMenu "$ADVSNDMNU_SELCONFIG", "wildmidi_config", "WildMidiConfigMenu" - Option "$ADVSNDMNU_REVERB", "wildmidi_reverb", "OnOff" } OptionMenu GusConfigMenu protected @@ -1750,6 +1721,7 @@ OptionValue ModVolumeRamps } + OptionMenu ModReplayerOptions protected { Title "$MODMNU_TITLE" @@ -1764,6 +1736,85 @@ OptionMenu ModReplayerOptions protected // the foo_dumb preferences in foobar2000. } +/*======================================= + * + * MIDI player + * + *=======================================*/ + + OptionValue TimidityReverb + { + 0, "$OPTVAL_OFF" + 1, "$OPTVAL_STANDARD" + 2, "$ADVSNDMNU_GLOBAL" + 3, "$ADVSNDMNU_FREEVERB" + 4, "$ADVSNDMNU_GLOBAL_FREEVERB" + } + + OptionMenu MidiPlayerOptions protected + { + Title "$SNDMNU_MIDIPLAYER" + Submenu "$ADVSNDMNU_FLUIDSYNTH", "FluidsynthOptions", 0, 1 + Submenu "$ADVSNDMNU_TIMIDITY", "TimidityOptions", 0, 1 + Submenu "$ADVSNDMNU_GUSEMULATION", "GUSOptions", 0, 1 + Submenu "$ADVSNDMNU_WILDMIDI", "WildMidiOptions", 0, 1 + Submenu "$ADVSNDMNU_OPLSYNTHESIS", "OPLOptions", 0, 1 + Submenu "$ADVSNDMNU_ADLMIDI", "ADLOptions", 0, 1 + } + + OptionMenu FluidsynthOptions protected + { + Title "$ADVSNDMNU_FLUIDSYNTH" + LabeledSubMenu "$ADVSNDMNU_SELCONFIG", "fluid_patchset", "FluidPatchsetMenu" + Slider "$ADVSNDMNU_FLUIDGAIN", "fluid_gain", 0, 10, 0.5, 1 + Option "$ADVSNDMNU_REVERB", "fluid_reverb", "OnOff" + Option "$ADVSNDMNU_CHORUS", "fluid_chorus", "OnOff" + Slider "$ADVSNDMNU_MIDIVOICES", "fluid_voices", 16, 4096, 16, 0 + // other CVARs need to be revieved for usefulness + } + + OptionMenu TimidityOptions protected + { + Title "$ADVSNDMNU_TIMIDITY" + LabeledSubMenu "$ADVSNDMNU_SELCONFIG", "timidity_config", "TimidityConfigMenu" + Option "$ADVSNDMNU_REVERB", "timidity_reverb", "TimidityReverb" + Slider "$ADVSNDMNU_REVERB_LEVEL", "timidity_reverb_level", 9, 127, 1, 0 + Option "$ADVSNDMNU_CHORUS", "timidity_chorus", "OnOff" + // other CVARs need to be revieved for usefulness + } + + OptionMenu GUSOptions protected + { + Title "$ADVSNDMNU_GUSEMULATION" + LabeledSubMenu "$ADVSNDMNU_SELCONFIG", "midi_config", "GusConfigMenu" + Slider "$ADVSNDMNU_MIDIVOICES", "midi_voices", 16, 256, 4, 0 + Option "$ADVSNDMNU_DMXGUS", "midi_dmxgus", "OnOff" + Option "$ADVSNDMNU_GUSMEMSIZE", "gus_memsize", "GusMemory" + } + + OptionMenu WildMidiOptions protected + { + Title "$ADVSNDMNU_WILDMIDI" + LabeledSubMenu "$ADVSNDMNU_SELCONFIG", "wildmidi_config", "WildMidiConfigMenu" + Option "$ADVSNDMNU_REVERB", "wildmidi_reverb", "OnOff" + Option "$ADVSNDMNU_ADVRESAMPLING", "wildmidi_enhanced_resampling", "OnOff" + } + + OptionMenu OPLOptions protected + { + Title "$ADVSNDMNU_OPLSYNTHESIS" + Option "$ADVSNDMNU_OPLCORES", "opl_core", "OplCores" + Slider "$ADVSNDMNU_OPLNUMCHIPS", "opl_numchips", 1, 8, 1, 0 + Option "$ADVSNDMNU_OPLFULLPAN", "opl_fullpan", "OnOff" +} + + OptionMenu ADLOptions protected + { + Title "$ADVSNDMNU_ADLMIDI" + StaticText "$ADVSNDMNU_OPLBANK", 1 + // todo: fill in from internal data + } + /*======================================= * * Change Renderer Menu From 4e012e376555087b1cc65cb95e2c621f43f7612c Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 24 Mar 2018 21:19:10 +0100 Subject: [PATCH 2/5] - fill in the ADL bank menu from the internal table. Some of the names had to be shortened to prevent it from getting too confusing. --- src/menu/menudef.cpp | 17 ++++++++++++++ src/sound/adlmidi/adldata.cpp | 42 +++++++++++++++++------------------ wadsrc/static/menudef.txt | 8 +++++-- 3 files changed, 44 insertions(+), 23 deletions(-) diff --git a/src/menu/menudef.cpp b/src/menu/menudef.cpp index beb1562f2..ea410f571 100644 --- a/src/menu/menudef.cpp +++ b/src/menu/menudef.cpp @@ -1381,6 +1381,8 @@ static void InitCrosshairsList() // Initialize the music configuration submenus // //============================================================================= +extern const char* const banknames[74]; + static void InitMusicMenus() { DMenuDescriptor **advmenu = MenuDescriptors.CheckKey("AdvSoundOptions"); @@ -1418,6 +1420,21 @@ static void InitMusicMenus() } } } + + DMenuDescriptor **menu = MenuDescriptors.CheckKey("ADLBankMenu"); + + if (menu != nullptr) + { + if (soundfonts.Size() > 0) + { + for(int i=0;i<74;i++) + { + auto it = CreateOptionMenuItemCommand(banknames[i], FStringf("adl_bank %d", i), true); + static_cast(*menu)->mItems.Push(it); + i++; + } + } + } } //============================================================================= diff --git a/src/sound/adlmidi/adldata.cpp b/src/sound/adlmidi/adldata.cpp index d43f33b2f..f17d0c839 100644 --- a/src/sound/adlmidi/adldata.cpp +++ b/src/sound/adlmidi/adldata.cpp @@ -9002,7 +9002,7 @@ int maxAdlBanks() const char* const banknames[74] = { - "AIL (Star Control 3, Albion, Empire 2, Sensible Soccer, Settlers 2, many others)", + "AIL (Star Control 3, Albion, Empire 2, many others)", "Bisqwit (selection of 4op and 2op)", "HMI (Descent, Asterix)", "HMI (Descent:: Int)", @@ -9016,47 +9016,47 @@ const char* const banknames[74] = "HMI (Aces of the Deep)", "HMI (Earthsiege)", "HMI (Anvil of Dawn)", - "DMX (Doom :: partially pseudo 4op)", - "DMX (Hexen, Heretic :: partially pseudo 4op)", - "DMX (MUS Play :: partially pseudo 4op)", - "AIL (Discworld, Grandest Fleet, Pocahontas, Slob Zone 3d, Ultima 4, Zorro)", + "DMX (Doom)", + "DMX (Hexen, Heretic)", + "DMX (MUS Play)", + "AIL (Discworld, Grandest Fleet)", "AIL (Warcraft 2)", "AIL (Syndicate)", - "AIL (Guilty, Orion Conspiracy, Terra Nova Strike Force Centauri :: 4op)", + "AIL (Guilty, Orion Conspiracy)", "AIL (Magic Carpet 2)", "AIL (Nemesis)", "AIL (Jagged Alliance)", - "AIL (When Two Worlds War :: 4op, MISSING INSTRUMENTS)", - "AIL (Bards Tale Construction :: MISSING INSTRUMENTS)", + "AIL (When Two Worlds War)", + "AIL (Bards Tale Construction)", "AIL (Return to Zork)", "AIL (Theme Hospital)", "AIL (National Hockey League PA)", "AIL (Inherit The Earth)", "AIL (Inherit The Earth, file two)", - "AIL (Little Big Adventure :: 4op)", + "AIL (Little Big Adventure)", "AIL (Wreckin Crew)", "AIL (Death Gate)", "AIL (FIFA International Soccer)", "AIL (Starship Invasion)", - "AIL (Super Street Fighter 2 :: 4op)", - "AIL (Lords of the Realm :: MISSING INSTRUMENTS)", - "AIL (SimFarm, SimHealth :: 4op)", + "AIL (Super Street Fighter 2)", + "AIL (Lords of the Realm)", + "AIL (SimFarm, SimHealth)", "AIL (SimFarm, Settlers, Serf City)", - "AIL (Caesar 2 :: partially 4op, MISSING INSTRUMENTS)", + "AIL (Caesar 2, MISSING INSTRUMENTS)", "AIL (Syndicate Wars)", "AIL (Bubble Bobble Feat. Rainbow Islands, Z)", "AIL (Warcraft)", - "AIL (Terra Nova Strike Force Centuri :: partially 4op)", - "AIL (System Shock :: partially 4op)", + "AIL (Terra Nova Strike Force Centuri)", + "AIL (System Shock)", "AIL (Advanced Civilization)", - "AIL (Battle Chess 4000 :: partially 4op, melodic only)", - "AIL (Ultimate Soccer Manager :: partially 4op)", - "AIL (Air Bucks, Blue And The Gray, America Invades, Terminator 2029)", + "AIL (Battle Chess 4000, melodic only)", + "AIL (Ultimate Soccer Manager)", + "AIL (Air Bucks, Blue And The Gray)", "AIL (Ultima Underworld 2)", "AIL (Kasparov's Gambit)", - "AIL (High Seas Trader :: MISSING INSTRUMENTS)", - "AIL (Master of Magic, Master of Orion 2 :: 4op, std percussion)", - "AIL (Master of Magic, Master of Orion 2 :: 4op, orchestral percussion)", + "AIL (High Seas Trader)", + "AIL (Master of Magic, std percussion)", + "AIL (Master of Magic, orchestral percussion)", "SB (Action Soccer)", "SB (3d Cyberpuck :: melodic only)", "SB (Simon the Sorcerer :: melodic only)", diff --git a/wadsrc/static/menudef.txt b/wadsrc/static/menudef.txt index 0277fdad0..73ee39e84 100644 --- a/wadsrc/static/menudef.txt +++ b/wadsrc/static/menudef.txt @@ -1687,6 +1687,11 @@ OptionMenu FluidPatchsetMenu protected Title "$ADVSNDMNU_SELCONFIG" } +OptionMenu ADLBankMenu protected +{ + Title "$ADVSNDMNU_OPLBANK" +} + /*======================================= * * Module Replayer Options Menu @@ -1811,8 +1816,7 @@ OptionMenu ModReplayerOptions protected OptionMenu ADLOptions protected { Title "$ADVSNDMNU_ADLMIDI" - StaticText "$ADVSNDMNU_OPLBANK", 1 - // todo: fill in from internal data + LabeledSubmenu "$ADVSNDMNU_OPLBANK", "adl_bank", "ADLBankMenu" } /*======================================= From be81e00722f3590d4706956a656d28dc1640a260 Mon Sep 17 00:00:00 2001 From: Vitaly Novichkov Date: Sat, 24 Mar 2018 22:45:54 +0300 Subject: [PATCH 3/5] ADLMIDI: Added built-in ability to disable unneeded MUS and XMI converters Also embedded MIDI sequencer has been disabled too as it is not needed in GZDoom I made that to allow easier updates of ADLMIDI into newer versions without of any future troubles and conflicts --- src/CMakeLists.txt | 3 + src/sound/adlmidi/adlmidi.cpp | 80 +++++++++++++++++++++++- src/sound/adlmidi/adlmidi.h | 2 +- src/sound/adlmidi/adlmidi_load.cpp | 86 +++++++++++++++++++++++++- src/sound/adlmidi/adlmidi_midiplay.cpp | 26 ++++++-- src/sound/adlmidi/adlmidi_mus2mid.h | 49 --------------- src/sound/adlmidi/adlmidi_private.hpp | 26 +++++--- src/sound/adlmidi/adlmidi_xmi2mid.h | 60 ------------------ 8 files changed, 206 insertions(+), 126 deletions(-) delete mode 100644 src/sound/adlmidi/adlmidi_mus2mid.h delete mode 100644 src/sound/adlmidi/adlmidi_xmi2mid.h diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 8992e118f..964e220d8 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -648,6 +648,9 @@ endif() # OPLMIDI needs for USE_LEGACY_EMULATOR macro to be correctly built add_definitions(-DUSE_LEGACY_EMULATOR) +# Disable ADLMIDI's MIDI Sequencer, MUS and XMI converters +add_definitions(-DADLMIDI_DISABLE_MUS_SUPPORT -DADLMIDI_DISABLE_XMI_SUPPORT -DADLMIDI_DISABLE_MIDI_SEQUENCER) + # Project files should be aware of the header files. We can GLOB these since # there's generally a new cpp for every header so this file will get changed if( WIN32 ) diff --git a/src/sound/adlmidi/adlmidi.cpp b/src/sound/adlmidi/adlmidi.cpp index 5adad234a..e87835459 100644 --- a/src/sound/adlmidi/adlmidi.cpp +++ b/src/sound/adlmidi/adlmidi.cpp @@ -107,7 +107,7 @@ ADLMIDI_EXPORT int adl_setBank(ADL_MIDIPlayer *device, int bank) MIDIplay *play = reinterpret_cast(device->adl_midiPlayer); if(static_cast(bankno) >= NumBanks) { - #if 0 //ndef __WATCOMC__ + #ifndef __WATCOMC__ std::stringstream s; s << "bank number may only be 0.." << (NumBanks - 1) << ".\n"; play->setErrorString(s.str()); @@ -142,7 +142,7 @@ ADLMIDI_EXPORT int adl_setNumFourOpsChn(ADL_MIDIPlayer *device, int ops4) MIDIplay *play = reinterpret_cast(device->adl_midiPlayer); if((unsigned int)ops4 > 6 * play->m_setup.NumCards) { - #if 0 //ndef __WATCOMC__ + #ifndef __WATCOMC__ std::stringstream s; s << "number of four-op channels may only be 0.." << (6 * (play->m_setup.NumCards)) << " when " << play->m_setup.NumCards << " OPL3 cards are used.\n"; play->setErrorString(s.str()); @@ -272,6 +272,7 @@ ADLMIDI_EXPORT int adl_openFile(ADL_MIDIPlayer *device, const char *filePath) if(device && device->adl_midiPlayer) { MIDIplay *play = reinterpret_cast(device->adl_midiPlayer); +#ifndef ADLMIDI_DISABLE_MIDI_SEQUENCER play->m_setup.tick_skip_samples_delay = 0; if(!play->LoadMIDI(filePath)) { @@ -281,6 +282,10 @@ ADLMIDI_EXPORT int adl_openFile(ADL_MIDIPlayer *device, const char *filePath) return -1; } else return 0; +#else + play->setErrorString("ADLMIDI: MIDI Sequencer is not supported in this build of library!"); + return -1; +#endif //ADLMIDI_DISABLE_MIDI_SEQUENCER } ADLMIDI_ErrorString = "Can't load file: ADL MIDI is not initialized"; @@ -292,6 +297,7 @@ ADLMIDI_EXPORT int adl_openData(ADL_MIDIPlayer *device, const void *mem, unsigne if(device && device->adl_midiPlayer) { MIDIplay *play = reinterpret_cast(device->adl_midiPlayer); +#ifndef ADLMIDI_DISABLE_MIDI_SEQUENCER play->m_setup.tick_skip_samples_delay = 0; if(!play->LoadMIDI(mem, static_cast(size))) { @@ -301,6 +307,10 @@ ADLMIDI_EXPORT int adl_openData(ADL_MIDIPlayer *device, const void *mem, unsigne return -1; } else return 0; +#else + play->setErrorString("ADLMIDI: MIDI Sequencer is not supported in this build of library!"); + return -1; +#endif //ADLMIDI_DISABLE_MIDI_SEQUENCER } ADLMIDI_ErrorString = "Can't load file: ADL MIDI is not initialized"; return -1; @@ -348,7 +358,11 @@ ADLMIDI_EXPORT const char *adl_getMusicTitle(struct ADL_MIDIPlayer *device) MIDIplay *play = reinterpret_cast(device->adl_midiPlayer); if(!play) return ""; + #ifndef ADLMIDI_DISABLE_MIDI_SEQUENCER return play->musTitle.c_str(); + #else + return ""; + #endif } ADLMIDI_EXPORT void adl_close(struct ADL_MIDIPlayer *device) @@ -375,49 +389,71 @@ ADLMIDI_EXPORT double adl_totalTimeLength(struct ADL_MIDIPlayer *device) { if(!device) return -1.0; + #ifndef ADLMIDI_DISABLE_MIDI_SEQUENCER return reinterpret_cast(device->adl_midiPlayer)->timeLength(); + #else + return -1.0; + #endif } ADLMIDI_EXPORT double adl_loopStartTime(struct ADL_MIDIPlayer *device) { if(!device) return -1.0; + #ifndef ADLMIDI_DISABLE_MIDI_SEQUENCER return reinterpret_cast(device->adl_midiPlayer)->getLoopStart(); + #else + return -1.0; + #endif } ADLMIDI_EXPORT double adl_loopEndTime(struct ADL_MIDIPlayer *device) { if(!device) return -1.0; + #ifndef ADLMIDI_DISABLE_MIDI_SEQUENCER return reinterpret_cast(device->adl_midiPlayer)->getLoopEnd(); + #else + return -1.0; + #endif } ADLMIDI_EXPORT double adl_positionTell(struct ADL_MIDIPlayer *device) { if(!device) return -1.0; + #ifndef ADLMIDI_DISABLE_MIDI_SEQUENCER return reinterpret_cast(device->adl_midiPlayer)->tell(); + #else + return -1.0; + #endif } ADLMIDI_EXPORT void adl_positionSeek(struct ADL_MIDIPlayer *device, double seconds) { if(!device) return; + #ifndef ADLMIDI_DISABLE_MIDI_SEQUENCER reinterpret_cast(device->adl_midiPlayer)->seek(seconds); + #endif } ADLMIDI_EXPORT void adl_positionRewind(struct ADL_MIDIPlayer *device) { if(!device) return; + #ifndef ADLMIDI_DISABLE_MIDI_SEQUENCER reinterpret_cast(device->adl_midiPlayer)->rewind(); + #endif } ADLMIDI_EXPORT void adl_setTempo(struct ADL_MIDIPlayer *device, double tempo) { if(!device || (tempo <= 0.0)) return; + #ifndef ADLMIDI_DISABLE_MIDI_SEQUENCER reinterpret_cast(device->adl_midiPlayer)->setTempo(tempo); + #endif } @@ -425,7 +461,11 @@ ADLMIDI_EXPORT const char *adl_metaMusicTitle(struct ADL_MIDIPlayer *device) { if(!device) return ""; + #ifndef ADLMIDI_DISABLE_MIDI_SEQUENCER return reinterpret_cast(device->adl_midiPlayer)->musTitle.c_str(); + #else + return ""; + #endif } @@ -433,24 +473,37 @@ ADLMIDI_EXPORT const char *adl_metaMusicCopyright(struct ADL_MIDIPlayer *device) { if(!device) return ""; + #ifndef ADLMIDI_DISABLE_MIDI_SEQUENCER return reinterpret_cast(device->adl_midiPlayer)->musCopyright.c_str(); + #else + return ""; + #endif } ADLMIDI_EXPORT size_t adl_metaTrackTitleCount(struct ADL_MIDIPlayer *device) { if(!device) return 0; +#ifndef ADLMIDI_DISABLE_MIDI_SEQUENCER return reinterpret_cast(device->adl_midiPlayer)->musTrackTitles.size(); +#else + return 0; +#endif } ADLMIDI_EXPORT const char *adl_metaTrackTitle(struct ADL_MIDIPlayer *device, size_t index) { if(!device) return 0; +#ifndef ADLMIDI_DISABLE_MIDI_SEQUENCER MIDIplay *play = reinterpret_cast(device->adl_midiPlayer); if(index >= play->musTrackTitles.size()) return "INVALID"; return play->musTrackTitles[index].c_str(); +#else + (void)device; (void)index; + return "NOT SUPPORTED"; +#endif } @@ -458,12 +511,17 @@ ADLMIDI_EXPORT size_t adl_metaMarkerCount(struct ADL_MIDIPlayer *device) { if(!device) return 0; +#ifndef ADLMIDI_DISABLE_MIDI_SEQUENCER return reinterpret_cast(device->adl_midiPlayer)->musMarkers.size(); +#else + return 0; +#endif } ADLMIDI_EXPORT Adl_MarkerEntry adl_metaMarker(struct ADL_MIDIPlayer *device, size_t index) { struct Adl_MarkerEntry marker; + #ifndef ADLMIDI_DISABLE_MIDI_SEQUENCER MIDIplay *play = reinterpret_cast(device->adl_midiPlayer); if(!device || !play || (index >= play->musMarkers.size())) { @@ -479,6 +537,12 @@ ADLMIDI_EXPORT Adl_MarkerEntry adl_metaMarker(struct ADL_MIDIPlayer *device, siz marker.pos_time = mk.pos_time; marker.pos_ticks = (unsigned long)mk.pos_ticks; } + #else + (void)device; (void)index; + marker.label = "NOT SUPPORTED"; + marker.pos_time = 0.0; + marker.pos_ticks = 0; + #endif return marker; } @@ -531,6 +595,7 @@ inline static void SendStereoAudio(int &samples_requested, ADLMIDI_EXPORT int adl_play(ADL_MIDIPlayer *device, int sampleCount, short *out) { + #ifndef ADLMIDI_DISABLE_MIDI_SEQUENCER #ifdef ADLMIDI_HW_OPL (void)device; (void)sampleCount; @@ -633,6 +698,9 @@ ADLMIDI_EXPORT int adl_play(ADL_MIDIPlayer *device, int sampleCount, short *out) return static_cast(gotten_len); #endif + #else + return 0; + #endif //ADLMIDI_DISABLE_MIDI_SEQUENCER } @@ -720,22 +788,30 @@ ADLMIDI_EXPORT int adl_generate(struct ADL_MIDIPlayer *device, int sampleCount, ADLMIDI_EXPORT double adl_tickEvents(struct ADL_MIDIPlayer *device, double seconds, double granuality) { +#ifndef ADLMIDI_DISABLE_MIDI_SEQUENCER if(!device) return -1.0; MIDIplay *player = reinterpret_cast(device->adl_midiPlayer); if(!player) return -1.0; return player->Tick(seconds, granuality); +#else + return -1.0; +#endif } ADLMIDI_EXPORT int adl_atEnd(struct ADL_MIDIPlayer *device) { +#ifndef ADLMIDI_DISABLE_MIDI_SEQUENCER if(!device) return 1; MIDIplay *player = reinterpret_cast(device->adl_midiPlayer); if(!player) return 1; return (int)player->atEnd; +#else + return 1; +#endif } ADLMIDI_EXPORT void adl_panic(struct ADL_MIDIPlayer *device) diff --git a/src/sound/adlmidi/adlmidi.h b/src/sound/adlmidi/adlmidi.h index a1ac0f8ac..10fe4ddff 100644 --- a/src/sound/adlmidi/adlmidi.h +++ b/src/sound/adlmidi/adlmidi.h @@ -30,7 +30,7 @@ extern "C" { #define ADLMIDI_VERSION_MAJOR 1 #define ADLMIDI_VERSION_MINOR 3 -#define ADLMIDI_VERSION_PATCHLEVEL 1 +#define ADLMIDI_VERSION_PATCHLEVEL 2 #define ADLMIDI_TOSTR(s) #s #define ADLMIDI_VERSION \ diff --git a/src/sound/adlmidi/adlmidi_load.cpp b/src/sound/adlmidi/adlmidi_load.cpp index 3057a7e35..03206bcd6 100644 --- a/src/sound/adlmidi/adlmidi_load.cpp +++ b/src/sound/adlmidi/adlmidi_load.cpp @@ -23,8 +23,14 @@ #include "adlmidi_private.hpp" -#include "adlmidi_mus2mid.h" -#include "adlmidi_xmi2mid.h" +#ifndef ADLMIDI_DISABLE_MIDI_SEQUENCER +# ifndef ADLMIDI_DISABLE_MUS_SUPPORT +# include "adlmidi_mus2mid.h" +# endif//MUS +# ifndef ADLMIDI_DISABLE_XMI_SUPPORT +# include "adlmidi_xmi2mid.h" +# endif//XMI +#endif //ADLMIDI_DISABLE_MIDI_SEQUENCER uint64_t MIDIplay::ReadBEint(const void *buffer, size_t nbytes) { @@ -339,6 +345,7 @@ tryAgain: return true; } +#ifndef ADLMIDI_DISABLE_MIDI_SEQUENCER bool MIDIplay::LoadMIDI(const std::string &filename) { fileReader file; @@ -412,6 +419,80 @@ riffskip: fr.seek(7 - static_cast(HeaderSize), SEEK_CUR); is_GMF = true; } + #ifndef ADLMIDI_DISABLE_MUS_SUPPORT + else if(std::memcmp(HeaderBuf, "MUS\x1A", 4) == 0) + { + // MUS/DMX files (Doom) + fr.seek(0, SEEK_END); + size_t mus_len = fr.tell(); + fr.seek(0, SEEK_SET); + uint8_t *mus = (uint8_t *)malloc(mus_len); + if(!mus) + { + errorStringOut = "Out of memory!"; + return false; + } + fr.read(mus, 1, mus_len); + //Close source stream + fr.close(); + + uint8_t *mid = NULL; + uint32_t mid_len = 0; + int m2mret = AdlMidi_mus2midi(mus, static_cast(mus_len), + &mid, &mid_len, 0); + if(mus) free(mus); + if(m2mret < 0) + { + errorStringOut = "Invalid MUS/DMX data format!"; + return false; + } + cvt_buf.reset(mid); + //Open converted MIDI file + fr.openData(mid, static_cast(mid_len)); + //Re-Read header again! + goto riffskip; + } + #endif //ADLMIDI_DISABLE_MUS_SUPPORT + #ifndef ADLMIDI_DISABLE_XMI_SUPPORT + else if(std::memcmp(HeaderBuf, "FORM", 4) == 0) + { + if(std::memcmp(HeaderBuf + 8, "XDIR", 4) != 0) + { + fr.close(); + errorStringOut = fr._fileName + ": Invalid format\n"; + return false; + } + + fr.seek(0, SEEK_END); + size_t mus_len = fr.tell(); + fr.seek(0, SEEK_SET); + uint8_t *mus = (uint8_t*)malloc(mus_len); + if(!mus) + { + errorStringOut = "Out of memory!"; + return false; + } + fr.read(mus, 1, mus_len); + //Close source stream + fr.close(); + + uint8_t *mid = NULL; + uint32_t mid_len = 0; + int m2mret = AdlMidi_xmi2midi(mus, static_cast(mus_len), + &mid, &mid_len, XMIDI_CONVERT_NOCONVERSION); + if(mus) free(mus); + if(m2mret < 0) + { + errorStringOut = "Invalid XMI data format!"; + return false; + } + cvt_buf.reset(mid); + //Open converted MIDI file + fr.openData(mid, static_cast(mid_len)); + //Re-Read header again! + goto riffskip; + } + #endif //ADLMIDI_DISABLE_XMI_SUPPORT else if(std::memcmp(HeaderBuf, "CTMF", 4) == 0) { opl.dynamic_instruments.clear(); @@ -691,3 +772,4 @@ riffskip: ch.resize(opl.NumChannels); return true; } +#endif //ADLMIDI_DISABLE_MIDI_SEQUENCER diff --git a/src/sound/adlmidi/adlmidi_midiplay.cpp b/src/sound/adlmidi/adlmidi_midiplay.cpp index 432785f85..ea3b1fefb 100644 --- a/src/sound/adlmidi/adlmidi_midiplay.cpp +++ b/src/sound/adlmidi/adlmidi_midiplay.cpp @@ -133,6 +133,8 @@ void MIDIplay::AdlChannel::AddAge(int64_t ms) } } +#ifndef ADLMIDI_DISABLE_MIDI_SEQUENCER + MIDIplay::MidiEvent::MidiEvent() : type(T_UNKNOWN), subtype(T_UNKNOWN), @@ -250,7 +252,9 @@ void MIDIplay::MidiTrackRow::sortEvents(bool *noteStates) events.insert(events.end(), controllers.begin(), controllers.end()); events.insert(events.end(), anyOther.begin(), anyOther.end()); } +#endif //ADLMIDI_DISABLE_MIDI_SEQUENCER +#ifndef ADLMIDI_DISABLE_MIDI_SEQUENCER bool MIDIplay::buildTrackData() { fullSongTimeLength = 0.0; @@ -687,10 +691,13 @@ bool MIDIplay::buildTrackData() return true; } +#endif + MIDIplay::MIDIplay(unsigned long sampleRate): - cmf_percussion_mode(false), - fullSongTimeLength(0.0), + cmf_percussion_mode(false) +#ifndef ADLMIDI_DISABLE_MIDI_SEQUENCER + , fullSongTimeLength(0.0), postSongWaitDelay(1.0), loopStartTime(-1.0), loopEndTime(-1.0), @@ -699,6 +706,7 @@ MIDIplay::MIDIplay(unsigned long sampleRate): loopStart(false), loopEnd(false), invalidLoop(false) +#endif { devices.clear(); @@ -781,7 +789,7 @@ uint64_t MIDIplay::ReadVarLenEx(uint8_t **ptr, uint8_t *end, bool &ok) return result; } - +#ifndef ADLMIDI_DISABLE_MIDI_SEQUENCER double MIDIplay::Tick(double s, double granularity) { s *= tempoMultiplier; @@ -816,6 +824,7 @@ double MIDIplay::Tick(double s, double granularity) return CurrentPositionNew.wait; } +#endif void MIDIplay::TickIteratos(double s) { @@ -825,6 +834,8 @@ void MIDIplay::TickIteratos(double s) UpdateArpeggio(s); } +#ifndef ADLMIDI_DISABLE_MIDI_SEQUENCER + void MIDIplay::seek(double seconds) { if(seconds < 0.0) @@ -930,6 +941,7 @@ void MIDIplay::setTempo(double tempo) { tempoMultiplier = tempo; } +#endif void MIDIplay::realTime_ResetState() { @@ -1608,7 +1620,7 @@ void MIDIplay::NoteUpdate(uint16_t MidCh, Ch[MidCh].activenotes.erase(i); } - +#ifndef ADLMIDI_DISABLE_MIDI_SEQUENCER bool MIDIplay::ProcessEventsNew(bool isSeek) { if(CurrentPositionNew.track.size() == 0) @@ -1720,7 +1732,9 @@ bool MIDIplay::ProcessEventsNew(bool isSeek) return true;//Has events in queue } +#endif +#ifndef ADLMIDI_DISABLE_MIDI_SEQUENCER MIDIplay::MidiEvent MIDIplay::parseEvent(uint8_t **pptr, uint8_t *end, int &status) { uint8_t *&ptr = *pptr; @@ -1924,6 +1938,7 @@ MIDIplay::MidiEvent MIDIplay::parseEvent(uint8_t **pptr, uint8_t *end, int &stat return evt; } +#endif const std::string &MIDIplay::getErrorString() { @@ -1935,7 +1950,7 @@ void MIDIplay::setErrorString(const std::string &err) errorStringOut = err; } - +#ifndef ADLMIDI_DISABLE_MIDI_SEQUENCER void MIDIplay::HandleEvent(size_t tk, const MIDIplay::MidiEvent &evt, int &status) { if(hooks.onEvent) @@ -2092,6 +2107,7 @@ void MIDIplay::HandleEvent(size_t tk, const MIDIplay::MidiEvent &evt, int &statu } } } +#endif long MIDIplay::CalculateAdlChannelGoodness(unsigned c, const MIDIchannel::NoteInfo::Phys &ins, uint16_t) const { diff --git a/src/sound/adlmidi/adlmidi_mus2mid.h b/src/sound/adlmidi/adlmidi_mus2mid.h deleted file mode 100644 index cc41b87a1..000000000 --- a/src/sound/adlmidi/adlmidi_mus2mid.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - * MUS2MIDI: DMX (DOOM) MUS to MIDI Library Header - * - * Copyright (C) 2014-2016 Bret Curtis - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -#ifndef MUSLIB_H -#define MUSLIB_H - -#include - -#ifdef __DJGPP__ -typedef signed char int8_t; -typedef unsigned char uint8_t; -typedef signed short int16_t; -typedef unsigned short uint16_t; -typedef signed long int32_t; -typedef unsigned long uint32_t; -#endif - -#ifdef __cplusplus -extern "C" -{ -#endif - -int AdlMidi_mus2midi(uint8_t *in, uint32_t insize, - uint8_t **out, uint32_t *outsize, - uint16_t frequency); - -#ifdef __cplusplus -} -#endif - -#endif /* MUSLIB_H */ diff --git a/src/sound/adlmidi/adlmidi_private.hpp b/src/sound/adlmidi/adlmidi_private.hpp index 70cd9e30e..8b2bf19da 100644 --- a/src/sound/adlmidi/adlmidi_private.hpp +++ b/src/sound/adlmidi/adlmidi_private.hpp @@ -75,6 +75,7 @@ typedef int32_t ssize_t; #include #include #include +#include //#ifdef __WATCOMC__ //#include //TODO: Implemnet a workaround for OpenWatcom to fix a crash while using those containers //#include @@ -104,13 +105,6 @@ typedef int32_t ssize_t; #include #include -#ifdef _MSC_VER -#pragma warning(disable:4319) -#pragma warning(disable:4267) -#pragma warning(disable:4244) -#pragma warning(disable:4146) -#endif - #include "fraction.hpp" #ifndef ADLMIDI_HW_OPL @@ -583,6 +577,7 @@ public: void AddAge(int64_t ms); }; +#ifndef ADLMIDI_DISABLE_MIDI_SEQUENCER /** * @brief MIDI Event utility container */ @@ -707,6 +702,7 @@ public: PositionNew(): began(false), wait(0.0), absTimePosition(0.0), track() {} }; +#endif//ADLMIDI_DISABLE_MIDI_SEQUENCER struct Setup { @@ -757,6 +753,8 @@ private: char ____padding[7]; std::vector ch; + +#ifndef ADLMIDI_DISABLE_MIDI_SEQUENCER std::vector > TrackData; PositionNew CurrentPositionNew, LoopBeginPositionNew, trackBeginPositionNew; @@ -770,13 +768,16 @@ private: double loopStartTime; //! Loop end time double loopEndTime; +#endif //! Local error string std::string errorString; //! Local error string std::string errorStringOut; +#ifndef ADLMIDI_DISABLE_MIDI_SEQUENCER //! Pre-processed track data storage std::vector trackDataNew; +#endif //! Missing instruments catches std::set caugh_missing_instruments; @@ -785,6 +786,7 @@ private: //! Missing percussion banks catches std::set caugh_missing_banks_percussion; +#ifndef ADLMIDI_DISABLE_MIDI_SEQUENCER /** * @brief Build MIDI track data from the raw track data storage * @return true if everything successfully processed, or false on any error @@ -799,12 +801,14 @@ private: * @return Parsed MIDI event entry */ MidiEvent parseEvent(uint8_t **ptr, uint8_t *end, int &status); +#endif//ADLMIDI_DISABLE_MIDI_SEQUENCER public: const std::string &getErrorString(); void setErrorString(const std::string &err); +#ifndef ADLMIDI_DISABLE_MIDI_SEQUENCER std::string musTitle; std::string musCopyright; std::vector musTrackTitles; @@ -818,6 +822,7 @@ public: loopEnd, invalidLoop; /*Loop points are invalid (loopStart after loopEnd or loopStart and loopEnd are on same place)*/ char ____padding2[2]; +#endif OPL3 opl; int16_t outBuf[1024]; @@ -846,6 +851,7 @@ public: bool LoadBank(const void *data, size_t size); bool LoadBank(fileReader &fr); +#ifndef ADLMIDI_DISABLE_MIDI_SEQUENCER bool LoadMIDI(const std::string &filename); bool LoadMIDI(const void *data, size_t size); bool LoadMIDI(fileReader &fr); @@ -857,6 +863,7 @@ public: * @return desired number of seconds until next call */ double Tick(double s, double granularity); +#endif /** * @brief Process extra iterators like vibrato or arpeggio @@ -864,6 +871,7 @@ public: */ void TickIteratos(double s); +#ifndef ADLMIDI_DISABLE_MIDI_SEQUENCER /** * @brief Change current position to specified time position in seconds * @param seconds Absolute time position in seconds @@ -904,6 +912,7 @@ public: * @param tempo Tempo multiplier: 1.0 - original tempo. >1 - faster, <1 - slower */ void setTempo(double tempo); +#endif//ADLMIDI_DISABLE_MIDI_SEQUENCER /* RealTime event triggers */ void realTime_ResetState(); @@ -942,8 +951,11 @@ private: MIDIchannel::activenoteiterator i, unsigned props_mask, int32_t select_adlchn = -1); + +#ifndef ADLMIDI_DISABLE_MIDI_SEQUENCER bool ProcessEventsNew(bool isSeek = false); void HandleEvent(size_t tk, const MidiEvent &evt, int &status); +#endif // Determine how good a candidate this adlchannel // would be for playing a note from this instrument. diff --git a/src/sound/adlmidi/adlmidi_xmi2mid.h b/src/sound/adlmidi/adlmidi_xmi2mid.h deleted file mode 100644 index 950d58ca6..000000000 --- a/src/sound/adlmidi/adlmidi_xmi2mid.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - * XMIDI: Miles XMIDI to MID Library Header - * - * Copyright (C) 2001 Ryan Nunn - * Copyright (C) 2014-2016 Bret Curtis - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -/* XMIDI Converter */ - -#ifndef XMIDILIB_H -#define XMIDILIB_H - -#include - -#ifdef __DJGPP__ -typedef signed char int8_t; -typedef unsigned char uint8_t; -typedef signed short int16_t; -typedef unsigned short uint16_t; -typedef signed long int32_t; -typedef unsigned long uint32_t; -#endif - -#ifdef __cplusplus -extern "C" -{ -#endif - -/* Conversion types for Midi files */ -#define XMIDI_CONVERT_NOCONVERSION 0x00 -#define XMIDI_CONVERT_MT32_TO_GM 0x01 -#define XMIDI_CONVERT_MT32_TO_GS 0x02 -#define XMIDI_CONVERT_MT32_TO_GS127 0x03 /* This one is broken, don't use */ -#define XMIDI_CONVERT_MT32_TO_GS127DRUM 0x04 /* This one is broken, don't use */ -#define XMIDI_CONVERT_GS127_TO_GS 0x05 - -int AdlMidi_xmi2midi(uint8_t *in, uint32_t insize, - uint8_t **out, uint32_t *outsize, - uint32_t convert_type); - -#ifdef __cplusplus -} -#endif - -#endif /* XMIDILIB_H */ From e31830e8bef24d0b8ba19fd3238a03d1cddcf261 Mon Sep 17 00:00:00 2001 From: Vitaly Novichkov Date: Sat, 24 Mar 2018 23:19:50 +0300 Subject: [PATCH 4/5] ADLMIDI: Tiny warning fix --- src/sound/adlmidi/adlmidi.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/sound/adlmidi/adlmidi.cpp b/src/sound/adlmidi/adlmidi.cpp index e87835459..787c729c4 100644 --- a/src/sound/adlmidi/adlmidi.cpp +++ b/src/sound/adlmidi/adlmidi.cpp @@ -796,6 +796,7 @@ ADLMIDI_EXPORT double adl_tickEvents(struct ADL_MIDIPlayer *device, double secon return -1.0; return player->Tick(seconds, granuality); #else + (void)seconds; (void)granuality; return -1.0; #endif } From 77a2101c06e6225ad1f72efc0add1c202441a82c Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 24 Mar 2018 21:30:59 +0100 Subject: [PATCH 5/5] - re-applied my changes to ADLMIDI code: * disable sstream. No point pulling in such a large piece of code for two error messages. * disable MSVC warnings which get emitted by the code. --- src/sound/adlmidi/adlmidi.cpp | 4 ++-- src/sound/adlmidi/adlmidi_private.hpp | 8 +++++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/sound/adlmidi/adlmidi.cpp b/src/sound/adlmidi/adlmidi.cpp index 787c729c4..1adf399cc 100644 --- a/src/sound/adlmidi/adlmidi.cpp +++ b/src/sound/adlmidi/adlmidi.cpp @@ -107,7 +107,7 @@ ADLMIDI_EXPORT int adl_setBank(ADL_MIDIPlayer *device, int bank) MIDIplay *play = reinterpret_cast(device->adl_midiPlayer); if(static_cast(bankno) >= NumBanks) { - #ifndef __WATCOMC__ + #if 0 //ndef __WATCOMC__ std::stringstream s; s << "bank number may only be 0.." << (NumBanks - 1) << ".\n"; play->setErrorString(s.str()); @@ -142,7 +142,7 @@ ADLMIDI_EXPORT int adl_setNumFourOpsChn(ADL_MIDIPlayer *device, int ops4) MIDIplay *play = reinterpret_cast(device->adl_midiPlayer); if((unsigned int)ops4 > 6 * play->m_setup.NumCards) { - #ifndef __WATCOMC__ + #if 0 //ndef __WATCOMC__ std::stringstream s; s << "number of four-op channels may only be 0.." << (6 * (play->m_setup.NumCards)) << " when " << play->m_setup.NumCards << " OPL3 cards are used.\n"; play->setErrorString(s.str()); diff --git a/src/sound/adlmidi/adlmidi_private.hpp b/src/sound/adlmidi/adlmidi_private.hpp index 8b2bf19da..8f0c6579f 100644 --- a/src/sound/adlmidi/adlmidi_private.hpp +++ b/src/sound/adlmidi/adlmidi_private.hpp @@ -75,7 +75,6 @@ typedef int32_t ssize_t; #include #include #include -#include //#ifdef __WATCOMC__ //#include //TODO: Implemnet a workaround for OpenWatcom to fix a crash while using those containers //#include @@ -105,6 +104,13 @@ typedef int32_t ssize_t; #include #include +#ifdef _MSC_VER +#pragma warning(disable:4319) +#pragma warning(disable:4267) +#pragma warning(disable:4244) +#pragma warning(disable:4146) +#endif + #include "fraction.hpp" #ifndef ADLMIDI_HW_OPL