It is currently May 9th, 2024, 3:25 am

[SOLVED] Multiple bangs in one condition | Edit: Restarting a skin

Get help with creating, editing & fixing problems with skins
User avatar
balala
Rainmeter Sage
Posts: 16206
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Multiple bangs in one condition | Edit: Restarting a skin

Post by balala »

ZXCVBOT wrote: September 5th, 2023, 1:14 pm 2. Would the loadlayout bang work for making the skin disappear or not?
In addition to eclectic-tech's reply, note that when you load a layout (doesn't matter if you do this manually or with a !LoadLayout bang) the skins are not disappearing. All activated skins are deactivated (unloaded) then the skins belonging to the loaded layout are activated. When you load a layout, even the skins which are active and are in the layout as well, are deactivated then re-activated. This is something important to keep in mind, because by deactivating and reactivating the skins you lose all dynamic modifications of the skin. For instance you lose the values set to variables through !SetVariable bangs as well as the options modified by !SetOption bangs. The only things which are kept are the ones written by !WriteKeyValue bangs, because these have been written to the hard-drive and this way they are kept.
So, long story short, the skins are not disappearing (and are not hidden), but completely reloaded.
User avatar
Yincognito
Rainmeter Sage
Posts: 7211
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Multiple bangs in one condition | Edit: Restarting a skin

Post by Yincognito »

ZXCVBOT wrote: September 5th, 2023, 1:14 pm I have 2 questions-
1. Does hide bang make the skin eat resources, or not?
2. Would the loadlayout bang work for making the skin disappear or not?

I know they are not what I originally asked, but would they perform the same job?

Thanking you.
Eclectic-tech and balala already answered these (yes to all), I'll only add that it depends which skin you would be hiding: if it's a resource intensive skin (like visualizers are, because of their fast update, audio handling and potentially large skin size) then to conserve resources you'd want to unload it, rather than hiding it. If it's a regular skin, you can hide it and not feel a thing since it would already be light on the system anyway.

To be even more to the point, hiding or unloading would not necessarily be required, if it's just about conserving resources - you could very well dynamically alter the UpdateDivider values of every measure and meter in your visualizer skin to achieve a similar effect (I do this in some of my animated skins to basically drop their CPU usage to near zero at will when pausing their animation). In your case, given the 1 and -1 values given by your Process measure, you could simply do in that measure, if you include it in your visualizer with an UpdateDivider equal to (1000/#YourSkinUpdate#):

