How to launch Retroplayer from an addon?
#1
I want to write a games addon, not relying on the automatic recognition of the emulated platform built in retroplayer, but instead setting explicity the local rom to load and what dll to use to run the game (e.g. according to the folder where the rom is). What is the python command and his syntax?
Reply
#2
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 betterSmile. Otherwise feel free to ask if you have any questions while building your addon.
Reply
#3
Ok, thanx for your help!
Reply
#4
Good luck getting it working. It's going to be useful for roms for different systems that share an extension.
Reply
#5
As malte said, the binaries I provided from the PR branch don't contain the python or json functionality here. When I rebase on alpha8, i'll release binaries for my dev branch that has this functionality added back in.
Reply
#6
ghizzu, if you're up for it, I had a good idea for a games plugin: showing ROMs from the sites listed in the public domain roms thread, and playing the http URL with XBMC.PlayMedia() (like streaming a video).
Reply

Logout Mark Read Team Forum Stats Members Help
How to launch Retroplayer from an addon?0