当前位置: 首页>>代码示例>>Python>>正文


Python xbmcgui.getCurrentWindowId函数代码示例

本文整理汇总了Python中xbmcgui.getCurrentWindowId函数的典型用法代码示例。如果您正苦于以下问题:Python getCurrentWindowId函数的具体用法?Python getCurrentWindowId怎么用?Python getCurrentWindowId使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了getCurrentWindowId函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: writeMsg

	def writeMsg(self, line1, line2, line3, count=0):
		
		if self.windowID != xbmcgui.getCurrentWindowId():
			self.windowID = xbmcgui.getCurrentWindowId()
			if xbmcgui.getCurrentWindowId() in ALLOWEDWINDOWS:			
			 self.paintProgress()
		
		#check if action was canceled from RCB						  
		scrapeOnStartupAction = util.getSettings().getSetting(util.SETTING_RCB_SCRAPEONSTARTUPACTION)
		if (scrapeOnStartupAction == 'cancel'):
			self.label.setLabel("%d %% - %s" % (100, 'Update canceled'))
			return False
		
		if not self.label:
		  return True  
		elif (count > 0):
			percent = int(count * (float(100) / self.itemCount))
			self.header.setLabel(line1)
			self.label.setLabel("%d %% - %s" % (percent, line2))
			self.progress.setPercent(percent)
		else:			
			self.window.remove(self.image)
			self.window.remove(self.header)
			self.window.remove(self.label)
			self.window.remove(self.progress)
			
		return True
开发者ID:070499,项目名称:repo-scripts,代码行数:27,代码来源:dbUpLauncher.py

示例2: isChangeTheme

 def isChangeTheme(self):
     id = xbmc.getInfoLabel('ListItem.Property(ItemGUID)')
     WINDOW = xbmcgui.Window( 10025 )
     if id == '' and xbmcgui.getCurrentWindowId() == 10025:    
        id =  WINDOW.getProperty("ItemGUID")
     if id == '' and xbmcgui.getCurrentWindowId() == 10000:    
        id =  xbmcgui.Window( 10000 ).getProperty("ItemGUID")
     if id != "":
         if self.volume == '':
             self.volume = self.getVolume()
         # we have something to start with
         addonSettings = xbmcaddon.Addon(id='plugin.video.xbmb3c') 
         if addonSettings.getSetting('useThemeMusic') == "true" or addonSettings.getSetting('useThemeMovies') == "true" :
           # cool theme music is on continue
           if id == self.themeId:
               # same as before now do we need to restart 
               if ((addonSettings.getSetting('loopThemeMusic') == "true"  and self.playingMovie == False) or (addonSettings.getSetting('loopThemeMovies') == "true" and self.playingMovie == True))  and xbmc.Player().isPlaying() == False:
                   self.logMsg("isChangeTheme restart true")
                   return True
           if id != self.themeId:
               # new id return true
               self.logMsg("isChangeTheme new id restart true")
               return True  
           
     # still here return False
     self.logMsg("isChangeTheme restart false") 
     return False 
开发者ID:MediaBrowser,项目名称:MediaBrowser.Kodi,代码行数:27,代码来源:ThemeMedia.py

示例3: refresh_slideshow

