Wintermute0110/plugin.program.AEL.dev

Integration with RetroPlayer

Closed this issue · 4 comments

Hi,

Sorry for opening an "issue" here; however, I'm not a Python developer and I was really just doing a tiny bit of hacking this evening to see if I could modify the AEL to work with RetroPlayer. I saw you mention on the Kodi.tv forums that you weren't sure how it works and, since I'm not a member there, I thought I'd share. I really don't consider myself competent enough to build this out and open a PR (this was literally my first time mucking with Python); but, I thought these things might be helpful.

I'm including a snippet below of what I did. Obviously, I was just hacking around; but, this does successfully launch a ROM from AEL into RetroPlayer.

One important note: it seems that RetroPlayer itself cannot introspect ZIP files by default (or maybe it's a configuration that I didn't mess with). I'm sure there's a way to have the add-on do it; however, in the interim, I simply extracted a few ROMS for testing The below code will launch and ask for which emulator to use and then launch the game in the selection. If the ROM is still zipped, you'll get the wrong options for emulators.

Basically, I replaced the 3 lines under "Execute External Application" with the below.

bc_romfile = os.path.basename(ROMFileName.getPath())
bc_listitem = xbmcgui.ListItem(bc_romfile, "0", "", "")
bc_parameters = {'Platform': 'Test Platform', 'Title': 'Test Game', 'URL': 'testurl'}
bc_listitem.setInfo( type='game', infoLabels=bc_parameters)
xbmc.Player().play(ROMFileName.getPath(), bc_listitem)

Hope this is helpful in integrating your addon with RetroPlayer. It seems like a match made in heaven! Thanks for the hard work!

Thanks a lot for your help. Is is absolutely fine to use Github for discussion. Every contribution counts!

Main problem now is that I have no easy access to a machine where I can test Retroplayer. I think I will install Retroplayer in a Windows virtual machine to do the development. Also, I have to think on a good integration of Retroplayer in AEL. For example, when creating a launcher the user can choose between an external emulator or Retroplayer OR Retroplayer may be an option in every ROM launcher so user can switch between an external emulator (if configured) or Retroplayer?

Another question: when you call xbmc.Player().play(ROMFileName.getPath(), bc_listitem) you don't specify the core to use, right? Does Retroplayer show a list of cores that support that particular ROM at launching time?

Yes, the default behavior for RetroPlayer is to show the available cores list. I'm honestly not sure if there's a way to pass the desired core into RetroPlayer. Since finding documentation for everything Kodi / RetroPlayer seems to be a bit of a pain, I wasn't able to dig into it.

OK. It will be very useful that AEL is aware in some way of the cores installed, so the user can choose from the list of cores for every launcher so it won't be asked every time a ROM is launched or alternatively do not pass the desired core to xbmc.Player().play() to keep current behavior.

I think I will do first an implementation based on your code, then I will open a thread in Retroplayer subforum to tell Garbear the features I need.

I think the former is the right approach. Honestly, with the direction that libretro is taking, there is very little reason to ever launch titles from a particular launcher outside of RetroPlayer since there will be many options for core within RetroPlayer itself.

OK then. I will add support for Retroplayer in 0.9.6. At launcher creation user will choose an external application OR Retroplayer. Later, the application/arguments can be edited/removed OR Retroplayer configured as launching app.

I agree with you that MAME + Retroplayer will cover emulation needs for 99% of the people (including myself). However, never underestimate what users will do or the features they will ask! There are some emulators (notably Dolphin and Sega Model 2) not supported by Retroarch and loved by some people.

Upsss... I am very sorry, I edited your comment by mistake! I didn't even know you can change comments by other people. Sorry again.

Hi. I just implemented Retroplayer support in last commit. When you create a launcher you can choose Retroplayer or an external launching app. In any case, in Edit Launcher > Advanced Modifications... > Change application you can edit any launcher to use Retroplayer or an external app (in Windows you also have the option to launch LNK files).

Please give a test and close the issue if you are happy. Report any problem or feature request you may have. Enjoy!