I am trying to make a clickable seekbar, but it has proven to be quite difficult because of the way the command works.
[!CommandMeasure "mProgress" "SetPosition +10"] works to skip 10% forward,
but i am using a invisible overlay over the bar to calculate the mouse position over the bar.
I then send that calculation to mProgress as shown below.
But that percentage i arrive at from my calculation is from the beginning of the bar to the point i am clicking at.
Not from the point of progression of the song to where i am clicking.
I guess what i am trying to say is that i might need a little help with the math ;P
Or even another approach to this.
But i feel like it should be possible some how.
EDIT: So i managed to get the math right, but it just skips to the end or beginning of the song still. hmm
Code: Select all
[mProgress] Measure=Plugin Plugin=WebNowPlaying PlayerType=Progress [Progress] Meter=Bar MeasureName=mProgress X=r Y=30r W=200 H=6 BarColor=255,255,255 SolidColor=0,0,0,100 BarOrientation=Horizontal [mProgressFormula] Measure=Calc [ProgressClickArea] Meter=Image X=r Y=-9r W=[Progress:W] H=24 SolidColor=55,10,0,100 LeftMouseDownAction=[!SetOption mProgressFormula Formula "(($MouseX$)/([Progress:W])*100)"][!Update] LeftMouseUpAction=[!CommandMeasure "mProgress" "SetPosition [mProgressFormula]"] DynamicVariables=1
And if i spam the bar it some times work. double hmm
Code: Select all
[mProgressFormula] Measure=Calc OnChangeAction=[!CommandMeasure mProgress "SetPosition [mProgressFormula]"] [ProgressClickArea] Meter=Image X=r Y=-9r W=[Progress:W] H=24 SolidColor=55,10,0,100 LeftMouseUpAction=[!SetOption mProgressFormula Formula "((($MouseX$)/([Progress:W])*100)-[mProgress])"] DynamicVariables=1