OnChangeAction= [!SetOptionGroup AllMeasures UpdateDivider [#CURRENTSECTION#]][!SetOptionGroup AllMeters UpdateDivider [#CURRENTSECTION#]][!UpdateMeasureGroup AllMeasures][!UpdateMeterGroup AllMeters][!Redraw]

assuming you add Group=AllMeasures to all your measures bar the Process one, and Group=AllMeters to all your meters. Just another way of achieving the same thing, really. Of course, you should choose whichever way you feel more comfortable with, or it's simpler.
Last edited by Yincognito on September 6th, 2023, 3:47 pm, edited 1 time in total.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
ZXCVBOT

Re: Multiple bangs in one condition | Edit: Restarting a skin

Post by ZXCVBOT »

Firstly,this forum will be insightful for those who are not beginners, Yincognito, balala, and eclectic-tech all answered my questions calmly and with precision. The sages are full of wisdom indeed :rolmfao: !

1- For eclectic-tech:
I chose the method, ahem, skin by eclectic-tech, and added:
ConfigName26=Enhancements\Music Enhancements\Visualizer
SkinName26=Visualizer Glow Inverted.ini
...
ContextTitle26=[#ConfigName26]
ContextAction26=[!DeactivateConfig "[#ConfigName[#Current]]"][!WriteKeyValue Variables Current 26][!Refresh]
Thinking whether or not would it work. But to my shock, it did. The way I wanted. I know what did the magic:
...
IfCondition=(MeasureProcess<>1)
IfTrueAction=[!DeactivateConfig "[#ConfigName[#Current]]"]
IfFalseAction=[!ActivateConfig "[#ConfigName[#Current]]" "[#SkinName[#Current]]"]
The thing I did not consider was MeasureProcess<>1

2- For balala:
Thank you for telling me things in a beginner-friendly tone. I knew what loadlayout did. I made my skin follow the coordinates that will be centering it as per monitor set in settings, so, I do not have to worry about the positions or reloading of skins. I'll call it Auto-Coordinator :lol:
3- For Yincognito:
I know you are helping me since the beginning, but, as a beginner, I can not mostly get what thing does what. The thing that did not get in my brain till now - what the following code is for:

OnChangeAction= [!SetOptionGroup AllMeasures UpdateDivider [#CURRENTSECTION#]][!SetOptionGroup AllMeters UpdateDivider [#CURRENTSECTION#]][!UpdateMeasureGroup AllMeasures][!UpdateMetetGroup AllMeters][!Redraw]

The thing was, I did not know how updatedivider worked, so I used update. Now, I know that so I could have set the update to near-infinite and updatedivider to what I initially put as the value of update, in the code you provided as the first solution; This is untested and theoritical as I'm away from my PC.
  Also, [FontAwesome] Font Awesome [/FontAwesome] is broken? I believe.  
THANK YOU EVERYONE FOR BEING SO SUPPORTIVE AND KIND! :bow:
ZXCVBOT

Re: Multiple bangs in one condition | Edit: Restarting a skin

Post by ZXCVBOT »

THE ROOT OF ALL PROBLEMS + SOLUTIONS: I now know what went wrong. The code Yincognito provided in the first case works too, so, sorry about earlier, you are going to know why now.

1. I put the Dummy Restarter in the same package-folder (? I honestly do not know whether this is correct.): Skins-Directory/Enhancements/_DummyRestarter.

Sol 1. Make a separate package for it.: Skins-Directory/_DummyRestarter

2. In the IfCondition, I used -1 or 1 conditions for checking whether the process is active or not as per manuals.

Sol 2. Thanks to eclectic-tech, using this not equal to one, which simply means the process is not running or otherwise: IfCondition=(MeasureProcess<>1)

Phew! This has been one heck of a ride for me!
User avatar
Yincognito
Rainmeter Sage
Posts: 7211
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Multiple bangs in one condition | Edit: Restarting a skin

Post by Yincognito »

ZXCVBOT wrote: September 6th, 2023, 12:01 pm3- For Yincognito:
I know you are helping me since the beginning, but, as a beginner, I can not mostly get what thing does what. The thing that did not get in my brain till now - what the following code is for:

OnChangeAction= [!SetOptionGroup AllMeasures UpdateDivider [#CURRENTSECTION#]][!SetOptionGroup AllMeters UpdateDivider [#CURRENTSECTION#]][!UpdateMeasureGroup AllMeasures][!UpdateMeterGroup AllMeters][!Redraw]

The thing was, I did not know how updatedivider worked, so I used update. Now, I know that so I could have set the update to near-infinite and updatedivider to what I initially put as the value of update, in the code you provided as the first solution; This is untested and theoritical as I'm away from my PC.
Well, at least it stirred your interest to find out what was that all about, so it's ok. It was meant as an alternative, to seamlessly do what you wanted without deactivating or hiding anything, that's all.

The update principle in skins is simple. The Update option in the [Rainmeter] section of a skin is the general update and the lowest time interval in milliseconds at which everything in that skin updates. The UpdateDivider option in a measure or meter section is basically a factor (i.e. a multiplier) of the general update for that particular section, that allows it to update at a custom rate compared to the rest of the things in the skin. By default, even when not present as an option in a section, that UpdateDivider is 1 for that section (since any number multiplied with 1 results in the same number). You can set it to any integer, and if it's negative the said section will only update once at skin load, while if it's positive the section will update every (Update * UpdateDivider) milliseconds.

This is why the code above looks like it does: it takes advantage of the fact that your Process measure returns either 1 or -1 as its value, then sets the UpdateDividers of everything else to the value of that Process measure (identified as [#CURRENTSECTION#] since the code is supposed to be added to the said Process measure). In other words, what should happen is: if the process is running the update dividers are set to 1 meaning stuff will update at the same frequency as the skin, and if the process is not running the update dividers are set to -1 meaning stuff won't update at all afterwards. The latter will basically turn stuff in the skin to idle, so no additional resources used and most likely a similar effect to deactivating or hiding the visualizer since all its band measures would be at 0.
ZXCVBOT wrote: September 6th, 2023, 3:29 pm THE ROOT OF ALL PROBLEMS + SOLUTIONS: I now know what went wrong. The code Yincognito provided in the first case works too, so, sorry about earlier, you are going to know why now.
Yeah, no worries, the important thing is that you figured it out eventually. I actually wanted to package the codes to a .rmskin file for easy installation at that time (that would have prevented any misunderstandings about folders), but decided against it to avoid replacing the code you already had and moving it to the @Backup folder when installing, since the path structure was identical to yours. :D
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
balala
Rainmeter Sage
Posts: 16206
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Multiple bangs in one condition | Edit: Restarting a skin

Post by balala »

ZXCVBOT wrote: September 6th, 2023, 12:01 pm 2- For balala:
Thank you for telling me things in a beginner-friendly tone. I knew what loadlayout did. I made my skin follow the coordinates that will be centering it as per monitor set in settings, so, I do not have to worry about the positions or reloading of skins. I'll call it Auto-Coordinator :lol:
I always try to explain things as for a beginner, especially when I see folk having not too many posts. This leads me thinking the user is a beginner and I know for a beginner things have to be explained a little bit more detailed (remembering how was when I was a beginner). So, am glad if I helped anytime (and same as well if I did not).
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5408
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Multiple bangs in one condition | Edit: Restarting a skin

Post by eclectic-tech »

ZXCVBOT wrote: September 6th, 2023, 12:01 pm {-clip-}
  Also, [FontAwesome] Font Awesome [/FontAwesome] is broken? I believe.  
{-clip-}
Fontawesome is working if you set the "size-px" and "icon-name" from a page like this.

Code: Select all

[color=#FFBF00][FontAwesome]60 trophy[/FontAwesome][/color]
Glad to help!
ZXCVBOT

Re: Multiple bangs in one condition | Edit: Restarting a skin

Post by ZXCVBOT »

Gotcha!
Rating: