Problem with "OnTrackEnd" event

This forum is for questions / discussions regarding development of addons / tweaks for MediaMonkey.

Moderator: Gurus

kacso
Posts: 18
Joined: Sat Feb 08, 2014 3:25 pm

Problem with "OnTrackEnd" event

Post by kacso » Mon Feb 17, 2014 9:58 am

I'm trying to play specified track after current track ends so I try to use OnTrackEnd event but it doesn't works as I suppose it should. When this event occurs MM start playing my track but right after that switch to next track.
So, how can I stop MM to switch track one extra time?

mcow
Posts: 820
Joined: Sun Sep 21, 2008 9:35 pm
Location: Cupertino, California

Re: Problem with "OnTrackEnd" event

Post by mcow » Fri Feb 21, 2014 6:38 pm

OnTrackEnd just means the track has completed; it's not stopping playback. You either need to put your track into Now Playing following the track that's playing now (i.e. Play Next) or you have stop playback yourself. In that case, wait for OnPlaybackEnd rather than OnTrackEnd.

An easy way to stop playback is to set SDB.Player.StopAfterCurrent to True.

kacso
Posts: 18
Joined: Sat Feb 08, 2014 3:25 pm

Re: Problem with "OnTrackEnd" event

Post by kacso » Sat Feb 22, 2014 7:04 am

I tried with onPlaybackEnd too but problem stays. OnPlay event I set SDB.Player.StopAfterCurrent to True and then onPlaybackEnd I play my track but MM still change track after me. Workable, but not to good, solution I found is play track at OnPlay event. Here is problem that MM starts playing next track from Now Playing before I manage to change track.
You say that I can put my track into Now Playing following the current playing track. Is it possible to do this without changing Now Playing playlist order and without turning off shuffle?

trixmoto
Posts: 10024
Joined: Fri Aug 26, 2005 3:28 am
Location: Hull, UK
Contact:

Re: Problem with "OnTrackEnd" event

Post by trixmoto » Mon Feb 24, 2014 9:40 am

I don't think you can force the player to play a particular song, all you can do is make sure it's next in the list and shuffle is switched off. This isn't ideal, but you could then use the next firing of the event to remove the track again and put shuffle back on, I guess.
Download my scripts at my own MediaMonkey fansite.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.

Post Reply