Page 1 of 1

OnPlay event is not triggered all the time

Posted: Thu Apr 04, 2013 12:44 pm
by musinik
Steps to reproduce:
1. Add the script with name "FastForwardInDjMode.vbs" into Scripts/Auto.

Code: Select all

Sub OnStartup 
  Script.RegisterEvent SDB, "OnPlay", "ForwardInDjMode"
End Sub

Sub ForwardInDjMode
	Dim pltime

	pltime = 100

	If Not (SDB.Player.PlaybackTime+(pltime*1000) > SDB.Player.CurrentSongLength) Then
		SDB.Player.PlaybackTime = SDB.Player.PlaybackTime+(pltime*1000)
	End If
End Sub
2. Restart application
3. Start playing a track, by clicking on it in main window (I suppose it's called collection). Note, that the track starts from 1min 40sec.
4. Press "Next track" button. Note, that next track starts from 1min 40sec.
5. Repeat step 4. Note the same.
6. Press "Previous track" button. Note, that previous track starts from 0sec.
7. Repeat step 6. Note, that the track again starts from 1min 40sec.
8. Repeat steps 6 and 7.

Result:
OnPlay event is not triggered all the time, when navigating to the previous tracks, but is invoked one by one.

Environment:
Win7 SP1, Core2 Duo 3.0 GHz, 8 GB RAM, MediaMonkey 4.0.7.1511 Standard, MegaDJ plug-in enabled

Re: OnPlay event is not triggered all the time

Posted: Fri Apr 05, 2013 2:59 am
by Ludek
I see, you mean that pressing [Previous] when you are in the middle of a song seeks to the beggining of the song rather than changes to the previous track.

This is by design and I am not sure that OnPlay should be triggered, because actually playback was not started, the track was just seeked from 1:41 to 0:00
What do you think?

Re: OnPlay event is not triggered all the time

Posted: Fri Apr 05, 2013 7:23 am
by Ludek
BTW: I fixed is as http://www.ventismedia.com/mantis/view.php?id=10710 in build 1630 although I think that this issue is disputable.