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.cpp51
1 files changed, 50 insertions, 1 deletions
diff --git a/src/adlmidi_midiplay.cpp b/src/adlmidi_midiplay.cpp
index 9841f73..e01a1b8 100644
--- a/src/adlmidi_midiplay.cpp
+++ b/src/adlmidi_midiplay.cpp
@@ -397,7 +397,7 @@ bool MIDIplay::realTime_NoteOn(uint8_t channel, uint8_t note, uint8_t velocity)
if((m_synth.m_rhythmMode == 1) && PercussionMap[midiins & 0xFF])
voices[1] = voices[0];//i[1] = i[0];
- bool isBlankNote = (ains->flags & adlinsdata::Flag_NoSound);
+ bool isBlankNote = (ains->flags & adlinsdata::Flag_NoSound) != 0;
if(hooks.onDebugMessage)
{
@@ -1722,6 +1722,55 @@ void MIDIplay::updateGlide(double amount)
}
}
+void MIDIplay::describeChannels(char *str, char *attr, size_t size)
+{
+ if (!str || size <= 0)
+ return;
+
+ OPL3 &synth = m_synth;
+ uint32_t numChannels = synth.m_numChannels;
+
+ uint32_t index = 0;
+ for(uint32_t i = 0; index < numChannels && index < size - 1; ++i)
+ {
+ const AdlChannel &adlChannel = m_chipChannels[i];
+
+ AdlChannel::LocationData *loc = adlChannel.users_first;
+ if(!loc) // off
+ {
+ str[index++] = '-';
+ }
+ else if(loc->next) // arpeggio
+ {
+ str[index++] = '@';
+ }
+ else // on
+ {
+ switch(synth.m_channelCategory[i])
+ {
+ case OPL3::ChanCat_Regular:
+ str[index++] = '+';
+ break;
+ case OPL3::ChanCat_4op_Master:
+ case OPL3::ChanCat_4op_Slave:
+ str[index++] = '#';
+ break;
+ default: // rhythm-mode percussion
+ str[index++] = 'r';
+ break;
+ }
+ }
+
+ uint8_t attribute = 0;
+ if (loc) // 4-bit color index of MIDI channel
+ attribute |= (uint8_t)(loc->loc.MidCh & 0xF);
+
+ attr[index] = (char)attribute;
+ }
+
+ str[index] = 0;
+ attr[index] = 0;
+}
#ifndef ADLMIDI_DISABLE_CPP_EXTRAS