vvopensource
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Properties Macros Groups Pages
OSCManager.h
1 
2 #if IPHONE
3 #import <UIKit/UIKit.h>
4 #else
5 #import <Cocoa/Cocoa.h>
6 #endif
7 #import "OSCAddressSpace.h"
8 #import "OSCZeroConfManager.h"
9 #import "OSCInPort.h"
10 #import "OSCOutPort.h"
11 #import "OSCQueryReply.h"
12 
13 
14 
15 
17 
37 @interface OSCManager : NSObject {
38  MutLockArray *inPortArray; // Array of OSCInPorts in a locking array for threadsafe access
39  MutLockArray *outPortArray; // Array of OSCOutPorts in a locking array for threadsafe access
40 
41  id delegate;
42 
43  OSCZeroConfManager *zeroConfManager;
44 
45  Class inPortClass;
46  NSString *inPortLabelBase;
47  Class outPortClass;
48 }
49 
50 // used to generate the IP addresses for this host
51 + (NSArray *) hostIPv4Addresses;
52 
53 - (id) initWithServiceType:(NSString *)t;
54 - (id) initWithInPortClass:(Class)i outPortClass:(Class)o;
55 - (id) initWithInPortClass:(Class)i outPortClass:(Class)o serviceType:(NSString *)t;
56 - (void) _generalInit;
57 
59 - (void) deleteAllInputs;
61 - (void) deleteAllOutputs;
62 
64 - (OSCInPort *) createNewInputFromSnapshot:(NSDictionary *)s;
66 - (OSCInPort *) createNewInputForPort:(int)p withLabel:(NSString *)l;
68 - (OSCInPort *) createNewInputForPort:(int)p;
70 - (OSCInPort *) createNewInput;
71 
73 - (OSCOutPort *) createNewOutputFromSnapshot:(NSDictionary *)s;
75 - (OSCOutPort *) createNewOutputToAddress:(NSString *)a atPort:(int)p withLabel:(NSString *)l;
77 - (OSCOutPort *) createNewOutputToAddress:(NSString *)a atPort:(int)p;
79 - (OSCOutPort *) createNewOutput;
80 
82 - (void) receivedOSCMessage:(OSCMessage *)m;
84 - (void) dispatchQuery:(OSCMessage *)m toOutPort:(OSCOutPort *)o timeout:(float)t replyHandler:(void (^)(OSCMessage *replyMsg))block;
86 - (void) dispatchQuery:(OSCMessage *)m toOutPort:(OSCOutPort *)o timeout:(float)t replyDelegate:(id <OSCQueryReplyDelegate>)d;
88 - (void) transmitReplyOrError:(OSCMessage *)m;
89 
90 // Creates and returns a unique label for an input port (unique to this manager)
91 - (NSString *) getUniqueInputLabel;
92 - (BOOL) isUniqueInputLabel:(NSString *)n;
93 // Creates and returns a unique label for an output port (unique to this manager)
94 - (NSString *) getUniqueOutputLabel;
95 // Finds and returns an input matching the passed label (returns nil if not found)
96 - (OSCInPort *) findInputWithLabel:(NSString *)n;
97 - (NSMutableArray *) findInputsWithLabel:(NSString *)n;
98 // Finds and returns an output matching the passed label (returns nil if not found)
99 - (OSCOutPort *) findOutputWithLabel:(NSString *)n;
100 - (NSMutableArray *) findOutputsWithLabel:(NSString *)n;
101 // Finds and returns an output matching the passed address and port (returns nil if not found)
102 - (OSCOutPort *) findOutputWithAddress:(NSString *)a andPort:(int)p;
103 // Finds and returns an output matching the passed address (which is the raw, network-byte-order internet address expressed as an int) and port. Returns nil if not found.
104 - (OSCOutPort *) findOutputWithRawAddress:(unsigned int)a andPort:(unsigned short)p;
105 // Finds and returns an output matching the passed address (which is the raw, network-byte-order internet address as an int). returns nil if not found.
106 - (OSCOutPort *) findOutputWithRawAddress:(unsigned int)a;
107 
108 // Returns the output at the provided index in outPortArray
109 - (OSCOutPort *) findOutputForIndex:(int)i;
110 // Finds and returns the input whose zero conf name matches the passed string (returns nil if not found)
111 - (OSCInPort *) findInputWithZeroConfName:(NSString *)n;
113 - (void) removeInput:(id)p;
115 - (void) removeOutput:(id)p;
117 - (void) removeOutputWithLabel:(NSString *)n;
119 - (void) removeAllOutputs;
121 - (NSArray *) outPortLabelArray;
122 
124 - (id) inPortClass;
125 // By default, returns @"VVOSC"- subclass around this to use a different base string when generating in port labels
126 - (NSString *) inPortLabelBase;
127 - (void) setInPortLabelBase:(NSString *)n;
129 - (id) outPortClass;
130 
131 // misc
133 - (id) delegate;
135 - (void) setDelegate:(id)n;
136 - (id) inPortArray;
137 - (id) outPortArray;
138 
139 
140 @end
id delegate
If there's a delegate, it will be notified when OSC messages are received.
Definition: OSCManager.h:41
Corresponds to an OSC message: contains zero or more values, and the address path the values have to ...
Definition: OSCMessage.h:18
Main VVOSC class- manages in & out port creation, zero configuration networking (bonjour/zeroconf) ...
Definition: OSCManager.h:37
id inPortClass()
By default, returns [OSCInPort class]- subclass around to use different subclasses of OSCInPort...
Definition: OSCManager.m:685
id outPortClass()
By default, returns [OSCOutPort class]- subclass around to use different subclasses of OSCOutPort...
Definition: OSCManager.m:705
OSCInPort handles everything needed to receive OSC data on a given port.
Definition: OSCInPort.h:32
OSCOutPort handles everything needed to send OSC data to a given address.
Definition: OSCOutPort.h:25
Similar to NSMutableArray, but thread-safe. Internally, uses an NSMutableArray and a rwlock...
Definition: MutLockArray.h:20
OSCZeroConfManager * zeroConfManager
Creates OSCOutPorts for any OSC destinations detected via bonjour/zeroconf.
Definition: OSCManager.h:43