Exemple #1
0
 def doChannelEntry(self,digit):
     window = KodiChannelEntry(skin.CHANNEL_ENTRY,skin.getSkinPath(),'Main','1080p',digit=digit,has_sub_channels=self.lineUp.hasSubChannels)
     window.doModal()
     channelNumber = window.getChannel()
     del window
     if not channelNumber: return
     util.DEBUG_LOG('Channel entered: {0}'.format(channelNumber))
     if not channelNumber in self.lineUp: return
     channel = self.lineUp[channelNumber]
     self.playChannel(channel)
     self.selectChannel(channel)
Exemple #2
0
 def openEpisodeDialog(self):
     item = self.showList.getSelectedItem()
     if not item: return
     path = skin.getSkinPath()
     groupID = item.dataSource and item.dataSource.displayGroupID or None
     d = EpisodesDialog(skin.DVR_EPISODES_DIALOG,path,'Main','1080i',group_id=groupID,storage_server=self.storageServer)
     d.doModal()
     self.play = d.play
     count = d.count
     del d
     if self.play:
         util.setGlobalProperty('window.animations','')
         self.doClose()
     else:
         if not count:
             if item.dataSource:  # i.e. Not the all eps item
                 self.showList.removeItem(item.pos())
         else:
             item.setProperty('show.count', str(count))
Exemple #3
0
def start():
    util.LOG('Version: {0}'.format(util.ADDON.getAddonInfo('version')))
    util.DEBUG_LOG('Current Kodi skin: {0}'.format(skin.currentKodiSkin()))

    util.setGlobalProperty('guide.full.detail',util.getSetting('guide.full.detail',False) and 'true' or '')
    util.setGlobalProperty('DVR_ENABLED','')
    util.setGlobalProperty('busy','')
    util.setGlobalProperty('window.animations',util.getSetting('window.animations',True) and '1' or '')
    util.setGlobalProperty('search.terms','')

    path = skin.getSkinPath()

    back = BackgroundWindow('script-hdhomerun-view-background.xml',path,'Main','1080i')
    back.show()

    if util.getSetting('touch.mode',False):
        util.setGlobalProperty('touch.mode','true')
        window = GuideOverlayWindow(skin.OVERLAY,path,'Main','1080i')
        window.touchMode = True
    else:
        #player.FullsceenVideoInitializer().start()
        util.setGlobalProperty('touch.mode','')
        window = GuideOverlayDialog(skin.OVERLAY,path,'Main','1080i')

    with util.Cron(5) as window.cron:
        window.doModal()
        window.shutdown()
        window.abort = True
        del window

    threads = threading.enumerate()
    while len(threads) > 1:
        util.DEBUG_LOG('Waiting on {0} threads...'.format(len(threads) - 1))
        threads = threading.enumerate()
        for t in threads:
            if t != threading.currentThread():
                t.join()
                break

    back.doClose()
    del back

    util.DEBUG_LOG('Finished')
Exemple #4
0
    def openRecordDialog(self, ep, item=None):
        if not self.hasDVR():
            return

        if not ep:
            return

        if item and not ep.channelNumber:
            ep['ChannelNumber'] = item.dataSource['channel'].number

        try:
            if self.dvrWindow:
                series = hdhr.guide.createSeriesFromEpisode(self.dvrWindow.storageServer, ep)
                self.recordDialog = self.dvrWindow.openRecordDialog(None, series=series, episode=ep, return_dialog=True)
            else:
                ss = hdhr.storageservers.StorageServers(self.devices)
                series = hdhr.guide.createSeriesFromEpisode(ss, ep)
                self.recordDialog = record.RecordDialog(
                    skin.DVR_RECORD_DIALOG,
                    skin.getSkinPath(),
                    'Main',
                    '1080i',
                    rule=ss.getSeriesRule(series.ID),
                    series=series,
                    episode=ep,
                    storage_server=ss,
                    show_hide=False
                )

                self.recordDialog.doModal()

            eps = self.recordDialog.episodes

            if item:
                self.updateSliceRules(item, eps)
        finally:
            del self.recordDialog
Exemple #5
0
    def openDVRWindow(self):
        if not self.hasDVR():
            return

        if (self.dvrWindow and self.dvrWindow.open) or (self.optionsDialog and self.optionsDialog.open):
            return

        if not self.dvrWindow:
            path = skin.getSkinPath()
            if util.getSetting('touch.mode',False):
                self.dvrWindow = dvr.DVRWindow(skin.DVR_WINDOW,path,'Main','1080i',main=self)
            else:
                self.dvrWindow = dvr.DVRDialog(skin.DVR_WINDOW,path,'Main','1080i',main=self)

        self.dvrWindow.modal()

        self.showProgress() #Hide the progress because of re-init triggering <onload>


        if self.dvrWindow.play:
            self.showOverlay(False)
            util.setGlobalProperty('window.animations',util.getSetting('window.animations',True) and '1' or '')

            if isinstance(self.dvrWindow.play, hdhr.storageservers.Recording):
                rec = self.dvrWindow.play
                self.playRecording(rec)
                util.setGlobalProperty('playing.dvr','1')
            else:
                self.playChannelByNumber(self.dvrWindow.play.channelNumber)

            self.dvrWindow.play = None


            return True

        return False
Exemple #6
0
    def openRecordDialog(self, source, item=None, series=None, episode=None, return_dialog=False):
        rule = None
        if not series:
            if source == 'SEARCH':
                if self.category == 'movie':
                    item = item or self.moviePanel.getSelectedItem()
                else:
                    item = item or self.searchPanel.getSelectedItem()

                rule = self.storageServer.getSeriesRule(item.dataSource.ID)
            elif source == 'RULES':
                item = item or self.ruleList.getSelectedItem()
                rule = item.dataSource

                if rule and (rule.dateTimeOnly or rule.teamOnly):
                    self.deleteRule(rule)
                    return

            elif source == 'NOWSHOWING':
                panel = self.currentNowShowingPanel()
                item = item or panel.getSelectedItem()
                rule = self.storageServer.getSeriesRule(item.dataSource.ID)

            if not item: return
        else:
            if not rule:
                rule = self.storageServer.getSeriesRule(series.ID)

        path = skin.getSkinPath()
        series = series or item.dataSource

        try:
            d = record.RecordDialog(
                skin.DVR_RECORD_DIALOG,
                path,
                'Main',
                '1080i',
                parent=self,
                series=series,
                episode=episode,
                rule=rule,
                storage_server=self.storageServer,
                show_hide=not self.searchTerms and source != 'RULES',
                source=source
            )

            d.doModal()

            if item:
                if d.setPriority:
                    self.setMode('RULES')
                    item = self.ruleList.getListItemByProperty('seriesID', series.ID)
                    if not item or not rule:
                        util.LOG('openRecordDialog() - setPriority: No item or no rule')
                        return
                    self.ruleList.selectItem(item.pos())
                    self.moveRule()
                else:
                    if source == 'SEARCH' or source == 'NOWSHOWING':
                        item.setProperty('has.rule', series.hasRule and '1' or '')

                self.removeSeries(series)

        finally:
            if return_dialog:
                return d
            else:
                del d