Kodi Community Forum
random function - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32)
+--- Forum: Kodi Application (https://forum.kodi.tv/forumdisplay.php?fid=93)
+--- Thread: random function (/showthread.php?tid=83099)



random function - tungmeister - 2010-10-13

hi, I've decided i'm going to attempt to code a random function as mentioned here could someone tell me where I could locate the queue and play methods located in the context menu and where I could find and the context menu's method calls so I can see the variables that are passed, thanks.


- spiff - 2010-10-13

it's in xbmc/ ;P

contextmenu get filled from the GetContextButtons() function and handled in the OnContextButton() function. these are overloaded in all the media windows.


- tungmeister - 2010-10-13

cheers I'll have a look into it, see if my rusty limited knowledge is any good :p


- tungmeister - 2010-10-14

right I've got the function setup i now need to know where keyboard input is managed so i can map the function to a key, had a look but couldn't work it out based on file names lol


- spiff - 2010-10-14

you can define an action in Key.h. you then handle the action in the relevant media window. to use it, you map the action to a human name in ButtonTranslator.cpp. you then do the final mapping in e.g. keyboard.xml


- tungmeister - 2010-10-15

Right, think I've got it fully working so I've submitted a patch on trac if anyone is interested
http://trac.xbmc.org/ticket/10503