aboutsummaryrefslogtreecommitdiff
path: root/src/adlmidi_midiplay.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/adlmidi_midiplay.cpp')
-rw-r--r--src/adlmidi_midiplay.cpp175
1 files changed, 0 insertions, 175 deletions
diff --git a/src/adlmidi_midiplay.cpp b/src/adlmidi_midiplay.cpp
index c3ef14c..70e5854 100644
--- a/src/adlmidi_midiplay.cpp
+++ b/src/adlmidi_midiplay.cpp
@@ -1865,178 +1865,3 @@ void MIDIplay::describeChannels(char *str, char *attr, size_t size)
str[index] = 0;
attr[index] = 0;
}
-
-#ifndef ADLMIDI_DISABLE_CPP_EXTRAS
-
-struct AdlInstrumentTester::Impl
-{
- uint32_t cur_gm;
- uint32_t ins_idx;
- int cur_note;
- std::vector<uint32_t> adl_ins_list;
- Synth *opl;
- MIDIplay *play;
-};
-
-ADLMIDI_EXPORT AdlInstrumentTester::AdlInstrumentTester(ADL_MIDIPlayer *device)
- : p(new Impl)
-{
-#ifndef DISABLE_EMBEDDED_BANKS
- MIDIplay *play = reinterpret_cast<MIDIplay *>(device->adl_midiPlayer);
- p->cur_gm = 0;
- p->ins_idx = 0;
- p->cur_note = -1;
- p->play = play;
- p->opl = play ? play->m_synth.get() : NULL;
-#else
- ADL_UNUSED(device);
-#endif
-}
-
-ADLMIDI_EXPORT AdlInstrumentTester::~AdlInstrumentTester()
-{
- delete p;
-}
-
-ADLMIDI_EXPORT void AdlInstrumentTester::start()
-{
- NextGM(0);
-}
-
-ADLMIDI_EXPORT void AdlInstrumentTester::FindAdlList()
-{
-#ifndef DISABLE_EMBEDDED_BANKS
- p->play->realTime_panic();
- p->cur_note = -1;
- p->opl->silenceAll();
-#endif
-}
-
-
-ADLMIDI_EXPORT void AdlInstrumentTester::DoNote(int note)
-{
-#ifndef DISABLE_EMBEDDED_BANKS
- DoNoteOff();
- p->play->realTime_NoteOn(0, note, 127);
- p->cur_note = note;
-#else
- ADL_UNUSED(note);
-#endif
-}
-
-void AdlInstrumentTester::DoNoteOff()
-{
-#ifndef DISABLE_EMBEDDED_BANKS
- if(p->cur_note > 0)
- p->play->realTime_NoteOff(0, p->cur_note);
-#endif
-}
-
-ADLMIDI_EXPORT void AdlInstrumentTester::NextGM(int offset)
-{
-#ifndef DISABLE_EMBEDDED_BANKS
- if(offset < 0 && (static_cast<long>(p->cur_gm) + offset) < 0)
- p->cur_gm += g_embeddedBanksCount;
-
- p->cur_gm += offset;
-
- if(p->cur_gm >= g_embeddedBanksCount)
- p->cur_gm = (p->cur_gm + offset) - g_embeddedBanksCount;
-
- p->play->m_setup.numFourOps = -1;
- p->opl->setEmbeddedBank(p->cur_gm);
- adlCalculateFourOpChannels(p->play, true);
- p->opl->updateChannelCategories();
-
-// std::printf("Bank %u [%s]\n", P->cur_gm, adl_getBankNames()[P->cur_gm]);
-// std::fflush(stdout);
-
- FindAdlList();
-#else
- ADL_UNUSED(offset);
-#endif
-}
-
-ADLMIDI_EXPORT void AdlInstrumentTester::NextAdl(int offset)
-{
-#ifndef DISABLE_EMBEDDED_BANKS
-
-#if 0
- UI.Color(15);
- std::fflush(stderr);
- std::printf("SELECTED G%c%d\t%s\n",
- cur_gm < 128 ? 'M' : 'P', cur_gm < 128 ? cur_gm + 1 : cur_gm - 128,
- "<-> select GM, ^v select ins, qwe play note");
- std::fflush(stdout);
- UI.Color(7);
- std::fflush(stderr);
-#endif
-
- if(offset < 0 && (static_cast<long>(p->ins_idx) + offset) < 0)
- p->ins_idx += 127;
-
- p->ins_idx += offset;
-
- if(p->ins_idx >= 127)
- p->ins_idx = (p->ins_idx + offset) - 127;
-
- p->play->realTime_PatchChange(0, p->ins_idx);
- p->play->realTime_Controller(0, 7, 127);
- p->play->realTime_Controller(0, 11, 127);
- p->play->realTime_Controller(0, 10, 64);
-
-// std::printf("Instrument %u\n", p->ins_idx);
-// std::fflush(stdout);
-
-#else
- ADL_UNUSED(offset);
-#endif
-}
-
-ADLMIDI_EXPORT bool AdlInstrumentTester::HandleInputChar(char ch)
-{
-#ifndef DISABLE_EMBEDDED_BANKS
- static const char notes[] = "zsxdcvgbhnjmq2w3er5t6y7ui9o0p";
- // c'd'ef'g'a'bC'D'EF'G'A'Bc'd'e
- switch(ch)
- {
- case '/':
- case 'H':
- case 'A':
- NextAdl(-1);
- break;
- case '*':
- case 'P':
- case 'B':
- NextAdl(+1);
- break;
- case '-':
- case 'K':
- case 'D':
- NextGM(-1);
- break;
- case '+':
- case 'M':
- case 'C':
- NextGM(+1);
- break;
- case ' ':
- DoNoteOff();
- break;
- case 3:
-#if !((!defined(__WIN32__) || defined(__CYGWIN__)) && !defined(__DJGPP__))
- case 27:
-#endif
- return false;
- default:
- const char *p = std::strchr(notes, ch);
- if(p && *p)
- DoNote((int)(p - notes) + 48);
- }
-#else
- ADL_UNUSED(ch);
-#endif
- return true;
-}
-
-#endif /* ADLMIDI_DISABLE_CPP_EXTRAS */