For some reason your method isn't working properly. The goal is to hide all skins, mute the system volume, and pause any playing music. What's happening is that some of the skins are hidden, the volume is muted, and the music keeps playing. I like you code better because it's more simple, but I might have to stick with death.crafter's because it is working as intended. I've cobbled together a couple different pieces of code so maybe there's a bug in the way I put it together. Below is the full code for both options;balala wrote: ↑October 19th, 2021, 5:50 pm Ok, here is it. Add the IfCondition / IfTrueAction / IfFalseAction options to the [MeasurePlayPause] measure, without modifying it otherwise. The two !SetOption bangs will set the appropriate KeyDownAction option to the [HideSkins] measure:Additionally you can freely remove the KeyDownAction option of the [HideSkins] measure, because this option is now set dynamically by one of the above !SetOption bangs, so there is no need to have it explicitly set on the measure. It's not a problem is you leave it there, but it's completely useless, because on refresh of the skin, it is anyway set by one of the above bangs.Code: Select all
[MeasurePlayPause] ... IfCondition=(MeasurePlayPause=2) IfTrueAction=[!SetOption HideSkins KeyDownAction """[!Hide *][!CommandMeasure "MeasureMedia" "PlayPause"][!CommandMeasure "MeasureMedia" "VolumeMute"]"""][!UpdateMeasure "HideSkins"] IfFalseAction=[!SetOption HideSkins KeyDownAction """[!Hide *][!CommandMeasure "MeasureMedia" "VolumeMute"]"""][!UpdateMeasure "HideSkins"]
Take care that the !Hide (used by you above) and the !Hide * (used by Devo, in the !RainmeterHide * form), perform different actions. First is hiding the current skin, while the last is hiding ALL activated skins.
balala's code
Code: Select all
[Rainmeter]
Update=1000
BackgroundMode=2
[Variables]
HideKey=CTRL BACKSLASH
ShowKey=CTRL RBRACKET
[MeasureMedia]
Measure=MediaKey
;The play state of the player
;0 is no song is selected, this will almost never happen as the plugin retains the last known song in the future I may change it so it clears when the websocket closes but I dont think I want to do that in the event the websocket closes unexpectedly you may want it to keep old data
;1 is playing
;2 is paused
[MeasurePlayPause]
Measure=Plugin
Plugin=WebNowPlaying
PlayerType=State
IfCondition=(MeasurePlayPause=1)
IfTrueAction=[!SetOption HideSkins KeyDownAction """[!RainmeterHide *][!CommandMeasure "MeasureMedia" "PlayPause"][!CommandMeasure "MeasureMedia" "VolumeMute"]"""][!UpdateMeasure "HideSkins"]
IfFalseAction=[!SetOption HideSkins KeyDownAction """[!RainmeterHide *][!CommandMeasure "MeasureMedia" "VolumeMute"]"""][!UpdateMeasure "HideSkins"]
[Meter]
Meter=String
Text=""
[HideSkins]
Measure=Plugin
Plugin=HotKey
HotKey=#HideKey#
[ShowSkins]
Measure=Plugin
Plugin=HotKey
HotKey=#ShowKey#
KeyDownAction=[!RainmeterShow *]
death.crafter's code:
Code: Select all
[Rainmeter]
Update=1000
BackgroundMode=2
[Variables]
HideKey=CTRL BACKSLASH
ShowKey=CTRL RBRACKET
HideSkins0=[!RainmeterHide *][!CommandMeasure "MeasureMedia" "VolumeMute"]
HideSkins1=[!RainmeterHide *][!CommandMeasure "MeasurePlayPause" "PlayPause"][!CommandMeasure "MeasureMedia" "VolumeMute"]
[MeasureMedia]
Measure=MediaKey
;The play state of the player
;0 is no song is selected, this will almost never happen as the plugin retains the last known song in the future I may change it so it clears when the websocket closes but I dont think I want to do that in the event the websocket closes unexpectedly you may want it to keep old data
;1 is playing
;2 is paused
[MeasurePlayPause]
Measure=Plugin
Plugin=WebNowPlaying
PlayerType=State
[IsPlaying]
Measure=Calc
Formula=MeasurePlayPause = 1
[Meter]
Meter=String
Text=""
[HideSkins]
Measure=Plugin
Plugin=HotKey
HotKey=#HideKey#
KeyDownAction=[#HideSkins[&IsPlaying]]
[ShowSkins]
Measure=Plugin
Plugin=HotKey
HotKey=#ShowKey#
KeyDownAction=[!RainmeterShow *]