WSH Panel Mod Queue Selected Song

0

I'm using the default user interface and am trying to create a button to queue the selected song, the button is in a WSH panel mod running javascript. Is there a function to either (a) directly queue the selected song or (b) send a set of keystrokes that will queue the song (where the keyboard shortcut is defined in: Preferences > Keyboard Shortcuts > [context] > Add to playback queue)?

What I've found about the two methods are:

(a) There is a function "queue_add_item()" but I'm not sure how to pass in the selected item (inputs to this function are "metadb_handle_ptr" and "p_item")

(b) In Winamp I was able to send a keyboard shortcut by running a file in the directory, the XML code was:

System.navigateUrl(skin_dir"\scripts\ctrl_alt_q.vbs");

and "ctrl_alt_q.vbs" contained:

CreateObject("WScript.Shell").SendKeys "^%q"

user217558

Posted 2014-04-14T01:34:37.223

Reputation: 121

Answers

0

I discovered the RunContextCommandWithMetadb command which has a string input that corresponds to the labels in the [context] tree as seen in preferences when setting keyboard shortcuts. All that's required is:

fb.RunContextCommandWithMetadb("Add to playback queue",fb.GetFocusItem())

user217558

Posted 2014-04-14T01:34:37.223

Reputation: 121