From 0401ee9f58ea842cb4aef687e8e107380d46445c Mon Sep 17 00:00:00 2001 From: Wohlstand Date: Wed, 25 Oct 2017 03:01:50 +0300 Subject: Clean-up - Move all private variables into MIDIplay class away from public ADL_MIDIPlayer structure - Comment out most of legacy code - Implement new-style ReadVarLenEx for error-checked var-len value reading process TODO: Stabilize this and implement missing fields and API calls (meta-data retreiving) --- src/adlmidi_private.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/adlmidi_private.cpp') diff --git a/src/adlmidi_private.cpp b/src/adlmidi_private.cpp index c888b18..04bb481 100644 --- a/src/adlmidi_private.cpp +++ b/src/adlmidi_private.cpp @@ -47,7 +47,7 @@ int adlRefreshNumCards(ADL_MIDIPlayer *device) //For embedded bank for(unsigned a = 0; a < 256; ++a) { - unsigned insno = banks[device->AdlBank][a]; + unsigned insno = banks[play->m_setup.AdlBank][a]; if(insno == 198) continue; ++n_total[a / 128]; @@ -57,13 +57,13 @@ int adlRefreshNumCards(ADL_MIDIPlayer *device) } } - device->NumFourOps = - (n_fourop[0] >= n_total[0] * 7 / 8) ? device->NumCards * 6 - : (n_fourop[0] < n_total[0] * 1 / 8) ? 0 - : (device->NumCards == 1 ? 1 : device->NumCards * 4); - play->opl.NumFourOps = device->NumFourOps; + play->m_setup.NumFourOps = + (n_fourop[0] >= n_total[0] * 7 / 8) ? play->m_setup.NumCards * 6 + : (n_fourop[0] < n_total[0] * 1 / 8) ? 0 + : (play->m_setup.NumCards == 1 ? 1 : play->m_setup.NumCards * 4); + play->opl.NumFourOps = play->m_setup.NumFourOps; - if(n_fourop[0] >= n_total[0] * 15 / 16 && device->NumFourOps == 0) + if(n_fourop[0] >= n_total[0] * 15 / 16 && play->m_setup.NumFourOps == 0) { ADLMIDI_ErrorString = "ERROR: You have selected a bank that consists almost exclusively of four-op patches.\n" " The results (silence + much cpu load) would be probably\n" -- cgit v1.2.3