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...
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
It is currently March 29th, 2024, 1:05 am
Please help "player mode in Foobar200"
-
- Posts: 23
- Joined: December 28th, 2015, 6:21 am
-
- Rainmeter Sage
- Posts: 16110
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: Please help "player mode in Foobar200"
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:
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:
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?
Code: Select all
[Variables]
Repeat=0
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
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?
-
- Posts: 23
- Joined: December 28th, 2015, 6:21 am
Re: Please help "player mode in Foobar200"
First of all, thankyou for answering!
Like this?
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!
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
-
- Rainmeter Sage
- Posts: 16110
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: Please help "player mode in Foobar200"
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?
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?
-
- Posts: 23
- Joined: December 28th, 2015, 6:21 am
Re: Please help "player mode in Foobar200"
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.
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.
-
- Rainmeter Sage
- Posts: 16110
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: Please help "player mode in Foobar200"
But is it set on, when you initially click the white icon?chumeo_di_hia wrote:No, the repeat is'nt setting to default when I click on the red icon changes to white.
-
- Posts: 908
- Joined: December 30th, 2015, 9:47 am
Re: Please help "player mode in Foobar200"
I think the following code may work, but actually doesn't.
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.
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
Nowplaying plugin now doesn't handle "SetRepeat 0" of !CommandMeasure to the current version(1.3.15) of foobar2000 correctly? Just my guess.
-
- Posts: 23
- Joined: December 28th, 2015, 6:21 am
Re: Please help "player mode in Foobar200"
Yes, it's. I checked it.balala wrote:But is it set on, when you initially click the white icon?
-
- Posts: 23
- Joined: December 28th, 2015, 6:21 am
Re: Please help "player mode in Foobar200"
No, it doesn't. I used "foobar2000 v1.3.14", I updated to "foobar2000 v1.3.15" now.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.
-
- Posts: 908
- Joined: December 30th, 2015, 9:47 am
Re: Please help "player mode in Foobar200"
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.
What I want to say is...there may be a problem in the Nowplaying plugin interface with foobar2000, not our skin codes.