Go Back   Cockos Incorporated Forums > REAPER Forums > REAPER Pre-Release Discussion

Reply
 
Thread Tools Display Modes
Old 09-16-2023, 02:13 AM   #1
smandrap
Human being with feelings
 
smandrap's Avatar
 
Join Date: Feb 2021
Location: Right here
Posts: 1,086
Default WALTER custom elements in default 7 theme

Hi,

I am curious about how the new custom buttons/blocks are used in the default 7 theme (if they are used at all). I’m not experienced in WALTER, and the 1500+ lines of rtconfig are quite daunting to decipher

@White Tie if you have spare time could you share how you leveraged this feature with the new theme? Did they help achieving something you weren’t able to do before? For curiosity’s sake only

Sorry for bad English

Last edited by White Tie; 09-16-2023 at 07:45 AM.
smandrap is offline   Reply With Quote
Old 09-16-2023, 04:17 AM   #2
White Tie
Pixel Pusher
 
White Tie's Avatar
 
Join Date: Mar 2007
Location: Blighty
Posts: 4,903
Default

The v7 theme is built with extensive use of the new custom elements, which have made a huge difference.

Replacing Images
Lots and lots of things that were images in previous themes are now custom elements - rectangles of colour created and managed by WALTER. I did a big push in v6 to reduce the image count, because of HiDPI but also to make modding easier, and this the next level of that because I've not needed to use many (nearly all?) of the '_bg' images.

New Images
Things like the little 'selection dot' I have previously had to do as part of index_bg, so it swaps image on selection, and then jump through hoops to get it centred. That's now just two little images, by my choice, independently positioned and swapped by WALTER and reused across TCP and MCP. And as it happens I'm not using index bg at all, I did that as a re-colourable custom element as well. For theme making this is the end of a lot of hacks we've been doing for years, for which I almost shed a nostalgic tear.

Code control
So, they're just rectangles of colour created and managed by WALTER. So the theme can change things that were previously fixed, and the adjuster script can tell them how. That's why there are now sliders for everything : background colour, custom colour depth, selection strength ...and even on the Env panel, which didn't have custom colour before.

Development Help
You may not directly feel the benefit of this, but being able to use the custom elements as guides for planning and managing WALTER has been huge, and along with the new error checking is why I've been able to do lots of the really complicated stuff I've been doing with the theme and how it interacts with the theme adjuster. You can turn on 'visualise sections' in the dubugging box (in Global) to see that sort of thing.

I also use them to make little graphs on each panel to indicate WALTER values when I'm debugging, which is new and a big help.



...and yes, also...


...yeah, custom buttons I suppose, but I want to really downplay this because it seems to be something people have really grasped onto as the answer to all their dreams. Maybe that's true, but the reality is custom elements can fire of actions, and if so use a three state image. I've experimented and had some fun, but haven't found a use for them yet and its not because I'm being a big old meanie.
__________________
The House of White Tie
White Tie is offline   Reply With Quote
Old 09-16-2023, 05:14 AM   #3
smandrap
Human being with feelings
 
smandrap's Avatar
 
Join Date: Feb 2021
Location: Right here
Posts: 1,086
Default

Thanks for your reply.

It seems like it was indeed a big thing !
Do you plan on writing a little bit about how to work with this stuff in the future?

I feel that this will open a lot of new possibilities for themers (as you already said) but it’s a somewhat hidden thing, so maybe it would be beneficial to have some sort of “tutorial” which highlights some of the more complicated stuff in the default theme.

Or maybe it’s easier than I think and I just can’t cope with Walter
smandrap is offline   Reply With Quote
Old 09-16-2023, 06:25 AM   #4
lexaproductions
Human being with feelings
 
Join Date: Jan 2013
Posts: 1,125
Default

So it is now possible to use three states buttons on custom buttons? Is it documented somewhere how it is implemented?
lexaproductions is offline   Reply With Quote
Old 09-16-2023, 06:49 AM   #5
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,578
Default

Quote:
Originally Posted by lexaproductions View Post
So it is now possible to use three states buttons on custom buttons? Is it documented somewhere how it is implemented?
Would love to know as well.

