•   
  • 1
  • 3
  • 4
  • 5(current)
  • 6
  • 7
  • 9
  •   
Android HOW-TO Configure Advanced Launcher and Rom Collection Browser for emulators
#61
(2014-11-12, 23:12)bradwatson Wrote:
(2014-11-12, 20:35)LakersFan Wrote: Brad,
Could I trouble you for your applaunch.sh and launcher.py files? I tried editing them as stated in the first post, but I get errors. Also, what version of RCB are you using? I'm on 2.0.17. Also, what version of Mupen are you using for N64? (I have a rooted FireTV.) And I know this is probably a really dumb question, but once I select the version of Mupen I use, does the program download it or do I need to sideload it manually and point to that?

I came to this thread from your XDA post on your awesome XBMC on Fire TV setup. So I know yours is working good. Smile

Thank you!
Traveling today, but should be able to get this info to you tomorrow.

Thank you, sir. No rush as I'm leaving tonight and will be back Friday afternoon...
Reply
#62
(2014-11-13, 00:59)LakersFan Wrote:
(2014-11-12, 23:12)bradwatson Wrote:
(2014-11-12, 20:35)LakersFan Wrote: Brad,
Could I trouble you for your applaunch.sh and launcher.py files? I tried editing them as stated in the first post, but I get errors. Also, what version of RCB are you using? I'm on 2.0.17. Also, what version of Mupen are you using for N64? (I have a rooted FireTV.) And I know this is probably a really dumb question, but once I select the version of Mupen I use, does the program download it or do I need to sideload it manually and point to that?

I came to this thread from your XDA post on your awesome XBMC on Fire TV setup. So I know yours is working good. Smile

Thank you!
Traveling today, but should be able to get this info to you tomorrow.

Thank you, sir. No rush as I'm leaving tonight and will be back Friday afternoon...

Here is my applaunch.sh file:
Code:
#!/bin/bash
# App Launch script - Quit XBMC to launch another program
# Thanks to rodalpho @ # http://xbmc.org/forum/showthread.php?t=34635
# By Redsandro     2008-07-07
# By ryosaeba87    2010-08-24 (Added support for MacOSX)
#


# Check for agruments
if [ -z "$*" ]; then
    echo "No arguments provided."
    echo "Usage:"
    echo "launcher.sh [/path/to/]executable [arguments]"
    exit
fi


#case "$(uname -s)" in
#    Darwin)
#        XBMC_PID=$(ps -A | grep XBMC.app | grep -v Helper | grep -v grep | awk '{print $1}')
#        XBMC_BIN=$(ps -A | grep XBMC.app | grep -v Helper | grep -v grep | awk '{print $5}')
#        ;;
#    Linux)
#        XBMC_PID=$(pidof xbmc.bin)
#        XBMC_BIN="xbmc"
#        ;;    
#    *)
#        echo "I don't support this OS!"
#        exit 1
#        ;;
#esac


# Is XBMC running?
if [ -n $XBMC_PID ]
then
    kill $XBMC_PID # Shutdown nice
    echo "Shutdown nice"
else
    echo "This script should only be run from within XBMC."
    exit
fi

# Wait for the kill
# sleep


# Is XBMC still running?
if [ -n $XBMC_PID ]
then
    kill -9 $XBMC_PID # Force immediate kill
    echo "Shutdown hard"    
fi

echo "$@"

# Launch app - escaped!
"$@"


# SOMETIMES xbmc starts too fast, and on some hardware if there is still a millisecond of sound being used, XBMC starts witout sound and some emulators say there is a problem with the sound hardware. If so, remove comment:
#sleep 1


# Done? Restart XBMC
$XBMC_BIN &

Here is my launcher.py file:
Code:
# Copyright (C) 2009-2013 Malte Loepmann ([email protected])
#
# This program is free software; you can redistribute it and/or modify it under the terms
# of the GNU General Public License as published by the Free Software Foundation;
# either version 2 of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
# without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along with this program;
# if not, see <http://www.gnu.org/licenses/>.


# I have built this script from scratch but you will find some lines or ideas that are taken
# from other xbmc scripts. Some basic ideas are taken from Redsandros "Arcade Browser" and I often
# had a look at Nuka1195's "Apple Movie Trailers" script while implementing this one. Thanks for your work!



import os, sys, re
import xbmcaddon


# Shared resources
addonPath = ''
addon = xbmcaddon.Addon(id='script.games.rom.collection.browser')
addonPath = addon.getAddonInfo('path')


BASE_RESOURCE_PATH = os.path.join(addonPath, "resources" )
sys.path.append( os.path.join( BASE_RESOURCE_PATH, "lib" ) )
sys.path.append( os.path.join( BASE_RESOURCE_PATH, "lib", "pyparsing" ) )
sys.path.append( os.path.join( BASE_RESOURCE_PATH, "lib", "pyscraper" ) )


# append the proper platforms folder to our path, xbox is the same as win32
env = ( os.environ.get( "OS", "win32" ), "win32", )[ os.environ.get( "OS", "win32" ) == "xbox" ]

