Go Back   Cockos Incorporated Forums > REAPER Forums > REAPER Feature Requests

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Old 07-06-2019, 10:47 AM   #1
mespotine
Human being with feelings
 
mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig, Germany
Posts: 2,130
Default WalterTheme&API: Custom Buttons, Textfields, Sliders, etc.

Time and again, I run into the wish of having the ability to add my own custom-buttons/sliders/etc to my theme.
For instance, I have a set of vst-plugins, that I would love to load by clicking a button on a track or add other nice and important stuff to the Transport-panel.
Especially with the new scripting-possibilities using the theme-layout-functions and the massive changes for Reaper v6, this would be another killer customize feature.

How I think it could be done.

Theme
You can add, let's say, up to 32 custom-elements to a Theme-element.
In the rt-config, a button and a caption could be added to a track like:
Code:
 tcp.custom1 "button" x y w h
 tcp.custom2 "caption=This is a button" x y w h
 tcp.custom2 "slider=minval,maxval,default,stepsize" x y w h
So it's
themelement.customxxx "type of element like button, slider, etc" x y width height

themeelement is the usual themeelements Walter supports like mcp, tcp, trans, etc

This could be themed as all other theme-elements(buttons, captions), but with the difference, that they're not "linked" to a feature/an action by default.

Set and Action to this theme-element
Now, how can we trigger scripts/actions. For that I would suggest to treat them like shortcuts.
So I go into the ActionList-window, select an action, select AddShortcut and when the dialog opens which asks for the shortcut, you click on the custom-element(in our case, the clickable button).
So everytime the button gets clicked, it will run the associated action with it.

Scripting/coding the action behind the theme-element
Now, how to program the scripts behind that.
I would suggest a new function "get_action_context2", which returns:
custom_theme_elementname - like tcp.custom1
object_id - the track/obejct number, in which one clicked the button/etc.
min_value - the minimum value for this element
max_value - the maximum value for this element
current value - 0,1 for buttons, min_value to max_value for buttons

With that, this could be codeable in a quite extensive way and would help us tons.


This is my current idea, how this could be done, but I'm open for better ones that could do things even easier for devs, scripters, themers and users.
__________________
Use she/her, when contacting me, please. Thanks :) Not mentoring via PMs, sorry.
Ultraschall-API - 1200 ReaScript functions for Reaper - Reaper Internals - Developerdocs4Reaper - Donate, if you want

Last edited by mespotine; 03-31-2020 at 03:31 PM.
mespotine is offline   Reply With Quote
 

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 04:00 AM.


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