From 98e239c7aa86a73e1fa29e331c2258990be0470e Mon Sep 17 00:00:00 2001 From: Wohlstand Date: Mon, 24 Aug 2020 23:21:53 +0300 Subject: ADLMIDI2: Fixed an "bank always 0" bug --- include/adlmidi.hpp | 2 ++ src/adlmidi_midiplay.cpp | 7 +++++-- utils/adlmidi-2/midiplay.cc | 3 +++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/include/adlmidi.hpp b/include/adlmidi.hpp index 69ee026..0df6dd4 100644 --- a/include/adlmidi.hpp +++ b/include/adlmidi.hpp @@ -37,6 +37,8 @@ public: explicit AdlInstrumentTester(ADL_MIDIPlayer *device); virtual ~AdlInstrumentTester(); + void start(); + // Find list of adlib instruments that supposedly implement this GM void FindAdlList(); void DoNote(int note); diff --git a/src/adlmidi_midiplay.cpp b/src/adlmidi_midiplay.cpp index 2ed7815..c3ef14c 100644 --- a/src/adlmidi_midiplay.cpp +++ b/src/adlmidi_midiplay.cpp @@ -1888,8 +1888,6 @@ ADLMIDI_EXPORT AdlInstrumentTester::AdlInstrumentTester(ADL_MIDIPlayer *device) p->cur_note = -1; p->play = play; p->opl = play ? play->m_synth.get() : NULL; - - NextGM(0); #else ADL_UNUSED(device); #endif @@ -1900,6 +1898,11 @@ ADLMIDI_EXPORT AdlInstrumentTester::~AdlInstrumentTester() delete p; } +ADLMIDI_EXPORT void AdlInstrumentTester::start() +{ + NextGM(0); +} + ADLMIDI_EXPORT void AdlInstrumentTester::FindAdlList() { #ifndef DISABLE_EMBEDDED_BANKS diff --git a/utils/adlmidi-2/midiplay.cc b/utils/adlmidi-2/midiplay.cc index 773e766..c77d180 100644 --- a/utils/adlmidi-2/midiplay.cc +++ b/utils/adlmidi-2/midiplay.cc @@ -1902,6 +1902,9 @@ int main(int argc, char **argv) AdlInstrumentTester InstrumentTester(myDevice); + if(DoingInstrumentTesting) + InstrumentTester.start(); + //static std::vector sample_buf; #ifdef __DJGPP__ double tick_delay = 0.0; -- cgit v1.2.3