It is currently March 28th, 2024, 10:51 pm

Toggle Shuffle & Button Image Issue

Get help with creating, editing & fixing problems with skins
User avatar
Mor3bane
Posts: 943
Joined: May 7th, 2016, 7:32 am

Toggle Shuffle & Button Image Issue

Post by Mor3bane »

Hi,
I am trying to add a Shuffle button to my media player. When clicked the image will change to show if shuffle is on or not.

One image is named, "Shuffle.png" for shuffle "on".

The other image is, "Continuous.png" for shuffle "off"

The code I have seems to only work for one image, and it is not toggling the shuffle mode of my player (iTunes).

Code: Select all

[MeasureShuffle]
Measure=Plugin
Plugin=NowPlaying.dll
PlayerName=iTunes
PlayerType=Shuffle
Substitute="0":"Continuous","1":"Shuffle","-1":"Continuous"

[MeterShuffle]
Meter=Image
ImageName=#@#[MeasureShuffle].png
X=123
Y=241
W=35
H=35
Antialias=1
LeftMouseDownAction=[!CommandMeasure "SetShuffle" -1]
DynamicVariables=1
I feel I am close, however am stumped at the moment.

Suggestions welcome :D
My DevArt Gallery

There are many ways to be different - there is only one way to be yourself - be amazing at it

The law of averages says what it means; even if you get everything right, you will get something wrong. Therefore; self managing error trapping initiates another set of averages - amongst the errors, some of them will not be errors, instead those instances will appear to be "luck". One cannot complain of the 'appearance' of 'infinite regress of causation', even if it does not have a predictable pattern, only that it requires luck to achieve.
User avatar
Mor3bane
Posts: 943
Joined: May 7th, 2016, 7:32 am

Re: Toggle Shuffle & Button Image Issue

Post by Mor3bane »

Hey!

I figured it out 8D

Code: Select all

[MeasureShuffle]
Measure=Plugin
Plugin=NowPlaying.dll
PlayerName=#PlayerName#
PlayerType=Shuffle
Substitute="0":"#@#\Continuous.png","1":"#@#\Shuffle.png"

[MeterShuffle]
Meter=Image
MeasureName=MeasureShuffle
ImageName=#@#\Continuous.png
X=123
Y=241
W=35
H=35
Antialias=1
LeftMouseDownAction=[!CommandMeasure "MeasureShuffle" SetShuffle" 0][!Update]
DynamicVariables=1
 
[Shuffleon]
Meter=Image
MeasureName=MeasureShuffle
ImageName=#@#\Shuffle.png
X=r
Y=r
W=35
H=35
LeftMouseDownAction=[!CommandMeasure "MeasureShuffle" "SetShuffle -1"][!Update]
My DevArt Gallery

There are many ways to be different - there is only one way to be yourself - be amazing at it

The law of averages says what it means; even if you get everything right, you will get something wrong. Therefore; self managing error trapping initiates another set of averages - amongst the errors, some of them will not be errors, instead those instances will appear to be "luck". One cannot complain of the 'appearance' of 'infinite regress of causation', even if it does not have a predictable pattern, only that it requires luck to achieve.