Go Back   Cockos Incorporated Forums > REAPER Forums > ReaScript, JSFX, REAPER Plug-in Extensions, Developer Forum

Reply
 
Thread Tools Display Modes
Old 11-20-2017, 07:11 PM   #1
pcartwright
Human being with feelings
 
Join Date: Jan 2009
Posts: 1,030
Default JSFX Slider Drop-down Options: Can the values be imported from a file?

Is it possible to populate the values of a JSFX slider drop-down from a text file?

A related question, is it then possible for the the number of drop-down values to be variable (i.e. a user updates the underlying file to add an option and the same option is added to the JSFX drop-down)?
pcartwright is offline   Reply With Quote
Old 11-21-2017, 03:18 AM   #2
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,875
Default

You an set slider/dropdown value with slider1 = value; where 1 is the index of the slider.
This means that sliders can be used to display infos, or to be populate by other data, but they have to be declared first.

You can so also populate from a file, as long as you can transpose at one point or another these values to integer or float numbers. You can say "Populate my dropdown with "My String" ", but you can declare a drodown which have an index for "My String" and have value in your file to make it switch to "My String" index.

https://www.reaper.fm/sdk/js/js.php#js_file
X-Raym is offline   Reply With Quote
Old 11-21-2017, 07:20 AM   #3
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 14,690
Default

Quote:
Originally Posted by pcartwright View Post
Is it possible to populate the values of a JSFX slider drop-down from a text file?
If you mean the text lines that are displayed to be chosen from by the drop-down button, I don't suppose that this is possible.

To do something like this you would need to write a GUI from scratch using the gfx functions. This is definitively doable, and I suppose there are some helpful libraries around.

-Michael
mschnell is offline   Reply With Quote
Old 11-21-2017, 10:10 PM   #4
pcartwright
Human being with feelings
 
Join Date: Jan 2009
Posts: 1,030
Default

Quote:
Originally Posted by mschnell View Post
If you mean the text lines that are displayed to be chosen from by the drop-down button, I don't suppose that this is possible.

To do something like this you would need to write a GUI from scratch using the gfx functions. This is definitively doable, and I suppose there are some helpful libraries around.

-Michael
Yes, this is what I meant. I'll look to get started with a GUI library.
pcartwright is offline   Reply With Quote
Old 11-21-2017, 10:11 PM   #5
pcartwright
Human being with feelings
 
Join Date: Jan 2009
Posts: 1,030
Default

Quote:
Originally Posted by X-Raym View Post
You can so also populate from a file, as long as you can transpose at one point or another these values to integer or float numbers. You can say "Populate my dropdown with "My String" ", but you can declare a drodown which have an index for "My String" and have value in your file to make it switch to "My String" index.

https://www.reaper.fm/sdk/js/js.php#js_file
Do you have an example of this in a JSFX? I'm not sure it would solve my particular need, but it might be handy for other projects.
pcartwright is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 03:34 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.