def refresh_slideshow(driveid, item_id, child_count, waitForSlideshow):
    onedrive = onedrives[driveid]
    if waitForSlideshow:
        print 'Waiting up to 10 minutes until the slideshow of folder ' + item_id + ' starts...'
        current_time = time.time()
        max_waiting_time = current_time + 10 * 60
        while not cancelOperation(onedrive) and xbmcgui.getCurrentWindowId() != 12007 and max_waiting_time > current_time:
            if monitor.waitForAbort(2):
                break
            current_time = time.time()
        print_slideshow_info(onedrive)
    interval = addon.getSetting('slideshow_refresh_interval')
    print 'Waiting up to ' + interval + ' minute(s) to check if it is needed to refresh the slideshow of folder ' + item_id + '...'
    current_time = time.time()
    target_time = current_time + int(interval) * 60
    while not cancelOperation(onedrive) and target_time > current_time and xbmcgui.getCurrentWindowId() == 12007:
        if monitor.waitForAbort(10):
            break
        current_time = time.time()
    print_slideshow_info(onedrive)
    if not cancelOperation(onedrive) and xbmcgui.getCurrentWindowId() == 12007:
        try:
            start_auto_refreshed_slideshow(driveid, item_id, child_count)
        except Exception as e:
            print 'Slideshow fails to auto refresh. Will be restarted when possible. Error: '
            if isinstance(e, OneDriveException):
                try:
                    print ''.join(traceback.format_exception(type(e.origin), e.origin, e.tb))
                except:
                    traceback.print_exc()
            else:
                traceback.print_exc()
            refresh_slideshow(driveid, item_id, -1, waitForSlideshow)
    else:
        print 'Slideshow is not running anymore or abort requested.'
开发者ID:kodiline,项目名称:repository.Play-Mix-EVO,代码行数:35,代码来源:addon.py

示例4: isPlayingZone

 def isPlayingZone(self):
     if "plugin://plugin.video.xbmb3c" in xbmc.getInfoLabel( "ListItem.Path" ):
         return True
     if xbmcgui.getCurrentWindowId() == 10025 or xbmcgui.getCurrentWindowId() == 10000:
         return True 
     
     # Any other area is deemed to be a non play area
     return False 
开发者ID:MediaBrowser,项目名称:MediaBrowser.Kodi,代码行数:8,代码来源:ThemeMedia.py

示例5: onFocus

 def onFocus(self, controlID):
      # self.getControl(32204).setEnabled(0)
     WINDOW = xbmcgui.Window(xbmcgui.getCurrentWindowId())
     if __bLogging__ == "true":xbmc.log("SPY Window " +str(xbmcgui.getCurrentWindowId()))
     self.playmates = WINDOW.getProperty("playmates")
     if WINDOW.getProperty("playmates") != "":
         # try:
          self.players = WINDOW.getProperty("playmates")
     if __bLogging__ == "true":xbmc.log("SPY retrieved property" +str(self.playmates))
开发者ID:KodiFun,项目名称:KodiFun,代码行数:9,代码来源:dialog.py

示例6: _read_dir

 def _read_dir(self, dir):  
     #xbmc.executebuiltin("Notification(Drawers, Reading: %s, 3000, C:/Users/Programming/AppData/Roaming/Kodi/addons/plugin.video.drawers/icon.png)" % dir  ) 
     viewmode = xbmcgui.Window(xbmcgui.getCurrentWindowId()).getFocusId()
     data = self._get_json().Files.GetDirectory(directory=dir, properties=file_info)
     if xbmcgui.Window(xbmcgui.getCurrentWindowId()).getFocusId() != viewmode:
         xbmc.executebuiltin('Container.setViewmode(%d)' % viewmode)
     if data is None or not data.has_key('files'):
         return []
     return [clean(d) for d in data['files']]
开发者ID:floooooWi,项目名称:Drawers,代码行数:9,代码来源:drawers.py

示例7: getCurrentWindowId

def getCurrentWindowId():
    winID = xbmcgui.getCurrentWindowId()
    tries = 10

    while winID == 10000 and tries > 0:
        xbmc.sleep(100)
        tries -= 1
        winID = xbmcgui.getCurrentWindowId()

    return winID if winID != 10000 else 10025
开发者ID:badb0iie,项目名称:spoyser-repo,代码行数:10,代码来源:default.py

