mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
AU: Avoid forming references to variable-size structs MIDIEventList and MIDIPacketList
This commit is contained in:
parent
f8e91d4003
commit
e9e39de069
1 changed files with 11 additions and 11 deletions
|
|
@ -661,11 +661,11 @@ namespace CoreMidiHelpers
|
|||
: u32InputHandler (std::make_unique<ump::U32ToBytestreamHandler> (input, callback))
|
||||
{}
|
||||
|
||||
void dispatch (const MIDIEventList& list, double time) const
|
||||
void dispatch (const MIDIEventList* list, double time) const
|
||||
{
|
||||
auto* packet = &list.packet[0];
|
||||
auto* packet = list->packet;
|
||||
|
||||
for (uint32_t i = 0; i < list.numPackets; ++i)
|
||||
for (uint32_t i = 0; i < list->numPackets; ++i)
|
||||
{
|
||||
static_assert (sizeof (uint32_t) == sizeof (UInt32)
|
||||
&& alignof (uint32_t) == alignof (UInt32),
|
||||
|
|
@ -695,11 +695,11 @@ namespace CoreMidiHelpers
|
|||
: bytestreamInputHandler (std::make_unique<ump::BytestreamToBytestreamHandler> (input, callback))
|
||||
{}
|
||||
|
||||
void dispatch (const MIDIPacketList& list, double time) const
|
||||
void dispatch (const MIDIPacketList* list, double time) const
|
||||
{
|
||||
auto* packet = &list.packet[0];
|
||||
auto* packet = list->packet;
|
||||
|
||||
for (unsigned int i = 0; i < list.numPackets; ++i)
|
||||
for (unsigned int i = 0; i < list->numPackets; ++i)
|
||||
{
|
||||
auto len = readUnaligned<decltype (packet->length)> (&(packet->length));
|
||||
bytestreamInputHandler->pushMidiData (packet->data, len, time);
|
||||
|
|
@ -725,12 +725,12 @@ namespace CoreMidiHelpers
|
|||
: newReceiver (input, callback), oldReceiver (input, callback)
|
||||
{}
|
||||
|
||||
void dispatch (const MIDIEventList& list, double time) const
|
||||
void dispatch (const MIDIEventList* list, double time) const
|
||||
{
|
||||
newReceiver.dispatch (list, time);
|
||||
}
|
||||
|
||||
void dispatch (const MIDIPacketList& list, double time) const
|
||||
void dispatch (const MIDIPacketList* list, double time) const
|
||||
{
|
||||
oldReceiver.dispatch (list, time);
|
||||
}
|
||||
|
|
@ -768,7 +768,7 @@ namespace CoreMidiHelpers
|
|||
}
|
||||
|
||||
template <typename EventList>
|
||||
void handlePackets (const EventList& list)
|
||||
void handlePackets (const EventList* list)
|
||||
{
|
||||
const auto time = Time::getMillisecondCounterHiRes() * 0.001;
|
||||
|
||||
|
|
@ -885,7 +885,7 @@ namespace CoreMidiHelpers
|
|||
|
||||
static void newMidiInputProc (const MIDIEventList* list, void* readProcRefCon, void*)
|
||||
{
|
||||
static_cast<MidiPortAndCallback*> (readProcRefCon)->handlePackets (*list);
|
||||
static_cast<MidiPortAndCallback*> (readProcRefCon)->handlePackets (list);
|
||||
}
|
||||
};
|
||||
#endif
|
||||
|
|
@ -928,7 +928,7 @@ namespace CoreMidiHelpers
|
|||
private:
|
||||
static void oldMidiInputProc (const MIDIPacketList* list, void* readProcRefCon, void*)
|
||||
{
|
||||
static_cast<MidiPortAndCallback*> (readProcRefCon)->handlePackets (*list);
|
||||
static_cast<MidiPortAndCallback*> (readProcRefCon)->handlePackets (list);
|
||||
}
|
||||
};
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue