Example #1
0
def runBordcomputerGUI():

    _obcActive = True

    # show radio GUI
    uiBC = bordcomputer.GUI("bc-skin.xml", _cwd)
    uiBC.doModal()
    del uiBC

    # reset callbacks
    openbm.setOnMessage(onMessage)

    _obcActive = False
Example #2
0
def runBordcomputerGUI():

	_obcActive = True
	
	# show radio GUI
	uiBC = bordcomputer.GUI( "bc-skin.xml", _cwd)
	uiBC.doModal()
	del uiBC

	# reset callbacks
	openbm.setOnMessage(onMessage)
	
	_obcActive = False
Example #3
0
def runRadioGUI():

	# pause XBMC player
	xbmc.executebuiltin('XBMC.PlayerControl(play)')
		
	# show radio GUI
	uiMid = radio.GUI( "radio-skin.xml", _cwd)
	uiMid.setRadioState(_radioState)
	uiMid.doModal()
	del uiMid
		
	# resume if played before
	xbmc.executebuiltin('XBMC.PlayerControl(play)')

	# reset callback method
	openbm.setOnRadioStateChange(onRadioState)
	openbm.setOnMessage(onMessage)
Example #4
0
def runRadioGUI():

    # pause XBMC player
    xbmc.executebuiltin('XBMC.PlayerControl(play)')

    # show radio GUI
    uiMid = radio.GUI("radio-skin.xml", _cwd)
    uiMid.setRadioState(_radioState)
    uiMid.doModal()
    del uiMid

    # resume if played before
    xbmc.executebuiltin('XBMC.PlayerControl(play)')

    # reset callback method
    openbm.setOnRadioStateChange(onRadioState)
    openbm.setOnMessage(onMessage)
Example #5
0
def runIgnitionOffGUI():

	_ignitionOff = True
	
	# pause XBMC player
	xbmc.executebuiltin('XBMC.PlayerControl(play)')
		
	uiMid = ignitionoff.GUI( "ignition-off-skin.xml", _cwd)
	uiMid.doModal()
	del uiMid
		
	# resume if played before
	xbmc.executebuiltin('XBMC.PlayerControl(play)')

	# reset callback method
	openbm.setOnMessage(onMessage)

	_ignitionOff = False
Example #6
0
def runIgnitionOffGUI():

    _ignitionOff = True

    # pause XBMC player
    xbmc.executebuiltin('XBMC.PlayerControl(play)')

    uiMid = ignitionoff.GUI("ignition-off-skin.xml", _cwd)
    uiMid.doModal()
    del uiMid

    # resume if played before
    xbmc.executebuiltin('XBMC.PlayerControl(play)')

    # reset callback method
    openbm.setOnMessage(onMessage)

    _ignitionOff = False
Example #7
0
    def setup_all(self):
        self.getControl(MAIN_LABEL).setLabel("Radio RDS")

        # try to connect to dbus, if fails, then error message
        try:

            openbm.setOnTitleChange(self.onTitleChange)
            openbm.setOnDisconnect(self.onStop)
            openbm.setOnButtonFieldChange(self.onButtonFieldChange)
            openbm.setOnRadioStateChange(self.onRadioState)
            openbm.setOnMessage(self.onIBusMessage)
            openbm.midEnableEmulation()
            openbm.start()
            openbm.midReqUpdateFields()

        except openbm.error, e:
            dialog = xbmcgui.Dialog()
            dialog.ok("connection to gateway failed", str(e))
            xbmc.output(str(e), xbmc.LOGDEBUG)
Example #8
0
File: gui.py Project: Inz999/OpenBM
	def setup_all( self ):
		self.getControl( MAIN_LABEL ).setLabel( "Radio RDS")
		
		# try to connect to dbus, if fails, then error message
		try:	
			
			openbm.setOnTitleChange(self.onTitleChange)
			openbm.setOnDisconnect(self.onStop)
			openbm.setOnButtonFieldChange(self.onButtonFieldChange)
			openbm.setOnRadioStateChange(self.onRadioState)
			openbm.setOnMessage(self.onIBusMessage)
			openbm.midEnableEmulation()
			openbm.start()
			openbm.midReqUpdateFields()
			
		except openbm.error,e:
			dialog = xbmcgui.Dialog()
			dialog.ok("connection to gateway failed", str(e))	
			xbmc.output(str(e), xbmc.LOGDEBUG)
Example #9
0
 def onInit(self):
     openbm.setOnMessage(self.onMessage)
     pass
Example #10
0
#---------------------------------------------------------------------
# Main Function - run a daemon checking for actions on ibus
#         it will execute corresponding scripts based on ibus messages
#---------------------------------------------------------------------
if ( __name__ == "__main__" ):

	# write file to lock execution (remove previous one)
	if os.path.exists(_processPID):
		os.remove(_processPID)        
	file( _processPID , "w" ).write( "" )

	try:
		openbm.setOnDisconnect(onDisconnect)
		openbm.midEnableEmulation()
		openbm.setOnRadioStateChange(onRadioState)
		openbm.setOnMessage(onMessage)
		_connectionLost = True
		
		# try to connect to IBus client, repeat the retries
		while (_connectionLost == True):
			try:	
				openbm.start()
				_connectionLost = False
						
				xbmc.executebuiltin("XBMC.Notification(%s,%s,2000,%s)"%("Connected", "BMW I-Bus connected...", bmwLogoSmallImg))		
			
			except openbm.error,e:
				xbmc.executebuiltin("XBMC.Notification(%s,%s,2000,%s)"%("Wait for I-BUS", "BMW I-Bus not found, connect...", bmwLogoSmallImg))		
				xbmc.sleep(2000)
				
				#dialog = xbmcgui.Dialog()
Example #11
0
#---------------------------------------------------------------------
# Main Function - run a daemon checking for actions on ibus
#         it will execute corresponding scripts based on ibus messages
#---------------------------------------------------------------------
if (__name__ == "__main__"):

    # write file to lock execution (remove previous one)
    if os.path.exists(_processPID):
        os.remove(_processPID)
    file(_processPID, "w").write("")

    try:
        openbm.setOnDisconnect(onDisconnect)
        openbm.midEnableEmulation()
        openbm.setOnRadioStateChange(onRadioState)
        openbm.setOnMessage(onMessage)

        # try to connect to IBus client, repeat the retries
        try:
            openbm.start()
            _connectionLost = False

            # perform greetings and say current time
            #xbmc.executebuiltin("XBMC.Notification(%s,%s,2000,'')"%("Settings", __settings__.getSetting( "speech.greetings")))
            if (__settings__.getSetting("speech.greetings") == 'true'):
                now = datetime.datetime.now()
                greeting = ""
                if (now.hour < 4):
                    greeting = 'Good night, '
                elif (now.hour < 12):
                    greeting = 'Good morning, '
Example #12
0
 def onInit(self):
     openbm.setOnMessage(self.onMessage)
     pass