Documentation/FbUiSelectionHolder
class

FbUiSelectionHolder

js/foo_uie_jsplitter.js:4112

This is typically used to update the selection used by the default UI artwork panel or any other panel that makes use of the preferences under File > Preferences > Display > Selection viewers. Use in conjunction with the on_focus callback.

Examples

<caption>For playlist viewers</caption>
let selection_holder = fb.AcquireUiSelectionHolder();
selection_holder.SetPlaylistSelectionTracking();

function on_focus(is_focused) {
    if (is_focused) { // Updates the selection when panel regains focus
        selection_holder.SetPlaylistSelectionTracking();
    }
}
<caption>For library viewers</caption>
let selection_holder = fb.AcquireUiSelectionHolder();
let handle_list = null;

function on_mouse_lbtn_up(x, y) { // Presumably going to select something here...
   handle_list = ...;
   selection_holder.SetSelection(handle_list);
}

function on_focus(is_focused) {
   if (is_focused) { // Updates the selection when panel regains focus
       if (handle_list && handle_list.Count)
           selection_holder.SetSelection(handle_list);
   }
}
method

SetPlaylistSelectionTracking

js/foo_uie_jsplitter.js:4166
SetPlaylistSelectionTracking()

Sets selected items to playlist selection and enables tracking.
When the playlist selection changes, the stored selection is automatically updated. Tracking ends when a set method is called on any ui_selection_holder or when the last reference to this ui_selection_holder is released.

method

SetPlaylistTracking

js/foo_uie_jsplitter.js:4174
SetPlaylistTracking()

Sets selected items to playlist contents and enables tracking.
When the playlist selection changes, the stored selection is automatically updated. Tracking ends when a set method is called on any ui_selection_holder or when the last reference to this ui_selection_holder is released.

method

SetSelection

js/foo_uie_jsplitter.js:4149
SetSelection(handle_list, type)

Sets the selected items.

Parameters

NameTypeDescription
handle_listFbMetadbHandleList
type = 0optionalnumber

Selection type. Possible values:
0 - default, undefined
1 - active_playlist_selection
2 - caller_active_playlist
3 - playlist_manager
4 - now_playing
5 - keyboard_shortcut_list
6 - media_library_viewer