Looking for a module that can jump to time in Winamp Thread last updated on 2004-08-25 01:34:53

Posted by member 12025 on 2004-08-24 15:30:08

NOT open the jump-to-time dialog box, but like, "!gototime 4:03".

Posted by member 37809 on 2004-08-24 16:01:31 link

It was broken in geekamp, and then removed in dynamp :/
Time to coax some module coders to fix it...

Anyhoo, here's a bang from my theme if you want to adjust it (I didn't bother to really clean it up after adding in foobar2000 support later; also there are some sanity checks for when the winamp time escape codes of xLabel weren't available in seconds units):
; seeks to a given time (give or take 3s i think)
; we have to do it the crazy way since !Amp_MovePosition is broken!
*script bang !maudioctrl_jumpto ;<seconds>
*script gotoif ("%{audiostatus}" = "Idle") donenow
; check current track to see if it has definite time
*script exec !LabelInfoExport b "[winampTotalTime('sec')]"
*script gotoif ("%{b}" = "0") done
*script gotoif ("%{b}" = "") done
*script exec !varset to %{\1}
; get current time
*script exec !LabelInfoExport a "[winampTime('sec')]"
*script exec !ifeval ("%{a}" = "") '|varset a 0'
*script exec !ifeval ("%{a}" = "-1") '|varset from 0' else '|varset from %{a}'

*script gotoif ("$audioplayer_foobar$" = "1") fb2k

; either rewind or fast forward
*script gotoif ("%{from}" < "%{to}") wfw
*script gotoif ("%{from}" > "%{to}") wrw
*script goto done
*script label wfw
*script exec !varset cmd ffwd
*script exec !varset amt %#%{to}-%{from}%#
*script goto wpre
*script label wrw
*script exec !varset cmd rewd
*script exec !varset amt %#%{from}-%{to}%#
*script label wpre
*script exec !varset m20 %#%{amt}/20%#
*script exec !varadd amt -%#20*%{m20}%#
*script exec !varset m10 %#%{amt}/10%#
*script exec !varadd amt -%#10*%{m10}%#
*script exec !varset m5 %#%{amt}/5%#
*script exec !varadd amt -%#5*%{m5}%#
*script label wl20
*script gotoif ("%{m20}" = "0") wdr
*script exec !amp_%{cmd}20s
*script exec !varadd m20 -1
*script goto wl20
*script label wdr
*script exec !ifeval ("%{m10}" = "1") '|amp_%{cmd}10s'
*script exec !ifeval ("%{m5}" = "1") '|amp_%{cmd}5s'
;*script exec !ifeval ("%{amt}" > "2") '|amp_%{cmd}5s'
*script label done
*script exec !LabelUpdate audioInfoTime
*script label donenow
*script exit
*script label fb2k
*script exec !ifeval ("%{audiostatus}" = "Playing") '|varset unpause true' else '|varset unpause false'
*script exec !ifeval ("%{unpause}" = "true") {"$FoobarPath$" /pause}
*script gotoif ("%{from}" < "%{to}") fw
*script gotoif ("%{from}" > "%{to}") rw
*script goto done
*script label fw
*script exec !varset cmd ahead
*script exec !varset amt %#%{to}-%{from}%#
*script goto pre
*script label rw
*script exec !varset cmd back
*script exec !varset amt %#%{from}-%{to}%#
*script label pre
*script exec !varset m600 %#%{amt}/600%#
*script exec !varadd amt -%#600*%{m600}%#
*script exec !varset m300 %#%{amt}/300%#
*script exec !varadd amt -%#300*%{m300}%#
*script exec !varset m120 %#%{amt}/120%#
*script exec !varadd amt -%#120*%{m120}%#
*script exec !varset m60 %#%{amt}/60%#
*script exec !varadd amt -%#60*%{m60}%#
*script exec !varset m30 %#%{amt}/30%#
*script exec !varadd amt -%#30*%{m30}%#
*script exec !varset m10 %#%{amt}/10%#
*script exec !varadd amt -%#10*%{m10}%#
*script exec !varset m5 %#%{amt}/5%#
*script exec !varadd amt -%#5*%{m5}%#
*script exec !varset m1 %{amt}
*script label l600
*script gotoif ("%{m600}" = "0") l300
*script exec "$FoobarPath$" /command:"Playback/Seek %{cmd} by 10 minutes"
*script exec !varadd m600 -1
*script goto l600
*script label l300
*script gotoif ("%{m300}" = "0") l120
*script exec "$FoobarPath$" /command:"Playback/Seek %{cmd} by 5 minutes"
*script label l120
*script gotoif ("%{m120}" = "0") l60
*script exec "$FoobarPath$" /command:"Playback/Seek %{cmd} by 2 minutes"
*script exec !varadd m120 -1
*script goto l120
*script label l60
*script gotoif ("%{m60}" = "0") l30
*script exec "$FoobarPath$" /command:"Playback/Seek %{cmd} by 1 minute"
*script label l30
*script gotoif ("%{m30}" = "0") l10
*script exec "$FoobarPath$" /command:"Playback/Seek %{cmd} by 30 seconds"
*script label l10
*script gotoif ("%{m10}" = "0") l5
*script exec "$FoobarPath$" /command:"Playback/Seek %{cmd} by 10 seconds"
*script exec !varadd m10 -1
*script goto l10
*script label l5
*script gotoif ("%{m5}" = "0") l1
*script exec "$FoobarPath$" /command:"Playback/Seek %{cmd} by 5 seconds"
*script label l1
*script gotoif ("%{m1}" = "0") l0
*script exec "$FoobarPath$" /command:"Playback/Seek %{cmd} by 1 second"
*script exec !varadd m1 -1
*script goto l1
*script label l0
*script exec !ifeval ("%{unpause}" = "true") {$maudioctrl_pause$}