示例8: _get_queued_video_info

 def _get_queued_video_info(self):
     try:
         xbmc.log("_get_queued_video_info()", xbmc.LOGNOTICE)
         # clear then queue the currently selected video
         xbmc.executebuiltin("Playlist.Clear")
         xbmc.executebuiltin("Action(Queue,%d)" % (xbmcgui.getCurrentWindowId() - 10000,))
         xbmc.log("Action(Queue,%d)" % (xbmcgui.getCurrentWindowId() - 10000,), xbmc.LOGNOTICE)
         # we need to sleep so the video gets queued properly
         xbmc.sleep(300)
         # create a video playlist
         self.playlist = xbmc.PlayList(xbmc.PLAYLIST_VIDEO)
         # get movie name
         movie_title = self.playlist[0].getdescription()
         # this is used to skip trailer for current movie selection
         movie = os.path.splitext(os.path.basename(self.playlist[0].getfilename()))[0]
         # format our records start and end
         xbmc.executehttpapi("SetResponseFormat()")
         xbmc.executehttpapi("SetResponseFormat(OpenField,)")
         # TODO: verify the first is the best audio
         # setup the sql, we limit to 1 record as there can be multiple entries in streamdetails
         sql = (
             "SELECT movie.c12, movie.c14, streamdetails.strAudioCodec FROM movie, streamdetails WHERE movie.idFile=streamdetails.idFile AND streamdetails.iStreamType=1 AND c00='%s' LIMIT 1"
             % (movie_title.replace("'", "''"),)
         )
         xbmc.log("SQL: %s" % (sql,), xbmc.LOGNOTICE)
         # query database for info dummy is needed as there are two </field> formatters
         mpaa, genre, audio, dummy = xbmc.executehttpapi("QueryVideoDatabase(%s)" % quote_plus(sql)).split(
             "</field>"
         )
         # TODO: add a check and new sql for videos queued from files mode, or try an nfo
         # calculate rating
         mpaa = mpaa.split(" ")[1 - (len(mpaa.split(" ")) == 1)]
         mpaa = (mpaa, "NR")[mpaa not in ("G", "PG", "PG-13", "R", "NC-17", "Unrated")]
     except:
         movie_title = mpaa = audio = genre = movie = ""
     # spew queued video info to log
     xbmc.log("-" * 70, xbmc.LOGNOTICE)
     xbmc.log("Title: %s" % (movie_title,), xbmc.LOGNOTICE)
     xbmc.log("Path: %s" % (movie,), xbmc.LOGNOTICE)
     xbmc.log("Genre: %s" % (genre,), xbmc.LOGNOTICE)
     xbmc.log("MPAA: %s" % (mpaa,), xbmc.LOGNOTICE)
     xbmc.log("Audio: %s" % (audio,), xbmc.LOGNOTICE)
     if _S_("audio_videos_folder"):
         xbmc.log(
             "- Folder: %s"
             % (
                 xbmc.translatePath(_S_("audio_videos_folder"))
                 + {"dca": "DTS", "ac3": "Dolby"}.get(audio, "Other")
                 + xbmc.translatePath(_S_("audio_videos_folder"))[-1],
             ),
             xbmc.LOGNOTICE,
         )
     xbmc.log("-" * 70, xbmc.LOGNOTICE)
     # return results
     return mpaa, audio, genre, movie
开发者ID:ackbarr,项目名称:script.cinema.experience,代码行数:55,代码来源:xbmcscript_player.py

示例9: unlock

def unlock(account_settings):
    unlocked = True
    win = xbmcgui.Window(xbmcgui.getCurrentWindowId())
    if (account_settings.passcode != ''):
        #create windows property name
        win_prop_name = urllib.quote(account_settings.account_name.encode("utf-8") + 'Unlocked')
        unlockTimeout = account_settings.passcodetimeout * 60 # to minutes
        #get last unlocked time
        try:
            unlockedTime = float( win.getProperty(win_prop_name) )
        except ValueError:
            unlockedTime = 0.0
        #unlocked = True when timeout not expired
        unlocked = (time.time() < (unlockedTime + unlockTimeout) )
        if not unlocked:
            log('Unlock with passcode required...')
            keyboard = xbmc.Keyboard('', LANGUAGE_STRING(30013))
            keyboard.setHiddenInput(True)
            keyboard.doModal()
            if keyboard.isConfirmed() and keyboard.getText() == account_settings.passcode:
                unlocked = True
            else:
                #Wrong passcode
                dialog = xbmcgui.Dialog()
                dialog.ok(ADDON_NAME, LANGUAGE_STRING(30014) )
        if unlocked:
            #update the unlock time
            win.setProperty(win_prop_name, '%s'%time.time() )
    return unlocked
