It is currently March 24th, 2019, 10:38 pm

How do i hide a skin when music is not playing

Help with creating, editing & fixing problems with skins
Tadiu
Posts: 4
Joined: February 15th, 2019, 11:27 pm

How do i hide a skin when music is not playing

Tadiu » February 15th, 2019, 11:33 pm

Hi, Im new at this and I don't know much about coding. I would like to hide one skin i have when music is not playing. If someone knows what I have to change I will really apreciate it! The code is this:

Code: Select all

Rainmeter]
Update=1000
Author=Connect-R
BackgroundMode=2
SolidColor=0,0,0,1
DynamicWindowSize=1

[Variables]
@include=#@#Variables.inc
Player=CAD

;-------------------------------------------------------------
;-------------------------------------------------------------

[MeasurePlayer]
Measure=Plugin
Plugin=NowPlaying.dll
PlayerName=#Player#
PlayerType=TITLE

[MeasureArtist]
Measure=Plugin
Plugin=NowPlaying.dll
PlayerName=[MeasurePlayer]
PlayerType=ARTIST

[MeasureTrack]
Measure=Plugin
Plugin=NowPlaying.dll
PlayerName=[MeasurePlayer]
PlayerType=TITLE

;-------------------------------------------------------------
;-------------------------------------------------------------

[MeterSign]
Meter=String
StringAlign=Center
FontColor=255,255,255
FontFace=Zona Pro
FontSize=20
X=200
Y=0
Text="♪"
DynamicVariables=1
AntiAlias=1

;-------------------------------------------------------------
;-------------------------------------------------------------

[MeterArtistInfo]
Meter=String
MeasureName=MeasureArtist
StringAlign=Center
FontColor=255,255,255
FontFace=LHF Stanford Script
FontSize=35
X=200
Y=35r
W=400
Text="%1"
DynamicVariables=1
AntiAlias=1
ClipString=1

[MeterTrackInfo]
Meter=String
MeasureName=MeasureTrack
StringAlign=Center
FontColor=255,255,255
FontFace=Quicksand
FontSize=11
X=200
Y=40r
W=400
Text="%1"
InlinePattern=".*"
InlineSetting=CharacterSpacing | 1 | 1
DynamicVariables=1
AntiAlias=1
ClipString=1
User avatar
balala
Rainmeter Sage
Posts: 7914
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: How do i hide a skin when music is not playing

balala » February 16th, 2019, 7:23 am

Tadiu wrote:
February 15th, 2019, 11:33 pm
Hi, Im new at this and I don't know much about coding. I would like to hide one skin i have when music is not playing. If someone knows what I have to change I will really apreciate it!
Add a new NowPlaying measure, beside the existing ones:

Code: Select all