And tutorials for the other new things with minimal code/theme examples would be awesome, as the new addition seem to be quite powerful.
If one knows how to use them..
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Old 09-16-2023, 07:18 AM   #6
smandrap
Human being with feelings
 
smandrap's Avatar
 
Join Date: Feb 2021
Location: Right here
Posts: 1,086
Default

Quote:
Originally Posted by lexaproductions View Post
So it is now possible to use three states buttons on custom buttons? Is it documented somewhere how it is implemented?
Yes but it's only normal, hover, click i think. When it fires the action it returns to the normal state.
smandrap is offline   Reply With Quote
Old 09-16-2023, 08:08 AM   #7
White Tie
Pixel Pusher
 
White Tie's Avatar
 
Join Date: Mar 2007
Location: Blighty
Posts: 4,903
Default

I hope you don't mind, I've changed the name of the thread from 'buttons' to 'elements', since I haven't used that side of it (I did, but removed it) and its a word that inflames many flights of fancy, followed by crashing disappointment. Let's not have any disappointment about what they aren't, because what these things are is awesome.

Custom elements are still in pre-release, so their documentation is the change logs:
Code:
+ WALTER: create custom elements by using "custom tcp.custom.xyz [label] [action ID] [accessibility description]" in layouts
+ WALTER: allow custom elements to reference theme images and be normal buttons, using: custom mcp.custom.foo "Text Desc" command_id "accessibility_string" "image_name"
Mostly I've just created a custom WALTER element just as an element:
Code:
custom tcp.custom.myCustomElement
..but it could also have a background image...
Code:
custom tcp.custom.myCustomElement '' 0 '' 'fileNameOfPngImage'
And give it properties :
Code:
set tcp.custom.myCustomElement [0 0 20 10]
set tcp.custom.myCustomElement.color [0 0 0 255 150 150 150 255]
Color is standard WALTER : first four numbers RGBA of the text, second four numbers RGBA of the background rectangle, which is the bit I've mostly used.

And that's all of it. There's nothing more complicated than that in the Default 7 theme, just add lots of messing with those values of the elements by WALTER and scripting.
__________________
The House of White Tie
White Tie is offline   Reply With Quote
Old 09-16-2023, 08:36 AM   #8
smandrap
Human being with feelings
 
smandrap's Avatar
 
Join Date: Feb 2021
Location: Right here
Posts: 1,086
Default

No problem for the title

So for example, the track selection indicator is a custom element right? How did you manage to make it a circle?

EDIT: that was a VERY dumb question, I figured it out


Sorry to bother you with dumb questions, just a lot curious
smandrap is offline   Reply With Quote
Old 09-16-2023, 11:09 AM   #9
lexaproductions
Human being with feelings
 
Join Date: Jan 2013
Posts: 1,125
Default

Quote:
Originally Posted by White Tie View Post
And that's all of it. There's nothing more complicated than that in the Default 7 theme, just add lots of messing with those values of the elements by WALTER and scripting.
Thanks for this explanation. By looking at your WALTER and your LUA code, I think I understood a few things. My need is to simply add functions to the already existing Transport buttons. Like when I press the repeat button, I want an extra script to be triggered. But I want to keep the Highlighted button when Repeat is on.
I just tried to setup my custom button on top of the current Repeat button but it appears to be either one or the other. Pushing it won't trigger my script. Do you have a suggestion?
lexaproductions is offline   Reply With Quote
Old 09-16-2023, 11:15 AM   #10
White Tie
Pixel Pusher
 
White Tie's Avatar
 
Join Date: Mar 2007
Location: Blighty
Posts: 4,903
Default

Top thing gets the click, so no, I think you'd need to do a really annoying thing where your script also toggled Reaper's repeat state. Sounds messy.
__________________
The House of White Tie
White Tie is offline   Reply With Quote
Old 09-16-2023, 11:19 AM   #11
lexaproductions
Human being with feelings
 
Join Date: Jan 2013
Posts: 1,125
Default

Quote:
Originally Posted by White Tie View Post
Top thing gets the click, so no, I think you'd need to do a really annoying thing where your script also toggled Reaper's repeat state. Sounds messy.
Actually, that's no problem to trigger Reaper's state. But it won't help me as I wanted to trigger a button and have it reflect a state at the same time. I guess I can assume it just can't be done at the moment?

