It is currently March 28th, 2024, 11:31 am

Please help "player mode in Foobar200"

Get help with creating, editing & fixing problems with skins
chumeo_di_hia
Posts: 23
Joined: December 28th, 2015, 6:21 am

Please help "player mode in Foobar200"

Post by chumeo_di_hia »

Please help me fix this code. I want the white heart icon when player in default mode >> when I click on the white heart icon, it becomes the red heart icon and Foobar's playing in repeat mode >> and when I click on the red heart icon, it returns the white heart icon and Foobar's playing in default mode...

Image

I'v spent a long time to finish it but I can't fix it as I expect. Please finish it for me! Thankyou so much!
https://drive.google.com/file/d/0B8WnTI-f67uoU25Ub1dhRDhOaFE/view?usp=sharing
User avatar
balala
Rainmeter Sage
Posts: 16109
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Please help "player mode in Foobar200"

Post by balala »

Unfortunately I don't have installed the Foobar2000, so I can't check the following solution specifically with that player, but I'd propose a solution, which requires a new variable. Let's name this variable Repeat. Add it to the [Variables] section:

Code: Select all

[Variables]
Repeat=0
This variable will control the repetition: if its value is 0, repeat is not set, if it's 1, it is set.
Now you'll need a Calc measure, to follow the actual value of the Repeat variable:

Code: Select all

[MeasureSetRepeat]
Measure=Calc
Formula=#Repeat#
IfCondition=(MeasureSetRepeat=0)
IfTrueAction=[!CommandMeasure "MeasureRepeat" "SetRepeat 0"][!SetOption Repeat ImageName "#@#Repeat1.png"][!UpdateMeasure "MeasureRepeat"][!UpdateMeter "Repeat"][!Redraw]
IfFalseAction=[!CommandMeasure "MeasureRepeat" "SetRepeat 1"][!SetOption Repeat ImageName "#@#Repeat3.png"][!UpdateMeasure "MeasureRepeat"][!UpdateMeter "Repeat"][!Redraw]
DynamicVariables=1
According to the value of the variable, the above measure will set the image shown by the [Repeat] meter, along with setting the proper state of the [MeasureRepeat] measure. With this solution, the [RepeatOn] meter isn't needed any more, you can simply remove it. We'll use just the [Repeat] and set its image accordingly.
One single thing will be needed furtherly: to add an option to the [Repeat] meter, to set the value of the Repeat variable: to add an option to the [Repeat] meter, to set the value of the Repeat variable. So, replace the LeftMouseUpAction option of the [Repeat] meter, with the following one: LeftMouseUpAction=[!SetVariable Repeat "(1-#Repeat#)"][!UpdateMeasure "MeasureSetRepeat"]. But this option requires to also add the DynamicVariables=1 option, so don't forget it.
As I said, I didn't check this solution with Foobar2000, because I can't, but I'm sure it'll work. Does it?
chumeo_di_hia
Posts: 23
Joined: December 28th, 2015, 6:21 am

Re: Please help "player mode in Foobar200"

Post by chumeo_di_hia »

First of all, thankyou for answering! :)

Like this?

Code: Select all

[Variables]
Repeat=0

[MeasureSetRepeat]
Measure=Calc
Formula=#Repeat#
IfCondition=(MeasureSetRepeat=0)
IfTrueAction=[!CommandMeasure "MeasureRepeat" "SetRepeat 0"][!SetOption Repeat ImageName "#@#Repeat1.png"][!UpdateMeasure "MeasureRepeat"][!UpdateMeter "Repeat"][!Redraw]
IfFalseAction=[!CommandMeasure "MeasureRepeat" "SetRepeat 1"][!SetOption Repeat ImageName "#@#Repeat3.png"][!UpdateMeasure "MeasureRepeat"][!UpdateMeter "Repeat"][!Redraw]
DynamicVariables=1

[MeasureRepeat]
Measure=Plugin
Plugin=NowPlaying
PlayerName=Foobar2000
PlayerType=Repeat
IfBelowValue=1
IfBelowAction=!Execute [!HideMeter RepeatOn][!Redraw]
IfAboveValue=1
IfAboveAction=!Execute [!ShowMeter RepeatOn][!Redraw]