# Check to see if using a 64bit version of Linux
if re.match("Linux", env):
    try:
        import platform
        env2 = platform.machine()
        if(env2 == "x86_64"):
            env = "Linux64"
    except:
        pass

sys.path.append( os.path.join( BASE_RESOURCE_PATH, "platform_libraries", env ) )


class dummyGUI():
    useRCBService = True
    player = xbmc.Player()
    
    def writeMsg(self, message):
        pass
    
    def saveViewState(self, isOnExit):
        pass
    

class Main():
    
    def __init__(self):
        print 'RCB: sys.argv = ' +str(sys.argv)
        launchRCB = False
        for arg in sys.argv:
            param = str(arg)
            print 'RCB: param = ' +param
            if param == '' or param == 'script.games.rom.collection.browser':
                print 'RCB: setting launchRCB = True'
                launchRCB = True
                    
            #provide data that skins can show on home screen
            if 'limit=' in param:
                print 'RCB: setting launchRCB = False'
                launchRCB = False
                #check if RCB should be launched at startup (via RCB Service)
                launchOnStartup = addon.getSetting('rcb_launchOnStartup')
                if(launchOnStartup.lower() == 'true'):
                    print "RCB: RCB will be started via RCB service. Won't gather widget data on this run."                    
                else:
                    self.gatherWidgetData(param)
                
            if 'launchid' in param:
                launchRCB = False
                self.launchGame(param)
                
        # Start the main gui
        print 'RCB: launchRCB = ' +str(launchRCB)
        if launchRCB:
            import gui
                
                
    def gatherWidgetData(self, param):
        print 'start gatherWidgetData'
        import util, helper
        from gamedatabase import Game, GameDataBase, File
        from config import Config, RomCollection
        
        gdb = GameDataBase(util.getAddonDataPath())
        gdb.connect()
        
        doImport, errorMsg = gdb.checkDBStructure()
        if(doImport) > 0:
            print "RCB: No database available. Won't gather any data."
            gdb.close()
            return
                
        #cache lookup tables
        yearDict = helper.cacheYears(gdb)
        publisherDict = helper.cachePublishers(gdb)
        developerDict = helper.cacheDevelopers(gdb)
        reviewerDict = helper.cacheReviewers(gdb)
        genreDict = helper.cacheGenres(gdb)
                
        limit = int(param.replace('limit=', ''))
        games = Game(gdb).getMostPlayedGames(limit)
        print 'most played games: %s' %games
        
        config = Config(None)
        statusOk, errorMsg = config.readXml()
        
        settings = util.getSettings()
        
        import xbmcgui
        count = 0
        for gameRow in games:
        
            count += 1
            try:
                print "Gathering data for rom no %i: %s" %(count, gameRow[util.ROW_NAME])
                
                romCollection = config.romCollections[str(gameRow[util.GAME_romCollectionId])]                
        
                #get artwork that is chosen to be shown in gamelist
                files = File(gdb).getFilesByParentIds(gameRow[util.ROW_ID], gameRow[util.GAME_romCollectionId], gameRow[util.GAME_publisherId], gameRow[util.GAME_developerId])
                fileDict = helper.cacheFiles(files)
                files = helper.getFilesByControl_Cached(gdb, romCollection.imagePlacingMain.fileTypesForGameList, gameRow[util.ROW_ID], gameRow[util.GAME_publisherId], gameRow[util.GAME_developerId], gameRow[util.GAME_romCollectionId], fileDict)        
                if(files != None and len(files) != 0):
                    thumb = files[0]
                else:
                    thumb = ""
                    
                files = helper.getFilesByControl_Cached(gdb, romCollection.imagePlacingMain.fileTypesForMainViewBackground, gameRow[util.ROW_ID], gameRow[util.GAME_publisherId], gameRow[util.GAME_developerId], gameRow[util.GAME_romCollectionId], fileDict)        
                if(files != None and len(files) != 0):
                    fanart = files[0]
                else:
                    fanart = ""
                
                description = gameRow[util.GAME_description]
                if(description == None):
                    description = ""
                
                year = helper.getPropertyFromCache(gameRow, yearDict, util.GAME_yearId, util.ROW_NAME)
                publisher = helper.getPropertyFromCache(gameRow, publisherDict, util.GAME_publisherId, util.ROW_NAME)
                developer = helper.getPropertyFromCache(gameRow, developerDict, util.GAME_developerId, util.ROW_NAME)
                genre = genreDict[gameRow[util.ROW_ID]]
                
                maxplayers = helper.saveReadString(gameRow[util.GAME_maxPlayers])
                rating = helper.saveReadString(gameRow[util.GAME_rating])
                votes = helper.saveReadString(gameRow[util.GAME_numVotes])
                url = helper.saveReadString(gameRow[util.GAME_url])
                region = helper.saveReadString(gameRow[util.GAME_region])
                media = helper.saveReadString(gameRow[util.GAME_media])                
                perspective = helper.saveReadString(gameRow[util.GAME_perspective])
                controllertype = helper.saveReadString(gameRow[util.GAME_controllerType])
                originaltitle = helper.saveReadString(gameRow[util.GAME_originalTitle])
                alternatetitle = helper.saveReadString(gameRow[util.GAME_alternateTitle])
                translatedby = helper.saveReadString(gameRow[util.GAME_translatedBy])
                version = helper.saveReadString(gameRow[util.GAME_version])
                playcount = helper.saveReadString(gameRow[util.GAME_launchCount])
                
                #get launch command
                filenameRows = File(gdb).getRomsByGameId(gameRow[util.ROW_ID])
                
                xbmcgui.Window(10000).setProperty("MostPlayedROM.%d.Id" %count, str(gameRow[util.ROW_ID]))
                xbmcgui.Window(10000).setProperty("MostPlayedROM.%d.Console" %count, romCollection.name)
                xbmcgui.Window(10000).setProperty("MostPlayedROM.%d.Title" %count, gameRow[util.ROW_NAME])
                xbmcgui.Window(10000).setProperty("MostPlayedROM.%d.Thumb" %count, thumb)
                xbmcgui.Window(10000).setProperty("MostPlayedROM.%d.Fanart" %count, fanart)
                xbmcgui.Window(10000).setProperty("MostPlayedROM.%d.Plot" %count, description)
                xbmcgui.Window(10000).setProperty("MostPlayedROM.%d.Year" %count, year)
                xbmcgui.Window(10000).setProperty("MostPlayedROM.%d.Publisher" %count, publisher)
                xbmcgui.Window(10000).setProperty("MostPlayedROM.%d.Developer" %count, developer)
                xbmcgui.Window(10000).setProperty("MostPlayedROM.%d.Genre" %count, genre)
                
                xbmcgui.Window(10000).setProperty("MostPlayedROM.%d.Maxplayers" %count, maxplayers)
                xbmcgui.Window(10000).setProperty("MostPlayedROM.%d.Region" %count, region)
                xbmcgui.Window(10000).setProperty("MostPlayedROM.%d.Media" %count, media)
                xbmcgui.Window(10000).setProperty("MostPlayedROM.%d.Perspective" %count, perspective)
                xbmcgui.Window(10000).setProperty("MostPlayedROM.%d.Controllertype" %count, controllertype)
                xbmcgui.Window(10000).setProperty("MostPlayedROM.%d.Playcount" %count, playcount)                
                xbmcgui.Window(10000).setProperty("MostPlayedROM.%d.Rating" %count, rating)
                xbmcgui.Window(10000).setProperty("MostPlayedROM.%d.Votes" %count, votes)
                xbmcgui.Window(10000).setProperty("MostPlayedROM.%d.Url" %count, url)                
                xbmcgui.Window(10000).setProperty("MostPlayedROM.%d.Originaltitle" %count, originaltitle)
                xbmcgui.Window(10000).setProperty("MostPlayedROM.%d.Alternatetitle" %count, alternatetitle)
                xbmcgui.Window(10000).setProperty("MostPlayedROM.%d.Translatedby" %count, translatedby)
                xbmcgui.Window(10000).setProperty("MostPlayedROM.%d.Version" %count, version)
                                
            except Exception, (exc):
                print 'RCB: Error while getting most played games: ' +str(exc)
        
        gdb.close()
    
    
    def launchGame(self, param):
        import launcher, util
        from gamedatabase import GameDataBase
        from config import Config
        
        gdb = GameDataBase(util.getAddonDataPath())
        gdb.connect()
        
        gameId = int(param.replace('launchid=', ''))
        
        config = Config(None)
        statusOk, errorMsg = config.readXml()
        
        settings = util.getSettings()
        
        gui = dummyGUI()
        
        launcher.launchEmu(gdb, gui, gameId, config, settings, None)


