GithubHelp home page GithubHelp logo

ofxtcposc's Introduction

ofxTcpOsc

A lightweight reliable OSC library over TCP for openFrameworks.

It's as easy as ofxOsc!

Dependency

  • ofxNetwork

Usage

1. Sender

testApp.h

#include "ofxTcpOsc.h"

const string host = "localhost";
const int port = 50000;

class testApp : public ofBaseApp{
	// definitions
	ofxTcpOscSender sender;
}

testApp.cpp

void testApp::setup() {
    sender.setup(host, port);
}

void testApp::sendMessage {
    ofxTcpOscMessage m;
    m.setAddress("/testAddress");
    m.addStringArg("test message");
    m.addIntArg(0);
    m.addInt64Arg(123);
    m.addFloatArg(0.123);
    
    sender.sendMessage(m);
}

2. Receiver

testApp.h

#include "ofxTcpOsc.h"

const int port = 50000;

class testApp : public ofBaseApp{
    // definitions
    ofxTcpOscReceiver receiver;
}

testApp.cpp

void testApp::setup() {
    receiver.setup(port);
}

void testApp::update() {
    while (receiver.hasWaitingMessages()) {
        ofxTcpOscMessage m;
        receiver.getNextMessage(&m);
        
        if (m.getAddress() == "/testAddress") {
            string message = m.getArgAsString(0);
            int i = m.getArgAsInt32(1);
            uint64_t j = m.getArgAsInt64(2);
            float f = m.getArgAsFloat(3);
        }
    }
}

Support

  • Tested on OS X 10.9.3 + oF v0.8.0
  • No bundle support
  • Supported OSC types
    • int32
    • int64
    • float32
    • string

ofxtcposc's People

Contributors

kokinomura avatar

Stargazers

Ted Charles Brown avatar 王文锋 avatar  avatar nariakiiwatani avatar Katsuyoshi Hotta avatar jens alexander ewald avatar Pierluigi Dalla Rosa avatar Bob Jarvis avatar asagi_tokyo avatar Hideyuki Saito avatar HORIGUCHI Junshi avatar  avatar mactkg avatar 2bit avatar Jordi Puig avatar Kenta Watashima avatar

Watchers

James Cloos avatar  avatar  avatar

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.