It is currently May 4th, 2024, 9:37 pm

Player Button Animation

Get help with creating, editing & fixing problems with skins
User avatar
tass_co
Posts: 517
Joined: May 4th, 2020, 3:01 pm
Location: Ankara, TURKEY

Re: Player Button Animation

Post by tass_co »

balala wrote: April 11th, 2022, 6:38 pm There is no such thing as Calc meter. Calc is a measure, not a meter.
Sorry my bad
balala wrote: April 11th, 2022, 6:38 pm So would you want to use a measure to get a value in one of the above intervals, in appropriate cases and show the corresponding frame of the bitmap? Sorry but I'm not sure I really understand your intention.
Yes balala. I guess, this way can solve my problem.
I can't think of any other way.
I don't know where i going from here, but i promise it won't be boring... :great:
User avatar
balala
Rainmeter Sage
Posts: 16200
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Player Button Animation

Post by balala »

tass_co wrote: April 11th, 2022, 7:07 pm Yes balala. I guess, this way can solve my problem.
I can't think of any other way.
Yep, but there is no image which is in accord with your description:
tass_co wrote: April 11th, 2022, 5:06 pm for example, we have one bitmap. The first 4 pictures are for play, 5-9 for pause, 10-15 for reverse play animation.
Such a bitmap is missing from your package, I think.
User avatar
tass_co
Posts: 517
Joined: May 4th, 2020, 3:01 pm
Location: Ankara, TURKEY

Re: Player Button Animation

Post by tass_co »

balala wrote: April 11th, 2022, 7:14 pm Yep, but there is no image which is in accord with your description:

Such a bitmap is missing from your package, I think.
No problem. I can create one from what I have :thumbup:

The important thing here is the formulas in Calc measures.

It will difficult me a lot.
I don't know where i going from here, but i promise it won't be boring... :great:
User avatar
balala
Rainmeter Sage
Posts: 16200
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Player Button Animation

Post by balala »

tass_co wrote: April 11th, 2022, 7:26 pm No problem. I can create one from what I have :thumbup:

The important thing here is the formulas in Calc measures.

It will difficult me a lot.
To be honest would much easier to help you with those formulas if I had the image.
User avatar
tass_co
Posts: 517
Joined: May 4th, 2020, 3:01 pm
Location: Ankara, TURKEY

Re: Player Button Animation

Post by tass_co »

balala wrote: April 11th, 2022, 8:11 pm To be honest would much easier to help you with those formulas if I had the image.
Thank you balala. you always help to us :great:
I don't know where i going from here, but i promise it won't be boring... :great:
User avatar
balala
Rainmeter Sage
Posts: 16200
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Player Button Animation

Post by balala »

tass_co wrote: April 11th, 2022, 8:36 pm Thank you balala. you always help to us :great:
:thumbup:
User avatar
tass_co
Posts: 517
Joined: May 4th, 2020, 3:01 pm
Location: Ankara, TURKEY

Re: Player Button Animation

Post by tass_co »

balala wrote: April 11th, 2022, 8:11 pm To be honest would much easier to help you with those formulas if I had the image.
balala, i have a question

I want to countdown 7 to 3 but how can I on Calc Measure?

This Formula countdown 7 to 0 :???:

Code: Select all

(CalcNext-1+(8))%8*#Calc01#

Code: Select all


[Variables]
Calc01=1

[CalcNext]
Measure=Calc
Formula=CalcNext+(CalcNext<3)
IfEqualValue=0
IfEqualAction=[!DisableMeasure #CURRENTSECTION#]
IfAboveValue=6
IfAboveAction=[!SetOption CalcNext Formula "(CalcNext-1+(8))%8*#Calc01#"]
Disabled=1
DynamicVariables=1

[CalcNext]
Measure=Calc
Formula=CalcNext+(CalcNext<3)
IfEqualValue=0
IfEqualAction=[!DisableMeasure #CURRENTSECTION#]
IfAboveValue=6
;FOR THIS LINE ==>> IfAboveAction=[!SetOption CalcNext Formula "(CalcNext-1+(8))%8*#Calc01#"]
Disabled=1
DynamicVariables=1

[MtrNext]
Meter=BitMap
MeasureName=CalcNext
BitmapImage=#in#
X=46
Y=5.5
BitmapFrames=11
BitmapExtend=1
MouseOverAction=[!SetOption CalcNext Formula "(CalcNext+(CalcNext<3))"][!EnableMeasure CalcNext][!Redraw]
MouseLeaveAction=[!SetOption CalcNext Formula "(CalcNext-1+(3))%(3)"][!EnableMeasure CalcNext][!Redraw]
LeftMouseDownAction=[!SetOption CalcNext Formula "(CalcNext+(CalcNext<7))"][!EnableMeasure CalcNext][!Redraw]
LeftMouseUpAction=
Hidden=1
DynamicVariables=1

EDIT: I handled it with IfBelowAction :thumbup:

Code: Select all

[CalcNext]
Measure=Calc
Formula=CalcNext+(CalcNext<3)
IfEqualValue=0
IfEqualAction=[!DisableMeasure #CURRENTSECTION#]
IfAboveValue=6
IfAboveAction=[!SetOption CalcNext Formula "(CalcNext-1+(8))%8*#Calc01#"][!SetOption CalcNext IfBelowValue "4"]
IfBelowValue=
IfBelowAction=[!SetOption CalcNext Formula "3"]
Disabled=1
DynamicVariables=1
I don't know where i going from here, but i promise it won't be boring... :great:
User avatar
balala
Rainmeter Sage
Posts: 16200
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Player Button Animation

Post by balala »

tass_co wrote: April 12th, 2022, 11:02 am I want to countdown 7 to 3 but how can I on Calc Measure?
Even if finally you succeeded by yourself, here is an alternative solution:

Code: Select all

[Variables]
From=7
To=3

[CalcNext]
Measure=Calc
Formula=(( CalcNext > #To# ) ? ( CalcNext - 1 ) : #From# )
...
No need here to use neither IfActions, nor IfConditions.
User avatar
tass_co
Posts: 517
Joined: May 4th, 2020, 3:01 pm
Location: Ankara, TURKEY

Re: Player Button Animation

Post by tass_co »

balala wrote: April 12th, 2022, 3:13 pm Even if finally you succeeded by yourself, here is an alternative solution:

Code: Select all

[Variables]
From=7
To=3

[CalcNext]
Measure=Calc
Formula=(( CalcNext > #To# ) ? ( CalcNext - 1 ) : #From# )
...
No need here to use neither IfActions, nor IfConditions.
I think there are minor errors.

Sometimes the animation doesn't work when the mouse is leaving the button.
Could you please check?

Also i want to add shuffle and repeate button.
But repeat has 3 modes on winamp. Disable/Repeat 1/Repeat All
How can I do that? I asking because NowPlaying measure has 2 modes :confused:

The buttons are a problem when the player is not working.
When I press the play button while Winamp is not running, it should run the application and play the track.
Otherwise, the play/pause button are wrong command sending.

Last minor error is media keys.
I can't update the skin when I use the media keys from the keyboard.
Likewise, the animations should work when the keyboard is pressed.

I know i want a lot of things... :D :D

text_.rmskin
You do not have the required permissions to view the files attached to this post.
I don't know where i going from here, but i promise it won't be boring... :great:
User avatar
balala
Rainmeter Sage
Posts: 16200
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Player Button Animation

Post by balala »

tass_co wrote: April 13th, 2022, 2:55 am Could you please check?
Seems extremely complicated for me to follow all those measures you have there. Therefor I rewrote the code and simplified a little bit, but I removed a few features of the skin. Later these can be added back. But first please check the code below. Just replace the code of your skin (make sure you have a backup before) with the below one and check.
Note a few changes:
  • Most important: I replaced the Update=25 with the default Update=1000.
  • Even if a while ago NowPlaying has been a plugin, in meantime it became an internal measure and should be treated accordingly. I did this.
  • I added two ActionTimer plugin measures ([MeasureAnimation] and [MeasurePlayPauseAnimation]). Since the value of Update has been increased, we need these measures in order to have proper animations.
  • Added a few new variables (Wait, Open, Play, UOpen and UPlay).
  • I rewrote the NowPlaying measures:
    • Added a new such measure ([MeasurePlayer]), used as the parent measure.
    • Rewrote the PlayerName options of the child measures ([Media] and [PlayerStatus]) in order to get them using the parent - child measure structure. In your code all NowPlaying measures have been set as parent measures, but a much better approach is to use these measures on a parent - child structure. In such a structure one measure has to be the parent measure (the one which has the PlayerName=#Player# option, in this case [MeasurePlayer]) while the others have to be the child measures (the ones using the PlayerName=[MeasurePlayer] option, in this case [Media] and [PlayerStatus]).
  • Didn't work so far with the repeat and shuffle features.
  • Left for now most not-used options, commenting them out.
Please check the code and let me know if it does work for you. Note that so far the buttons (play and pause) don't change / recolor when you're hovering the mouse over them, this still has to be done.

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1

[Variables]
in=#@#Images\next.png
ipr=#@#Images\prev.png
ipl=#@#Images\play.png
ipa=#@#Images\pause.png
io=#@#Images\openclose.png
;sh=#@#Images\shuffle.png
Player=Winamp
From7=7
To3=3
Calc01=1
Calc02=1
Calc03=1
Calc04=1
Calc05=1
Wait=20
Open=4
Play=15
UOpen=[!UpdateMeasure "MeasureAnimation"][!UpdateMeasure "CalcOpen"][!UpdateMeasure "Media"][!UpdateMeter "MtrOpen"][!Redraw]
UPlay=[!UpdateMeasure "MeasurePlayPauseAnimation"][!UpdateMeasure "CalcPlay"][!UpdateMeter "MtrPlay"][!Redraw]

;////////////////////////////////////////////////////////////// PLUGIN ///////////////////////////////////////

[MeasureAnimation]
Measure=Plugin
Plugin=ActionTimer
Group=Sliders
ActionList1=Repeat OpenAct,#Wait#,5
OpenAct=[!SetVariable Open "(Clamp((#Open#-1),0,4))"]#UOpen#
ActionList2=Repeat CloseAct,#Wait#,5
CloseAct=[!SetVariable Open "(Clamp((#Open#+1),0,4))"]#UOpen#
IfCondition=(#Open#=0)
IfTrueAction=[!HideMeter "MtrOpen"][!ShowMeterGroup "Buttons"][!Redraw]
IfFalseAction=[!ShowMeter "MtrOpen"][!HideMeterGroup "Buttons"][!Redraw]
DynamicVariables=1

[MeasurePlayPauseAnimation]
Measure=Plugin
Plugin=ActionTimer
Group=Sliders
ActionList1=Repeat PlayAct,#Wait#,15
PlayAct=[!SetVariable Play "(Clamp((#Play#-1),0,15))"]#UPlay#
ActionList2=Repeat PauseAct,#Wait#,15
PauseAct=[!SetVariable Play "(Clamp((#Play#+1),0,15))"]#UPlay#
;IfCondition=(#Open#=0)
;IfTrueAction=[!HideMeter "MtrOpen"][!ShowMeterGroup "Buttons"][!Redraw]
;IfFalseAction=[!ShowMeter "MtrOpen"][!HideMeterGroup "Buttons"][!Redraw]
DynamicVariables=1

[WinampPlaying]
Measure=Plugin
Plugin=WindowMessagePlugin
WindowClass=Winamp v1.x
WindowMessage=1024 0 104

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

[Media]
Measure=NowPlaying
PlayerName=[MeasurePlayer]
PlayerType=State
IfCondition=(((#CURRENTSECTION#=0)||(#CURRENTSECTION#=2))&&(#Open#=0))
IfTrueAction=[!ShowMeter "MtrPlay"][!CommandMeasure "MeasurePlayPauseAnimation" "Execute 1"][!CommandMeasure "MeasurePlayPauseAnimation" "Stop 2"][!Redraw]
IfCondition2=((#CURRENTSECTION#=1)&&(#Open#=0))
IfTrueAction2=[!ShowMeter "MtrPlay"][!CommandMeasure "MeasurePlayPauseAnimation" "Stop 1"][!CommandMeasure "MeasurePlayPauseAnimation" "Execute 2"][!Redraw]
;IfCondition3=(#Open#>0)
;IfTrueAction3=[!HideMeter "MtrPlay"][!HideMeter "MtrPause"][!Redraw]
DynamicVariables=1

[PlayerStatus]
Measure=NowPlaying
PlayerName=[MeasurePlayer]
PlayerType=Status
IfCondition=(#CURRENTSECTION#=0)
IfTrueAction=[!CommandMeasure "MeasureAnimation" "Stop 1"][!CommandMeasure "MeasureAnimation" "Execute 2"]
IfFalseAction=[!CommandMeasure "MeasureAnimation" "Execute 1"][!CommandMeasure "MeasureAnimation" "Stop 2"]
DynamicVariables=1

[Repeate]
Measure=Plugin
Plugin=Plugins\NowPlaying.dll
PlayerName=#Player#
PlayerType=Repeat
IfEqualValue=0
IfEqualAction=
IfEqualValue2=0
IfEqualAction2=
IfEqualValue3=0
IfEqualAction3=
;[!SetOption MeterRepeat ImageName #repeat1#][!UpdateMeter MeterRepeat][!Redraw]


;[Shuffle]

;////////////////////////////////////////////////////////////// CALC ///////////////////////////////////////

[CalcOpen]
Measure=Calc
Formula=#Open#
DynamicVariables=1

;[CalcNext]
;Measure=Calc
;Formula=CalcNext+(CalcNext<3)
;IfEqualValue=0
;IfEqualAction=[!DisableMeasure #CURRENTSECTION#]
;IfAboveValue=7
;IfAboveAction=[!SetOption CalcNext Formula "(CalcNext-1+(8))%8*#Calc01#"][!SetOption CalcNext ;IfBelowValue "4"][!UpdateMeasure CalcNext]
;IfBelowValue=
;IfBelowAction=[!SetOption CalcNext Formula "3"][!UpdateMeasure CalcNext]
;Disabled=1
;DynamicVariables=1

;[CalcPrev]
;Measure=Calc
;Formula=CalcPrev+(CalcPrev<3)
;IfEqualValue=0
;IfEqualAction=[!DisableMeasure #CURRENTSECTION#]
;IfAboveValue=7
;IfAboveAction=[!SetOption CalcPrev Formula "(CalcPrev-1+(8))%8*#Calc02#"][!SetOption CalcPrev ;IfBelowValue "4"][!UpdateMeasure CalcPrev]
;IfBelowValue=
;IfBelowAction=[!SetOption CalcPrev Formula "3"][!UpdateMeasure CalcPrev]
;Disabled=1
;DynamicVariables=1

[CalcPlay]
Measure=Calc
Formula=#Play#
;IfEqualValue=0
;IfEqualAction=[!DisableMeasure #CURRENTSECTION#]
;IfAboveValue=14
;IfAboveAction=[!SetOption CalcPause Formula "3"][!UpdateMeasure CalcPlay][!ShowMeter MtrPause][!HideMeter MtrPlay][!Redraw]
;Disabled=1
DynamicVariables=1

;[CalcPause]
;Measure=Calc
;Formula=CalcPause+(CalcPause<18)
;IfEqualValue=0
;IfEqualAction=[!DisableMeasure #CURRENTSECTION#]
;IfAboveValue=15
;IfAboveAction=[!SetOption CalcPlay Formula "3"][!UpdateMeasure CalcPause][!HideMeter MtrPause][!ShowMeter MtrPlay][!Redraw]
;Disabled=1
;DynamicVariables=1

[CalcShuffle]
Measure=Calc
Formula=CalcShuffle+(Shuffle<3)
IfEqualValue=0
IfEqualAction=[!DisableMeasure #CURRENTSECTION#]
IfAboveValue=6
IfAboveAction=[!SetOption CalcShuffle Formula "(CalcShuffle-1+(8))%8*#Calc03#"][!SetOption CalcShuffle IfBelowValue "4"][!UpdateMeasure CalcShuffle]
IfBelowValue=
IfBelowAction=[!SetOption CalcShuffle Formula "3"][!UpdateMeasure CalcShuffle]
Disabled=1
DynamicVariables=1

;////////////////////////////////////////////////////////////// ACTIONTIMER ///////////////////////////////////////
[MeaAgain]
Measure=Plugin
Plugin=ActionTimer
ActionList1=Repeat OkTorrent,4000,
OkTorrent=[""][!Delay 1000]
DynamicVariables=1
UpdateDivider=-1

;////////////////////////////////////////////////////////////// METER ///////////////////////////////////////

[MtrOpen]
Meter=BitMap
MeasureName=CalcOpen
BitmapImage=#io#
X=1
BitmapFrames=5
BitmapExtend=1
DynamicVariables=1

[MtrNext]
Meter=BitMap
MeasureName=CalcNext
BitmapImage=#in#
X=46
Y=5.5
BitmapFrames=11
BitmapExtend=1
MouseOverAction=[!SetOption CalcNext Formula "(CalcNext+(CalcNext<3))"][!UpdateMeasure CalcNext][!EnableMeasure CalcNext][!Redraw]
MouseLeaveAction=[!SetOption CalcNext Formula "(CalcNext-1+(3))%(3)"][!UpdateMeasure CalcNext][!EnableMeasure CalcNext][!Redraw]
LeftMouseDownAction=[!SetOption CalcNext Formula "(CalcNext+(CalcNext<8))"][!UpdateMeasure CalcNext][!EnableMeasure CalcNext][!Redraw][!CommandMeasure "Media" "Next"]
Group=Buttons
Hidden=1
DynamicVariables=1

[MtrPrev]
Meter=BitMap
MeasureName=CalcPrev
BitmapImage=#ipr#
X=1
Y=5.5
BitmapFrames=11
BitmapExtend=1
MouseOverAction=[!SetOption CalcPrev Formula "(CalcPrev+(CalcPrev<3))"][!UpdateMeasure CalcPrev][!EnableMeasure CalcPrev][!Redraw]
MouseLeaveAction=[!SetOption CalcPrev Formula "(CalcPrev-1+(3))%(3)"][!UpdateMeasure CalcPrev][!EnableMeasure CalcPrev][!Redraw]
LeftMouseDownAction=[!SetOption CalcPrev Formula "(CalcPrev+(CalcPrev<8))"][!EnableMeasure CalcPrev][!UpdateMeasure CalcPrev][!Redraw][!CommandMeasure "Media" "Previous"]
Group=Buttons
Hidden=1
DynamicVariables=1

[MtrPlay]
Meter=BitMap
MeasureName=CalcPlay
BitmapImage=#ipl#
X=24
Y=0
BitmapFrames=16
BitmapExtend=1
LeftMouseUpAction=[!CommandMeasure "MeasurePlayer" "PlayPause"]
;MouseOverAction=[!SetOption CalcPlay Formula "(CalcPlay+(CalcPlay<3))"][!UpdateMeasure CalcPlay][!EnableMeasure CalcPlay][!Redraw]
;MouseLeaveAction=[!SetOption CalcPlay Formula "(CalcPlay-1+(3))%(3)"][!UpdateMeasure CalcPlay][!EnableMeasure CalcPlay][!Redraw]
;LeftMouseDownAction=[!SetOption CalcPlay Formula "(CalcPlay+(CalcPlay<16))"][!UpdateMeasure CalcPlay][!EnableMeasure CalcPlay][!CommandMeasure "Media" "Play"][!Redraw]
;Group=Buttons
Hidden=1
DynamicVariables=1

;[MtrPause]
;Meter=BitMap
;MeasureName=CalcPause
;BitmapImage=#ipa#
;X=24
;Y=0
;BitmapFrames=17
;BitmapExtend=1
;MouseOverAction=[!SetOption CalcPause Formula "(CalcPause+(CalcPause<3))"][!UpdateMeasure CalcPause][!EnableMeasure CalcPause][!Redraw]
;MouseLeaveAction=[!SetOption CalcPause Formula "(CalcPause-1+(3))%(3)"][!UpdateMeasure CalcPause][!EnableMeasure CalcPause][!Redraw]
;LeftMouseDownAction=[!SetOption CalcPause Formula "(CalcPause+(CalcPause<17))"][!UpdateMeasure CalcPause][!EnableMeasure CalcPause][!CommandMeasure "Media" "Pause"][!Redraw]
;Group=Buttons
;Hidden=1
;DynamicVariables=1