if ( __name__ == "__main__" ):
    print 'RCB started'
    try:
        Main()
    except Exception, (exc):
        message = 'Unhandled exception occured during execution of RCB:'
        message2 = str(exc)
        message3 = 'See xbmc.log for details'
        print message
        print message2
        import xbmcgui
        xbmcgui.Dialog().ok("Rom Collection Browser", message, message2, message3)

It looks like I'm running Mupen64 Plus AE - Version: 2.4.4 Version Code: 36. It will not automatically download this for you I don't think. Pretty sure you will have to sideload it. If you have the play store working, you can probably install it directly from there.
Reply
#63
In my case XBMC and RCB on a Fire TV are not working Undecided
XBMC and Snes Ex+ are working standalone prettygood, but with installed RCB and modified files I cannot start roms directly from RCB.

Here's a log from the start process of a rom:

PHP Code:
18:50:32 T:1518535688  NOTICERCB_INFOPutting extracted file in /storage/emulated/0/Android/data/org.xbmc.xbmc/files/.xbmc/userdata/profiles/Stereo/addon_data/script.games.rom.collection.browser/tmp/Axelay.smc
18
:50:32 T:1518535688  NOTICEroms compressed = ['/storage/emulated/0/Android/data/org.xbmc.xbmc/files/.xbmc/userdata/profiles/Stereo/addon_data/script.games.rom.collection.browser/tmp/Axelay.smc']
18:50:32 T:1518535688  NOTICERCB_INFONo precmd created.
18:50:32 T:1518535688  NOTICERCB_INFONo postcmd created.
18:50:32 T:1518535688  NOTICERCB_INFOcmd"/system/bin/am" start -n com.explusalpha.Snes9xPlus/com.imagine.BaseActivity -a android.intent.action.VIEW -eu Uri "file:///storage/emulated/0/Android/data/org.xbmc.xbmc/files/.xbmc/userdata/profiles/Stereo/addon_data/script.games.rom.collection.browser/tmp/Axelay.smc"
18:50:32 T:1518535688  NOTICERCB_INFOprecmd:
18:50:32 T:1518535688  NOTICERCB_INFOpostcmd:
18:50:32 T:1518535688  NOTICERCB_INFOlaunchEmu on non-xbox
18
:50:32 T:1518535688  NOTICERCB_INFOscreenMode1920x1080 60.00 Full Screen
18
:50:32 T:1518535688  NOTICERCB_INFOlaunch emu
18
:50:33 T:1518535688  NOTICERCB_INFOlaunch emu done
18
:50:33 T:1512116448  NOTICEFound 1 Lists of Devices
18
:50:33 T:1512116448  NOTICEEnumerated AUDIOTRACK devices:
18:50:33 T:1512116448  NOTICE:     Device 1
18
:50:33 T:1512116448  NOTICE:         m_deviceName      AudioTrack
18
:50:33 T:1512116448  NOTICE:         m_displayName     android
18
:50:33 T:1512116448  NOTICE:         m_displayNameExtraaudiotrack
18
:50:33 T:1512116448  NOTICE:         m_deviceType      AE_DEVTYPE_HDMI
18
:50:33 T:1512116448  NOTICE:         m_channels        FL,FR
18
:50:33 T:1512116448  NOTICE:         m_sampleRates     48000
18
:50:33 T:1512116448  NOTICE:         m_dataFormats     AE_FMT_S16LE,AE_FMT_AC3,AE_FMT_DTS
18
:50:33 T:1512512352    INFOCActiveAESink::OpenSink initialize sink
18
:50:33 T:1512512352   DEBUGCActiveAESink::OpenSink trying to open device AUDIOTRACK:AudioTrack
18
:50:33 T:1512512352   DEBUGCActiveAESink::OpenSink AUDIOTRACK Initialized:
18:50:33 T:1512512352   DEBUG:   Output Device android
18
:50:33 T:1512512352   DEBUG:   Sample Rate   48000
18
:50:33 T:1512512352   DEBUG:   Sample Format AE_FMT_S16NE
18
:50:33 T:1512512352   DEBUG:   Channel Count 2
18
:50:33 T:1512512352   DEBUG:   Channel LayoutFL,FR
18
:50:33 T:1512512352   DEBUG:   Frames        1536
18
:50:33 T:1512512352   DEBUG:   Frame Samples 3072
18
:50:33 T:1512512352   DEBUG:   Frame Size    4
18
:50:33 T:1512116448   DEBUGCActiveAE::ClearDiscardedBuffers buffer pool deleted
18
:50:33 T:1518535688  NOTICERCB_INFOEnd launcher.launchEmu
18
:50:33 T:1518535688  NOTICERCB_INFOEnd launchEmu
18
:50:33 T:1518535688  NOTICERCB_INFOonAction7
18
:50:34 T:1511097160   DEBUGKeyboardscancode0x04sym0x0008unicode0x0000modifier0x0
18
:50:34 T:1511097160   DEBUGbool CApplication::OnKey(const CKey&): backspace (0xf008pressedaction is Back
18
:50:34 T:1518535688  NOTICERCB_INFOonAction92
18
:50:34 T:1518535688  NOTICERCB_INFOonActionACTION_CANCEL_DIALOG
18
:50:34 T:1518535688  NOTICERCB_INFO: exit
18:50:34 T:1518535688  NOTICERCB_INFOBegin saveViewState
18
:50:34 T:1518535688  NOTICERCB_INFOBegin saveViewMode
18
:50:34 T:1518535688  NOTICERCB_INFOEnd saveViewMode
18
:50:34 T:1518535688  NOTICERCB_INFOBegin helper.saveViewState
18
:50:34 T:1518535688  NOTICERCB_INFOEnd helper.saveViewState
18
:50:34 T:1518535688  NOTICERCB_INFOEnd saveViewState 

Are all changing of the files still necessary?
Cause I saw that I can directly choose the right emulator on my config, and the start parameter in config.xml is ok.

Thanks for your Help!
Kodi 19.3 Intel NUC7I3BNH [Kaby Lake i3-7100U/HD620 graphics] | Windows 10 - 21H2 [1920x1080/60Hz]
LG OLED65G19 | Yamaha V4A AV-Receiver
Reply
#64
(2014-11-14, 18:16)bradwatson Wrote:
(2014-11-13, 00:59)LakersFan Wrote:
(2014-11-12, 23:12)bradwatson Wrote: Traveling today, but should be able to get this info to you tomorrow.

Thank you, sir. No rush as I'm leaving tonight and will be back Friday afternoon...

Here is my applaunch.sh file:
Code:
#!/bin/bash
# App Launch script - Quit XBMC to launch another program
# Thanks to rodalpho @ # http://xbmc.org/forum/showthread.php?t=34635
# By Redsandro     2008-07-07
# By ryosaeba87    2010-08-24 (Added support for MacOSX)
#


# Check for agruments
if [ -z "$*" ]; then
    echo "No arguments provided."
    echo "Usage:"
    echo "launcher.sh [/path/to/]executable [arguments]"
    exit
fi


#case "$(uname -s)" in
#    Darwin)
#        XBMC_PID=$(ps -A | grep XBMC.app | grep -v Helper | grep -v grep | awk '{print $1}')
#        XBMC_BIN=$(ps -A | grep XBMC.app | grep -v Helper | grep -v grep | awk '{print $5}')
#        ;;
#    Linux)
#        XBMC_PID=$(pidof xbmc.bin)
#        XBMC_BIN="xbmc"
#        ;;    
#    *)
#        echo "I don't support this OS!"
#        exit 1
#        ;;
#esac


# Is XBMC running?
if [ -n $XBMC_PID ]
then
    kill $XBMC_PID # Shutdown nice
    echo "Shutdown nice"
else
    echo "This script should only be run from within XBMC."
    exit
fi

# Wait for the kill
# sleep


# Is XBMC still running?
if [ -n $XBMC_PID ]
then
    kill -9 $XBMC_PID # Force immediate kill
    echo "Shutdown hard"    
fi

echo "$@"

# Launch app - escaped!
"$@"


# SOMETIMES xbmc starts too fast, and on some hardware if there is still a millisecond of sound being used, XBMC starts witout sound and some emulators say there is a problem with the sound hardware. If so, remove comment:
#sleep 1


# Done? Restart XBMC
$XBMC_BIN &

Here is my launcher.py file:
Code:
# Copyright (C) 2009-2013 Malte Loepmann ([email protected])
#
# This program is free software; you can redistribute it and/or modify it under the terms
# of the GNU General Public License as published by the Free Software Foundation;
# either version 2 of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
# without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along with this program;
# if not, see <http://www.gnu.org/licenses/>.


# I have built this script from scratch but you will find some lines or ideas that are taken
# from other xbmc scripts. Some basic ideas are taken from Redsandros "Arcade Browser" and I often
# had a look at Nuka1195's "Apple Movie Trailers" script while implementing this one. Thanks for your work!



import os, sys, re
import xbmcaddon


# Shared resources
addonPath = ''
addon = xbmcaddon.Addon(id='script.games.rom.collection.browser')
addonPath = addon.getAddonInfo('path')


BASE_RESOURCE_PATH = os.path.join(addonPath, "resources" )
sys.path.append( os.path.join( BASE_RESOURCE_PATH, "lib" ) )
sys.path.append( os.path.join( BASE_RESOURCE_PATH, "lib", "pyparsing" ) )
sys.path.append( os.path.join( BASE_RESOURCE_PATH, "lib", "pyscraper" ) )


# append the proper platforms folder to our path, xbox is the same as win32
env = ( os.environ.get( "OS", "win32" ), "win32", )[ os.environ.get( "OS", "win32" ) == "xbox" ]

# Check to see if using a 64bit version of Linux
if re.match("Linux", env):
    try:
        import platform
        env2 = platform.machine()
        if(env2 == "x86_64"):
            env = "Linux64"
    except:
        pass

sys.path.append( os.path.join( BASE_RESOURCE_PATH, "platform_libraries", env ) )


class dummyGUI():
    useRCBService = True
    player = xbmc.Player()
    
    def writeMsg(self, message):
        pass
    
    def saveViewState(self, isOnExit):
        pass
    

class Main():
    
    def __init__(self):
        print 'RCB: sys.argv = ' +str(sys.argv)
        launchRCB = False
        for arg in sys.argv:
            param = str(arg)
            print 'RCB: param = ' +param
            if param == '' or param == 'script.games.rom.collection.browser':
                print 'RCB: setting launchRCB = True'
                launchRCB = True
                    
            #provide data that skins can show on home screen
            if 'limit=' in param:
                print 'RCB: setting launchRCB = False'
                launchRCB = False
                #check if RCB should be launched at startup (via RCB Service)
                launchOnStartup = addon.getSetting('rcb_launchOnStartup')
                if(launchOnStartup.lower() == 'true'):
                    print "RCB: RCB will be started via RCB service. Won't gather widget data on this run."                    
                else:
                    self.gatherWidgetData(param)
                
            if 'launchid' in param:
                launchRCB = False
                self.launchGame(param)
                
        # Start the main gui
        print 'RCB: launchRCB = ' +str(launchRCB)
        if launchRCB:
            import gui
                
                
    def gatherWidgetData(self, param):
        print 'start gatherWidgetData'
        import util, helper
        from gamedatabase import Game, GameDataBase, File
        from config import Config, RomCollection
        
        gdb = GameDataBase(util.getAddonDataPath())
        gdb.connect()
        
        doImport, errorMsg = gdb.checkDBStructure()
        if(doImport) > 0:
            print "RCB: No database available. Won't gather any data."
            gdb.close()
            return
                
        #cache lookup tables
        yearDict = helper.cacheYears(gdb)
        publisherDict = helper.cachePublishers(gdb)
        developerDict = helper.cacheDevelopers(gdb)
        reviewerDict = helper.cacheReviewers(gdb)
        genreDict = helper.cacheGenres(gdb)
                
        limit = int(param.replace('limit=', ''))
        games = Game(gdb).getMostPlayedGames(limit)
        print 'most played games: %s' %games
        
        config = Config(None)
        statusOk, errorMsg = config.readXml()
        
        settings = util.getSettings()
        
        import xbmcgui
        count = 0
        for gameRow in games:
        
            count += 1
            try:
                print "Gathering data for rom no %i: %s" %(count, gameRow[util.ROW_NAME])
                
                romCollection = config.romCollections[str(gameRow[util.GAME_romCollectionId])]                
        
                #get artwork that is chosen to be shown in gamelist
                files = File(gdb).getFilesByParentIds(gameRow[util.ROW_ID], gameRow[util.GAME_romCollectionId], gameRow[util.GAME_publisherId], gameRow[util.GAME_developerId])
                fileDict = helper.cacheFiles(files)
                files = helper.getFilesByControl_Cached(gdb, romCollection.imagePlacingMain.fileTypesForGameList, gameRow[util.ROW_ID], gameRow[util.GAME_publisherId], gameRow[util.GAME_developerId], gameRow[util.GAME_romCollectionId], fileDict)        
                if(files != None and len(files) != 0):
                    thumb = files[0]
                else:
                    thumb = ""
                    
                files = helper.getFilesByControl_Cached(gdb, romCollection.imagePlacingMain.fileTypesForMainViewBackground, gameRow[util.ROW_ID], gameRow[util.GAME_publisherId], gameRow[util.GAME_developerId], gameRow[util.GAME_romCollectionId], fileDict)        
                if(files != None and len(files) != 0):
                    fanart = files[0]
                else:
                    fanart = ""
                
                description = gameRow[util.GAME_description]
                if(description == None):
                    description = ""
                
                year = helper.getPropertyFromCache(gameRow, yearDict, util.GAME_yearId, util.ROW_NAME)
                publisher = helper.getPropertyFromCache(gameRow, publisherDict, util.GAME_publisherId, util.ROW_NAME)
                developer = helper.getPropertyFromCache(gameRow, developerDict, util.GAME_developerId, util.ROW_NAME)
                genre = genreDict[gameRow[util.ROW_ID]]
                
                maxplayers = helper.saveReadString(gameRow[util.GAME_maxPlayers])
                rating = helper.saveReadString(gameRow[util.GAME_rating])
                votes = helper.saveReadString(gameRow[util.GAME_numVotes])
                url = helper.saveReadString(gameRow[util.GAME_url])
                region = helper.saveReadString(gameRow[util.GAME_region])
                media = helper.saveReadString(gameRow[util.GAME_media])                
                perspective = helper.saveReadString(gameRow[util.GAME_perspective])
                controllertype = helper.saveReadString(gameRow[util.GAME_controllerType])
                originaltitle = helper.saveReadString(gameRow[util.GAME_originalTitle])
                alternatetitle = helper.saveReadString(gameRow[util.GAME_alternateTitle])
                translatedby = helper.saveReadString(gameRow[util.GAME_translatedBy])
                version = helper.saveReadString(gameRow[util.GAME_version])
                playcount = helper.saveReadString(gameRow[util.GAME_launchCount])
                
                #get launch command
                filenameRows = File(gdb).getRomsByGameId(gameRow[util.ROW_ID])
                
                xbmcgui.Window(10000).setProperty("MostPlayedROM.%d.Id" %count, str(gameRow[util.ROW_ID]))
                xbmcgui.Window(10000).setProperty("MostPlayedROM.%d.Console" %count, romCollection.name)
                xbmcgui.Window(10000).setProperty("MostPlayedROM.%d.Title" %count, gameRow[util.ROW_NAME])
                xbmcgui.Window(10000).setProperty("MostPlayedROM.%d.Thumb" %count, thumb)
                xbmcgui.Window(10000).setProperty("MostPlayedROM.%d.Fanart" %count, fanart)
                xbmcgui.Window(10000).setProperty("MostPlayedROM.%d.Plot" %count, description)
                xbmcgui.Window(10000).setProperty("MostPlayedROM.%d.Year" %count, year)
                xbmcgui.Window(10000).setProperty("MostPlayedROM.%d.Publisher" %count, publisher)
                xbmcgui.Window(10000).setProperty("MostPlayedROM.%d.Developer" %count, developer)
                xbmcgui.Window(10000).setProperty("MostPlayedROM.%d.Genre" %count, genre)
                
                xbmcgui.Window(10000).setProperty("MostPlayedROM.%d.Maxplayers" %count, maxplayers)
                xbmcgui.Window(10000).setProperty("MostPlayedROM.%d.Region" %count, region)
                xbmcgui.Window(10000).setProperty("MostPlayedROM.%d.Media" %count, media)
                xbmcgui.Window(10000).setProperty("MostPlayedROM.%d.Perspective" %count, perspective)
                xbmcgui.Window(10000).setProperty("MostPlayedROM.%d.Controllertype" %count, controllertype)
                xbmcgui.Window(10000).setProperty("MostPlayedROM.%d.Playcount" %count, playcount)                
                xbmcgui.Window(10000).setProperty("MostPlayedROM.%d.Rating" %count, rating)
                xbmcgui.Window(10000).setProperty("MostPlayedROM.%d.Votes" %count, votes)
                xbmcgui.Window(10000).setProperty("MostPlayedROM.%d.Url" %count, url)                
                xbmcgui.Window(10000).setProperty("MostPlayedROM.%d.Originaltitle" %count, originaltitle)
                xbmcgui.Window(10000).setProperty("MostPlayedROM.%d.Alternatetitle" %count, alternatetitle)
                xbmcgui.Window(10000).setProperty("MostPlayedROM.%d.Translatedby" %count, translatedby)
                xbmcgui.Window(10000).setProperty("MostPlayedROM.%d.Version" %count, version)
                                
            except Exception, (exc):
                print 'RCB: Error while getting most played games: ' +str(exc)
        
        gdb.close()
    
    
    def launchGame(self, param):
        import launcher, util
        from gamedatabase import GameDataBase
        from config import Config
        
        gdb = GameDataBase(util.getAddonDataPath())
        gdb.connect()
        
        gameId = int(param.replace('launchid=', ''))
        
        config = Config(None)
        statusOk, errorMsg = config.readXml()
        
        settings = util.getSettings()
        
        gui = dummyGUI()
        
        launcher.launchEmu(gdb, gui, gameId, config, settings, None)


if ( __name__ == "__main__" ):
    print 'RCB started'
    try:
        Main()
    except Exception, (exc):
        message = 'Unhandled exception occured during execution of RCB:'
        message2 = str(exc)
        message3 = 'See xbmc.log for details'
        print message
        print message2
        import xbmcgui
        xbmcgui.Dialog().ok("Rom Collection Browser", message, message2, message3)

It looks like I'm running Mupen64 Plus AE - Version: 2.4.4 Version Code: 36. It will not automatically download this for you I don't think. Pretty sure you will have to sideload it. If you have the play store working, you can probably install it directly from there.

Thanks Brad. Is that the entire launcher code? It seems much smaller than the one that comes with RCB initially. Either way, I'm still having trouble getting it to work. I'll play around with it more before I bug you again. Wink Thanks for posting these.
Reply
#65
Just by installing it and using the default files (not updating applaunch.sh & launcher.py), I am able to get the emulator to run by clicking the game I want to play. However, all it is doing is launching the emulator to the home (Load game page) at which I select load game, then have to choose the game again. When I try to edit the files as stated in this initial post, it simply doesn't work.

I am using a rooted Amazon Fire TV with NES.emu as my emulator. Can anyone tell me which part I am missing to get the click of a game within RCB to directly launch the game I click and bypass the initial emulator home screen?

Here is my log if anyone needs it. http://pastebin.com/Q5eExPs2
Reply
#66
For the people having the "cannot create backup" and "cannot create launchers.xml file" ....
It is some kind of permission or possibly the version of Python being used that makes the advanced launcher app unable to write to the launchers.xml file.
Only way I was able to get it working was manually inputting the meta data into the file myself.

The good news is if you have xbmc and advanced launcher on a pc you can just copy and paste most of the info in.
I have a laptop I use just for messing around with xbmc and emulators that was already set up, just had to modify a few things to get it working.
Now my little $50 android tv box has all the emulators and roms running with full artwork and descriptions.
Even plugged in a generic corded ps3 controller! I only need to figure out how to exit ePSXe and N64oid from the controller and my system will be complete!

I can provide my launchers.xml file if anyone wants to use it for a reference.
Reply
#67
(2014-11-16, 00:00)LakersFan Wrote: Just by installing it and using the default files (not updating applaunch.sh & launcher.py), I am able to get the emulator to run by clicking the game I want to play. However, all it is doing is launching the emulator to the home (Load game page) at which I select load game, then have to choose the game again. When I try to edit the files as stated in this initial post, it simply doesn't work.

I am using a rooted Amazon Fire TV with NES.emu as my emulator. Can anyone tell me which part I am missing to get the click of a game within RCB to directly launch the game I click and bypass the initial emulator home screen?

Here is my log if anyone needs it. http://pastebin.com/Q5eExPs2

Hello LakersFan,

I have the exact same problem! Did you find a fix?

Thanks
Reply
#68
Sorry, I swear i answered this but it's not here ... Anyways, no I have no fixed it. Any suggestions would be great.
Reply
#69
(2014-12-04, 06:36)kronusprime Wrote: For the people having the "cannot create backup" and "cannot create launchers.xml file" ....
It is some kind of permission or possibly the version of Python being used that makes the advanced launcher app unable to write to the launchers.xml file.
Only way I was able to get it working was manually inputting the meta data into the file myself.

The good news is if you have xbmc and advanced launcher on a pc you can just copy and paste most of the info in.
I have a laptop I use just for messing around with xbmc and emulators that was already set up, just had to modify a few things to get it working.
Now my little $50 android tv box has all the emulators and roms running with full artwork and descriptions.
Even plugged in a generic corded ps3 controller! I only need to figure out how to exit ePSXe and N64oid from the controller and my system will be complete!

I can provide my launchers.xml file if anyone wants to use it for a reference.

Can you please post your launchers.xml for reference. I too am getting the same errors.

Thank You
Reply
#70
I been using the advanced launcher method and I have gotten it to work. But to upload thumbs and fanart, I have to do it manually by saving the pictures to my sd card.

1) Has anyone been able to get the auto-scaper to work in advanced laucher?
2) I been trying the logcat for a few other emulators like cps2emu. But I cannot figure out how to call the rom file to load automatically.

