In current pr-branch this feature that you have in mind is not (yet) available. In garbears dev-branch it should still be possible and may be integrated in xbmc with a later pr (at least I hope so).
Basically launching games via libretro can be done like starting a video (this still works in pr-branch):
Code:
xbmc.player.play(rom)
or
Code:
xbmc.executebuiltin('PlayMedia(\"%s\")' %rom)
rom should be the complete path to the rom file.
Everything below does not work in pr-branch.
We can tell RetroPlayer what platform or even what libretro core (gameclient) we want to use.
In the first example (using xbmc.player) it can be done like this:
Code:
listitem = xbmcgui.ListItem(rom, gamename, "", "")
listitem.setInfo( type="game", infoLabels={ "platform": platformname, "gameclient" : gameclient})
xbmc.player.play(rom, listitem)
In the second example it can be done like this:
Code:
xbmc.executebuiltin('PlayMedia(\"%s\", platform=%s, gameclient=%s)' %(rom, romCollection.name, romCollection.gameclient))
platform should be the name of the platform like you see it
here
gameclient should be the name of the gameclient addon (e.g. "gameclient.snes9x-next")
We can also get lists of all installed or installable gameclients if we want to provide configuration options.
Here is an example how to get lists of all gameclient addons (installed and not installed). At the end of
dialogcontextmenu.py you can see how this is done in RCB.
BTW: RCB is already prepared to do what you have in mind, including scraping and other stuff. As RetroPlayer starts to be integrated in xbmc sooner or later I also started to add full integration including UI options to configure RetroPlayer (until now this had to be done by editing the config file). Maybe it already fits your needs or you can gladly help out to make it better
. Otherwise feel free to ask if you have any questions while building your addon.