*script goto done
*script ~bang

Posted by member 12025 on 2004-08-24 20:17:30 link

My idea is even more complex than that, and that's before doing the ff/rw bits :). I was hoping to do some LSSlider emulation through xLabel. Looks like I'll pass a slider by this time around, too.

Posted by member 37809 on 2004-08-25 00:10:47 link

What? Explain.

You can certainly make a progress bar/slider with xLabel or SkinBox or whatever else takes up/down clicks...

Posted by member 12025 on 2004-08-25 00:25:27 link

Use a timer and xLabel to get the current position. One label for the slider, one for the bar you slide. When moving it, you remove the X coord and borders and all of the label(s) it is hooked into, and get the X you want (subtract from %{mousex}, which can be reverse-engineered to a position in the song, to within rounding and truncation errors, since everything in LS likes to deal with integers at every step.

(Time*SliderWidth)/TotalTime = X coordinate of the center of the bar. On left-button-down, start a new timer that checks the x position and does the sliding (visually) and changing of position in the song. Say evern 25ms. On label-leave of the label the bar is hooked into, the 25ms timer stops, or on left-button-up.

This would basically allow for most of the functionality of LSSlider, but without being tied down to the dimensions of an image. My current dynamp buttons are magic pink labels with text in the middle, and then the label they are in has mouse click regions for the buttons. Any size at all. LSXCommand...any size at all. LSSlider...the size of the current bitmap image. But if I can only get it to +/-5 seconds, I may as well alt-tab and use the program's progress bar, since it would be much more accurate.

Posted by member 37809 on 2004-08-25 00:28:09 link

Oh, I was just confused by your statements, lacking context.

I have a progress bar/slider implementation, too (see my screenshot), done with SkinBox (it could be rehauled; to get past xLabel not having an event to handle releases outside of the Label I'll have to kill the seeking timer OnLeave, as you just mentioned; but I'm using SkinBox for its handy variables anyhow, so it's a moot point to replace it, unless I really wanted gradients :P ).

Yea, I have to agree it's a crummy, slow way of seeking. I use it more as a progress indicator than for seeking, though. For when I less often seek, it's good enough for now.

I'm also using this whole thing for resizability and colorizability :)

My ideals aren't as far-reaching as yours are though, since I have size constraints for my design. At a point things could look ridiculously disproportionate, since I only care about sizing in one dimension for this theme.

Posted by member 12025 on 2004-08-25 01:34:53 link

For mine, things need to match up, but a variable width and height are nice. With foo_winamp_spam, progress just works, but seeking to a spot is less-than-ideal in winamp (but works within 5s) or Foobar (doesn't work right w/o command line).

On the bright side, that's one less feature to make :)