And last, for the rom collection browser I see that the code changes are different. The newest version of RCB has a slightly different structure and I cannot get any roms to load. I like the look of the RCB a bit better but had no luck getting it to take the code changes and modifications.
Reply
#71
(2014-12-18, 05:19)wdjoho Wrote: I been using the advanced launcher method and I have gotten it to work. But to upload thumbs and fanart, I have to do it manually by saving the pictures to my sd card.

1) Has anyone been able to get the auto-scaper to work in advanced laucher?
2) I been trying the logcat for a few other emulators like cps2emu. But I cannot figure out how to call the rom file to load automatically.

And last, for the rom collection browser I see that the code changes are different. The newest version of RCB has a slightly different structure and I cannot get any roms to load. I like the look of the RCB a bit better but had no luck getting it to take the code changes and modifications.

How did you get Advance launcher working. Did you run into "cannot create backup" and "cannot create launchers.xml file" problem? Could you post your launcher.xml as reference? Advance launcher sees the roms and lists them for me but is not scrapping. It also is not launching the rom file. I am using a non-root fire tv stick.
Reply
#72
Bradwatson– what version of RCB are you using and are you able to share that with us? I'm thinking changes ("improvements") have been made to the addon since this guide was introduced that now cause the information in it to be inaccurate and not work. I don't need the latest and greatest features. Just something that works like yours in your video over at XDA.
Reply
#73
(2014-12-19, 19:39)LakersFan Wrote: Bradwatson– what version of RCB are you using and are you able to share that with us? I'm thinking changes ("improvements") have been made to the addon since this guide was introduced that now cause the information in it to be inaccurate and not work. I don't need the latest and greatest features. Just something that works like yours in your video over at XDA.