开发者ID:kodiline,项目名称:repository.Play-Mix-EVO,代码行数:29,代码来源:login.py

示例10: activateWindowCommand

def activateWindowCommand(cmd):
    cmds = cmd.split(',', 1)

    #special case for filemanager
    if '10003' in cmds[0] or 'filemanager' in cmds[0].lower():
        xbmc.executebuiltin(cmd)
        return   

    plugin   = None
    activate = None

    if len(cmds) == 1:
        activate = cmds[0]
    else:
        activate = cmds[0]+',return)'
        plugin   = cmds[1][:-1]

    #check if it is a different window and if so activate it
    id = str(xbmcgui.getCurrentWindowId())    

    if id not in activate:
        xbmc.executebuiltin(activate)

    if plugin:
        parent = getParentCommand(plugin)
        if parent:
            xbmc.executebuiltin('Container.Update(%s)' % parent)
            xbmc.sleep(500)
        xbmc.executebuiltin('Container.Update(%s)' % plugin)
开发者ID:kevintone,项目名称:tdbaddon,代码行数:29,代码来源:player.py

示例11: setupWindow

    def setupWindow( self ):
        error = 0
        # get the id for the current 'active' window as an integer.
        # http://wiki.xbmc.org/index.php?title=Window_IDs
        try: currentWindowId = xbmcgui.getCurrentWindowId()
        except: currentWindowId = self.window

        if hasattr( self.button, "isSelected" ):
            self.canceled = self.button.isSelected()
        if hasattr( self.window, "getProperty" ):
            self.canceled = self.canceled  or ( self.window.getProperty( "DialogAddonScan.Cancel" ) == "true" )
        if hasattr( self.window, "setProperty" ):
            self.window.setProperty( "DialogAddonScan.Hide", "false")

        #if self.window is None and hasattr( currentWindowId, "__int__" ):
        #    self.window = xbmcgui.Window( currentWindowId )
        if hasattr( currentWindowId, "__int__" ) and currentWindowId != self.windowId:
            self.removeControls()
            self.windowId = currentWindowId
            self.window = xbmcgui.Window( self.windowId )
            self.initialize()

        if not self.window or not hasattr( self.window, "addControl" ):
            self.removeControls()
            error = 1

        self.window.setProperty( "DialogAddonScan.Hide", "false" )
        if error:
            raise xbmcguiWindowError( "xbmcgui.Window(%s)" % repr( currentWindowId ) )

        self.window.setProperty( "DialogAddonScan.IsAlive", "true" )
开发者ID:cClaude,项目名称:plugin.image.mypicsdb,代码行数:31,代码来源:AddonScan.py

示例12: isClose

    def isClose(self):
        # Check if the base class has detected a need to close
        needToClose = SonosControllerWindow.isClose(self)

        # There are cases where the user could have changed the screen being
        # displayed, for example, if they have the following in their keymap:
        #   <keymap>
        #     <global>
        #       <keyboard>
        #         <f5>ActivateWindow(0)</f5>
        #       </keyboard>
        #     </global>
        #   </keymap>
        # This could cause a change in window, such as loading the home screen
        # however we do not get a call to close - as the Sonos window will be
        # still running in the back-ground - just not showing on the screen
        # If the user then exits, the keymap file will be left, so we will
        # automatically close the window in this case
        # Note: This is not an issue with the normal controller - as it is a
        # dialog window, so will always remain in view
        if (not needToClose) and (self.windowId != -1):
            # Get the current window
            showingWindowId = xbmcgui.getCurrentWindowId()
            # Check if the window is no longer showing
            if showingWindowId != self.windowId:
                log("SonosArtistSlideshow: Detected change in window, sonos window = %d, new window = %d" % (self.windowId, showingWindowId))
                return True

        return needToClose
