Skip to content

Commit

Permalink
Fix AU midi event sizes
Browse files Browse the repository at this point in the history
Signed-off-by: falkTX <[email protected]>
  • Loading branch information
falkTX committed May 23, 2024
1 parent d49a13f commit 32ba6c1
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 5 deletions.
34 changes: 30 additions & 4 deletions distrho/src/DistrhoPluginAU.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2015,23 +2015,49 @@ class PluginAU
midiEvent.data[1] = inData1;
midiEvent.data[2] = inData2;

// TODO
switch (inStatus)
{
case 0x80:
case 0x90:
case 0xA0:
case 0xB0:
case 0xD0:
case 0xE0:
midiEvent.size = 3;
break;
case 0xC0:
case 0xD0:
midiEvent.size = 2;
break;
default:
midiEvent.size = 1;
case 0xF0:
switch (inStatus & 0x0F)
{
case 0x0:
case 0x4:
case 0x5:
case 0x7:
case 0x9:
case 0xD:
// unsupported
kAudioUnitErr_InvalidPropertyValue;
case 0x1:
case 0x2:
case 0x3:
case 0xE:
midiEvent.size = 3;
break;
case 0x6:
case 0x8:
case 0xA:
case 0xB:
case 0xC:
case 0xF:
midiEvent.size = 1;
break;
}
break;
default:
// invalid
return kAudioUnitErr_InvalidPropertyValue;
}

#if DISTRHO_PLUGIN_NUM_INPUTS + DISTRHO_PLUGIN_NUM_OUTPUTS == 0
Expand Down
2 changes: 1 addition & 1 deletion distrho/src/DistrhoUI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ PluginWindow& UI::PrivateData::createNextWindow(UI* const ui, uint width, uint h
height *= scaleFactor;
}

d_stdout("createNextWindow %u %u %d", width, height, scaleFactor);
d_stdout("createNextWindow %u %u %f", width, height, scaleFactor);
uiData->window = new PluginWindow(ui, uiData->app, uiData->winId, width, height, scaleFactor);

if (uiData->callbacksPtr != nullptr)
Expand Down

0 comments on commit 32ba6c1

Please sign in to comment.