diff --git a/.gitmodules b/.gitmodules index 4a777a9..93f56da 100644 --- a/.gitmodules +++ b/.gitmodules @@ -83,6 +83,22 @@ path = _Package/com.ultracombos.coloring url = https://github.com/UltraCombos/com.ultracombos.coloring branch = master +[submodule "of_v0.11.0/addons/ofxImGui"] + path = of_v0.11.0/addons/ofxImGui + url = https://github.com/UltraCombos/ofxImGui.git + branch = master +[submodule "of_v0.11.0/addons/ofxUltraControls"] + path = of_v0.11.0/addons/ofxUltraControls + url = https://github.com/UltraCombos/ofxUltraControls.git + branch = master +[submodule "of_v0.11.0/uc_libs/lib_UltraControls"] + path = of_v0.11.0/uc_libs/lib_UltraControls + url = https://github.com/UltraCombos/lib_UltraControls.git + branch = master +[submodule "of_v0.11.0/apps/myApps/ucEmptyExample"] + path = of_v0.11.0/apps/myApps/ucEmptyExample + url = https://github.com/UltraCombos/ucEmptyExample.git + branch = master [submodule "_Package/com.ultracombos.multilingual"] path = _Package/com.ultracombos.multilingual url = https://github.com/UltraCombos/com.ultracombos.multilingual diff --git a/of_v0.11.0/.gitignore b/of_v0.11.0/.gitignore new file mode 100644 index 0000000..afb0548 --- /dev/null +++ b/of_v0.11.0/.gitignore @@ -0,0 +1,139 @@ +/libs +/export +/addons/ofxAccelerometer +/addons/ofxAssimpModelLoader +/addons/ofxGui +/addons/ofxNetwork +/addons/ofxOsc +/addons/ofxSvg +/addons/ofxThreadedImageLoader +/addons/ofxVectorGraphics +/addons/ofxXmlSettings +/addons/ofxAndroid +/addons/ofxEmscripten +/addons/ofxGPS +/addons/ofxKinect +/addons/ofxOpenCv +/addons/ofxPoco +/addons/ofxiOS +/addons/ofxUnitTests +/apps/myApps/emptyExample +/docs +/other/examples +/libs +/scripts + +*.obj + + +# Created by https://www.gitignore.io/api/openframeworks+visualstudio +# Edit at https://www.gitignore.io/?templates=openframeworks+visualstudio + +### OpenFrameworks+VisualStudio ### +# ignore generated binaries +# but not the data folder + +/bin/* +!/bin/data/ + +# general + +[Bb]uild/ +[Oo]bj/ +*.o +[Dd]ebug*/ +[Rr]elease*/ +*.mode* +*.app/ +*.pyc +.svn/ +*.log + +# IDE files which should +# be ignored + +# XCode +*.pbxuser +*.perspective +*.perspectivev3 +*.mode1v3 +*.mode2v3 +# XCode 4 +xcuserdata +*.xcworkspace + +# Code::Blocks +*.depend +*.layout + +# Visual Studio +*.sdf +*.opensdf +*.suo +*.pdb +*.ilk +*.aps +ipch/ + +# Eclipse +.metadata +local.properties +.externalToolBuilders + +# operating system + +# Linux +*~ +# KDE +.directory +.AppleDouble + +# OSX +.DS_Store +*.swp +*~.nib +# Thumbnails +._* + +# Windows +# Image file caches +Thumbs.db +# Folder config file +Desktop.ini + +# Android +.csettings + +### OpenFrameworks+VisualStudio Patch ### +.vs/ +*.ncb +*.opendb +*.cachefile +*.VC.db +*.VC.VC.opendb +*.psess +*.vsp +*.vspx +*.sap + +# End of https://www.gitignore.io/api/openframeworks+visualstudio/docs +/examples +/other +/projectGenerator-vs +/scripts +Debug* +Release* +*.lib +*.md +*.db* +*.opendb +*.ipch +*.suo +*.dll +*.exe +*.exp +*.obj +*.iobj +*.ipdb +*.ilk +*.pdb \ No newline at end of file diff --git a/of_v0.11.0/addons/ofxImGui b/of_v0.11.0/addons/ofxImGui new file mode 160000 index 0000000..e3aaeb8 --- /dev/null +++ b/of_v0.11.0/addons/ofxImGui @@ -0,0 +1 @@ +Subproject commit e3aaeb860722bd257ec3bb66ec4bacd063919ae7 diff --git a/of_v0.11.0/addons/ofxUltraControls b/of_v0.11.0/addons/ofxUltraControls new file mode 160000 index 0000000..18ab965 --- /dev/null +++ b/of_v0.11.0/addons/ofxUltraControls @@ -0,0 +1 @@ +Subproject commit 18ab9656f687de91b10714c1f0a828b01faf9e20 diff --git a/of_v0.11.0/apps/myApps/OSC2UltraControl/OSC2UltraControl.vcxproj b/of_v0.11.0/apps/myApps/OSC2UltraControl/OSC2UltraControl.vcxproj new file mode 100644 index 0000000..5d887cd --- /dev/null +++ b/of_v0.11.0/apps/myApps/OSC2UltraControl/OSC2UltraControl.vcxproj @@ -0,0 +1,293 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + $([Microsoft.Build.Utilities.ToolLocationHelper]::GetLatestSDKTargetPlatformVersion('Windows', '10.0')) + $(LatestTargetPlatformVersion) + $(WindowsTargetPlatformVersion) + + + {7FD42DF7-442E-479A-BA76-D0022F99702A} + Win32Proj + OSC2UltraControl + + + + Application + Unicode + v141 + + + Application + Unicode + v141 + + + Application + Unicode + true + v141 + + + Application + Unicode + true + v141 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + bin\ + obj\$(Platform)\$(Configuration)\ + $(ProjectName)_debug + true + true + + + bin\ + obj\$(Platform)\$(Configuration)\ + $(ProjectName)_debug + true + true + + + bin\ + obj\$(Platform)\$(Configuration)\ + false + + + bin\ + obj\$(Platform)\$(Configuration)\ + false + + + + Disabled + EnableFastChecks + %(PreprocessorDefinitions) + MultiThreadedDebugDLL + Level3 + %(AdditionalIncludeDirectories);src + CompileAsCpp + $(IntDir) + + + true + Console + false + %(AdditionalDependencies) + %(AdditionalLibraryDirectories) + + + + + + Disabled + EnableFastChecks + %(PreprocessorDefinitions) + MultiThreadedDebugDLL + Level3 + %(AdditionalIncludeDirectories);src + CompileAsCpp + true + $(IntDir) + + + true + Console + false + %(AdditionalDependencies) + %(AdditionalLibraryDirectories) + + + + + + false + %(PreprocessorDefinitions) + MultiThreadedDLL + Level3 + %(AdditionalIncludeDirectories);src + CompileAsCpp + true + $(IntDir) + + + false + false + Console + true + true + false + %(AdditionalDependencies) + %(AdditionalLibraryDirectories) + + + + + + false + %(PreprocessorDefinitions) + MultiThreadedDLL + Level3 + %(AdditionalIncludeDirectories);src + CompileAsCpp + $(IntDir) + + + false + false + Console + true + true + false + %(AdditionalDependencies) + %(AdditionalLibraryDirectories) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {5837595d-aca9-485c-8e76-729040ce4b0b} + + + + + /D_DEBUG %(AdditionalOptions) + /D_DEBUG %(AdditionalOptions) + $(OF_ROOT)\libs\openFrameworksCompiled\project\vs + + + + + + + + + \ No newline at end of file diff --git a/of_v0.11.0/apps/myApps/OSC2UltraControl/OSC2UltraControl.vcxproj.filters b/of_v0.11.0/apps/myApps/OSC2UltraControl/OSC2UltraControl.vcxproj.filters new file mode 100644 index 0000000..75d5a47 --- /dev/null +++ b/of_v0.11.0/apps/myApps/OSC2UltraControl/OSC2UltraControl.vcxproj.filters @@ -0,0 +1,297 @@ + + + + + src + + + src + + + addons\ofxUltraControls\src + + + addons\ofxUltraControls\src + + + uc_libs\lib_UltraControls\src + + + uc_libs\lib_UltraControls\src + + + addons\ofxImGui\src + + + addons\ofxImGui\src + + + addons\ofxImGui\src + + + addons\ofxImGui\src + + + addons\ofxImGui\src + + + addons\ofxImGui\src + + + addons\ofxImGui\src + + + addons\ofxImGui\src + + + addons\ofxImGui\src + + + addons\ofxImGui\libs + + + addons\ofxImGui\libs + + + addons\ofxImGui\libs + + + addons\ofxImGui\libs + + + addons\ofxOsc\src + + + addons\ofxOsc\src + + + addons\ofxOsc\src + + + addons\ofxOsc\src + + + addons\ofxOsc\libs\oscpack\src\ip + + + addons\ofxOsc\libs\oscpack\src\ip\win32 + + + addons\ofxOsc\libs\oscpack\src\ip\win32 + + + addons\ofxOsc\libs\oscpack\src\osc + + + addons\ofxOsc\libs\oscpack\src\osc + + + addons\ofxOsc\libs\oscpack\src\osc + + + addons\ofxOsc\libs\oscpack\src\osc + + + + + {d8376475-7454-4a24-b08a-aac121d3ad6f} + + + {1b70f676-6198-4aab-8a10-9d74c64eaff0} + + + {5321ca23-ba83-45a3-b830-3c2ce3845d08} + + + {c9c06d07-c064-418a-b236-5616de4fc65f} + + + {b2fdb7b9-f10d-408c-934b-609257c34857} + + + {c4f2439c-9bfa-430e-a565-b9d1d057772c} + + + {9f7c261d-f652-4b08-9559-b14495e5dc98} + + + {fc14fcd8-8da7-47c6-a30c-0706be024399} + + + {7cb3d11f-40c8-4567-b49f-f6505087f1f6} + + + {d3f9c8d8-774e-4f79-a0e0-5723676ea0bf} + + + {4ca39b3b-95d6-4029-a947-5e6dc7d9a268} + + + {9091508e-b5a5-4812-bd8d-b01467947a79} + + + {46cb6b97-acfc-4f14-82a1-a515f1247b1e} + + + {64d801cd-ffb5-4ce8-8807-9d051c22e6e1} + + + {89ce4e2a-00be-4811-90ee-9e7982753f36} + + + {1c5366d0-8548-4b16-b663-9235aed9f001} + + + {6d211978-c3d2-4728-93df-87fa56d7cdee} + + + {78163d86-1ad9-4290-aa28-fecbdd00fe60} + + + + + src + + + addons\ofxUltraControls\src + + + addons\ofxUltraControls\src + + + addons\ofxUltraControls\src + + + uc_libs\lib_UltraControls\src + + + uc_libs\lib_UltraControls\src + + + uc_libs\lib_UltraControls\src + + + uc_libs\lib_UltraControls\src + + + uc_libs\lib_UltraControls\src + + + uc_libs\lib_UltraControls\src + + + uc_libs\lib_UltraControls\src + + + addons\ofxImGui\src + + + addons\ofxImGui\src + + + addons\ofxImGui\src + + + addons\ofxImGui\src + + + addons\ofxImGui\src + + + addons\ofxImGui\src + + + addons\ofxImGui\src + + + addons\ofxImGui\src + + + addons\ofxImGui\src + + + addons\ofxImGui\src + + + addons\ofxImGui\src + + + addons\ofxImGui\src + + + addons\ofxImGui\libs + + + addons\ofxImGui\libs + + + addons\ofxImGui\libs + + + addons\ofxImGui\libs + + + addons\ofxImGui\libs + + + addons\ofxOsc\src + + + addons\ofxOsc\src + + + addons\ofxOsc\src + + + addons\ofxOsc\src + + + addons\ofxOsc\src + + + addons\ofxOsc\src + + + addons\ofxOsc\libs\oscpack\src\ip + + + addons\ofxOsc\libs\oscpack\src\ip + + + addons\ofxOsc\libs\oscpack\src\ip + + + addons\ofxOsc\libs\oscpack\src\ip + + + addons\ofxOsc\libs\oscpack\src\ip + + + addons\ofxOsc\libs\oscpack\src\osc + + + addons\ofxOsc\libs\oscpack\src\osc + + + addons\ofxOsc\libs\oscpack\src\osc + + + addons\ofxOsc\libs\oscpack\src\osc + + + addons\ofxOsc\libs\oscpack\src\osc + + + addons\ofxOsc\libs\oscpack\src\osc + + + addons\ofxOsc\libs\oscpack\src\osc + + + addons\ofxOsc\libs\oscpack\src\osc + + + + + + \ No newline at end of file diff --git a/of_v0.11.0/apps/myApps/OSC2UltraControl/addons.make b/of_v0.11.0/apps/myApps/OSC2UltraControl/addons.make new file mode 100644 index 0000000..e69de29 diff --git a/of_v0.11.0/apps/myApps/OSC2UltraControl/bin/data/Test.xml b/of_v0.11.0/apps/myApps/OSC2UltraControl/bin/data/Test.xml new file mode 100644 index 0000000..31f1f36 --- /dev/null +++ b/of_v0.11.0/apps/myApps/OSC2UltraControl/bin/data/Test.xml @@ -0,0 +1,23 @@ + + + + + 0 + 0 + 640 + 480 + + false + false + true + true + true + + 0.211 + + 0 + 133 + 0 + 0 + + diff --git a/of_v0.11.0/apps/myApps/OSC2UltraControl/emptyExample.png b/of_v0.11.0/apps/myApps/OSC2UltraControl/emptyExample.png new file mode 100644 index 0000000..8de27cc Binary files /dev/null and b/of_v0.11.0/apps/myApps/OSC2UltraControl/emptyExample.png differ diff --git a/of_v0.11.0/apps/myApps/OSC2UltraControl/icon.rc b/of_v0.11.0/apps/myApps/OSC2UltraControl/icon.rc new file mode 100644 index 0000000..7e26eb3 --- /dev/null +++ b/of_v0.11.0/apps/myApps/OSC2UltraControl/icon.rc @@ -0,0 +1,8 @@ +// Icon Resource Definition +#define MAIN_ICON 102 + +#if defined(_DEBUG) +MAIN_ICON ICON "icon_debug.ico" +#else +MAIN_ICON ICON "icon.ico" +#endif diff --git a/of_v0.11.0/apps/myApps/OSC2UltraControl/src/main.cpp b/of_v0.11.0/apps/myApps/OSC2UltraControl/src/main.cpp new file mode 100644 index 0000000..b156efd --- /dev/null +++ b/of_v0.11.0/apps/myApps/OSC2UltraControl/src/main.cpp @@ -0,0 +1,14 @@ +#include "ofMain.h" +#include "ofApp.h" + +//======================================================================== +int main( ){ + + ofSetupOpenGL(640,480, OF_WINDOW); // <-------- setup the GL context + + // this kicks off the running of my app + // can be OF_WINDOW or OF_FULLSCREEN + // pass in width and height too: + ofRunApp( new ofApp()); + +} diff --git a/of_v0.11.0/apps/myApps/OSC2UltraControl/src/ofApp.cpp b/of_v0.11.0/apps/myApps/OSC2UltraControl/src/ofApp.cpp new file mode 100644 index 0000000..057f267 --- /dev/null +++ b/of_v0.11.0/apps/myApps/OSC2UltraControl/src/ofApp.cpp @@ -0,0 +1,188 @@ +#include "ofApp.h" + +//-------------------------------------------------------------- +void ofApp::setup(){ + m_sp_uc_setter = ofxUCSetter::Create("OUTPUT",512); + if (m_sp_uc_setter) + { + m_sp_uc_setter->setup(); + } + + + ofxImGuiParameter::Initialize(); + ctx = ImGui::GetCurrentContext(); + m_imgui_parameter.setup("Test"); + m_imgui_parameter.set_fit_window(true); + m_imgui_parameter.bind(triggerDuration.set("Trigger Duration", triggerDuration, 0, 2)); + + osc_receiver.setup(7001); +} + +//-------------------------------------------------------------- +void ofApp::update(){ + + receiveMessage(); + + + m_sp_uc_setter->update(); + if (m_sp_param_group) + { + ofParameterGroup & group =*m_sp_param_group.get(); + for (int i = 0; i < group.size(); ++i) + { + ofAbstractParameter& param = group[i]; + auto type_name = param.type(); + if (type_name != typeid(ofParameter).name()) + continue; + string prefix = "CHANNEL_"; + int ch = ofToInt(param.getName().substr(prefix.size())); + //printf("ch=%d\n",ch); + ofParameter& param_int = param.cast(); + if (triggerTimeStamp.find(ch) == triggerTimeStamp.end()) + { + param_int = 0; + } + else + { + float stamp = ofGetElapsedTimef(); + if (stamp - triggerTimeStamp[ch] < triggerDuration) + { + param_int = 255; + } + else + { + param_int = 0; + } + } + } + } + else + { + if ((m_sp_param_group = m_sp_uc_setter->get_paramter_group())) + { + m_imgui_parameter.bind(*m_sp_param_group.get()); + ofParameterGroup & group = *m_sp_param_group.get(); + m_imgui_parameter.load(); + ofNotifyEvent(group.parameterChangedE(), group); + } + } +} + +//-------------------------------------------------------------- +void ofApp::draw(){ + //m_gui.draw(); + + + SetContex(); + ofxImGuiParameter::Draw(); +} + +//-------------------------------------------------------------- +void ofApp::keyPressed(int key){ + +} + +//-------------------------------------------------------------- +void ofApp::keyReleased(int key){ + +} + +//-------------------------------------------------------------- +void ofApp::mouseMoved(int x, int y){ + +} + +//-------------------------------------------------------------- +void ofApp::mouseDragged(int x, int y, int button){ + +} + +//-------------------------------------------------------------- +void ofApp::mousePressed(int x, int y, int button){ + +} + +//-------------------------------------------------------------- +void ofApp::mouseReleased(int x, int y, int button){ + +} + +//-------------------------------------------------------------- +void ofApp::mouseEntered(int x, int y){ + +} + +//-------------------------------------------------------------- +void ofApp::mouseExited(int x, int y){ + +} + +//-------------------------------------------------------------- +void ofApp::windowResized(int w, int h){ + +} + +//-------------------------------------------------------------- +void ofApp::gotMessage(ofMessage msg){ + +} + +//-------------------------------------------------------------- +void ofApp::dragEvent(ofDragInfo dragInfo){ + +} +void ofApp::SetContex() +{ + if (ctx ) + ImGui::SetCurrentContext(ctx); + +} +void ofApp::receiveMessage() +{ + while (osc_receiver.hasWaitingMessages()) { + ofxOscMessage m; + osc_receiver.getNextMessage(m); + + std::string msgString; + msgString = m.getAddress(); + msgString += ":"; + for (size_t i = 0; i < m.getNumArgs(); i++) { + + // get the argument type + msgString += " "; + msgString += m.getArgTypeName(i); + msgString += ":"; + + // display the argument - make sure we get the right type + if (m.getArgType(i) == OFXOSC_TYPE_INT32) { + msgString += ofToString(m.getArgAsInt32(i)); + } + else if (m.getArgType(i) == OFXOSC_TYPE_FLOAT) { + msgString += ofToString(m.getArgAsFloat(i)); + } + else if (m.getArgType(i) == OFXOSC_TYPE_STRING) { + msgString += m.getArgAsString(i); + } + else { + msgString += "unhandled argument type " + m.getArgTypeName(i); + } + } + printf("%s\n", msgString.c_str()); + + auto addr = m.getAddress(); + auto tokens = ofSplitString(addr, "/"); + + if (tokens.size() == 3 && m.getNumArgs() == 1 && m.getArgType(0) == OFXOSC_TYPE_INT32) + { + int ch = ofToInt(tokens[2]); + int i = m.getArgAsInt32(0); + if (i == 3) + { + printf("channel = %d, enter", ch); + if (triggerTimeStamp.find(ch) == triggerTimeStamp.end()) + triggerTimeStamp.insert(std::make_pair(ch, -numeric_limits::max())); + triggerTimeStamp[ch] = ofGetElapsedTimef(); + } + } + } +} \ No newline at end of file diff --git a/of_v0.11.0/apps/myApps/OSC2UltraControl/src/ofApp.h b/of_v0.11.0/apps/myApps/OSC2UltraControl/src/ofApp.h new file mode 100644 index 0000000..2c48562 --- /dev/null +++ b/of_v0.11.0/apps/myApps/OSC2UltraControl/src/ofApp.h @@ -0,0 +1,36 @@ +#pragma once + +#include "ofMain.h" +#include "ofxUCSetter.h" +#include "ofxImGuiParameter.h" +#include "imgui.h" +#include "ofxOscReceiver.h" +#include +class ofApp : public ofBaseApp{ + public: + void setup(); + void update(); + void draw(); + + void keyPressed(int key); + void keyReleased(int key); + void mouseMoved(int x, int y); + void mouseDragged(int x, int y, int button); + void mousePressed(int x, int y, int button); + void mouseReleased(int x, int y, int button); + void mouseEntered(int x, int y); + void mouseExited(int x, int y); + void windowResized(int w, int h); + void dragEvent(ofDragInfo dragInfo); + void gotMessage(ofMessage msg); + void receiveMessage(); + ofParameter triggerDuration = 0.2f; + SetterRef m_sp_uc_setter; + ParamGroupRef m_sp_param_group; + ofxImGuiParameter m_imgui_parameter; + ImGuiContext* ctx = nullptr; + void SetContex(); + ofxOscReceiver osc_receiver; + + std::map triggerTimeStamp; +}; diff --git a/of_v0.11.0/apps/myApps/ucEmptyExample b/of_v0.11.0/apps/myApps/ucEmptyExample new file mode 160000 index 0000000..338c4ac --- /dev/null +++ b/of_v0.11.0/apps/myApps/ucEmptyExample @@ -0,0 +1 @@ +Subproject commit 338c4ac9173a4b121535de8190f4704448fac518 diff --git a/of_v0.11.0/uc_libs/lib_UltraControls b/of_v0.11.0/uc_libs/lib_UltraControls new file mode 160000 index 0000000..e43d3c3 --- /dev/null +++ b/of_v0.11.0/uc_libs/lib_UltraControls @@ -0,0 +1 @@ +Subproject commit e43d3c3ee6f753226050e62cb5c999df16704f39