开发者ID:noba3,项目名称:KoTos,代码行数:29,代码来源:default.py

示例13: onInit

    def onInit(self):  # pylint: disable=invalid-name
        self.window = xbmcgui.Window(xbmcgui.getCurrentWindowId())
        self.season_list = self.window.getControl(210)
        self.weeks_list = self.window.getControl(220)
        self.games_list = self.window.getControl(230)
        self.live_list = self.window.getControl(240)

        if gpr.subscription == "domestic":
            self.window.setProperty("domestic", "true")

        if self.list_refill:
            self.season_list.reset()
            self.season_list.addItems(self.season_items)
            self.weeks_list.reset()
            self.weeks_list.addItems(self.weeks_items)
            self.games_list.reset()
            self.games_list.addItems(self.games_items)
            self.live_list.reset()
            self.live_list.addItems(self.live_items)
        else:
            self.window.setProperty("NW_clicked", "false")
            self.window.setProperty("GP_clicked", "false")

        xbmc.executebuiltin("Dialog.Close(busydialog)")

        try:
            self.setFocus(self.window.getControl(self.focusId))
        except:
            addon_log("Focus not possible: %s" % self.focusId)
开发者ID:henry73,项目名称:xbmc-gamepass,代码行数:29,代码来源:default.py

示例14: paintProgress

	def paintProgress(self):
		
		self.windowID = xbmcgui.getCurrentWindowId()
		self.window = xbmcgui.Window(self.windowID)
		self.image = xbmcgui.ControlImage(880, 630, 400, 60, "InfoMessagePanel.png", colorDiffuse='0xC0C0C0C0')
		self.window.addControl(self.image)
		self.image.setVisible(False)
		animations = [('Conditional', 'effect=slide start=1280,0 time=2000 condition=Control.IsVisible(%d)' % self.image.getId())]
		self.image.setAnimations(animations)
		
		self.header = xbmcgui.ControlLabel(900, 635, 400, 60, 'Scraping RCB', font='font10_title', textColor='0xFFEB9E17')
		self.window.addControl(self.header)
		self.header.setVisible(False)
		self.header.setAnimations(animations)
		
		self.label = xbmcgui.ControlLabel(900, 655, 400, 60, 'Scraping RCB', font='font10')
		self.window.addControl(self.label)
		self.label.setVisible(False)
		self.label.setAnimations(animations)

		self.progress = xbmcgui.ControlProgress(900, 675, 370, 8)
		self.window.addControl(self.progress)
		self.progress.setVisible(False)
		self.progress.setAnimations(animations)
		
		self.label.setVisible(True)
		self.image.setVisible(True)
		self.progress.setVisible(True)
		self.header.setVisible(True)
开发者ID:070499,项目名称:repo-scripts,代码行数:29,代码来源:dbUpLauncher.py

示例15: onInit

    def onInit(self):  # pylint: disable=invalid-name
        self.window = xbmcgui.Window(xbmcgui.getCurrentWindowId())
        self.season_list = self.window.getControl(210)
        self.weeks_list = self.window.getControl(220)
        self.games_list = self.window.getControl(230)
        self.live_list = self.window.getControl(240)

        if self.list_refill:
            self.season_list.reset()
            self.season_list.addItems(self.season_items)
            self.weeks_list.reset()
            self.weeks_list.addItems(self.weeks_items)
            self.games_list.reset()
            self.games_list.addItems(self.games_items)
            self.live_list.reset()
            self.live_list.addItems(self.live_items)
        else:
            self.window.setProperty('NW_clicked', 'false')
            self.window.setProperty('GP_clicked', 'false')

        hide_busy_dialog()

        try:
            self.setFocus(self.window.getControl(self.focusId))
        except:
            logger.error('Focus not possible: %s' % self.focusId)
开发者ID:kaileu,项目名称:xbmc-gamepass,代码行数:26,代码来源:default.py


注:本文中的xbmcgui.getCurrentWindowId函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。