PDA

View Full Version : system.onnext() aaarrrrrrrgggg!!!!


mc^^^^
4th October 2002, 15:39
there is system.onplay() system.onpause() and system.onstop() BUt there is no system.onnext() or system.onprevious() !!!!!

WHY?

there is system.onTitleChange(string newtitle), but that doesnt help for what im doing :@

anyone know how to detect if the song has been skipped?

Gonzotek
4th October 2002, 16:19
I'd maybe start a timer inside of onTitleChange, call it skipTimer. Have it run for thirty secs (or less), then, if onTitlechange is called again you check if the timer is running. If it is, the song has probably been skipped. If it isn't start the timer. In the onTimer event, just stop the timer.

-=Gonzotek=-

mc^^^^
4th October 2002, 16:57
so smart, iv been trying to figure that out for hours!

it aint the best option (the best would be if there was onnext :()

thanx gonzo

Gonzotek
4th October 2002, 17:16
Originally posted by mc^^^^

it aint the best option (the best would be if there was onnext :()


I agree. I thought that maybe onStatusMsg would give us a glimpse of status changes (next prev, etc.), but I can't seem to get it to report ~anything~.

-=Gonzotek=-

frisbeemonkey
4th October 2002, 17:35
Maybe use a combination of onAccelerator() and onLeftMouseUp() to catch keyboard and button prev/nexts? That should cover all the ways I can think of offhand that can skip forward or back a song.
Hope this helps,
~FrisbeeMonkey

Gonzotek
4th October 2002, 17:42
onleftbuttonup won't help, because he's writing a Skin-Mod/AddOn script. That means it has to work with every skin, and the script has no way of knowing every possible way a next/prev action can be called (menu item/button/accel/maki/etc.).

-=Gonzotek=-

frisbeemonkey
4th October 2002, 17:51
Oooh, alrighty. I figured this was for a skin he was making, so he'd be able to get the buttons, could handle it anywhere else in MAKI he changed it, etc. (I did forget menus, though)
Maybe then start a timer onPlay() that tracks the song length, but rather than for only 30s let it run until onTitleChange(), then compare it with the song length. If the current song position is less than the songlength, the song has been skipped. Maybe pad the comparison a bit to account for crossfading, etc? You'd have to start and stop the timer on pauses and resumes of course.
~FrisbeeMonkey

will
4th October 2002, 19:26
perhaps you could establish the prev and next buttons using group.enumobject() and getxmlparam("action")?

Gonzotek
4th October 2002, 22:45
That still won't allow for skipping next/prev from the menu, and it's a lot of work for data that ought to be readily accesible to scripters. But, it might be a good solution for other things not related to this particular script.

-=Gonzotek=-

mc^^^^
5th October 2002, 06:41
now using

setDelay(getplayitemlength() * 0.3)

:D, if you dont get it, it sets the timers delay to 30% of the songlength, so if the user skips over 30% of the song it go down as skipped. this way if a song has a ghey intro that goes for 20 seconds they can skip that and till have it counted as completed