From cfacf50fc1422d88b169d02cfaf48dd8529e5a76 Mon Sep 17 00:00:00 2001 From: Vitaly Novichkov Date: Fri, 20 Apr 2018 00:28:09 +0300 Subject: Put some another functions into "ADLMIDI_DISABLE_MIDI_SEQUENCER" zone Those functions are dead out of disabled MIDI Sequencer code, so, there are must NOT appear in the library when MIDI Sequencer is disabled. --- src/adlmidi_load.cpp | 3 +++ src/adlmidi_midiplay.cpp | 2 +- src/adlmidi_private.hpp | 15 +++++++++++++++ 3 files changed, 19 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/adlmidi_load.cpp b/src/adlmidi_load.cpp index 77e6f69..f87b547 100644 --- a/src/adlmidi_load.cpp +++ b/src/adlmidi_load.cpp @@ -32,6 +32,7 @@ # endif//XMI #endif //ADLMIDI_DISABLE_MIDI_SEQUENCER +#ifndef ADLMIDI_DISABLE_MIDI_SEQUENCER uint64_t MIDIplay::ReadBEint(const void *buffer, size_t nbytes) { uint64_t result = 0; @@ -54,6 +55,8 @@ uint64_t MIDIplay::ReadLEint(const void *buffer, size_t nbytes) return result; } +#endif + bool MIDIplay::LoadBank(const std::string &filename) { fileReader file; diff --git a/src/adlmidi_midiplay.cpp b/src/adlmidi_midiplay.cpp index d984fe1..702ebea 100644 --- a/src/adlmidi_midiplay.cpp +++ b/src/adlmidi_midiplay.cpp @@ -760,6 +760,7 @@ void MIDIplay::applySetup() ch.resize(opl.NumChannels); } +#ifndef ADLMIDI_DISABLE_MIDI_SEQUENCER uint64_t MIDIplay::ReadVarLen(uint8_t **ptr) { uint64_t result = 0; @@ -792,7 +793,6 @@ 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; diff --git a/src/adlmidi_private.hpp b/src/adlmidi_private.hpp index f6eea5a..3532126 100644 --- a/src/adlmidi_private.hpp +++ b/src/adlmidi_private.hpp @@ -1167,7 +1167,21 @@ public: Setup m_setup; +#ifndef ADLMIDI_DISABLE_MIDI_SEQUENCER + /** + * @brief Utility function to read Big-Endian integer from raw binary data + * @param buffer Pointer to raw binary buffer + * @param nbytes Count of bytes to parse integer + * @return Extracted unsigned integer + */ static uint64_t ReadBEint(const void *buffer, size_t nbytes); + + /** + * @brief Utility function to read Little-Endian integer from raw binary data + * @param buffer Pointer to raw binary buffer + * @param nbytes Count of bytes to parse integer + * @return Extracted unsigned integer + */ static uint64_t ReadLEint(const void *buffer, size_t nbytes); /** @@ -1184,6 +1198,7 @@ public: * @return Unsigned integer that conains parsed variable-length value */ uint64_t ReadVarLenEx(uint8_t **ptr, uint8_t *end, bool &ok); +#endif bool LoadBank(const std::string &filename); bool LoadBank(const void *data, size_t size); -- cgit v1.2.3