256dpi / OSCKit

objc OSC protocol implementation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

OSCKit

objc OSC protocol implementation

Version License Platform

Installation

OSCKit is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'OSCKit'

Then import it and use it:

#import <OSCKit/OSCKit.h>

Usage

Prepare the property in the header file:

@property (nonatomic, strong) OSCClient *client;

Initialize the server:

self.server = [[OSCServer alloc] init];
server.delegate = self;
[server listen:8000];

Define delegate method:

- (void)handleMessage:(OSCMessage*)message {
  // do something with the message
}

Bundles are handled by the server automatically and delegated using the same callback.

Sending messages:

OSCMessage *message = [OSCMessage to:@"/hello" with:@[@1, @"cool", @0.5f]]
[client sendMessage:message to:@"udp://localhost:8000"];

Sending bundles:

OSCMessage *message1 = [OSCMessage to:@"/hello" with:@[@1, @"cool", @0.5f]]
OSCMessage *message2 = [OSCMessage to:@"/world" with:@[@"crazy", @876]]
[client sendMessages:@[message1, message2] to:@"udp://localhost:8000"];

Author

Joël Gähwiler, joel.gaehwiler@gmail.com

License

OSCKit is available under the MIT license. See the LICENSE file for more info.

Credits

  • @heisters: Source code taken from his repository to bootstrap development.
  • @codeflows: Thanks for the pull requests, testings and improvements.

About

objc OSC protocol implementation

License:MIT License


Languages

Language:C++ 83.4%Language:Objective-C 7.8%Language:C 4.1%Language:Objective-C++ 3.8%Language:Ruby 0.8%