Welcome to %s forums

BrainModular Users Forum

Login Register

Update a param setting

Create your own modules in C++
Post Reply
23fx23
Member
Posts: 2545
Contact:

Unread post by 23fx23 » 15 Oct 2016, 00:19

Is it possible to change during the code a param setting.

for exemple let's say there is an output parameter as a ptDataField

onGetParamInfo it's set to a 3 digit float precision using
pParamInfo->Format = "%.3f";

then let's say on the code i later say i only need an integer precision, so something that would update it back to
Format = "%.0f"; for exemple

don't think it's possible yet but just wanna be sure to avoid searching^^

User avatar
oli_lab
Member
Posts: 1261
Location: Brittany, France
Contact:

Unread post by oli_lab » 15 Oct 2016, 10:22

probably not possible.
http://oli-lab.org

Win11 Ryzen9/32GB RAM - RME MADIFACE - SSL alpha link 4-16 - OSC capable interfaces

follow OLI_LAB adventures on Mastodon
@olivar_premier@mastodon.social

23fx23
Member
Posts: 2545
Contact:

Unread post by 23fx23 » 15 Oct 2016, 14:33

yes i tried a bit forcing a ongetparams but failed. anyway not big deal ..

by the way i dlike to format a float ie

1.23456 become

int 1
.x 1.2
.xx 1.23
.xx 2.235 ect

i found printf or setprecision commands in cpp usually refered to do that task but as far i i undestand it only affect a printed string representation of the float, not the float itself.

so what i do for now ie ie multiply input float by 10, round it, and then redivide by 10, or 100, 1000 ect depending whanted precision, that works but feel it's not the best way to proceed.
any ideas? Is there a cpp command to achieve this directly on the float itself?

User avatar
oli_lab
Member
Posts: 1261
Location: Brittany, France
Contact:

Unread post by oli_lab » 15 Oct 2016, 14:55

I do it the way you discribed.
http://oli-lab.org

Win11 Ryzen9/32GB RAM - RME MADIFACE - SSL alpha link 4-16 - OSC capable interfaces

follow OLI_LAB adventures on Mastodon
@olivar_premier@mastodon.social

Post Reply

Who is online

Users browsing this forum: No registered users and 40 guests