From 751842afec6b871bea8d75c52faa12c6bfee5d57 Mon Sep 17 00:00:00 2001 From: Arnaud Loonstra Date: Thu, 1 Nov 2018 10:55:35 +0100 Subject: [PATCH 01/18] define APPNAME earlier to fix msys2 copy dlls failing (#6166) --- .../project/makefileCommon/compile.project.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/openFrameworksCompiled/project/makefileCommon/compile.project.mk b/libs/openFrameworksCompiled/project/makefileCommon/compile.project.mk index c0dfbd0b831..a1f8a632b3f 100644 --- a/libs/openFrameworksCompiled/project/makefileCommon/compile.project.mk +++ b/libs/openFrameworksCompiled/project/makefileCommon/compile.project.mk @@ -3,13 +3,13 @@ # define the OF_SHARED_MAKEFILES location OF_SHARED_MAKEFILES_PATH=$(OF_ROOT)/libs/openFrameworksCompiled/project/makefileCommon -include $(OF_SHARED_MAKEFILES_PATH)/config.shared.mk - # if APPNAME is not defined, set it to the project dir name ifndef APPNAME APPNAME = $(shell basename `pwd`) endif +include $(OF_SHARED_MAKEFILES_PATH)/config.shared.mk + # Name TARGET ifeq ($(findstring Debug,$(MAKECMDGOALS)),Debug) TARGET_NAME = Debug From eacb4a33446c9e1d070100b987feac96b2cdec0a Mon Sep 17 00:00:00 2001 From: Arnaud Loonstra Date: Tue, 13 Nov 2018 11:36:15 +0100 Subject: [PATCH 02/18] appveyor: fix ssl dependencies (#6170) apply a fix to remove ssl libraries installed in windows and reinstall them through pacman. This was making tests fail to run cause of missing dlls --- .appveyor.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.appveyor.yml b/.appveyor.yml index aee0f513c5f..b4bdb4de384 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -25,11 +25,15 @@ shallow_clone: true clone_depth: 10 init: +# fix for https://github.com/appveyor/ci/issues/2571 +- del C:\Windows\System32\libssl-*.dll C:\Windows\system32\libcrypto-*.dll +- del C:\Windows\SysWOW64\libssl-*.dll C:\Windows\SysWOW64\libcrypto-*.dll - set MSYS2_PATH=c:\msys64 - set CHERE_INVOKING=1 - if "%BUILDER%_%PLATFORM%"=="MSYS2_x86" set MSYSTEM=MINGW32 - if "%BUILDER%_%PLATFORM%"=="MSYS2_x64" set MSYSTEM=MINGW64 -- '%MSYS2_PATH%\usr\bin\bash -lc "pacman --noconfirm -S --needed unzip rsync"' +- '%MSYS2_PATH%\usr\bin\bash -lc "pacman --noconfirm --needed -Sy bash pacman pacman-mirrors msys2-runtime msys2-runtime-devel"' +- '%MSYS2_PATH%\usr\bin\bash -lc "pacman --noconfirm -S --needed unzip rsync libopenssl mingw-w64-i686-openssl"' - if "%BUILDER%"=="VS" set PATH=%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin;%PATH% # - IF "%BUILDER%"=="VS" set PATH=C:\Program Files (x86)\MSBuild\14.0\Bin;%PATH% From 9dd4249eb4419d8d9ea2715453aca07d4169f906 Mon Sep 17 00:00:00 2001 From: Roy Macdonald Date: Tue, 13 Nov 2018 17:13:41 -0300 Subject: [PATCH 03/18] ofxGui: slider scrolling (#6144) Fixes #6133 The scrolling was still being handled when the gui was not being drawn both in ofxSlider and ofxInputField. Tested using the code provided in the mentioned issue. Also, there is some redundant code in ofxSlider.cpp and ofxInputField.cpp. Both have a function called toRange(...) which is identical in both. When the scroll callback is called this function is called. Can't we move this function to the ofxBaseGui for instance? Also, the code used in the scroll callback in both ofxSlider and ofxInputField is quite similar, maybe moving this to ofxBaseGui might be better too. --- addons/ofxGui/src/ofxInputField.cpp | 8 ++++++-- addons/ofxGui/src/ofxSlider.cpp | 26 +++++++++++++++----------- 2 files changed, 21 insertions(+), 13 deletions(-) diff --git a/addons/ofxGui/src/ofxInputField.cpp b/addons/ofxGui/src/ofxInputField.cpp index b1627ed7027..59442e66378 100644 --- a/addons/ofxGui/src/ofxInputField.cpp +++ b/addons/ofxGui/src/ofxInputField.cpp @@ -419,11 +419,15 @@ bool ofxInputField::mouseReleased(ofMouseEventArgs &){ //----------------------------------------------------------- template bool ofxInputField::mouseScrolled(ofMouseEventArgs & mouse){ + if(!isGuiDrawing() || insideSlider){ + //when insideSlider it is the slider object who is in charge of handling the scrolling + return false; + } if(b.inside(mouse)){ if(!bGuiActive){ - if(mouse.y>0 || mouse.y<0){ + if(mouse.scrollY>0 || mouse.scrollY<0){ double range = getRange(value.getMin(), value.getMax(), b.width); - Type newValue = value + ofMap(mouse.y,-1,1,-range, range); + Type newValue = value + ofMap(mouse.scrollY,-1,1,-range, range); newValue = ofClamp(newValue,value.getMin(),value.getMax()); value = newValue; } diff --git a/addons/ofxGui/src/ofxSlider.cpp b/addons/ofxGui/src/ofxSlider.cpp index c37936cc8be..8f4b69ce973 100644 --- a/addons/ofxGui/src/ofxSlider.cpp +++ b/addons/ofxGui/src/ofxSlider.cpp @@ -176,21 +176,25 @@ getRange(Type min, Type max, float width){ template bool ofxSlider::mouseScrolled(ofMouseEventArgs & args){ - if(state==Slider){ - if(mouseInside){ - if(args.scrollY>0 || args.scrollY<0){ - double range = getRange(value.getMin(),value.getMax(),b.width); - Type newValue = value + ofMap(args.scrollY,-1,1,-range, range); - newValue = ofClamp(newValue,value.getMin(),value.getMax()); - value = newValue; + if(isGuiDrawing()){ + if(state==Slider){ + if(mouseInside){ + if(args.scrollY>0 || args.scrollY<0){ + double range = getRange(value.getMin(),value.getMax(),b.width); + Type newValue = value + ofMap(args.scrollY,-1,1,-range, range); + newValue = ofClamp(newValue,value.getMin(),value.getMax()); + value = newValue; + } + return true; + }else{ + return false; } - return true; }else{ - return false; + // the following will always return false as it is inside the slider. +// return input.mouseScrolled(args); } - }else{ - return isGuiDrawing() && input.mouseScrolled(args); } + return false; } From 5a2cf1e3012aa8d756a8d427eb87c01a28ab0639 Mon Sep 17 00:00:00 2001 From: Leonardo Zimmerman Date: Tue, 13 Nov 2018 17:22:14 -0300 Subject: [PATCH 04/18] ofSoundBuffer getChannel fix (#6117) ofSoundBuffer::checkSizeAndChannelsConsistency is crashing when calling ofSoundBuffer::getChannel with channels = 1 --- libs/openFrameworks/sound/ofSoundBuffer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/openFrameworks/sound/ofSoundBuffer.cpp b/libs/openFrameworks/sound/ofSoundBuffer.cpp index 3e2b9a1897b..156aace6727 100644 --- a/libs/openFrameworks/sound/ofSoundBuffer.cpp +++ b/libs/openFrameworks/sound/ofSoundBuffer.cpp @@ -501,7 +501,7 @@ void ofSoundBuffer::getChannel(ofSoundBuffer & targetBuffer, std::size_t sourceC targetBuffer.setNumChannels(1); targetBuffer.setSampleRate(samplerate); if(channels == 1){ - copyTo(targetBuffer, getNumFrames(), 0, 0); + copyTo(targetBuffer, getNumFrames(), 1, 0); }else{ // fetch samples from only one channel targetBuffer.resize(getNumFrames()); From b6e3341e72d6602fc592ed655d12e63d158b7f74 Mon Sep 17 00:00:00 2001 From: arturo castro Date: Wed, 14 Nov 2018 13:24:20 +0100 Subject: [PATCH 05/18] Revert "ofConstants: revert version to 0.10.1" This reverts commit 19e083dba02722bab78204f5e734f1962d90c169. --- libs/openFrameworks/utils/ofConstants.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libs/openFrameworks/utils/ofConstants.h b/libs/openFrameworks/utils/ofConstants.h index 41159594296..d27b3892d03 100644 --- a/libs/openFrameworks/utils/ofConstants.h +++ b/libs/openFrameworks/utils/ofConstants.h @@ -3,9 +3,9 @@ //------------------------------- #define OF_VERSION_MAJOR 0 -#define OF_VERSION_MINOR 10 -#define OF_VERSION_PATCH 1 -#define OF_VERSION_PRE_RELEASE "stable" +#define OF_VERSION_MINOR 11 +#define OF_VERSION_PATCH 0 +#define OF_VERSION_PRE_RELEASE "master" // Set to 1 for compatibility with old projects using ofVec instead of glm #ifndef OF_USE_LEGACY_VECTOR_MATH From 6257aa613988de87486cf0eb04102aa911f8f558 Mon Sep 17 00:00:00 2001 From: arturo castro Date: Wed, 14 Nov 2018 13:33:20 +0100 Subject: [PATCH 06/18] create_package: pull OF from github instead of local --- scripts/dev/create_package.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/dev/create_package.sh b/scripts/dev/create_package.sh index 91870a14e36..c0af59ae8f9 100755 --- a/scripts/dev/create_package.sh +++ b/scripts/dev/create_package.sh @@ -24,7 +24,7 @@ else libs_abi="" fi -REPO=../.. +REPO=https://github.com/openframeworks/openFrameworks.git REPO_ALIAS=originlocal BRANCH=$branch From a1deaf147bf0f9bbd2282db880afd23fd4cb7a7f Mon Sep 17 00:00:00 2001 From: arturo castro Date: Wed, 14 Nov 2018 13:33:20 +0100 Subject: [PATCH 07/18] create_package: pull OF from github instead of local --- scripts/dev/create_package.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/dev/create_package.sh b/scripts/dev/create_package.sh index 91870a14e36..c0af59ae8f9 100755 --- a/scripts/dev/create_package.sh +++ b/scripts/dev/create_package.sh @@ -24,7 +24,7 @@ else libs_abi="" fi -REPO=../.. +REPO=https://github.com/openframeworks/openFrameworks.git REPO_ALIAS=originlocal BRANCH=$branch From 0607a720c846dd912f09035b1e5358a4e9397014 Mon Sep 17 00:00:00 2001 From: arturo castro Date: Wed, 14 Nov 2018 13:49:46 +0100 Subject: [PATCH 08/18] THANKS.md --- THANKS.md | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 THANKS.md diff --git a/THANKS.md b/THANKS.md new file mode 100644 index 00000000000..394568c17b3 --- /dev/null +++ b/THANKS.md @@ -0,0 +1,36 @@ +``` + .----. .---. .----. .---. + / .. \ /_ | / .. \ /_ | +. / \ . | |. / \ . | | +| | ' | | || | ' | | | +' \ / ' | |' \ / ' | | + \ `' / .-. | | \ `' / .-. | | + `---'' `-' `---' `---'' `-' `---' +``` + +Arnaud Loonstra +arturo castro +Christopher Baker +Daniel Rosser +Dan Wilcox +Davide Prati +d-egan +Hiroshi Matoba +ISHII 2bit +ivorne +Jason Van Cleave +jpericas22 +Kyle Kirby +Leonardo Zimmerman +lilive +Mike Allison +Nicola Pisanti +ofTheo +Pascal Baltazar +Patricio Gonzalez Vivo +Roy Macdonald +Seb Lee-Delisle +Tim Gfrerer +Yusuke Tomoto +なりたけいすけ + From 01e2e2fafed89be7b18b120abb6c5c5dcd30ba8a Mon Sep 17 00:00:00 2001 From: arturo castro Date: Wed, 14 Nov 2018 13:57:21 +0100 Subject: [PATCH 09/18] fixed thanks format --- THANKS.md | 50 +++++++++++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/THANKS.md b/THANKS.md index 394568c17b3..8e9b364086c 100644 --- a/THANKS.md +++ b/THANKS.md @@ -8,29 +8,29 @@ `---'' `-' `---' `---'' `-' `---' ``` -Arnaud Loonstra -arturo castro -Christopher Baker -Daniel Rosser -Dan Wilcox -Davide Prati -d-egan -Hiroshi Matoba -ISHII 2bit -ivorne -Jason Van Cleave -jpericas22 -Kyle Kirby -Leonardo Zimmerman -lilive -Mike Allison -Nicola Pisanti -ofTheo -Pascal Baltazar -Patricio Gonzalez Vivo -Roy Macdonald -Seb Lee-Delisle -Tim Gfrerer -Yusuke Tomoto -なりたけいすけ +- Arnaud Loonstra +- arturo castro +- Christopher Baker +- Daniel Rosser +- Dan Wilcox +- Davide Prati +- d-egan +- Hiroshi Matoba +- ISHII 2bit +- ivorne +- Jason Van Cleave +- jpericas22 +- Kyle Kirby +- Leonardo Zimmerman +- lilive +- Mike Allison +- Nicola Pisanti +- ofTheo +- Pascal Baltazar +- Patricio Gonzalez Vivo +- Roy Macdonald +- Seb Lee-Delisle +- Tim Gfrerer +- Yusuke Tomoto +- なりたけいすけ From faeb05d54647915464dcf2bf23ee9da03d8abcd5 Mon Sep 17 00:00:00 2001 From: arturo castro Date: Wed, 14 Nov 2018 15:33:22 +0100 Subject: [PATCH 10/18] changelog and thanks scripts --- scripts/dev/changelog.sh | 5 +++++ scripts/dev/thanks.sh | 5 +++++ 2 files changed, 10 insertions(+) create mode 100755 scripts/dev/changelog.sh create mode 100755 scripts/dev/thanks.sh diff --git a/scripts/dev/changelog.sh b/scripts/dev/changelog.sh new file mode 100755 index 00000000000..29e8c5d9245 --- /dev/null +++ b/scripts/dev/changelog.sh @@ -0,0 +1,5 @@ +if [ $# -ne 2 ]; then + echo Error: wrong number of arguments + echo Usage: ./thanks.sh tag1 tag2 +fi +git log $1...$2 --no-merges --pretty=format:'- %s [commit](https://github.com/openframeworks/openFrameworks/commit/%H)' --reverse | sed 's/^\s*[0-9][0-9]*\s\(.*\)$/- \1/g' \ No newline at end of file diff --git a/scripts/dev/thanks.sh b/scripts/dev/thanks.sh new file mode 100755 index 00000000000..8df89d2529a --- /dev/null +++ b/scripts/dev/thanks.sh @@ -0,0 +1,5 @@ +if [ $# -ne 2 ]; then + echo Error: wrong number of arguments + echo Usage: ./thanks.sh tag1 tag2 +fi +git log $1...$2 --no-merges "$@" | grep ^Author: | sed 's/ <.*//; s/^Author: //' | sort | uniq -c | sed 's/\s*[0-9][0-9]*\(.*\)/-\1/g' From b8aeefec163ebe8fc5755d37ec9bd6439984f93d Mon Sep 17 00:00:00 2001 From: arturo castro Date: Wed, 14 Nov 2018 15:33:22 +0100 Subject: [PATCH 11/18] changelog and thanks scripts --- scripts/dev/changelog.sh | 5 +++++ scripts/dev/thanks.sh | 5 +++++ 2 files changed, 10 insertions(+) create mode 100755 scripts/dev/changelog.sh create mode 100755 scripts/dev/thanks.sh diff --git a/scripts/dev/changelog.sh b/scripts/dev/changelog.sh new file mode 100755 index 00000000000..29e8c5d9245 --- /dev/null +++ b/scripts/dev/changelog.sh @@ -0,0 +1,5 @@ +if [ $# -ne 2 ]; then + echo Error: wrong number of arguments + echo Usage: ./thanks.sh tag1 tag2 +fi +git log $1...$2 --no-merges --pretty=format:'- %s [commit](https://github.com/openframeworks/openFrameworks/commit/%H)' --reverse | sed 's/^\s*[0-9][0-9]*\s\(.*\)$/- \1/g' \ No newline at end of file diff --git a/scripts/dev/thanks.sh b/scripts/dev/thanks.sh new file mode 100755 index 00000000000..8df89d2529a --- /dev/null +++ b/scripts/dev/thanks.sh @@ -0,0 +1,5 @@ +if [ $# -ne 2 ]; then + echo Error: wrong number of arguments + echo Usage: ./thanks.sh tag1 tag2 +fi +git log $1...$2 --no-merges "$@" | grep ^Author: | sed 's/ <.*//; s/^Author: //' | sort | uniq -c | sed 's/\s*[0-9][0-9]*\(.*\)/-\1/g' From 3ad6019824748f6a6f6dd5ee54b8dcefee2a3dd3 Mon Sep 17 00:00:00 2001 From: arturo castro Date: Wed, 14 Nov 2018 15:35:16 +0100 Subject: [PATCH 12/18] ofConstants: 0.10.2 --- libs/openFrameworks/utils/ofConstants.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/openFrameworks/utils/ofConstants.h b/libs/openFrameworks/utils/ofConstants.h index 41159594296..1721adcb0ab 100644 --- a/libs/openFrameworks/utils/ofConstants.h +++ b/libs/openFrameworks/utils/ofConstants.h @@ -4,8 +4,8 @@ //------------------------------- #define OF_VERSION_MAJOR 0 #define OF_VERSION_MINOR 10 -#define OF_VERSION_PATCH 1 -#define OF_VERSION_PRE_RELEASE "stable" +#define OF_VERSION_PATCH 2 +#define OF_VERSION_PRE_RELEASE "patch-release" // Set to 1 for compatibility with old projects using ofVec instead of glm #ifndef OF_USE_LEGACY_VECTOR_MATH From 503b805ce5a6405307dc3349a67730f80377c62f Mon Sep 17 00:00:00 2001 From: Hiroshi Matoba Date: Fri, 14 Dec 2018 15:07:21 +0100 Subject: [PATCH 13/18] add additional constructor to ofParameter to be able to set serializable via initializer list --- libs/openFrameworks/types/ofParameter.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/libs/openFrameworks/types/ofParameter.h b/libs/openFrameworks/types/ofParameter.h index 9e36af034f2..94a5c0bdc79 100644 --- a/libs/openFrameworks/types/ofParameter.h +++ b/libs/openFrameworks/types/ofParameter.h @@ -484,6 +484,7 @@ class ofParameter: public ofAbstractParameter{ ofParameter(const ParameterType & v); ofParameter(const std::string& name, const ParameterType & v); ofParameter(const std::string& name, const ParameterType & v, const ParameterType & min, const ParameterType & max); + ofParameter(const std::string& name, const ParameterType & v, const ParameterType & min, const ParameterType & max, bool serializable); const ParameterType & get() const; const ParameterType * operator->() const; @@ -616,6 +617,14 @@ class ofParameter: public ofAbstractParameter{ ,bInNotify(false) ,serializable(true){} + Value(std::string name, ParameterType v, ParameterType min, ParameterType max, bool serializable) + :name(name) + ,value(v) + ,min(min) + ,max(max) + ,bInNotify(false) + ,serializable(serializable){} + std::string name; ParameterType value; ParameterType min, max; @@ -661,6 +670,10 @@ ofParameter::ofParameter(const std::string& name, const Parameter :obj(std::make_shared(name, v, min, max)) ,setMethod(std::bind(&ofParameter::eventsSetValue, this, std::placeholders::_1)){} +template +ofParameter::ofParameter(const std::string& name, const ParameterType & v, const ParameterType & min, const ParameterType & max, bool serializable) +:obj(std::make_shared(name, v, min, max, serializable)) +,setMethod(std::bind(&ofParameter::eventsSetValue, this, std::placeholders::_1)){} template inline ofParameter & ofParameter::operator=(const ofParameter & v){ From 52e0e4b1335e055d8ae2476ec0aace39b6fe3d28 Mon Sep 17 00:00:00 2001 From: Hiroshi Matoba Date: Fri, 14 Dec 2018 15:08:01 +0100 Subject: [PATCH 14/18] add additional ofParameter::set to keep same style with its constructor --- libs/openFrameworks/types/ofParameter.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/libs/openFrameworks/types/ofParameter.h b/libs/openFrameworks/types/ofParameter.h index 94a5c0bdc79..63e9e685f28 100644 --- a/libs/openFrameworks/types/ofParameter.h +++ b/libs/openFrameworks/types/ofParameter.h @@ -558,6 +558,7 @@ class ofParameter: public ofAbstractParameter{ ofParameter & set(const ParameterType & v); ofParameter & set(const std::string& name, const ParameterType & v); ofParameter & set(const std::string& name, const ParameterType & v, const ParameterType & min, const ParameterType & max); + ofParameter & set(const std::string& name, const ParameterType & v, const ParameterType & min, const ParameterType & max, bool serializable); ofParameter & setWithoutEventNotifications(const ParameterType & v); @@ -702,6 +703,16 @@ ofParameter & ofParameter::set(const std::string& return *this; } +template +ofParameter & ofParameter::set(const std::string& name, const ParameterType & value, const ParameterType & min, const ParameterType & max, bool serializable){ + setName(name); + set(value); + setMin(min); + setMax(max); + setSerializable(serializable); + return *this; +} + template ofParameter & ofParameter::set(const std::string& name, const ParameterType & value){ setName(name); From 463692e1032a284fd57c0946e5d8afe9476d1a51 Mon Sep 17 00:00:00 2001 From: Hiroshi Matoba Date: Fri, 14 Dec 2018 15:08:40 +0100 Subject: [PATCH 15/18] add additional constructor to ofReadonlyParameter to be able to set serializable via initializer list --- libs/openFrameworks/types/ofParameter.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libs/openFrameworks/types/ofParameter.h b/libs/openFrameworks/types/ofParameter.h index 63e9e685f28..60a497fc28d 100644 --- a/libs/openFrameworks/types/ofParameter.h +++ b/libs/openFrameworks/types/ofParameter.h @@ -1102,6 +1102,7 @@ class ofReadOnlyParameter: public ofAbstractParameter{ ofReadOnlyParameter(const ParameterType & v); ofReadOnlyParameter(const std::string& name, const ParameterType & v); ofReadOnlyParameter(const std::string& name, const ParameterType & v, const ParameterType & min, const ParameterType & max); + ofReadOnlyParameter(const std::string& name, const ParameterType & v, const ParameterType & min, const ParameterType & max, bool serializable); const ParameterType & get() const; const ParameterType * operator->() const; @@ -1226,6 +1227,9 @@ template inline ofReadOnlyParameter::ofReadOnlyParameter(const std::string& name, const ParameterType & v, const ParameterType & min, const ParameterType & max) :parameter(name,v,min,max){} +template +inline ofReadOnlyParameter::ofReadOnlyParameter(const std::string& name, const ParameterType & v, const ParameterType & min, const ParameterType & max, bool serializable) +:parameter(name,v,min,max,serializable){} template inline const ParameterType & ofReadOnlyParameter::get() const{ From 890748e500504d261c4354330ba809549bc158c4 Mon Sep 17 00:00:00 2001 From: Hiroshi Matoba Date: Fri, 14 Dec 2018 15:09:17 +0100 Subject: [PATCH 16/18] add additional ofReadOnlyParameter::set to keep same style with its constructor --- libs/openFrameworks/types/ofParameter.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libs/openFrameworks/types/ofParameter.h b/libs/openFrameworks/types/ofParameter.h index 60a497fc28d..481f472d29c 100644 --- a/libs/openFrameworks/types/ofParameter.h +++ b/libs/openFrameworks/types/ofParameter.h @@ -1177,6 +1177,7 @@ class ofReadOnlyParameter: public ofAbstractParameter{ ofReadOnlyParameter& set(const std::string& name, const ParameterType & value); ofReadOnlyParameter& set(const std::string& name, const ParameterType & value, const ParameterType & min, const ParameterType & max); + ofReadOnlyParameter& set(const std::string& name, const ParameterType & value, const ParameterType & min, const ParameterType & max, bool serializable); void setMin(const ParameterType & min); void setMax(const ParameterType & max); @@ -1468,6 +1469,11 @@ inline ofReadOnlyParameter & ofReadOnlyParameter +inline ofReadOnlyParameter & ofReadOnlyParameter::set(const std::string& name, const ParameterType & value, const ParameterType & min, const ParameterType & max, bool serializable){ + parameter.set(name,value,min,max,serializable); + return *this; +} template inline void ofReadOnlyParameter::setMin(const ParameterType & min){ From 7fc9b3d3bed3eea9cf607295ea5c7b4649a067a9 Mon Sep 17 00:00:00 2001 From: Hiroshi Matoba Date: Fri, 14 Dec 2018 15:57:41 +0100 Subject: [PATCH 17/18] add more constructor to support ofParameter --- libs/openFrameworks/types/ofParameter.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/libs/openFrameworks/types/ofParameter.h b/libs/openFrameworks/types/ofParameter.h index 481f472d29c..df39d5c30b9 100644 --- a/libs/openFrameworks/types/ofParameter.h +++ b/libs/openFrameworks/types/ofParameter.h @@ -483,6 +483,7 @@ class ofParameter: public ofAbstractParameter{ ofParameter(const ofParameter & v); ofParameter(const ParameterType & v); ofParameter(const std::string& name, const ParameterType & v); + ofParameter(const std::string& name, const ParameterType & v, bool serializable); ofParameter(const std::string& name, const ParameterType & v, const ParameterType & min, const ParameterType & max); ofParameter(const std::string& name, const ParameterType & v, const ParameterType & min, const ParameterType & max, bool serializable); @@ -610,6 +611,14 @@ class ofParameter: public ofAbstractParameter{ ,bInNotify(false) ,serializable(true){} + Value(std::string name, ParameterType v, bool serializable) + :name(name) + ,value(v) + ,min(of::priv::TypeInfo::min()) + ,max(of::priv::TypeInfo::max()) + ,bInNotify(false) + ,serializable(serializable){} + Value(std::string name, ParameterType v, ParameterType min, ParameterType max) :name(name) ,value(v) @@ -666,6 +675,11 @@ ofParameter::ofParameter(const std::string& name, const Parameter :obj(std::make_shared(name, v)) ,setMethod(std::bind(&ofParameter::eventsSetValue, this, std::placeholders::_1)){} +template +ofParameter::ofParameter(const std::string& name, const ParameterType & v, bool serializable) +:obj(std::make_shared(name, v, serializable)) +,setMethod(std::bind(&ofParameter::eventsSetValue, this, std::placeholders::_1)){} + template ofParameter::ofParameter(const std::string& name, const ParameterType & v, const ParameterType & min, const ParameterType & max) :obj(std::make_shared(name, v, min, max)) From 44363ebebc47b20e5df2686fc1f97e0a6f97df7e Mon Sep 17 00:00:00 2001 From: Hiroshi Matoba Date: Fri, 14 Dec 2018 15:58:00 +0100 Subject: [PATCH 18/18] add more constructor to support ofReadOnlyParameter --- libs/openFrameworks/types/ofParameter.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libs/openFrameworks/types/ofParameter.h b/libs/openFrameworks/types/ofParameter.h index df39d5c30b9..1d19927d649 100644 --- a/libs/openFrameworks/types/ofParameter.h +++ b/libs/openFrameworks/types/ofParameter.h @@ -1115,6 +1115,7 @@ class ofReadOnlyParameter: public ofAbstractParameter{ // ofReadOnlyParameter(ofReadOnlyParameter & p); ofReadOnlyParameter(const ParameterType & v); ofReadOnlyParameter(const std::string& name, const ParameterType & v); + ofReadOnlyParameter(const std::string& name, const ParameterType & v, bool serializable); ofReadOnlyParameter(const std::string& name, const ParameterType & v, const ParameterType & min, const ParameterType & max); ofReadOnlyParameter(const std::string& name, const ParameterType & v, const ParameterType & min, const ParameterType & max, bool serializable); @@ -1238,6 +1239,10 @@ template inline ofReadOnlyParameter::ofReadOnlyParameter(const std::string& name, const ParameterType & v) :parameter(name,v){} +template +inline ofReadOnlyParameter::ofReadOnlyParameter(const std::string& name, const ParameterType & v, bool serializable) +:parameter(name,v, serializable){} + template inline ofReadOnlyParameter::ofReadOnlyParameter(const std::string& name, const ParameterType & v, const ParameterType & min, const ParameterType & max) :parameter(name,v,min,max){}