-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a57ea17
commit 615692c
Showing
9 changed files
with
290 additions
and
23 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file modified
BIN
-47.8 KB
(82%)
...oject.xcworkspace/xcuserdata/murawakimitsuhiro.xcuserdatad/UserInterfaceState.xcuserstate
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
ofxAssimpModelLoader | ||
ofxOsc |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// | ||
// OSCManager.cpp | ||
// Brain-Fu_k | ||
// | ||
// Created by Murawaki on 2017/08/20. | ||
// | ||
// | ||
|
||
#include "OSCManager.hpp" | ||
|
||
void OSCManager::setup() { | ||
receiver.setup(fromPort); | ||
} | ||
|
||
void OSCManager::update() { | ||
//receive message | ||
while( receiver.hasWaitingMessages()){ | ||
ofxOscMessage m; | ||
receiver.getNextMessage(m); | ||
|
||
dumpOSC(m); | ||
} | ||
} | ||
|
||
void OSCManager::dumpOSC(ofxOscMessage m) { | ||
string msg_string; | ||
msg_string = m.getAddress(); | ||
for (int i=0; i<m.getNumArgs(); i++ ) { | ||
msg_string += " "; | ||
if(m.getArgType(i) == OFXOSC_TYPE_INT32) | ||
msg_string += ofToString( m.getArgAsInt32(i)); | ||
else if(m.getArgType(i) == OFXOSC_TYPE_FLOAT) | ||
msg_string += ofToString( m.getArgAsFloat(i)); | ||
else if(m.getArgType(i) == OFXOSC_TYPE_STRING) | ||
msg_string += m.getArgAsString(i); | ||
} | ||
cout << msg_string << endl; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
// | ||
// OSCManager.hpp | ||
// Brain-Fu_k | ||
// | ||
// Created by Murawaki on 2017/08/20. | ||
// | ||
// | ||
|
||
#ifndef OSCManager_hpp | ||
#define OSCManager_hpp | ||
|
||
#include <stdio.h> | ||
#include <map> | ||
|
||
#include "ofMain.h" | ||
#include "ofxOsc.h" | ||
|
||
class OSCManager { | ||
private: | ||
OSCManager() = default; | ||
~OSCManager() = default; | ||
|
||
static const int fromPort = 8000; | ||
static const int toPort = 8001; | ||
|
||
ofxOscReceiver receiver; | ||
|
||
map<string, int> messageMap; | ||
|
||
public: | ||
OSCManager(const OSCManager&) = delete; | ||
OSCManager& operator=(const OSCManager&) = delete; | ||
OSCManager(OSCManager&&) = delete; | ||
OSCManager& operator=(OSCManager&&) = delete; | ||
|
||
static OSCManager& get_instance() { | ||
static OSCManager inst; | ||
return inst; | ||
} | ||
|
||
void setup(); | ||
void update(); | ||
void dumpOSC(ofxOscMessage m); | ||
}; | ||
|
||
#endif /* OSCManager_hpp */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters