aboutsummaryrefslogtreecommitdiff
path: root/src/adlmidi_load.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/adlmidi_load.cpp')
-rw-r--r--src/adlmidi_load.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/adlmidi_load.cpp b/src/adlmidi_load.cpp
index c67076b..03206bc 100644
--- a/src/adlmidi_load.cpp
+++ b/src/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,7 @@ riffskip:
fr.seek(7 - static_cast<long>(HeaderSize), SEEK_CUR);
is_GMF = true;
}
+ #ifndef ADLMIDI_DISABLE_MUS_SUPPORT
else if(std::memcmp(HeaderBuf, "MUS\x1A", 4) == 0)
{
// MUS/DMX files (Doom)
@@ -444,6 +452,8 @@ riffskip:
//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)
@@ -482,6 +492,7 @@ riffskip:
//Re-Read header again!
goto riffskip;
}
+ #endif //ADLMIDI_DISABLE_XMI_SUPPORT
else if(std::memcmp(HeaderBuf, "CTMF", 4) == 0)
{
opl.dynamic_instruments.clear();
@@ -761,3 +772,4 @@ riffskip:
ch.resize(opl.NumChannels);
return true;
}
+#endif //ADLMIDI_DISABLE_MIDI_SEQUENCER