MCPcopy Create free account
hub / github.com/RomanKubiak/ctrlr / handleAsyncUpdate

Method handleAsyncUpdate

Source/Core/CtrlrPanel/CtrlrPanel.cpp:1062–1100  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1060}
1061
1062void CtrlrPanel::handleAsyncUpdate()
1063{
1064 /* let's check any pending multi midi messages
1065 in the queue */
1066 for (int i=0; i<multiMidiQueue.size(); i++)
1067 {
1068 if (luaPanelMidiMultiReceivedCbk)
1069 getCtrlrLuaManager().getMethodManager().call (luaPanelMidiMultiReceivedCbk, multiMidiQueue[i]);
1070
1071 multiMidiQueue.remove(i);
1072 }
1073
1074 MidiBuffer buffer;
1075
1076 midiMessageCollector.removeNextBlockOfMessages (buffer, SAMPLERATE * 512);
1077
1078 /* We mute here, so we don't have to lock the value tree in the MIDI thread
1079 we need to empty the queue so it doesn't grow */
1080 if (isMidiInPaused())
1081 {
1082 return;
1083 }
1084
1085 MidiBuffer::Iterator i(buffer);
1086 int time;
1087 MidiMessage m;
1088 bool luaValid = false;
1089
1090 if (luaPanelMidiReceivedCbk)
1091 luaValid = luaPanelMidiReceivedCbk->isValid();
1092
1093 while (i.getNextEvent(m,time))
1094 {
1095 if (luaValid)
1096 getCtrlrLuaManager().getMethodManager().call (luaPanelMidiReceivedCbk, CtrlrMidiMessage (m));
1097
1098 listeners.call (&CtrlrPanel::Listener::midiReceived, m, inputDevice);
1099 }
1100}
1101
1102bool CtrlrPanel::getMidiOptionBool(const CtrlrPanelMidiOption optionToCheck)
1103{

Callers

nothing calls this directly

Calls 7

getNextEventMethod · 0.80
CtrlrMidiMessageClass · 0.50
sizeMethod · 0.45
callMethod · 0.45
removeMethod · 0.45
isValidMethod · 0.45

Tested by

no test coverage detected