Problem with "OnTrackEnd" event

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

Moderators: Gurus, Addon Administrators

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

Problem with "OnTrackEnd" event

Post by kacso »

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: 834
Joined: Sun Sep 21, 2008 9:35 pm
Location: Cupertino, California

Re: Problem with "OnTrackEnd" event

Post by mcow »

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 »

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 »

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