IPB

Welcome Guest ( Log In | Register )

> foobar2000 Development Forum Rules

This forum is for developer discussions only. If you have a problem / bug report / idea / feature request that isn't related to foobar2000 SDK, post it in an appropiate forum instead - tech support questions go to support forum, everything else goes to general forum.
All non-developer posts on this forum will be removed. Continued abuse of this forum will result in admin actions (warnings, account suspension).

 
Reply to this topicStart new topic
how to play specific track in playlist?
muzehyun
post Mar 25 2012, 05:37
Post #1





Group: Members
Posts: 13
Joined: 18-August 11
Member No.: 93119



How to start new track with given playlist index and item index?

I know how to play certain playlist
plm->set_playing_playlist(playlist_index);
But can't find one for track.

Thanks!
Go to the top of the page
+Quote Post
The vern
post Mar 25 2012, 09:31
Post #2





Group: Developer
Posts: 203
Joined: 2-June 09
Member No.: 70332



Try:
CODE
plm->playlist_execute_default_action( playlist_id, item_id );

HTH
Go to the top of the page
+Quote Post
muzehyun
post Mar 25 2012, 10:14
Post #3





Group: Members
Posts: 13
Joined: 18-August 11
Member No.: 93119



Thanks but I can't get it work.

plm->playlist_execute_default_action(playlist_index, item_index);
pbc->start();

It can start to play given playlist but not specified item, just start to play recently played one.

What did I do wrong?
Go to the top of the page
+Quote Post
The vern
post Mar 25 2012, 10:52
Post #4





Group: Developer
Posts: 203
Joined: 2-June 09
Member No.: 70332



You don't need to call pbc->start(). You're probably not passing valid indices to playlist_execute_default_action(), try something very simple. (calling pbc->start() will just restart the currently playing track, which sounds like what you're experiencing).

An alternative way of playing a track would be:
CODE
plm->playlist_set_focus_item( playlist_id, item_id );
pbc->start();

Go to the top of the page
+Quote Post
muzehyun
post Mar 25 2012, 12:57
Post #5





Group: Members
Posts: 13
Joined: 18-August 11
Member No.: 93119



thanks!!

It's wired that it works with only "playlist_execute_default_action"

--- bad ---
plm->playlist_execute_default_action(playlist_index, item_index);
pbc->start();
-------------

-- good ---
plm->playlist_execute_default_action(playlist_index, item_index);
-------------

why??
Go to the top of the page
+Quote Post
muzehyun
post Mar 25 2012, 13:09
Post #6





Group: Members
Posts: 13
Joined: 18-August 11
Member No.: 93119



nonono~~

It doesn't work for "playlist index"!!
I'm confusing!

The only way I can make it work is...
plm->set_active_playlist(playlist_index);
plm->playlist_execute_default_action(playlist_index, item_index);

?????
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 28th July 2014 - 15:33