It is currently March 29th, 2024, 10:35 am

Soita skin - hide if no media playing

Get help with creating, editing & fixing problems with skins
pf_moore
Posts: 4
Joined: May 21st, 2015, 1:32 pm

Soita skin - hide if no media playing

Post by pf_moore »

Hi,
I've just added the Soita skin (current track playing in my media player) to my rainmeter setup. It's quite a large panel, and not useful when I don't have music playing. Is there any way to check if anything is playing and hide the panel if not? I've not really done much customising or development of skins, I've just used premade ones, so apologies if this is a daft question.

Thanks,
Paul
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Soita skin - hide if no media playing

Post by balala »

pf_moore wrote:Hi,
I've just added the Soita skin (current track playing in my media player) to my rainmeter setup. It's quite a large panel, and not useful when I don't have music playing. Is there any way to check if anything is playing and hide the panel if not? I've not really done much customising or development of skins, I've just used premade ones, so apologies if this is a daft question.

Thanks,
Paul
Take a look at your code. It probably uses the NowPlaying plugin. There must be a parent measure (lets say it is called [MeasurePlayer]). This must have a PlayerName=YourPlayer option (eg PlayerName=WMP). Each child measure has a PlayerName=[MeasurePlayer] option. Find a child measure, which has PlayerType=STATE option. Probably you'll have this measure. Lets say its name is [MeasureState]. Add to it, these options:

Code: Select all

IfCondition=(MeasureState=0)
IfTrueAction=[!HideFade "#CURRENTCONFIG#"]
IfFalseAction=[!ShowFade "#CURRENTCONFIG#"]
Refresh your skin.
If you can't make it to work, post your code here please.
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Soita skin - hide if no media playing

Post by jsmorley »

I'd be hesitant to hide the skin if the player "state" is "stopped", as then you really can't use the skin itself to stop and play music. I'd instead probably use "status", to determine if the player application is running or not.
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Soita skin - hide if no media playing

Post by balala »

jsmorley wrote:I'd be hesitant to hide the skin if the player "state" is "stopped", as then you really can't use the skin itself to stop and play music. I'd instead probably use "status", to determine if the player application is running or not.
Yes, you're right and when I read the post first time, that was what I thought to. But the original question was:
pf_moore wrote:Is there any way to check if anything is playing and hide the panel if not?
and that's why I wrote my reply this way. Maybe indeed a status check would be better. Let's see what pf_moore would like to do.
pf_moore
Posts: 4
Joined: May 21st, 2015, 1:32 pm

Re: Soita skin - hide if no media playing

Post by pf_moore »

balala wrote: Yes, you're right and when I read the post first time, that was what I thought to. But the original question was: and that's why I wrote my reply this way. Maybe indeed a status check would be better. Let's see what pf_moore would like to do.
First of all, thanks for the suggested code. I got it working exactly as you explained, and it is now working as I'd requested.

To be honest, I hadn't thought about the issue of not being able to manage playback with the skin hidden, but now that it's been mentioned, yes it is a problem. So being able to detect when the player app is running is probably better.

I've therefore added a new measure that refers to STATUS, and hidden the skin when it's zero. Like this:

Code: Select all

[mStatus]
Measure=Plugin
Plugin=NowPlaying.dll
PlayerName=[mPlayer]
PlayerType=STATUS
IfCondition=(mStatus=0)
IfTrueAction=[!HideFade "#CURRENTCONFIG#"]
IfFalseAction=[!ShowFade "#CURRENTCONFIG#"]
Is that right? It seems to work, so I guess it is :)

Once again, thanks for the help.
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Soita skin - hide if no media playing

Post by balala »

pf_moore wrote:Is that right? It seems to work, so I guess it is :)
Yes, it is. Especially if it work!
nascent
Posts: 1
Joined: January 5th, 2017, 8:34 pm

Re: Soita skin - hide if no media playing

Post by nascent »

Just wanna say, I love you guys. This was exactly what I was looking for. :thumbup: