Fetch the menu structure from the host and populate menu.SetItems
(when provided). Allocates ids starting at base_id (default 1)
and capped to max_id slots.
Optionalmenu: MenuTargetOptionalbase_id: numberOptionalmax_id: numberStructured menu tree (sub-menus / separators preserved).
Dispatch the previously-allocated menu id (or a raw numeric C++
command id outside the ids the last BuildMenu allocated). Returns
false when the command cannot be resolved, including an allocated id
whose row carried no commandId.
Configure the menu against an explicit handle list.
Configure the menu against the active playlist (no per-track scope).
Configure the menu against the now-playing track.
ContextMenuManager— Context-menu builder for tracks / playlists.Backend mapping:
BuildMenu(menu, base_id, max_id)→menu.getContextMenu({ mode, handles })ExecuteByID(id)→menu.runContextCommandById({ id, mode, handles })Three context modes mirror the SMP API:
InitContext(handles)→mode = 'handles', attach handle ids.InitContextPlaylist()→mode = 'playlist', no handles.InitNowPlaying()→mode = 'nowPlaying', no handles.ExecuteByIDalso accepts a numeric C++ command id directly; this keeps theme code that bypassesBuildMenuworking.