I'm using 2.0.17 according to the addon.xml file. Here are zip files of my add-on and user data directories. Use a program like beyond compare to compare them to your directories to see what is different. Remember that my Fire TV is rooted.

Add-On Directory
User Data
Reply
#74
(2014-12-23, 23:21)bradwatson Wrote:
(2014-12-19, 19:39)LakersFan Wrote: Bradwatson– what version of RCB are you using and are you able to share that with us? I'm thinking changes ("improvements") have been made to the addon since this guide was introduced that now cause the information in it to be inaccurate and not work. I don't need the latest and greatest features. Just something that works like yours in your video over at XDA.

I'm using 2.0.17 according to the addon.xml file. Here are zip files of my add-on and user data directories. Use a program like beyond compare to compare them to your directories to see what is different. Remember that my Fire TV is rooted.

Add-On Directory
User Data

Thanks so much for sharing these. Mine's rooted too, so we should be fairly identical. I'll give it a go once the holidays have died down.

Have a good one!
Reply
#75
Still same problem here,i use minix x7,spmc version, not rooted.

Cannot create xml file error,auto scan doesnt work...

Fixing that bug would be really much appreciated

Thx
Reply
  •   
  • 1
  • 3
  • 4
  • 5(current)
  • 6
  • 7
  • 9
  •   



Logout Mark Read Team Forum Stats Members Help
HOW-TO Configure Advanced Launcher and Rom Collection Browser for emulators6
This forum uses Lukasz Tkacz MyBB addons.