To me that's the biggest gain to this custom functionality.

EDIT:
What makes it a "Top thing"? I tried to change the order in WALTER but it seems as if REAPER's stock command always wins over my script.
lexaproductions is offline   Reply With Quote
Old 09-17-2023, 09:12 AM   #12
Phazma
Human being with feelings
 
Join Date: Jun 2019
Posts: 2,872
Default

Quote:
Originally Posted by lexaproductions View Post
So it is now possible to use three states buttons on custom buttons? Is it documented somewhere how it is implemented?
Sadly three state buttons are not currently possible with “custom element”. I hope devs will give us this option at some point so this feature can become useful as buttons too, something many people hoped for.
Phazma is offline   Reply With Quote
Old 10-27-2023, 04:19 AM   #13
gapalil001
Human being with feelings
 
gapalil001's Avatar
 
Join Date: May 2016
Location: Kyiv, Ukraine
Posts: 539
Default

unfortunately, can't force REAPER to load images for custom commands from 150 and 200 folders, seems that it's broken for dpi translation layouts. any ideas?

[copypaste from pre-release thread]

[edited] seems that the custom command image name does not obey the layout folder:

Code:
      layout "Default 200" "200"
looks like a bug to me

[edited x2]
the workaround is to use macro in image name with "/"
Code:
macro DrawTCP scale layoutfolder
custom tcp.custom.command  " " none " " layoutfolder/tcp_command_bg
endmacro

layout "TCP 200"
DrawTCP 2 200
endlayout
but keep in mind that the default layout (layout "") should be below others

Last edited by gapalil001; 10-28-2023 at 03:09 AM.
gapalil001 is offline   Reply With Quote
Old 10-29-2023, 04:27 PM   #14
Justin
Administrator
 
Justin's Avatar
 
Join Date: Jan 2005
Location: NYC
Posts: 15,704
Default

Quote:
seems that the custom command image name does not obey the layout folder:
hmm, it seems to be working here. e.g., take the default 7 theme, go to the "set tcp.size" line, add this after it:
Code:
custom tcp.custom.test "" 0 "" customimagename
set tcp.custom.test [0 0 270 90]
front tcp.custom.test
If I copy track_mute_on.png to customimagename.png in each path, it clearly uses the 200/ one when on the 200% layout, etc.

If 200/customimagename.png does not exist, then it uses the root png.

Last edited by Justin; 10-29-2023 at 04:34 PM.
Justin is offline   Reply With Quote
Old 10-30-2023, 10:22 AM   #15
gapalil001
Human being with feelings
 
gapalil001's Avatar
 
Join Date: May 2016
Location: Kyiv, Ukraine
Posts: 539
Default

Quote:
Originally Posted by Justin View Post
hmm, it seems to be working here. e.g., take the default 7 theme, go to the "set tcp.size" line, add this after it:
Code:
custom tcp.custom.test "" 0 "" customimagename
set tcp.custom.test [0 0 270 90]
front tcp.custom.test
If I copy track_mute_on.png to customimagename.png in each path, it clearly uses the 200/ one when on the 200% layout, etc.

If 200/customimagename.png does not exist, then it uses the root png.
looking to default theme rtconfig seems that all works as expected in it, i have 2 questions:
- Could my issue be caused by forgetting to change "version 6" to "version 7" on the header?
- as you probably noticed, I use "" instead of '' and do not use them at all for image names. can it also break something?
gapalil001 is offline   Reply With Quote
Old 10-30-2023, 12:02 PM   #16
Justin
Administrator
 
Justin's Avatar
 
Join Date: Jan 2005
Location: NYC
Posts: 15,704
Default

Quote:
Originally Posted by gapalil001 View Post
looking to default theme rtconfig seems that all works as expected in it, i have 2 questions:
- Could my issue be caused by forgetting to change "version 6" to "version 7" on the header?
Should not matter.

Quote:

- as you probably noticed, I use "" instead of '' and do not use them at all for image names. can it also break something?
Also shouldn't matter... if you want to post a minimal test theme that does not work right in this respect, I'd be happy to look at why...
Justin is offline   Reply With Quote
Old 10-30-2023, 12:48 PM   #17
gapalil001
Human being with feelings
 