[MeasureSta]
Measure=NowPlaying
PlayerName=[MeasurePlayer]
PlayerType=STATE
IfCondition=(#CURRENTSECTION#=0)
IfTrueAction=[!HideFade]
IfFalseAction=[!ShowFade]
The above measure returns 0 if the player isn't playing, 1 if it is playing and 2 if it is paused. According to the posted IfCondition, if the measure returns 0 (so when the player is stopped), the skin is hidden by the !HideFade bang, used into the IfTrueAction option. For other cases (when the player is playing or is paused), the IfFalseAction option is executed and the skin is shown.
Another possibility is to replace the above PlayerType=STATE option with PlayerType=STATUS. In this case the skin is shown while the player is open and is hidden when you close the player.

As a side note, I just mention that although NowPlaying earlier was a plugin, a while ago it became an internal measure. Although it is working if coded as plugin (especially for backward compatibility reason), it is better to use it as a measure. That's why these measures should have to be written as such:

Code: Select all

[MeasurePlayer]
Measure=NowPlaying
PlayerName=#Player#
PlayerType=TITLE

[MeasureArtist]
Measure=NowPlaying
PlayerName=[MeasurePlayer]
PlayerType=ARTIST

[MeasureTrack]
Measure=NowPlaying
PlayerName=[MeasurePlayer]
PlayerType=TITLE
Tadiu
Posts: 4
Joined: February 15th, 2019, 11:27 pm

Re: How do i hide a skin when music is not playing

Tadiu » February 16th, 2019, 6:48 pm

balala wrote:
February 16th, 2019, 7:23 am
Add a new NowPlaying measure, beside the existing ones:

Code: Select all

[MeasureSta]
Measure=NowPlaying
PlayerName=[MeasurePlayer]
PlayerType=STATE
IfCondition=(#CURRENTSECTION#=0)
IfTrueAction=[!HideFade]
IfFalseAction=[!ShowFade]
The above measure returns 0 if the player isn't playing, 1 if it is playing and 2 if it is paused. According to the posted IfCondition, if the measure returns 0 (so when the player is stopped), the skin is hidden by the !HideFade bang, used into the IfTrueAction option. For other cases (when the player is playing or is paused), the IfFalseAction option is executed and the skin is shown.
Another possibility is to replace the above PlayerType=STATE option with PlayerType=STATUS. In this case the skin is shown while the player is open and is hidden when you close the player.

As a side note, I just mention that although NowPlaying earlier was a plugin, a while ago it became an internal measure. Although it is working if coded as plugin (especially for backward compatibility reason), it is better to use it as a measure. That's why these measures should have to be written as such:

Code: Select all

[MeasurePlayer]
Measure=NowPlaying
PlayerName=#Player#
PlayerType=TITLE

[MeasureArtist]
Measure=NowPlaying
PlayerName=[MeasurePlayer]
PlayerType=ARTIST

[MeasureTrack]
Measure=NowPlaying
PlayerName=[MeasurePlayer]
PlayerType=TITLE
Hi, thanks for the reply!!. It seems to hide the skin everytime even when I'm not playing something. Don't know why either.
User avatar
balala
Rainmeter Sage
Posts: 7914
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: How do i hide a skin when music is not playing

balala » February 16th, 2019, 6:55 pm

Tadiu wrote:
February 16th, 2019, 6:48 pm
It seems to hide the skin everytime even when I'm not playing something. Don't know why either.
That's exactly was I did, adding those measures/options. Not this is what you intended? Because this is what I understood from your request:
Tadiu wrote:
February 15th, 2019, 11:33 pm
I would like to hide one skin i have when music is not playing.
Or you would like to hide another skin, not the current one?
Tadiu
Posts: 4
Joined: February 15th, 2019, 11:27 pm

Re: How do i hide a skin when music is not playing

Tadiu » February 16th, 2019, 7:06 pm

balala wrote:
February 16th, 2019, 6:55 pm
That's exactly was I did, adding those measures/options. Not this is what you intended? Because this is what I understood from your request:

Or you would like to hide another skin, not the current one?
My mistake haha. I wanted to say that the skin hides even when the music is playing. Sorry for the misunderstanding. I don't know if it could be that I am using spotify as the player. But since it happens also with youtube maybe is not.
User avatar
balala
Rainmeter Sage
Posts: 7914
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: How do i hide a skin when music is not playing

balala » February 16th, 2019, 7:24 pm

Tadiu wrote:
February 16th, 2019, 7:06 pm
I wanted to say that the skin hides even when the music is playing. Sorry for the misunderstanding. I don't know if it could be that I am using spotify as the player. But since it happens also with youtube maybe is not.
Weird. Because in the code posted by you, in your initial request you have set the Player variable to Player=CAD ([Variables] section), which doesn't meet Spotify. For Spotify you should have to set this variable to Player=Spotify.
Now if you've set the variable properly, this can be a problem, because Spotify is just a partially supported player and as such nor the State, nor the Status option doesn't work. Probably with these options the appropriate measure is always returning 0, which makes the skin hidden. Unfortunately I can't check, because I'm not using Spotify and I don't have it installed.
But there is a Spotify plugin released and published. I think it properly returns both the state and the status (however, since I never tried it out, I'm not sure, nor here). But unfortunately I can't help here, someone who is using this player and the appropriate plugin will have to help you. Sorry.
But, there is one more but: the NowPlaying measures don't support YouTube. Again, there is a plugin which does, the WebNowPlaying. I don't know how does this plugin supports Spotify though. But maybe it does. Maybe it worth a try.
Tadiu
Posts: 4
Joined: February 15th, 2019, 11:27 pm

Re: How do i hide a skin when music is not playing

Tadiu » February 16th, 2019, 8:25 pm

balala wrote:
February 16th, 2019, 7:24 pm
Weird. Because in the code posted by you, in your initial request you have set the Player variable to Player=CAD ([Variables] section), which doesn't meet Spotify. For Spotify you should have to set this variable to Player=Spotify.
Now if you've set the variable properly, this can be a problem, because Spotify is just a partially supported player and as such nor the State, nor the Status option doesn't work. Probably with these options the appropriate measure is always returning 0, which makes the skin hidden. Unfortunately I can't check, because I'm not using Spotify and I don't have it installed.
But there is a Spotify plugin released and published. I think it properly returns both the state and the status (however, since I never tried it out, I'm not sure, nor here). But unfortunately I can't help here, someone who is using this player and the appropriate plugin will have to help you. Sorry.
But, there is one more but: the NowPlaying measures don't support YouTube. Again, there is a plugin which does, the WebNowPlaying. I don't know how does this plugin supports Spotify though. But maybe it does. Maybe it worth a try.
Changing the Player=CAD to Player=Spotify seemes to solve the problem! Thank you for the help and time :)
User avatar
balala
Rainmeter Sage
Posts: 7914
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: How do i hide a skin when music is not playing

balala » February 16th, 2019, 8:42 pm

Tadiu wrote:
February 16th, 2019, 8:25 pm
Changing the Player=CAD to Player=Spotify seemes to solve the problem!
Did it? I'm surprised, because the State and Status options should have to not be supported by the NowPlaying measure with Spotify. At least according to the help.
I'm glad if you got it working as intended though.