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: "Prefer current selection" vs. "Prefer currently playing track" (Read 2839 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

"Prefer current selection" vs. "Prefer currently playing track"

Is there a way to get the "Prefer current selection" vs. "Prefer currently playing track" user preference?

I'm using ui_selection_manager::get_selection_type() with "contextmenu_item::caller_now_playing / contextmenu_item::caller_active_playlist_selection" now but I'm not sure it's the best way.

Re: "Prefer current selection" vs. "Prefer currently playing track"

Reply #1
If you do this...

Code: [Select]
metadb_handle_list items;
ui_selection_manager_v2::get()->get_selection(items, 0);

.. the question is irrelevant. You get whatever the preferences are set to.

Re: "Prefer current selection" vs. "Prefer currently playing track"

Reply #2
If you do this...

Code: [Select]
metadb_handle_list items;
ui_selection_manager_v2::get()->get_selection(items, 0);

.. the question is irrelevant. You get whatever the preferences are set to.
True. Thx.

Re: "Prefer current selection" vs. "Prefer currently playing track"

Reply #3
If you do this...

Code: [Select]
metadb_handle_list items;
ui_selection_manager_v2::get()->get_selection(items, 0);

.. the question is irrelevant. You get whatever the preferences are set to.
True. Thx.
I was too quick: your suggestion does not cover my requirements.

playlist_manager::playlist_item_format_title() takes a playlist and item index. I don't see a way to get those from a metadb_handle_ptr.

Re: "Prefer current selection" vs. "Prefer currently playing track"

Reply #4
While I expose this API in my component for others to use, I don't use it/like it.

I prefer to roll my own preference to

1) prefer now playing, focused playlist item when stopped
2) always prefer focused playlist item

This way, I can get indexes.

Re: "Prefer current selection" vs. "Prefer currently playing track"

Reply #5
And just to expand on the above, the main reason for exposing my own preference is that I can have multiple instances not tied to the global fb2k setting.

An example: