It is currently February 25th, 2020, 9:36 am

Anyway to make a clickable progress bar?

Help with creating, editing & fixing problems with skins
Shaka
Posts: 5
Joined: January 7th, 2020, 11:51 am

Anyway to make a clickable progress bar?

Post by Shaka »

I made a skin for Audio playback and want to make a progress bar that not only moves for the duration but where I can click to scrub through the song.
mak_kawa
Posts: 510
Joined: December 30th, 2015, 9:47 am

Re: Anyway to make a clickable progress bar?

Post by mak_kawa »

It can be achieved using Mouse variable and CommandMeasure to the NowPlaying measure, like this;

Code: Select all

[mPlayer]
Measure=NowPlaying
PlayerName=(your player name)
PlayerType=Title

[PlaybackBarBackground]
Meter=Image
ImageName=progress.png
X=
Y=
W=
H=
LeftMouseUpAction=[!CommandMeasure mPlayer "SetPosition $MouseX:%$"]
User avatar
jsmorley
Developer
Posts: 20280
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Anyway to make a clickable progress bar?

Post by jsmorley »

Having this react to clicking is doable, as noted above, and I might suggest that mouse wheel scrolling might be a good additional behavior, maybe even a better behavior.

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1

[MeasureValue]
Measure=Calc
Formula=0
MinValue=0
MaxValue=100

[MeterBack]
Meter=Shape
Shape=Rectangle 0,0,300,20 | StrokeWidth 0 | Fill Color 69,50,40,255
MouseScrollDownAction=[!SetOption MeasureValue Formula "Clamp([MeasureValue]+5,0,100)"][!UpdateMeasure MeasureValue][!UpdateMeter MeterBar][!Redraw]
MouseScrollUpAction=[!SetOption MeasureValue Formula "Clamp([MeasureValue]-5,0,100)"][!UpdateMeasure MeasureValue][!UpdateMeter MeterBar][!Redraw]

[MeterBar]
Meter=Bar
MeasureName=MeasureValue
W=300
H=20
BarColor=232,204,134,255
BarOrientation=Horizontal

test.gif
You do not have the required permissions to view the files attached to this post.
Shaka
Posts: 5
Joined: January 7th, 2020, 11:51 am

Re: Anyway to make a clickable progress bar?

Post by Shaka »

The mouse wheel shows it moving but, does not change song progress I must be doing something wrong.
User avatar
jsmorley
Developer
Posts: 20280
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Anyway to make a clickable progress bar?

Post by jsmorley »

Shaka wrote:
January 7th, 2020, 1:22 pm
The mouse wheel shows it moving but, does not change song progress I must be doing something wrong.
Probably.
User avatar
jsmorley
Developer
Posts: 20280
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Anyway to make a clickable progress bar?

Post by jsmorley »

Works for me...

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1

[MeasurePlayer]
Measure=NowPlaying
PlayerName=Winamp
PlayerType=Progress

[MeterBack]
Meter=Shape
Shape=Rectangle 0,0,300,20 | StrokeWidth 0 | Fill Color 69,50,40,255
MouseScrollDownAction=[!CommandMeasure MeasurePlayer "SetPosition +5"][!UpdateMeasure MeasurePlayer][!UpdateMeter MeterBar][!Redraw]
MouseScrollUpAction=[!CommandMeasure MeasurePlayer "SetPosition -5"][!UpdateMeasure MeasurePlayer][!UpdateMeter MeterBar][!Redraw]

[MeterBar]
Meter=Bar
MeasureName=MeasurePlayer
W=300
H=20
BarColor=232,204,134,255
BarOrientation=Horizontal
Dropkick Murphys
Shaka
Posts: 5
Joined: January 7th, 2020, 11:51 am

Re: Anyway to make a clickable progress bar?

Post by Shaka »

Thanks for all the help I'm super dense I got it working but, now I don't see the progress bar move but it scrubs I'm a mess.
Shaka
Posts: 5
Joined: January 7th, 2020, 11:51 am

Re: Anyway to make a clickable progress bar?

Post by Shaka »

Everything works fine now I was just making errors (as expected) sorry you had to deal with that and thanks.
User avatar
jsmorley
Developer
Posts: 20280
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Anyway to make a clickable progress bar?

Post by jsmorley »

Shaka wrote:
January 7th, 2020, 2:03 pm
Everything works fine now I was just making errors (as expected) sorry you had to deal with that and thanks.
Not to worry, glad to help.
User avatar
jsmorley
Developer
Posts: 20280
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Anyway to make a clickable progress bar?

Post by jsmorley »

No reason why you can't have both...

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1

[MeasurePlayer]
Measure=NowPlaying
PlayerName=Winamp
PlayerType=Progress

[MeterBack]
Meter=Shape
Shape=Rectangle 0,0,300,20 | StrokeWidth 0 | Fill Color 69,50,40,255
MouseScrollDownAction=[!CommandMeasure MeasurePlayer "SetPosition +5"][!UpdateMeasure MeasurePlayer][!UpdateMeter MeterBar][!Redraw]
MouseScrollUpAction=[!CommandMeasure MeasurePlayer "SetPosition -5"][!UpdateMeasure MeasurePlayer][!UpdateMeter MeterBar][!Redraw]
LeftMouseUpAction=[!CommandMeasure MeasurePlayer "SetPosition $MouseX:%$"][!UpdateMeasure MeasurePlayer][!UpdateMeter MeterBar][!Redraw]
DynamicVariables=1

[MeterBar]
Meter=Bar
MeasureName=MeasurePlayer
W=300
H=20
BarColor=232,204,134,255
BarOrientation=Horizontal