Old 11-04-2023, 07:13 AM   #1
smda123
Human being with feelings
 
Join Date: Nov 2021
Posts: 12
Default WALTER custom image ON / OFF?



I'm glad to see this new features added to WALTER



but when a toggle script is ON, custom button image is not change to ON state.
return to OFF state



I wish to keep it ON state like this.



Is there a way for this?
smda123 is offline   Reply With Quote
Old 11-04-2023, 07:33 AM   #2
mister happy
Human being with feelings
 
Join Date: Mar 2017
Location: in the moment
Posts: 497
Default

I would like to learn if this is possible as well.

For the sake of discussion, most buttons that display an On and OFF state have a pair of .png asset files such as *_ON.png and *_OFF.png.

It would be easy to provide the second .png if there was a possibility of making use of it.

Thank you.
mister happy is online now   Reply With Quote
Old 11-04-2023, 08:12 AM   #3
Sexan
Human being with feelings
 
Sexan's Avatar
 
Join Date: Jun 2009
Location: Croatia
Posts: 4,362
Default

It does not have state (of actions/scripts) so not possible
Sexan is offline   Reply With Quote
Old 11-05-2023, 02:14 PM   #4
Win Conway
Human being with feelings
 
Join Date: Dec 2010
Posts: 3,822
Default

That must be a bug surely?
I mean how often is a momentary button ever needed?
__________________
Stop posting huge images, smaller images or thumbnail, it's not rocket science!
Win Conway is offline   Reply With Quote
Old 11-06-2023, 06:31 AM   #5
Rednroll
Human being with feelings
 
Join Date: Jan 2006
Posts: 1,926
Default

Actions don't necessarily need to have separate on_off images to show if a button is in on_off status. Reaper seems to have an internal list of actions which defines if an action has an on_off toggle functionality or not. If it does, it remains on the 3rd image of the defined toolbar_*.png file when the action is in the on status. If that action hasn't been defined to be an on/off toggle, then it just briefly flashes the 3rd image of the button as shown instead. I haven't found a way to be able to modify or define if an action is an on/off toggle but maybe there is a way I have yet to identify. Therefore, I am currently assuming Reaper does this internally for each action. I would have to think, for us to make the best use of this custom button functionality, Reaper would need to allow the user to define if a button or action is an on/off toggle or not. Not only with the custom action buttons as being discussed but I've run into this in other instances where it would have been nice if I could define if an action is toggled on or off.
Rednroll is offline   Reply With Quote
Old 11-06-2023, 07:37 AM   #6
mister happy
Human being with feelings
 
Join Date: Mar 2017
Location: in the moment
Posts: 497
Default

Quote:
Originally Posted by Rednroll View Post
Actions don't necessarily need to have separate on_off images to show if a button is in on_off status...
Hi,
Good point. Thank you for pointing this out and clarifying the discussion.

For the sake of discussion, I made a quick demo of the standard TCP buttons using a variant of my Record Arm button as an example. I was curious and wanted to see if my assumptions matched what really happened. In my case, relying on, and remembering the shades of grey or red seemed less than definitive so I replaced the "R" letter I use on all the states with numbers 1,2 and 3.




I hope this helps further discussion about possible implementation.

Thank you.

Last edited by mister happy; 11-09-2023 at 07:56 PM.
mister happy is online now   Reply With Quote
Old 11-06-2023, 07:57 AM   #7
mister happy
Human being with feelings
 
Join Date: Mar 2017
Location: in the moment
Posts: 497
Default

Here is an example of the Toolbar On-Off function.

I know it displays the obvious, but I thought "hey, why not make it more obviouser?", so here it is:



Thank you!

Last edited by mister happy; 11-09-2023 at 07:56 PM.
mister happy is online now   Reply With Quote
Old 11-06-2023, 10:26 AM   #8
Rednroll
Human being with feelings
 
Join Date: Jan 2006
Posts: 1,926
Default

Similar to what mister_happy demonstrated.

