From 6aeefc141ff5118c616bd7f63f55b89af75abcc8 Mon Sep 17 00:00:00 2001 From: Artur Wrona Date: Mon, 6 Mar 2023 11:01:02 +0100 Subject: [PATCH 1/5] Rewrite functional --- addons/ofxThinkgear/src/ThinkgearCommsDriver.h | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/addons/ofxThinkgear/src/ThinkgearCommsDriver.h b/addons/ofxThinkgear/src/ThinkgearCommsDriver.h index d057616..cd9fe5b 100755 --- a/addons/ofxThinkgear/src/ThinkgearCommsDriver.h +++ b/addons/ofxThinkgear/src/ThinkgearCommsDriver.h @@ -2,13 +2,7 @@ #include "ofMain.h" - -#ifdef _WIN32 -#include // tr1 deprecated in VS -#else -#include -#endif - +#include /* ThinkgearCommsDriver. @@ -73,7 +67,7 @@ class ThinkgearCommsDriver { ~ThinkgearCommsDriver(); bool isReady; - std::tr1::function callback; + std::function callback; string deviceName; int baudRate; @@ -81,7 +75,7 @@ class ThinkgearCommsDriver { void setup(string deviceName, int baudRate,T * listener, void (T::*listenerMethod)(int,float)) { this->deviceName = deviceName; this->baudRate = baudRate; - callback = std::tr1::bind(listenerMethod, listener, std::tr1::placeholders::_1, std::tr1::placeholders::_2); + callback = std::bind(listenerMethod, listener, std::placeholders::_1, std::placeholders::_2); }; bool connect(); From 0b3aed889e743af38c18869dbe285373a2b9cd29 Mon Sep 17 00:00:00 2001 From: Artur Wrona Date: Mon, 6 Mar 2023 11:03:13 +0100 Subject: [PATCH 2/5] Move variables to getters --- addons/ofxTouchGUI/src/ofxTouchGUIButton.mm | 8 ++++---- addons/ofxTouchGUI/src/ofxTouchGUIToggleButton.mm | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/addons/ofxTouchGUI/src/ofxTouchGUIButton.mm b/addons/ofxTouchGUI/src/ofxTouchGUIButton.mm index 98f79e0..8b99da5 100755 --- a/addons/ofxTouchGUI/src/ofxTouchGUIButton.mm +++ b/addons/ofxTouchGUI/src/ofxTouchGUIButton.mm @@ -25,8 +25,8 @@ upImage.loadImage(upImagePath); downImage.loadImage(downImagePath); if(useWidthHeightFromImage) { - this->width = upImage.width; - this->height = upImage.height; + this->width = upImage.getWidth(); + this->height = upImage.getHeight(); } } @@ -36,8 +36,8 @@ this->upImage = upImage; this->downImage = downImage; if(useWidthHeightFromImage) { - this->width = upImage.width; - this->height = upImage.height; + this->width = upImage.getWidth(); + this->height = upImage.getHeight(); } } diff --git a/addons/ofxTouchGUI/src/ofxTouchGUIToggleButton.mm b/addons/ofxTouchGUI/src/ofxTouchGUIToggleButton.mm index 326d4fc..8f877a9 100755 --- a/addons/ofxTouchGUI/src/ofxTouchGUIToggleButton.mm +++ b/addons/ofxTouchGUI/src/ofxTouchGUIToggleButton.mm @@ -32,8 +32,8 @@ onImage.loadImage(onImagePath); offImage.loadImage(offImagePath); if(useWidthHeightFromImage) { - this->width = onImage.width; - this->height = onImage.height; + this->width = onImage.getWidth(); + this->height = onImage.getHeight(); } } @@ -43,8 +43,8 @@ this->onImage = onImage; this->offImage = offImage; if(useWidthHeightFromImage) { - this->width = onImage.width; - this->height = onImage.height; + this->width = onImage.getWidth(); + this->height = onImage.getHeight(); } } From 5213fd5059353da57122ea61036c4ccdb1ced038 Mon Sep 17 00:00:00 2001 From: Artur Wrona Date: Mon, 6 Mar 2023 11:06:22 +0100 Subject: [PATCH 3/5] Add mouse events for correct compiling --- addons/ofxTouchGUI/src/ofxTouchGUI.h | 3 +++ addons/ofxTouchGUI/src/ofxTouchGUI.mm | 15 +++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/addons/ofxTouchGUI/src/ofxTouchGUI.h b/addons/ofxTouchGUI/src/ofxTouchGUI.h index 8580f4b..e05b047 100755 --- a/addons/ofxTouchGUI/src/ofxTouchGUI.h +++ b/addons/ofxTouchGUI/src/ofxTouchGUI.h @@ -268,8 +268,11 @@ class ofxTouchGUI { void disableMouse(); void mouseMoved(ofMouseEventArgs& args ); void mouseDragged(ofMouseEventArgs& args); + void mouseEntered(ofMouseEventArgs& args); + void mouseExited(ofMouseEventArgs& args); void mousePressed(ofMouseEventArgs& args); void mouseReleased(ofMouseEventArgs& args); + void mouseScrolled(ofMouseEventArgs& args); void touchDown(ofTouchEventArgs &touch); void touchMoved(ofTouchEventArgs &touch); void touchUp(ofTouchEventArgs &touch); diff --git a/addons/ofxTouchGUI/src/ofxTouchGUI.mm b/addons/ofxTouchGUI/src/ofxTouchGUI.mm index a2927cf..58675fc 100755 --- a/addons/ofxTouchGUI/src/ofxTouchGUI.mm +++ b/addons/ofxTouchGUI/src/ofxTouchGUI.mm @@ -1224,12 +1224,27 @@ onDown(args.x , args.y ); } +//-------------------------------------------------------------- +void ofxTouchGUI::mouseEntered(ofMouseEventArgs& args){ + +} + +//-------------------------------------------------------------- +void ofxTouchGUI::mouseExited(ofMouseEventArgs& args){ + +} + //-------------------------------------------------------------- void ofxTouchGUI::mouseReleased(ofMouseEventArgs& args){ // offset all through touches by windowPosition onUp(args.x , args.y ); } +//-------------------------------------------------------------- +void ofxTouchGUI::mouseScrolled(ofMouseEventArgs& args){ + +} + // TOUCH //-------------------------------------------------------------- void ofxTouchGUI::touchDown(ofTouchEventArgs &touch){ From 7600ff7951118b916f4f61055780d134d7e97b91 Mon Sep 17 00:00:00 2001 From: Artur Wrona Date: Mon, 6 Mar 2023 11:09:44 +0100 Subject: [PATCH 4/5] Remove undeclared argument in enableSendOSC --- BrainWaveOSC/src/BrainWaveGUI/BrainWaveGUI.mm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/BrainWaveOSC/src/BrainWaveGUI/BrainWaveGUI.mm b/BrainWaveOSC/src/BrainWaveGUI/BrainWaveGUI.mm index 1ec602c..c1d5dea 100755 --- a/BrainWaveOSC/src/BrainWaveGUI/BrainWaveGUI.mm +++ b/BrainWaveOSC/src/BrainWaveGUI/BrainWaveGUI.mm @@ -23,7 +23,7 @@ guiItems.push_back(tgtg); numGuiItems = guiItems.size(); - if(oscSendEnabled) tgtg->enableSendOSC(oscSender,false); + if(oscSendEnabled) tgtg->enableSendOSC(oscSender); return tgtg; } @@ -41,7 +41,7 @@ guiItems.push_back(tgtg); numGuiItems = guiItems.size(); - if(oscSendEnabled) tgtg->enableSendOSC(oscSender,false); + if(oscSendEnabled) tgtg->enableSendOSC(oscSender); return tgtg; } From a8b6268cc92dad1684679eb43adbfb2303eb777b Mon Sep 17 00:00:00 2001 From: Artur Wrona Date: Mon, 6 Mar 2023 11:13:02 +0100 Subject: [PATCH 5/5] Add cast int to unsigned char [fix compiler error] --- addons/ofxThinkgear/src/ofxThinkgear.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/ofxThinkgear/src/ofxThinkgear.cpp b/addons/ofxThinkgear/src/ofxThinkgear.cpp index 21eb66e..c4a7e91 100755 --- a/addons/ofxThinkgear/src/ofxThinkgear.cpp +++ b/addons/ofxThinkgear/src/ofxThinkgear.cpp @@ -32,7 +32,7 @@ void tgHandleStreamDataValueFunc( unsigned char extendedCodeLevel, unsigned char case( 0xd4 ): // printf("Standby... autoconnecting\n"); if(tg.allowRawDataEvents) ofNotifyEvent(tg.onConnecting, tg.values); - tg.device->writeByte(0xc2); // what is this? + tg.device->writeByte((unsigned char) 0xc2); // what is this? break; case( 0xd0 ): ofNotifyEvent(tg.onReady, tg.values);