-
Notifications
You must be signed in to change notification settings - Fork 113
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Big refactoring: moved SMPortOrVirtual{Output}Stream over to SysExLib…
…rarian, squished back into one class, renamed it SSECombinationOutputStream, and made it use a protocol for "destinations" rather than a bunch of dictionaries. It all builds cleanly but needs a little bit of work, and hasn't been tested at all...
- Loading branch information
Showing
10 changed files
with
649 additions
and
61 deletions.
There are no files selected for viewing
15 changes: 15 additions & 0 deletions
15
Applications/SysExLibrarian/SMDestinationEndpoint-SSEOutputStreamDestination.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// | ||
// SMDestinationEndpoint-SSEOutputStreamDestination.h | ||
// SysExLibrarian | ||
// | ||
// Created by Kurt Revis on Tue Sep 03 2002. | ||
// Copyright (c) 2002 __MyCompanyName__. All rights reserved. | ||
// | ||
|
||
#import <SnoizeMIDI/SnoizeMIDI.h> | ||
#import "SSEOutputStreamDestination.h" | ||
|
||
|
||
@interface SMDestinationEndpoint (SSEOutputStreamDestination) <SSEOutputStreamDestination> | ||
|
||
@end |
29 changes: 29 additions & 0 deletions
29
Applications/SysExLibrarian/SMDestinationEndpoint-SSEOutputStreamDestination.m
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// | ||
// SMDestinationEndpoint-SSEOutputStreamDestination.m | ||
// SysExLibrarian | ||
// | ||
// Created by Kurt Revis on Tue Sep 03 2002. | ||
// Copyright (c) 2002 __MyCompanyName__. All rights reserved. | ||
// | ||
|
||
#import "SMDestinationEndpoint-SSEOutputStreamDestination.h" | ||
|
||
|
||
@implementation SMDestinationEndpoint (SSEOutputStreamDestination) | ||
|
||
- (NSString *)outputStreamDestinationName; | ||
{ | ||
return [self uniqueName]; | ||
} | ||
|
||
- (NSArray *)outputStreamDestinationExternalDeviceNames; | ||
{ | ||
return [[self connectedExternalDevices] arrayByPerformingSelector:@selector(name)]; | ||
} | ||
|
||
- (BOOL)outputStreamDestinationNeedsSysExWorkaround; | ||
{ | ||
return [self needsSysExWorkaround]; | ||
} | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
// | ||
// Copyright 2001-2002 Kurt Revis. All rights reserved. | ||
// | ||
|
||
#import <OmniFoundation/OFObject.h> | ||
#import <Foundation/Foundation.h> | ||
#import <SnoizeMIDI/SnoizeMIDI.h> | ||
#import "SSEOutputStreamDestination.h" | ||
|
||
|
||
@interface SSECombinationOutputStream : OFObject <SMMessageDestination> | ||
{ | ||
SMVirtualOutputStream *virtualStream; | ||
SMPortOutputStream *portStream; | ||
|
||
SSESimpleOutputStreamDestination *virtualStreamDestination; | ||
SInt32 virtualEndpointUniqueID; | ||
NSString *virtualEndpointName; | ||
|
||
struct { | ||
unsigned int ignoresTimeStamps:1; | ||
unsigned int sendsSysExAsynchronously:1; | ||
} flags; | ||
} | ||
|
||
- (NSArray *)destinations; | ||
- (id <SSEOutputStreamDestination>)selectedDestination; | ||
- (void)setSelectedDestination:(id <SSEOutputStreamDestination>)aDestination; | ||
|
||
// TODO see if we can get rid of these | ||
- (void)setVirtualEndpointName:(NSString *)newName; | ||
- (void)setVirtualDisplayName:(NSString *)newName; | ||
|
||
- (NSDictionary *)persistentSettings; | ||
- (NSString *)takePersistentSettings:(NSDictionary *)settings; | ||
// If the endpoint indicated by the persistent settings couldn't be found, its name is returned | ||
|
||
- (id)stream; | ||
// Returns the actual stream in use (either virtualStream or portStream) | ||
|
||
|
||
// Methods which are passed on to the relevant stream: | ||
|
||
- (BOOL)ignoresTimeStamps; | ||
- (void)setIgnoresTimeStamps:(BOOL)value; | ||
// If YES, then ignore the timestamps in the messages we receive, and send immediately instead | ||
|
||
- (BOOL)sendsSysExAsynchronously; | ||
- (void)setSendsSysExAsynchronously:(BOOL)value; | ||
// If YES, then use MIDISendSysex() to send sysex messages. Otherwise, use plain old MIDI packets. | ||
// (This can only work on port streams, not virtual ones.) | ||
- (BOOL)canSendSysExAsynchronously; | ||
|
||
- (void)cancelPendingSysExSendRequests; | ||
- (SMSysExSendRequest *)currentSysExSendRequest; | ||
|
||
@end | ||
|
||
// Notifications | ||
extern NSString *SSECombinationOutputStreamEndpointDisappearedNotification; |
Oops, something went wrong.