How to play track by ID or playlist number?

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

How to play track by ID or playlist number?

Post by kacso »

Hi, as title says I'm trying to play some track by her ID or playlist number. For now I have just found a method play into SDBPlayer class but with that method I can't choose which track will be played.
Any solution for this?
kacso
Posts: 18
Joined: Sat Feb 08, 2014 3:25 pm

Re: How to play track by ID or playlist number?

Post by kacso »

I manage to play track using playlist number by moving track next to currently playing track then playing next track and after that returning track to her previous position BUT this works only when shuffle is off.

New question!
How to turn on/off shuffle?
For now I just now how to check if shuffle is on/off but don't now how to change that status.
mcow
Posts: 834
Joined: Sun Sep 21, 2008 9:35 pm
Location: Cupertino, California

Re: How to play track by ID or playlist number?

Post by mcow »

kacso wrote:How to turn on/off shuffle?
For now I just now how to check if shuffle is on/off but don't now how to change that status.
Assuming you're looking at the state using

Code: Select all

var shuffling = SDB.Player.isShuffle
then you can set it like:

Code: Select all

SDB.Player.isShuffle = 0
Peke
Posts: 17457
Joined: Tue Jun 10, 2003 7:21 pm
Location: Earth
Contact:

Re: How to play track by ID or playlist number?

Post by Peke »

Ok Not sure that I understand.
1. are you adding track to Now Playing and would like to start it automatically or ?
2. Can you give example where you use and need TrackID?
Best regards,
Peke
MediaMonkey Team lead QA/Tech Support guru
Admin of Free MediaMonkey addon Site HappyMonkeying
Image
Image
Image
How to attach PICTURE/SCREENSHOTS to forum posts
kacso
Posts: 18
Joined: Sat Feb 08, 2014 3:25 pm

Re: How to play track by ID or playlist number?

Post by kacso »

@mcow
I already done that but thanks anyway...

@Peke
Well, I'm searching for some track (by track title, artist name etc.) that is in Now Playing and need to play that track and that track must finally be on the same position in Now Playing as it was before. When user get results of search he select track from list and press "Enter". From there I can get SongID and after that I can find playlist number, so for now I moving track from previous position to position right after currently playing track, then turn off shuffle (if is on) and play next track. After that I move track back to previous position.
EDIT: I now done this using: SDB.Player.CurrentSongIndex = songIndex
Peke
Posts: 17457
Joined: Tue Jun 10, 2003 7:21 pm
Location: Earth
Contact:

Re: How to play track by ID or playlist number?

Post by Peke »

That confused me as SDB.Player.CurrentSongIndex is the right way, also it should set next song or at least you will be able to use that to set correct index on OnPlay event.

Think that ZvezdanD Queue script have similar example.
Best regards,
Peke
MediaMonkey Team lead QA/Tech Support guru
Admin of Free MediaMonkey addon Site HappyMonkeying
Image
Image
Image
How to attach PICTURE/SCREENSHOTS to forum posts
Post Reply