gapalil001's Avatar
 
Join Date: May 2016
Location: Kyiv, Ukraine
Posts: 539
Default

Quote:
Originally Posted by Justin View Post
Also shouldn't matter... if you want to post a minimal test theme that does not work right in this respect, I'd be happy to look at why...
thanks, Justin. Unfortunately, only the complete theme with an already implemented workaround. I can remove macro and send the theme archive if you don't mind, or if it will work I can just reply here

here is an theme demo

example custom commands lines are 545-552

Code:
            custom tcp.custom.folderlabel    " " 0 " "      'tcp_folder_namebg'
            custom tcp.custom.folderlabelsel " " 0 " "      'tcp_folder_namebg_sel'

            custom tcp.custom.colorbg        " " 0 " "      'tcp_color_bg'
            custom tcp.custom.colorbgsel     " " 0 " "      'tcp_color_bgsel'

            custom tcp.custom.greybg         " " 0 " "      'tcp_grey_bg'
            custom tcp.custom.greybgsel      " " 0 " "      'tcp_grey_bgsel'

Last edited by gapalil001; 10-30-2023 at 01:13 PM.
gapalil001 is offline   Reply With Quote
Old 10-30-2023, 04:34 PM   #18
Justin
Administrator
 
Justin's Avatar
 
Join Date: Jan 2005
Location: NYC
Posts: 15,704
Default

Quote:
Originally Posted by gapalil001 View Post
thanks, Justin. Unfortunately, only the complete theme with an already implemented workaround. I can remove macro and send the theme archive if you don't mind, or if it will work I can just reply here

here is an theme demo

example custom commands lines are 545-552

Code:
            custom tcp.custom.folderlabel    " " 0 " "      'tcp_folder_namebg'
            custom tcp.custom.folderlabelsel " " 0 " "      'tcp_folder_namebg_sel'

            custom tcp.custom.colorbg        " " 0 " "      'tcp_color_bg'
            custom tcp.custom.colorbgsel     " " 0 " "      'tcp_color_bgsel'

            custom tcp.custom.greybg         " " 0 " "      'tcp_grey_bg'
            custom tcp.custom.greybgsel      " " 0 " "      'tcp_grey_bgsel'
edit again: fixing, thank you!

Last edited by Justin; 10-30-2023 at 08:11 PM.
Justin is offline   Reply With Quote
Old 10-31-2023, 12:49 AM   #19
gapalil001
Human being with feelings
 
gapalil001's Avatar
 
Join Date: May 2016
Location: Kyiv, Ukraine
Posts: 539
Default

Quote:
Originally Posted by Justin View Post
edit again: fixing, thank you!
Wow, great, Thank You!
gapalil001 is offline   Reply With Quote
Old 11-07-2023, 02:24 AM   #20
Win Conway
Human being with feelings
 
Join Date: Dec 2010
Posts: 3,825
Default

Quote:
Originally Posted by Phazma View Post
Sadly three state buttons are not currently possible with “custom element”. I hope devs will give us this option at some point so this feature can become useful as buttons too, something many people hoped for.
Yeah this was a big feature for me in V7, and it wasn't what I thought it was haha, if it turns in to custom buttons it would be nice for sure.
__________________
Stop posting huge images, smaller images or thumbnail, it's not rocket science!
Win Conway is offline   Reply With Quote
Old 11-07-2023, 05:15 AM   #21
lexaproductions
Human being with feelings
 
Join Date: Jan 2013
Posts: 1,125
Default

Quote:
Originally Posted by Win Conway View Post
Yeah this was a big feature for me in V7, and it wasn't what I thought it was haha, if it turns in to custom buttons it would be nice for sure.
+1. Still praying for this.
lexaproductions is offline   Reply With Quote
Old 12-03-2023, 03:38 AM   #22
Vagelis
Human being with feelings
 
Vagelis's Avatar
 
Join Date: Oct 2017
Location: Larisa, Greece
Posts: 3,753
Default

Could someone explain please where and what I should add in rtconfig.txt to show a fixed lanes button?
Vagelis 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 11:06 PM.


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