I have lost around 30 hours researching how could I hide a meter based on automatically generated value. Actually the idea is to hide info/covers when the state of "winamp" is put to "stop". So here is my example code:
It is currently May 6th, 2024, 2:11 am
If statements with hiding meters
-
- Posts: 2
- Joined: February 3rd, 2012, 12:24 pm
If statements with hiding meters
Hi guys,
I have lost around 30 hours researching how could I hide a meter based on automatically generated value. Actually the idea is to hide info/covers when the state of "winamp" is put to "stop". So here is my example code:
Tried including a Calc measure.... not sure if this is even logically true:
Any help will be highly appreciated
I have lost around 30 hours researching how could I hide a meter based on automatically generated value. Actually the idea is to hide info/covers when the state of "winamp" is put to "stop". So here is my example code:
-
- Developer
- Posts: 2689
- Joined: November 24th, 2011, 1:42 am
- Location: Utah
Re: If statements with hiding meters
This code works for me, however I would add another if statement to show the background when the player is not "stopped".datacenter wrote:Code: Select all
[mState] Measure=Plugin Plugin=NowPlaying.dll PlayerName=Winamp PlayerType=STATE IfEqualValue=0 IfEqualAction=!Execute [!RainmeterHideMeter Background]
Like this:
Code: Select all
[mState]
Measure=Plugin
Plugin=NowPlaying.dll
PlayerName=Winamp
PlayerType=STATE
IfEqualValue=0
IfEqualAction=!Execute [!HideMeter Background]
IfAboveValue=0
IfAboveAction=!Execute [!ShowMeter Background]
Also, remember the meter will hide on the next update cycle.
-Brian
-
- Posts: 11
- Joined: February 2nd, 2012, 8:20 pm
Re: If statements with hiding meters
try this:
IfEqualAction=!Execute [!RainmeterHideMeter Background][!RainmeterRefresh]
IfEqualAction=!Execute [!RainmeterHideMeter Background][!RainmeterRefresh]
-
- Posts: 2
- Joined: February 3rd, 2012, 12:24 pm
Re: If statements with hiding meters
Thanks Brian... it is working now.
Have a nice day all
Have a nice day all
-
- Posts: 126
- Joined: August 12th, 2011, 12:30 pm
Re: If statements with hiding meters
Following the same pattern, code:
doesn't work entirely.
Measure=FreeDiskSpace
Type
If set to 1 this returns the type of the drive.
String >> numeric return:
Error >> 0
Removed >> 1
Removable >> 3
Fixed >> 4
Network >> 5
CDRom >> 6
Ram >> 7
So far so good. But the code does the following:
I refresh the skin with the USB not plugged in, the meters in the group are all visible, display all the information, bars, everything, with zero values. Then i plug in my USB, then all meters work as intended. Then i unplug my USB, and THEN [Ms_USB2State] finally hides all the meters (the USB2 group) ... permanently though, because if i plug it in again, it stays hidden. Long story short, i hate IfActions! -.-
Code: Select all
[Ms_USB2State]
Measure=FreeDiskSpace
Drive="#USB2#:"
Type=1
IgnoreRemovable=0
IfEqualValue=1
IfEqualAction=!Execute [!HideMeterGroup USB2] [!Redraw]
IfAboveValue=1
IfEqualAction=!Execute [!ShowMeterGroup USB2] [!Redraw]
Measure=FreeDiskSpace
Type
If set to 1 this returns the type of the drive.
String >> numeric return:
Error >> 0
Removed >> 1
Removable >> 3
Fixed >> 4
Network >> 5
CDRom >> 6
Ram >> 7
So far so good. But the code does the following:
I refresh the skin with the USB not plugged in, the meters in the group are all visible, display all the information, bars, everything, with zero values. Then i plug in my USB, then all meters work as intended. Then i unplug my USB, and THEN [Ms_USB2State] finally hides all the meters (the USB2 group) ... permanently though, because if i plug it in again, it stays hidden. Long story short, i hate IfActions! -.-
-
- Developer
- Posts: 2689
- Joined: November 24th, 2011, 1:42 am
- Location: Utah
Re: If statements with hiding meters
You have an extra "IfEqualAction"......it should be "IfAboveAction"
Try this:
-Brian
Try this:
Code: Select all
[Ms_USB2State]
Measure=FreeDiskSpace
Drive="#USB2#:"
Type=1
IgnoreRemovable=0
IfEqualValue=1
IfEqualAction=!Execute [!HideMeterGroup USB2] [!Redraw]
IfAboveValue=1
IfAboveAction=!Execute [!ShowMeterGroup USB2] [!Redraw]
-
- Posts: 126
- Joined: August 12th, 2011, 12:30 pm
Re: If statements with hiding meters
My apologies, it was a typo then.
Maybe if i would focus on only one issue at a time ... lol! Sorry again!
Maybe if i would focus on only one issue at a time ... lol! Sorry again!
-
- Developer
- Posts: 2689
- Joined: November 24th, 2011, 1:42 am
- Location: Utah
Re: If statements with hiding meters
No need to apologize, I can't tell you how many times I make typos like that!
-Brian
-Brian