It is currently May 5th, 2024, 4:30 pm

Refresh Skin on audio output change

Get help with creating, editing & fixing problems with skins
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5407
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Refresh Skin on audio output change

Post by eclectic-tech »

David8192 wrote: August 3rd, 2021, 2:02 pm So.... Measure=String looks for changes in a skin?
No, it looks at the value defined in the line "STRING=..." of the measure and takes actions if they change using the "OnChangeAction=..." Bang.

So in the above code, the value of that string measure is the string value of the [MeasureWin7Audio] measure; which will be the current audio device. Note that the number value of [MeasureWin7Audio] is the current volume level.

When you change your audio device in Windows, the measure will see the change and take the desired action. This refreshes a particular skin OnChangeAction=[!Refresh "Simplon\Visualizer"], but you can use any Bang such as OnChangeAction=[!Refresh] which will refresh the skin containing this measure.

The String Measure was introduced to allow testing of string values especially using IfMatch test, which were not easily performed until the String Measure was added.
User avatar
David8192
Posts: 246
Joined: July 8th, 2021, 11:30 pm
Location: The King's Avenue, Golden Kingdom

Re: Refresh Skin on audio output change

Post by David8192 »

eclectic-tech wrote: August 3rd, 2021, 2:33 pm No, it looks at the value defined in the line "STRING=..." of the measure and takes actions if they change using the "OnChangeAction=..." Bang.

So in the above code, the value of that string measure is the string value of the [MeasureWin7Audio] measure; which will be the current audio device. Note that the number value of [MeasureWin7Audio] is the current volume level.

When you change your audio device in Windows, the measure will see the change and take the desired action. This refreshes a particular skin OnChangeAction=[!Refresh "Simplon\Visualizer"], but you can use any Bang such as OnChangeAction=[!Refresh] which will refresh the skin containing this measure.

The String Measure was introduced to allow testing of string values especially using IfMatch test, which were not easily performed until the String Measure was added.
Ok. It's the BANG watching for the changes?
the DA GALLERY 8-) For some Reason, the square root of X2 does not involve X
User avatar
Yincognito
Rainmeter Sage
Posts: 7199
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Refresh Skin on audio output change

Post by Yincognito »

David8192 wrote: August 3rd, 2021, 2:49 pm Ok. It's the BANG watching for the changes?
No. The OnChangeAction= part is "watching for the changes". Bangs, to put it simply, are just "commands" you can make, based on something that happened (in this particular case only, the change you talked about). Such a bang is [!Refresh] (a bang is enclosed by square brackets and has an exclamation mark before its name).
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
David8192
Posts: 246
Joined: July 8th, 2021, 11:30 pm
Location: The King's Avenue, Golden Kingdom

Re: Refresh Skin on audio output change

Post by David8192 »

David8192 wrote: August 3rd, 2021, 2:49 pm Ok. It's the BANG watching for the changes?
Well, that was a little dumb of me. What I meant is, "OnChangeAction".
the DA GALLERY 8-) For some Reason, the square root of X2 does not involve X
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5407
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Refresh Skin on audio output change

Post by eclectic-tech »

David8192 wrote: August 3rd, 2021, 2:49 pm Ok. It's the BANG watching for the changes?
Here is what is happening;
The [MeasureWin7Audio] measure section returns 2 values: the current volume level as the NUMBER value and the current audio device as the STRING value.

The [MeasureDeviceName] measure section watches the STRING value of [MeasureWin7Audio] and takes actions based on the value.
It will take those actions whenever the value changes because it uses the OnChangeAction= option.

"BANG" is the action taken, it defines what you want to happen when a condition is met: a mouse is clicked, a value changes, the sun rises, etc.

You might want to look at this: Anatomy of a Skin
User avatar
David8192
Posts: 246
Joined: July 8th, 2021, 11:30 pm
Location: The King's Avenue, Golden Kingdom

Re: Refresh Skin on audio output change

Post by David8192 »

eclectic-tech wrote: August 3rd, 2021, 3:11 pm Here is what is happening;
The [MeasureWin7Audio] measure section returns 2 values: the current volume level as the NUMBER value and the current audio device as the STRING value.

The [MeasureDeviceName] measure section watches the STRING value of [MeasureWin7Audio] and takes actions based on the value.
It will take those actions whenever the value changes because it uses the OnChangeAction= option.

"BANG" is the action taken, it defines what you want to happen when a condition is met: a mouse is clicked, a value changes, the sun rises, etc.

You might want to look at this: Anatomy of a Skin
Thanks. I had fumbled around for quite a while on automation. It's this OnChangeAction= that I used to miss. :confused: because I never checked the docs about it,...... but now I see it.
the DA GALLERY 8-) For some Reason, the square root of X2 does not involve X
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5407
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Refresh Skin on audio output change

Post by eclectic-tech »

Happy to help! :thumbup:
User avatar
David8192
Posts: 246
Joined: July 8th, 2021, 11:30 pm
Location: The King's Avenue, Golden Kingdom

Re: Refresh Skin on audio output change

Post by David8192 »

eclectic-tech wrote: August 3rd, 2021, 7:50 pm Happy to help! :thumbup:
:great:
the DA GALLERY 8-) For some Reason, the square root of X2 does not involve X