Skip to content

Conversation

@hiroMTB
Copy link
Contributor

@hiroMTB hiroMTB commented Dec 14, 2018

Right now we are able to initialize ofParameter like below in ofApp.h.

ofParameter<int>  fps{"FPS", 0, 0, 120};
ofParameter<bool> bFullscreen{"Fullscreen", false};
ofParameterGroup  grp{"general settings", fps, bFullscreen};

The first parameter (e.g. "FPS") is the name of parameter then initial value, min and max.
This is very useful because we can write in header file and reduce code in ofApp.cpp file.
I'm using this often in my project since I found this syntax in Entropy project(for example here),

It would be nicer if we could initialize "serializable" variable as well in same manner. With this PR we can write this way and reduce .setSerializable(false) in ofApp.cpp to avoid saving parameter to xml (or json).

ofParameter<int>  fps{"FPS", 0, 0, 120, false};
ofParameter<bool> bFullscreen{"Fullscreen", false, false};
ofParameterGroup  grp{"general settings", fps, bFullscreen};

*Same to ofReadOnlyParameter

arturoc and others added 25 commits October 31, 2018 17:35
Fix to the Xcode template making PG work with certain addons.
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
Fixes openframeworks#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.
ofSoundBuffer::checkSizeAndChannelsConsistency is crashing when calling ofSoundBuffer::getChannel with channels = 1
@hiroMTB hiroMTB closed this Dec 14, 2018
@hiroMTB
Copy link
Contributor Author

hiroMTB commented Dec 14, 2018

This PR is closed because of wrong target branch, please refer to this one instead #6195

@hiroMTB hiroMTB deleted the feature-ofParameter-useful-constructor branch December 21, 2023 22:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants