def count_radio(self, resetSelect=False): listcontainer = self.getControl(1000) if listcontainer.size() > 0: if var.SearchFilterTerm != '': func.updateLabelText( self, 1, str(listcontainer.size()) + ' gevonden zenders') else: func.updateLabelText(self, 1, str(listcontainer.size()) + ' zenders') if resetSelect == True: func.focus_on_channel_list( self, 1000, 0, True, var.addon.getSetting('CurrentRadioId')) else: listcontainer = self.getControl(1001) self.setFocus(listcontainer) xbmc.sleep(100) if var.SearchFilterTerm != '': func.updateLabelText(self, 1, 'Geen zenders gevonden') listcontainer.selectItem(1) else: func.updateLabelText(self, 1, 'Geen zenders') listcontainer.selectItem(0) xbmc.sleep(100)
def seek_back(self, showEpg=False): xbmc.executebuiltin('Action(StepBack)') #Show the epg and select channel if showEpg: self.show_epg(True, True, True) return #Select channel in list container CurrentChannelId = var.addon.getSetting('CurrentChannelId') func.focus_on_channel_list(self, 1001, 0, False, CurrentChannelId)
def seek_live(self): #Seek to live position seekSeconds = int(xbmc.Player().getTotalTime()) xbmc.Player().seekTime(seekSeconds) notificationIcon = path.resources( 'resources/skins/default/media/common/seeklive.png') xbmcgui.Dialog().notification(var.addonname, 'De stream is nu live.', notificationIcon, 2500, False) #Select channel in list container CurrentChannelId = var.addon.getSetting('CurrentChannelId') func.focus_on_channel_list(self, 1001, 0, False, CurrentChannelId)
def load_channels(self): #Get and check the list container listcontainer = self.getControl(1001) if listcontainer.size() > 0: return True #Download the channels downloadResult = download.download_channels_tv(False) if downloadResult == False: return False #Add channels to list channellist.channel_list_load(listcontainer) #Select channel in list container currentChannelId = var.addon.getSetting('CurrentChannelId') func.focus_on_channel_list(self, 1001, 0, False, currentChannelId)
def show_epg(self, seekInterface=False, removeFocus=False, selectChannel=True): #Show the epg interface if seekInterface == False: self.setProperty('WebbiePlayerFull', 'true') else: self.setProperty('WebbiePlayerSeek', 'true') #Select the current channel if selectChannel: currentChannelId = var.addon.getSetting('CurrentChannelId') func.focus_on_channel_list(self, 1001, 0, True, currentChannelId) #Remove focus from the interface if removeFocus: listControl = self.getControl(4000) self.setFocus(listControl) xbmc.sleep(100)
def seek_begin_program(self): #Get and check the list container listcontainer = self.getControl(1001) selectedItem = listcontainer.getSelectedItem() ProgramNowTimeStartDateTime = func.datetime_from_string( selectedItem.getProperty("ProgramNowTimeStartDateTime"), '%Y-%m-%d %H:%M:%S') #Check the program start time if ProgramNowTimeStartDateTime != datetime(1970, 1, 1): playingSeconds = int( (datetime.now() - ProgramNowTimeStartDateTime).total_seconds()) totalSeconds = int(xbmc.Player().getTotalTime()) seekSeconds = totalSeconds - playingSeconds + 10 if seekSeconds >= 0: #Seek to program beginning xbmc.Player().seekTime(seekSeconds) notificationIcon = path.resources( 'resources/skins/default/media/common/rerun.png') xbmcgui.Dialog().notification( var.addonname, 'Naar programma begin gespoeld.', notificationIcon, 2500, False) #Select channel in list container CurrentChannelId = var.addon.getSetting('CurrentChannelId') func.focus_on_channel_list(self, 1001, 0, False, CurrentChannelId) else: notificationIcon = path.resources( 'resources/skins/default/media/common/rerun.png') xbmcgui.Dialog().notification( var.addonname, 'Programma begin niet beschikbaar.', notificationIcon, 2500, False) else: notificationIcon = path.resources( 'resources/skins/default/media/common/rerun.png') xbmcgui.Dialog().notification(var.addonname, 'Start tijd is onbekend.', notificationIcon, 2500, False)
def load_channels(self, forceLoad=False): #Get and check the list container listcontainer = self.getControl(1001) if forceLoad == False: if listcontainer.size() > 0: self.select_channel_live() return True else: listcontainer.reset() #Download the channels func.updateLabelText(self, 1, 'Zenders downloaden') func.updateLabelText(self, 2, 'Zenders worden gedownload, nog even geduld...') downloadResult = download.download_channels_tv(False) if downloadResult == False: func.updateLabelText(self, 1, 'Niet beschikbaar') func.updateLabelText(self, 2, 'TV Gids is niet beschikbaar.') listcontainer = self.getControl(1000) self.setFocus(listcontainer) xbmc.sleep(100) listcontainer.selectItem(0) xbmc.sleep(100) return False #Add channels to list func.updateLabelText(self, 1, 'Zenders laden') func.updateLabelText(self, 2, 'Zenders worden geladen, nog even geduld...') channellist.channel_list_load(listcontainer, True) #Focus on the list container if listcontainer.size() > 0: currentChannelId = var.addon.getSetting('CurrentChannelId') func.focus_on_channel_list(self, 1001, 0, True, currentChannelId) return True else: listcontainer = self.getControl(1000) self.setFocus(listcontainer) xbmc.sleep(100) if var.SearchFilterTerm != '': func.updateLabelText(self, 1, 'Geen zenders gevonden') func.updateLabelText( self, 2, "Geen zender om de programma's voor weer te geven gevonden." ) listcontainer.selectItem(1) elif var.LoadChannelFavoritesOnly == True: func.updateLabelText(self, 1, 'Geen favorieten zenders') func.updateLabelText( self, 2, "Geen zender om de programma's voor weer te geven gevonden." ) listcontainer.selectItem(0) else: func.updateLabelText(self, 1, 'Geen zenders gevonden') func.updateLabelText( self, 2, "Geen zender om de programma's voor weer te geven gevonden." ) listcontainer.selectItem(0) xbmc.sleep(100) #Reset the program list listcontainer = self.getControl(1002) listcontainer.reset() return False
def select_channel_live(self): #Select current live channel if var.PlayerOverlay == True: currentChannelId = var.addon.getSetting('CurrentChannelId') func.focus_on_channel_list(self, 1001, 0, False, currentChannelId)