How to play track by ID or playlist number?

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

How to play track by ID or playlist number?

Post by kacso » Sat Feb 08, 2014 3:39 pm

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 » Mon Feb 10, 2014 10:26 am

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

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

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

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: 12302
Joined: Tue Jun 10, 2003 7:21 pm
Location: Serbia
Contact:

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

Post by Peke » Fri Feb 21, 2014 6:40 pm

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,
Pavle
MediaMonkey Team lead QA/Tech Support guru
Admin of Free MediaMonkey addon Site HappyMonkeying
Image
Image
How to add SCREENSHOTS to forum

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

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

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

@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: 12302
Joined: Tue Jun 10, 2003 7:21 pm
Location: Serbia
Contact:

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

Post by Peke » Sat Feb 22, 2014 8:23 am

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,
Pavle
MediaMonkey Team lead QA/Tech Support guru
Admin of Free MediaMonkey addon Site HappyMonkeying
Image
Image
How to add SCREENSHOTS to forum

Post Reply