aboutsummaryrefslogtreecommitdiff
path: root/src/adlmidi_private.cpp
diff options
context:
space:
mode:
authorVitaly Novichkov <admin@wohlnet.ru>2018-05-19 22:33:37 +0300
committerVitaly Novichkov <admin@wohlnet.ru>2018-05-19 22:33:37 +0300
commitbb4797ee68c0f12018196d3ee8caddcdcad9fe38 (patch)
tree9cd938ebf9c39366eaf53401b439fa92a14f63bc /src/adlmidi_private.cpp
parentbed6bcb220346c622a307bf405b9a1e87fd99db5 (diff)
downloadlibADLMIDI-bb4797ee68c0f12018196d3ee8caddcdcad9fe38.tar.gz
libADLMIDI-bb4797ee68c0f12018196d3ee8caddcdcad9fe38.tar.bz2
libADLMIDI-bb4797ee68c0f12018196d3ee8caddcdcad9fe38.zip
Works and fixes
- Fixed an incorrect calculation of 4-op channels and choosing 4-op channels for 2-op only banks - Resolved trouble with automatically chosen flags because of internal confusion
Diffstat (limited to 'src/adlmidi_private.cpp')
-rw-r--r--src/adlmidi_private.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/adlmidi_private.cpp b/src/adlmidi_private.cpp
index 1e62250..920f5dc 100644
--- a/src/adlmidi_private.cpp
+++ b/src/adlmidi_private.cpp
@@ -39,13 +39,13 @@ int adlRefreshNumCards(ADL_MIDIPlayer *device)
size_t div = (a >= play->opl.dynamic_percussion_offset) ? 1 : 0;
++n_total[div];
adlinsdata2 &ins = play->opl.dynamic_metainstruments[a];
- if((ins.adl[0] != ins.adl[1]) && ((ins.flags & adlinsdata::Flag_Pseudo4op) == 0))
+ if(ins.flags & adlinsdata::Flag_Real4op)
++n_fourop[div];
}
- play->m_setup.NumFourOps =
- (n_fourop[0] >= 128 * 7 / 8) ? play->m_setup.NumCards * 6
- : (n_fourop[0] < 128 * 1 / 8) ? (n_fourop[1] > 0 ? 4 : 0)
+ play->m_setup.NumFourOps = ((n_fourop[0] == 0) && (n_fourop[1] == 0)) ? 0
+ : (n_fourop[0] >= (128 * 7) / 8) ? play->m_setup.NumCards * 6
+ : (n_fourop[0] < (128 * 1) / 8) ? (n_fourop[1] > 0 ? 4 : 0)
: (play->m_setup.NumCards == 1 ? 1 : play->m_setup.NumCards * 4);
}
else
@@ -58,13 +58,13 @@ int adlRefreshNumCards(ADL_MIDIPlayer *device)
continue;
++n_total[a / 128];
adlinsdata2 ins(adlins[insno]);
- if((ins.adl[0] != ins.adl[1]) && ((ins.flags & adlinsdata::Flag_Pseudo4op) == 0))
+ if(ins.flags & adlinsdata::Flag_Real4op)
++n_fourop[a / 128];
}
- play->m_setup.NumFourOps =
- (n_fourop[0] >= (n_total[0] % 128) * 7 / 8) ? play->m_setup.NumCards * 6
- : (n_fourop[0] < (n_total[0] % 128) * 1 / 8) ? 0
+ play->m_setup.NumFourOps = ((n_fourop[0] == 0) && (n_fourop[1] == 0)) ? 0
+ : (n_fourop[0] >= ((n_total[0] % 128) * 7) / 8) ? play->m_setup.NumCards * 6
+ : (n_fourop[0] < ((n_total[0] % 128) * 1) / 8) ? 0
: (play->m_setup.NumCards == 1 ? 1 : play->m_setup.NumCards * 4);
}
@@ -80,4 +80,3 @@ int adlRefreshNumCards(ADL_MIDIPlayer *device)
return 0;
}
-