HydrogenAudio

Hosted Forums => foobar2000 => Development - (fb2k) => Topic started by: grimes on 2011-05-04 08:42:58

Title: Set focus on playlist
Post by: grimes on 2011-05-04 08:42:58
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)
Title: Set focus on playlist
Post by: kerpondile on 2011-05-04 14:04:29
Have you given proper p_playlist?

From the documentation I would that you should specify p_playlist but leave p_item as infinite.
Title: Set focus on playlist
Post by: grimes on 2011-05-04 14:25:09
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?
Title: Set focus on playlist
Post by: kerpondile on 2011-05-04 14:45:23
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);



Title: Set focus on playlist
Post by: grimes on 2011-05-04 15:20:43
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.

Title: Set focus on playlist
Post by: foosion on 2011-05-04 17:59:48
What exactly are you trying to do? Note that you cannot remove the keyboard focus from a playlist view using the playlist_manager service.
Title: Set focus on playlist
Post by: grimes on 2011-05-04 18:42:59
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?

Title: Set focus on playlist
Post by: kode54 on 2011-05-04 21:01:35
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.
Title: Set focus on playlist
Post by: foosion on 2011-05-05 08:56:47
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.
Title: Set focus on playlist
Post by: スラッシュ on 2011-05-05 11:05:59
It's probably related to my request made here (http://www.hydrogenaudio.org/forums/index.php?s=&showtopic=83748&view=findpost&p=754552)? 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 (http://www.hydrogenaudio.org/forums/index.php?showtopic=49589)/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).