Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Set focus on playlist (Read 3917 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Set focus on playlist

Quote
virtual void playlist_manager::playlist_set_focus_item (t_size p_playlist, t_size p_item) [pure virtual]

Sets index of focus item on specified playlist; use infinite to set no focus item.


I have a question concerning this command. I what to set no focus (remove existing focus), so i should use "infinite".
How do i do this? (pfc::infinite_size doesn't work)

Set focus on playlist

Reply #1
Have you given proper p_playlist?

From the documentation I would that you should specify p_playlist but leave p_item as infinite.

Set focus on playlist

Reply #2
Thanks for answer. 

p_playlist is not the problem, i use: (following command has no comment)

Quote
void playlist_manager::activeplaylist_set_focus_item(t_size p_item)



Quote
leave p_item as infinite.

I don't understand. Is pfc::infinite_size correct for p_item?

give please a code example.

What should i insert to unfocus the active playlist?

Set focus on playlist

Reply #3
Well I haven't tried these but here goes...

Does this work as expected?
Code: [Select]
static_api_ptr_t<playlist_manager> api;
api->activeplaylist_set_focus_item(pfc::infinite_size);


Or this (clears the selection)?
Code: [Select]
static_api_ptr_t<playlist_manager> api;
t_size playlist = api->get_active_playlist();
if(playlist != pfc::infinite_size)  api->playlist_clear_selection(playlist);




Set focus on playlist

Reply #4
both do not work 

Quote
virtual void playlist_manager::playlist_set_focus_item (t_size p_playlist, t_size p_item) [pure virtual]

Sets index of focus item on specified playlist; use infinite to set no focus item.


"set no focus item" probably not mean: remove existing focus/selection.


Set focus on playlist

Reply #5
What exactly are you trying to do? Note that you cannot remove the keyboard focus from a playlist view using the playlist_manager service.

Set focus on playlist

Reply #6
I want to make an option to repeat a playlist or jump to first track of next playlist at playlistend.

Never heard from difference between Keyboard Focus and Item Focus before. 

Any way to remove Keyboard Focus?


Set focus on playlist

Reply #7
It may be easier to manipulate the playback queue. As in, when playback reaches the last item in the current playlist, add the first track of the next playlist to the playback queue.

Set focus on playlist

Reply #8
Never heard from difference between Keyboard Focus and Item Focus before.
Actually I was just guessing what you might be doing. The focused item in a playlist is indeed independent of the keyboard focus in the sense that even inactive playlists can have a focused item.

 

Set focus on playlist

Reply #9
It's probably related to my request made here? Using the queue might not be a bad solution, as long as it is able to be overwritten by manual queue content (ie. even if the last song of the playlist ends, if you queued something else, that will play rather than the first song of the next playlist).

Maybe foo_scheduler/andrew_smolko can shed light on this though? It has a feature that skips to next playlist and starts playback at 1 (or any other number you want).