Skip to content

Commit

Permalink
Fix type
Browse files Browse the repository at this point in the history
  • Loading branch information
kshoji committed Feb 16, 2024
1 parent 295366e commit 968ad97
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions MIDIPlugin.mm
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ void midiInputCallback(const MIDIPacketList *list, void *procRef, void *srcRef)
// sysex finished
if (onMidiSystemExclusive) {
unsigned char* sysexData = new unsigned char[[sysexArray count]];
for (int i = 0; i < [sysexArray count]; i++) {
for (NSUInteger i = 0; i < [sysexArray count]; i++) {
sysexData[i] = ((NSNumber *)[sysexArray objectAtIndex: i]).unsignedCharValue;
}
onMidiSystemExclusive([NSString stringWithFormat:@"%@", endpointId].UTF8String, 0, sysexData, (int)[sysexArray count]);
Expand All @@ -378,7 +378,7 @@ void midiInputCallback(const MIDIPacketList *list, void *procRef, void *srcRef)
dataIndex++;
} else {
// process channel messages
int status = packet->data[dataIndex];
Byte status = packet->data[dataIndex];
switch (status & 0xf0) {
case 0x80:
if (dataIndex + 2 >= packet->length) {
Expand Down Expand Up @@ -530,11 +530,11 @@ void midiInputCallback(const MIDIPacketList *list, void *procRef, void *srcRef)
// sysex finished
if (onMidiSystemExclusive) {
unsigned char* sysexData = new unsigned char[[sysexArray count]];
for (int i = 0; i < [sysexArray count]; i++) {
for (NSUInteger i = 0; i < [sysexArray count]; i++) {
sysexData[i] = ((NSNumber *)[sysexArray objectAtIndex: i]).unsignedCharValue;
}
onMidiSystemExclusive([NSString stringWithFormat:@"%@", endpointId].UTF8String, 0, sysexData, (int)[sysexArray count]);
delete[] sysexData;
delete[] sysexData;
}
[sysexMessage removeObjectForKey: endpointId];
}
Expand Down Expand Up @@ -667,10 +667,10 @@ - (void) getMidiDevices {

// source
ItemCount numOfSources = MIDIGetNumberOfSources();
for (int k = 0; k < numOfSources; k++) {
for (ItemCount k = 0; k < numOfSources; k++) {
MIDIEndpointRef endpoint = MIDIGetSource(k);

int endpointUniqueId;
SInt32 endpointUniqueId;
MIDIObjectGetIntegerProperty(endpoint, kMIDIPropertyUniqueID, &endpointUniqueId);
NSNumber* endpointNumber = [NSNumber numberWithInt:endpointUniqueId];

Expand Down Expand Up @@ -710,10 +710,10 @@ - (void) getMidiDevices {

// destination
ItemCount numOfDestinations = MIDIGetNumberOfDestinations();
for (int k = 0; k < numOfDestinations; k++) {
for (ItemCount k = 0; k < numOfDestinations; k++) {
MIDIEndpointRef endpoint = MIDIGetDestination(k);

int endpointUniqueId;
SInt32 endpointUniqueId;
MIDIObjectGetIntegerProperty(endpoint, kMIDIPropertyUniqueID, &endpointUniqueId);
NSNumber* endpointNumber = [NSNumber numberWithInt:endpointUniqueId];

Expand Down

0 comments on commit 968ad97

Please sign in to comment.