Git Product home page Git Product logo

osckit's Introduction

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, [email protected]

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.

osckit's People

Contributors

256dpi avatar codeflows avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

osckit's Issues

Getting Started Guide should be updated for ARC

Hi Joel,

thanks for your great work on OSCKit!
I just wanted you to know that using ARC your example usage code snippets create some erratic behavior. When writing lines like OSCClient *client = [[OSCClient alloc] init]; sending messages with that client works only occasionally if the client is not destroyed before sending the message.
Maybe it would be a good idea to write things like @property (nonatomic, strong) OSCClient *client; and self.client = [[OSCClient alloc] init]; into the Readme instead.

Cheers
brassel

Build error when installed from pod

I'm getting this error in OSCClient.h

'GCDAsyncUdpSocket.h' file not found with <angled> include; use "quotes" instead

Briefly tried changing header search paths, without success. It seems segmentio/analytics-ios#417 addresses a similar concern; perhaps it should be #import <CocoaAsyncSocket/GCDAsyncUdpSocket.h> or similar?

Compilation errors

I had trouble compiling, after running pod install within my project (lots of c++ errors). In case it can help others, I solved the issues by adding "-lstdc++" to the "other linker flags" field of the build settings. Maybe that's something that can be fixed in the podspec file? (not sure).

OSCServer could not bind

Hi, first of all, epic framework!

I'm building an iOS app, it works like a charm on iPhone and iPad, tho when trying to run it with a Mac Catalyst app it fails. Do I need some permissions to bind to ports on Mac?

*** Terminating app due to uncaught exception 'OSCProtocolException', reason: 'OSCServer could not bind: Error Domain=NSPOSIXErrorDomain Code=1 "Operation not permitted" UserInfo={NSLocalizedDescription=Operation not permitted, NSLocalizedFailureReason=Error in bind() function}'

Setup: Xcode Version 11.0 (11A419c) on macOS Catalina 10.15-beta (19A546d)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.