Skip to content

Tedcharlesbrown/ofxEtcTcpOsc

Repository files navigation

Addon Thumbnail

ofxEtcTcpOsc

This is an OpenFrameworks adaptation of the EosSyncLib from ETC Labs. Thanks to Jayson Haebich for the conversion and making everything work.

EOS Family Show Control Manual

About this project

ofxEtcTcpOsc is a open-open source addon for OpenFrameworks. Initially forked from the EosSyncLib, it has now been converted to recieve all incoming OSC rather than just the commands gotten from "/eos/subscribe". That functionality still remains in the code, but is currently commented out.

Installation

To use this addon with OpenFrameworks:

  • Download the library.
  • Put it into the OpenFrameworks addon folder.
  • Launch a new project or update an existing with the OpenFrameworks Project Manager.
  • More info on installing addons here

Simple Example

ofApp.h

#pragma once

#include "ofMain.h"

#include "ofxEosSyncOscMsg.h"
#include "ofxEosSync.h"

class ofApp : public ofBaseApp{
    
public:
    void setup();
    void update();
    
    ofxEosSync eosOsc;
    
    void keyPressed(int key);
    void mousePressed(int x, int y, int button);

ofApp.cpp

#include "ofApp.h"

//--------------------------------------------------------------
void ofApp::setup(){
    eosOsc.setup("192.168.0.24", 3032); //Initial connect
}

//--------------------------------------------------------------
void ofApp::update(){
    while(eosOsc.hasWaitingMessages()) {
        
        ofxEosSyncOscMsg m = eosOsc.getNextMessage();
        
        if (m.getAddress() == "/eos/out/user/1/cmd") { //Get command line
            cout << m.getArgAsStr(0) << endl;
            
        } else if (m.getAddress() == "/eos/out/ping") { //Get ping back
            cout << m.getAsString() << endl;
        }
    }
}

//--------------------------------------------------------------
void ofApp::keyPressed(int key){
    eosOsc.close();
    eosOsc.setup("192.168.0.35", 3032); //Close and re-connect test.
}

//--------------------------------------------------------------
void ofApp::mousePressed(int x, int y, int button){
    ofxEosSyncOscMsg msg;
    msg.setAddress("/eos/ping");
    eosOsc.send(msg);

}

Acknowledgements

License

The MIT License (MIT) 2020 - Ted Charles Brown.

Please have a look at the LICENSE.md for more details.

About

Conversion of EosSyncLib open source library to OpenFrameworks Library

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published