Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detect which slider was last selected/used #32

Open
yatara-visuals opened this issue Oct 1, 2020 · 3 comments
Open

Detect which slider was last selected/used #32

yatara-visuals opened this issue Oct 1, 2020 · 3 comments

Comments

@yatara-visuals
Copy link

Hi!

First of all thanks a lot for this awesome addon. I wish to be able to click a slider and then automatically through a hotkey assign its parameter to another automatically varying value (sound volume, bpm, etc). Typically looking for a method like gui.getLastUsedSlider() returning the ofParameter in question. Is there currently a way to do it this way or another way? Thank you so much in advance for your answer!

@NickHardeman
Copy link
Collaborator

Hello,
Interesting thought. If you are using midi, you might want to check out
https://github.com/NickHardeman/ofxMidiParams
It is less robust than ofxContolPanel, so it might not meet all your needs. We just pushed up to ofxControlPanel adding some more features like enable, disable, etc via ofParameter.
Maybe an event that passes the parameter that has been selected in the gui?

@NickHardeman
Copy link
Collaborator

Just pushed up an event that passes the last clicked gui object. See these lines in the example:

void ofApp::onGuiSelectElement( shared_ptr<guiBaseObject>& aobj ) {
// aobj->value.paramGroup.get(0);
cout << "onGuiSelectElement :: " << aobj->name << " num params: " << aobj->value.paramGroup.size() << " | " << ofGetFrameNum() << endl;
ofAbstractParameter& tparam = gui.getParam( aobj );
cout << "onGuiSelectElement :: abstract param: " << tparam.getName() << " value: " << tparam << endl;
}

@yatara-visuals
Copy link
Author

So got a new job and never saw your answer until recently. Thanks a lot!
I've been trying to make it work for a few days now, but I still haven't figured it out. As I intend to automate several parameters to several patterns it seemed the cleanest would be to declare parameters as pointers, and change the addresses they point to to that of another parameter varying in the desired pattern. Do you have an idea on how i could access the underlying parameter of the last clicked gui object? Anyway, thanks for the support you brought me!

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

No branches or pull requests

2 participants