I currently believe a button being able to "toggle" on/off is defined within the actual action you are trying to map to a custom button.

As an example, for the Action "Options: Toggle loop points linked to time selection", you will see when viewing that Action within the Action menu it shows a "State" which will toggle between ON and OFF. Some actions don't have a State defined as seen for example in the action Command ID 42196.

I have a single toolbar_*.png image assigned to the Action: "Options: Toggle loop points linked to time selection" and you can see how the button is displayed when the action is in the OFF state below.


When I press that toolbar button, it remains on the 3rd image of my assigned "toolbar_*.png" image when the state of the action changes to ON, as shown in the following image.


I haven't created any custom buttons within my theme yet to know for certain, but I'm envisioning it may work the same way as if the button was placed on a toolbar and will rely on if the action you are assigning to a custom button has a state defined within the action or not. So therefore, it will likely depend on which action you are mapping to a custom button if the button is capable of displaying an ON or OFF state or not. If the action doesn't have a state defined, then it likely can't be changed to show a button ON/OFF toggle.

Therefore without knowing what the script or action being used in the OP, we are unable to determine if this is a bug, a feature request, or a limitation of scripts, or a limitation of the particular script assigned to the custom button.

Last edited by Rednroll; 11-06-2023 at 02:08 PM.
Rednroll is offline   Reply With Quote
Old 11-14-2023, 04:04 AM   #9
Sexan
Human being with feelings
 
Sexan's Avatar
 
Join Date: Jun 2009
Location: Croatia
Posts: 4,362
Default

Its not a bug, this was discussed before. In order for walter to "know" the state of action it would needs to be aware of whole actions list and their state constantly (which it is not).

Here you are simple passing "run this" and walter just triggers command to run it.
Sexan is offline   Reply With Quote
Old 11-16-2023, 02:53 AM   #10
Win Conway
Human being with feelings
 
Join Date: Dec 2010
Posts: 3,822
Default

Why?
Just allow the theme developer to define if it is momentary or not.
There is no reason at all that WALTER needs to know anything, that is the theme developers job.
__________________
Stop posting huge images, smaller images or thumbnail, it's not rocket science!
Win Conway is offline   Reply With Quote
Old 11-16-2023, 04:41 AM   #11
Sexan
Human being with feelings
 
Sexan's Avatar
 
Join Date: Jun 2009
Location: Croatia
Posts: 4,362
Default

And if you set that way for example, how would walter know is it currently off or on? On maybe off or off can be on. What if you change its state via action or script? Whats then off or on for walter?

It needs to know the current state from actions and also update the state (of the action/script) when changed from walter

Last edited by Sexan; 11-16-2023 at 04:58 AM.
Sexan is offline   Reply With Quote
Old 11-19-2023, 09:52 AM   #12
Win Conway
Human being with feelings
 
Join Date: Dec 2010
Posts: 3,822
Default

So couldn't it be a new type of Macro, create the macro, with a tick box as "UI Only"
That way it is oblivious to any scripting, it is for UI use only.
To be honest I dont really get the "How does WALTER know what state it is in" Reapers theming already has non momentary controls, so it has to be doable.
__________________
Stop posting huge images, smaller images or thumbnail, it's not rocket science!
Win Conway is offline   Reply With Quote
Old 11-19-2023, 11:13 AM   #13
Sexan
Human being with feelings
 
Sexan's Avatar
 
Join Date: Jun 2009
Location: Croatia
Posts: 4,362
Default

Quote:
Originally Posted by Win Conway View Post
So couldn't it be a new type of Macro, create the macro, with a tick box as "UI Only"
That way it is oblivious to any scripting, it is for UI use only.
To be honest I dont really get the "How does WALTER know what state it is in" Reapers theming already has non momentary controls, so it has to be doable.
1. Action you want to manipulate is currently "OFF" in action list (its state is "off")
2. You press the button on TCP for that walter action to run it
3. Now that Action becomes "ON" (in action list its state is "on")

Lets just imagine at the moment there are on/off pictures