[Repeat]
Meter=IMAGE
ImageName=#@#Repeat1.png
SolidColor=0,0,0,0
X=7
Y=45
w=21
h=21
LeftMouseUpAction=[!SetVariable Repeat "(1-#Repeat#)"][!UpdateMeasure "MeasureSetRepeat"
DynamicVariables=1
I'm sorry but player mode doesn't return default mode after I click on the red heart icon (although the red heart icon's return the white heart icon). Please check again! :)
User avatar
balala
Rainmeter Sage
Posts: 16109
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Please help "player mode in Foobar200"

Post by balala »

First of all, if you use Foobar2000, the PlayerName option of the parent NowPlaying plugin measure (in your case the [MeasureRepeat] measure), should be not PlayerName=Foobar2000, but PlayerName=CAD. At least according to the list of fully supported players. Does it works for you with PlayerName=Foobar2000? If it does, it's very weird.
About the code, it seems ok, just remove the IfBelowValue, IfBelowAction, IfAboveValue and IfAboveAction options from the [MeasureRepeat] measure.
If the red icon changes to white, it means the IfTrueAction option of the [MeasureSetRepeat] is executed, so the repeat should be also set to default. Is the repeat setting set, when you click the white icon?
chumeo_di_hia
Posts: 23
Joined: December 28th, 2015, 6:21 am

Re: Please help "player mode in Foobar200"

Post by chumeo_di_hia »

Yes, it works with PlayerName=Foobar2000, I don't know why but I use it for all my skin :)

Now, I changed to PlayerName=CAD from PlayerName=Foobar2000

No, the repeat is'nt setting to default when I click on the red icon changes to white. :)
User avatar
balala
Rainmeter Sage
Posts: 16109
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Please help "player mode in Foobar200"

Post by balala »

chumeo_di_hia wrote:No, the repeat is'nt setting to default when I click on the red icon changes to white. :)
But is it set on, when you initially click the white icon?
mak_kawa
Posts: 908
Joined: December 30th, 2015, 9:47 am

Re: Please help "player mode in Foobar200"

Post by mak_kawa »

I think the following code may work, but actually doesn't.

Code: Select all

[Rainmeter]
Update=1000
BackGroundMode=2
SolidColor=64,64,64,192

[DetectRepeat]
Measure=Plugin
Plugin=NowPlaying
PlayerName=CAD
PlayerType=Repeat
IfCondition=[DetectRepeat]=0
IfTrueAction=[!SetOption HeartButton ImageName white.png]
IfFalseAction=[!SetOption HeartButton ImageName red.png]
DynamicVariables=1

[HeartButton]
Meter=Image
X=10
Y=10
W=32
H=32
LeftMouseUpAction=[!EnableMeasure measureSwitch]

[measureSwitch]
Measure=Calc
Formula=1
IfCondition=[DetectRepeat]=0
IfTrueAction=[!SetOption HeartButton ImageName red.png][!CommandMeasure DetectRepeat "SetRepeat 1"][!DisableMeasure measureSwitch]
IfFalseAction=[!SetOption HeartButton ImageName white.png][!CommandMeasure DetectRepeat "SetRepeat 0"][!DisableMeasure measureSwitch]
DynamicVariables=1
Disabled=1
This code can detect repeat mode of foobar2000 on refresh and switch it off to on, but can't switch on to off.
Nowplaying plugin now doesn't handle "SetRepeat 0" of !CommandMeasure to the current version(1.3.15) of foobar2000 correctly? Just my guess.
chumeo_di_hia
Posts: 23
Joined: December 28th, 2015, 6:21 am

Re: Please help "player mode in Foobar200"

Post by chumeo_di_hia »

balala wrote:But is it set on, when you initially click the white icon?
Yes, it's. I checked it. :)
chumeo_di_hia
Posts: 23
Joined: December 28th, 2015, 6:21 am

Re: Please help "player mode in Foobar200"

Post by chumeo_di_hia »

mak_kawa wrote: Nowplaying plugin now doesn't handle "SetRepeat 0" of !CommandMeasure to the current version(1.3.15) of foobar2000 correctly? Just my guess.
No, it doesn't. I used "foobar2000 v1.3.14", I updated to "foobar2000 v1.3.15" now.
mak_kawa
Posts: 908
Joined: December 30th, 2015, 9:47 am

Re: Please help "player mode in Foobar200"

Post by mak_kawa »

Ah...sorry for my bad English.

What I want to say is...there may be a problem in the Nowplaying plugin interface with foobar2000, not our skin codes.
Post Reply