Skip to content

Commit

Permalink
WIP, untested: integrate more into SnoizeMIDI.
Browse files Browse the repository at this point in the history
- Don't use a separate show control message type, just put it all in sysex message
- Cache dataForDisplay in sysex messages
- rename some stuff
- fix leak in parseCueItemsData

TODO:
- In tests target, use config files instead of ad-hoc settings
- test failing in parseCueItemsData, clean that up probably
- check this with MIDI Show Control spec, I suspect there is a lot more to show
- new TODOs in sysex message, e.g. checking for message lengths
  • Loading branch information
krevis committed Jan 21, 2019
1 parent 362d64e commit 71ec5b0
Show file tree
Hide file tree
Showing 14 changed files with 446 additions and 426 deletions.
2 changes: 2 additions & 0 deletions Applications/MIDIMonitor/SMMMonitorWindowController.m
Original file line number Diff line number Diff line change
Expand Up @@ -633,6 +633,8 @@ - (void)trivialWindowSettingsDidChange

- (void)displayPreferencesDidChange:(NSNotification *)notification
{
[self.displayedMessages makeObjectsPerformSelector:@selector(invalidateDisplayCache)];

[self.messagesTableView reloadData];
}

Expand Down
2 changes: 2 additions & 0 deletions Frameworks/SnoizeMIDI/SMMessage.h
Original file line number Diff line number Diff line change
Expand Up @@ -151,4 +151,6 @@ extern NSString *SMProgramChangeBaseIndexPreferenceKey;
- (NSString *)expertDataForDisplay;
- (NSString *)originatingEndpointForDisplay;

- (void)invalidateDisplayCache;

@end
5 changes: 5 additions & 0 deletions Frameworks/SnoizeMIDI/SMMessage.m
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,11 @@ - (NSString *)originatingEndpointForDisplay
}
}

- (void)invalidateDisplayCache
{
// Do nothing by default. Subclasses that cache results that depend on display preferences should override to invalidate their cache.
}

@end


Expand Down
7 changes: 1 addition & 6 deletions Frameworks/SnoizeMIDI/SMMessageParser.m
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#import "SMSystemCommonMessage.h"
#import "SMSystemRealTimeMessage.h"
#import "SMSystemExclusiveMessage.h"
#import "SMShowControlMessage.h"
#import "SMInvalidMessage.h"


Expand Down Expand Up @@ -342,11 +341,7 @@ - (SMSystemExclusiveMessage *)finishSysExMessageWithValidEnd:(BOOL)isEndValid;
// The MIDI spec says that messages should end with this byte, but apparently that is not always the case in practice.

if (readingSysExData) {
if (((uint8_t *)readingSysExData.mutableBytes)[2] == 0x02) { // MIDI Show Control Message
message = [SMShowControlMessage showControlMessageWithTimeStamp:startSysExTimeStamp data:readingSysExData];
} else {
message = [SMSystemExclusiveMessage systemExclusiveMessageWithTimeStamp:startSysExTimeStamp data:readingSysExData];
}
message = [SMSystemExclusiveMessage systemExclusiveMessageWithTimeStamp:startSysExTimeStamp data:readingSysExData];

[readingSysExData release];
readingSysExData = nil;
Expand Down
19 changes: 0 additions & 19 deletions Frameworks/SnoizeMIDI/SMShowControlMessage.h

This file was deleted.

308 changes: 0 additions & 308 deletions Frameworks/SnoizeMIDI/SMShowControlMessage.m

This file was deleted.

Loading

0 comments on commit 71ec5b0

Please sign in to comment.