4. The Button on TCP is Lit(its "on")
5. You run that action again but not from TCP button, but from lets say script or action list, Toolbar whatever
6. Button in TCP is lit(ON) since step 2. but action is currently OFF (action list state "off") since step 5.
7. TCP is showing ON but action is OFF

Do you get it now?
Sexan is offline   Reply With Quote
Old 11-19-2023, 11:24 AM   #14
Sexan
Human being with feelings
 
Sexan's Avatar
 
Join Date: Jun 2009
Location: Croatia
Posts: 4,362
Default

The workaround can be made, but will be complicated since involves custom script and additional walter code:

1. Add walter parameter entry for that specific action/button (state on off)
2. Add walter code that will swap images based on that parameter
3. Custom script that will call that action via MainOnCommand
4. Get the state of that action
5. Update that entry in walter from that same script based on current state
5. walter should now show proper on/off image
Sexan is offline   Reply With Quote
Old 11-20-2023, 03:38 PM   #15
Win Conway
Human being with feelings
 
Join Date: Dec 2010
Posts: 3,822
Default

Like i said, have an option in macros “UI only” so that registers the action as only actionable by a UI (WALTER) button.
I doubt most of the things that people want to add as custom buttons would be useful in scripts if they had custom button operation anyway.

Yeah i get that it would still be possible to change the original action elsewere and screw up the state, but lets not kid around like there are already ten thousand issues like this in Reaper we all work around daily.
I have this exact issue with my explorer/plugin browser view buttons for example, but we deal witn these issues and just workaround them to get the configuration that fits us.

Just seems like a strange decision to not support states based on an issue that is already an issue for so long with other features already in Reaper.

FYI just spitballing here, I know it wont change any time soon.
__________________
Stop posting huge images, smaller images or thumbnail, it's not rocket science!
Win Conway is offline   Reply With Quote
Old 11-21-2023, 06:40 AM   #16
Mickel Ehrmantraut
Human being with feelings
 
Join Date: Nov 2023
Posts: 2
Default

please +1 this topic in https://forum.cockos.com/showthread.php?t=285052
Mickel Ehrmantraut is offline   Reply With Quote
Old 11-23-2023, 06:25 AM   #17
ArmTazar
Human being with feelings
 
ArmTazar's Avatar
 
Join Date: Feb 2022
Posts: 64
Default

In my case I have created it so that it tells me if the track is selected or not.
And it is very simple to do.
It is required to create two buttons like what Reaper uses where its three states are. We put all of them off for that set of buttons.
We create the same set of buttons and now all three are on.
In my case, the script that I associate with the two buttons manages when the track is activated or not.
If it is activated, the button light turns on and if it is not selected, it will be off.

The important thing is also that both buttons share the same coordinates. And in my case with the ?select_track option I do the effect.

I attach screenshots with the idea.

All the best
Attached Images
File Type: jpg 1.jpg (95.8 KB, 21 views)
File Type: jpg 2.jpg (94.5 KB, 16 views)
File Type: jpg 3.jpg (19.4 KB, 19 views)
File Type: jpg 4.jpg (60.0 KB, 17 views)
File Type: jpg 5.jpg (29.9 KB, 17 views)
ArmTazar is offline   Reply With Quote
Old 11-23-2023, 10:31 AM   #18
mister happy
Human being with feelings
 
Join Date: Mar 2017
Location: in the moment
Posts: 497
Default

It seems like the status of the

Code:
track-selected
portion of

Code:
?track-selected
must be made available to WALTER scripting by REAPER.

A couple of weeks ago, I tried a similar approach with another pair of functions (I can't recall what they were) and it did not work.

Is it possible that this sort of function depends on the availability of a predefined variable via API?





.
__________________
Nov. 16, 2023: I just realized that any images I have uploaded to posts are deleted when I clean out my attachments. Bummer...sorry for all the dead image links.

Last edited by mister happy; 11-24-2023 at 07:27 AM.
mister happy is online now   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 08:40 AM.


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