コード例 #1
0
ファイル: player.py プロジェクト: golaizola/freevo1
    def stop(self, restore_menu=False):
        logger.debug('stop(restore_menu=%r)', restore_menu)

        if self.visible and self.dialog and restore_menu: 
            self.dialog = audio.show_play_state(dialog.PLAY_STATE_STOP, 
                self.item, self.get_time_info)
            self.dialog.show()

        global _player_
        _player_ = None
        self.player.stop()
        self.running = False

        if self.visible:
            rc.remove_app(self.player)
            if restore_menu:
                skin.draw('player', self.item, transition=skin.TRANSITION_OUT)
                self.visible = False
                if self.dialog:
                    self.dialog.hide()
                    self.dialog.finish()
                    self.dialog = None

        if self.menuw and not self.menuw.visible and restore_menu:
            self.menuw.show()
コード例 #2
0
ファイル: player.py プロジェクト: golaizola/freevo1
    def stop(self, restore_menu=False):
        logger.debug('stop(restore_menu=%r)', restore_menu)

        if self.visible and self.dialog and restore_menu:
            self.dialog = audio.show_play_state(dialog.PLAY_STATE_STOP,
                                                self.item, self.get_time_info)
            self.dialog.show()

        global _player_
        _player_ = None
        self.player.stop()
        self.running = False

        if self.visible:
            rc.remove_app(self.player)
            if restore_menu:
                skin.draw('player', self.item, transition=skin.TRANSITION_OUT)
                self.visible = False
                if self.dialog:
                    self.dialog.hide()
                    self.dialog.finish()
                    self.dialog = None

        if self.menuw and not self.menuw.visible and restore_menu:
            self.menuw.show()
コード例 #3
0
ファイル: menu.py プロジェクト: spartrekus/freevo1
    def refresh(self, reload=0):
        menu = self.menustack[-1]

        if not isinstance(menu, Menu):
            # Do not draw if there are any children
            if self.children:
                return False
            return menu.refresh()

        # We need to unmount devices but only at the top menu
        if len(self.menustack) == 1:
            if self.menustack[-1].umount_all == 1:
                util.umount_all()

        if reload:
            if menu.reload_func:
                reload = menu.reload_func()
                if reload:
                    self.menustack[-1] = reload
            if self.force_page_rebuild:
                self.force_page_rebuild = False
                self.rebuild_page()
            self.init_page()

        skin.draw('menu', self, self.menustack[-1], self.screen_transition)
        self.screen_transition = skin.TRANSITION_NONE
コード例 #4
0
ファイル: menu.py プロジェクト: adozenlines/freevo1
    def refresh(self, reload=0):
        menu = self.menustack[-1]

        if not isinstance(menu, Menu):
            # Do not draw if there are any children
            if self.children:
                return False
            return menu.refresh()

        # We need to unmount devices but only at the top menu
        if len(self.menustack) == 1:
            if self.menustack[-1].umount_all == 1:
                util.umount_all()

        if reload:
            if menu.reload_func:
                reload = menu.reload_func()
                if reload:
                    self.menustack[-1] = reload
            if self.force_page_rebuild:
                self.force_page_rebuild = False
                self.rebuild_page()
            self.init_page()
        
        skin.draw('menu', self, self.menustack[-1], self.screen_transition)
        self.screen_transition = skin.TRANSITION_NONE
コード例 #5
0
ファイル: tvguide.py プロジェクト: charrea6/freevo1
    def rebuild(self, start_time, stop_time, selected_fn, force=False):
        """ rebuild the guide

        This is neccessary we change the set of programs that have to be
        displayed, this is the case when the user moves around in the menu.
        """
        logger.log( 9, 'rebuild(start_time=%r, stop_time=%r, selected_fn=%r)', start_time, stop_time, selected_fn)
        start_channel_idx = self.start_channel_idx
        if self.selected_channel_idx > self.start_channel_idx + (self.n_items - 1):
            self.start_channel_idx = self.selected_channel_idx - (self.n_items - 1)

        elif self.selected_channel_idx < self.start_channel_idx:
            self.start_channel_idx = self.selected_channel_idx

        if force or self.start_time != start_time or self.start_channel_idx != start_channel_idx:

            end_idx = self.start_channel_idx + self.n_items

            channel_list = self.channels[self.start_channel_idx:end_idx]
            self.display_up_arrow = self.start_channel_idx > 0
            self.display_down_arrow = end_idx < len(self.channels)

            channels = tv.epg.get_grid(start_time+1, stop_time-1, channel_list)

            self.start_time    = start_time
            self.stop_time     = stop_time

            # table header
            header = ['Chan']
            for i in range(int(self.n_cols)):
                header.append( start_time + self.col_time * i * 60 )

            table = [header, self.selected]

            flag_selected = False

            for chan in channels:
                if not chan.programs:
                    prg = TvProgram(chan.id, 0, 0, 2147483647, CHAN_NO_DATA, desc='')
                    chan.programs = [ prg ]
                table.append(chan)

            self.table = table

        selected_channel_offset = (self.selected_channel_idx - self.start_channel_idx) + 2
        if selected_fn:
            for p in self.table[selected_channel_offset].programs:
                if selected_fn(p):
                    flag_selected = True
                    self.selected = p
                    self.table[1] = p
                    break

        if not flag_selected:
            p = self.table[selected_channel_offset].programs[0]
            self.table[1] = p
            self.selected = p

        skin.draw(self.type, self, transition=self.transition)
        self.transition = skin.TRANSITION_NONE
コード例 #6
0
ファイル: player.py プロジェクト: golaizola/freevo1
 def hide(self):
     logger.debug('hide() self.visible=%r', self.visible)
     if self.visible:
         skin.draw('player', self.item, transition=skin.TRANSITION_OUT)
         self.visible = False
         # skin.clear()
         rc.remove_app(self.player)
         if self.dialog:
             self.dialog.hide()
             self.dialog.finish()
             self.dialog = None
コード例 #7
0
ファイル: player.py プロジェクト: golaizola/freevo1
 def hide(self):
     logger.debug('hide() self.visible=%r', self.visible)
     if self.visible:
         skin.draw('player', self.item, transition=skin.TRANSITION_OUT)
         self.visible = False
         # skin.clear()
         rc.remove_app(self.player)
         if self.dialog:
             self.dialog.hide()
             self.dialog.finish()
             self.dialog = None
コード例 #8
0
ファイル: player.py プロジェクト: freevo/freevo1
    def stop(self, restore_menu=False):
        logger.debug("stop(restore_menu=%r)", restore_menu)
        global _player_
        _player_ = None
        self.player.stop()
        self.running = False
        if self.visible:
            rc.remove_app(self.player)
            skin.draw("player", self.item, transition=skin.TRANSITION_OUT)

        if self.menuw and not self.menuw.visible and restore_menu:
            self.menuw.show()
コード例 #9
0
ファイル: player.py プロジェクト: spartrekus/freevo1
    def stop(self, restore_menu=False):
        logger.debug('stop(restore_menu=%r)', restore_menu)
        global _player_
        _player_ = None
        self.player.stop()
        self.running = False
        if self.visible:
            rc.remove_app(self.player)
            skin.draw('player', self.item, transition=skin.TRANSITION_OUT)

        if self.menuw and not self.menuw.visible and restore_menu:
            self.menuw.show()
コード例 #10
0
    def refresh(self, force_update=True):
        """refresh the guide

        This function is called automatically by freevo whenever this menu is
        opened or reopened.
        """
        _debug_('refresh(force_update=True)', 2)
        if self.menuw.children:
            return
        _debug_('tvguide: setting context to %s' % self.event_context, 2)
        rc.set_context(self.event_context)
        self.update(force_update)
        skin.draw(self.type, self)
コード例 #11
0
ファイル: buttonbar.py プロジェクト: 1147279/SoftwareProject
 def __init__(self, menuw):
     tvguide = menuw.menustack[-1]
     prg = tvguide.selected
     if prg is None:
         name = _('No Information Available')
         description = ''
     else:
         name = prg.title
         description = prg.getattr('time') + u'\n' + prg.desc
     item = MenuItem(name=name)
     item.description = description
     self.visible = True
     self.menuw = menuw
     self.menuw.hide(clear=False)
     rc.app(self)
     skin.draw('tvguideinfo', item)
コード例 #12
0
ファイル: player.py プロジェクト: 1147279/SoftwareProject
    def refresh(self):
        """
        Give information to the skin..
        """
        if not self.visible:
            return

        if not self.running:
            return

        # Calculate some new values
        if not self.item.length:
            self.item.remain = 0
        else:
            self.item.remain = self.item.length - self.item.elapsed
        skin.draw('player', self.item)
        return
コード例 #13
0
class ShowHeadlineDetails:
    """
    Screen to show the details of the headline items
    """
    def __init__(self, (item, menuw)):
        self.menuw = menuw
        self.menuw.hide(clear=False)
        rc.app(self)
        skin.draw('headlines', item)
コード例 #14
0
ファイル: weather.py プロジェクト: adozenlines/freevo1
    def __init__(self, iArg=None, iMenuw=None, iWeather=None):
        self.arg     = iArg
        self.menuw   = iMenuw
        self.weather = iWeather
        self.menuw.hide(clear=False)
        rc.app(self)

        self.skins     = ('day', 'forecast', 'week', 'doplar')

        self.subtitles = (_('Current Conditions'), _('Today\'s Forecast'),
                          _('Extended Forecast'), _('Radar Map'))

        self.curSkin   = 0

        self.title    = self.weather.name
        self.subtitle = self.subtitles[0]

        # Fire up splashscreen and load the plugins
        skin.draw('weather', self)
コード例 #15
0
ファイル: oneclick.py プロジェクト: freevo/freevo1
    def __init__(self, arg=None, menu=None, weather=None):
        """ """
        logger.log(9, "WeatherDetailHandler.__init__(arg=%r, menu=%r, weather=%r)", arg, menu, weather)
        self.arg = arg
        self.menuw = menu
        self.weather = weather
        self.menuw.hide(clear=False)
        rc.add_app(self)

        self.skins = ("day", "forecast", "week", "map")

        self.skin_num = 0
        self.subtitles = (_("Current Conditions"), _("Today's Forecast"), _("Extended Forecast"), _("Radar Map"))

        self.title = ""
        self.subtitle = self.getSubtitle(self.skin_num)

        # Fire up splashscreen and load the plugins
        skin.draw("oneclick", self, transition=skin.TRANSITION_IN)
コード例 #16
0
ファイル: radio.py プロジェクト: jduda/freevo1
    def refresh(self):
        """ Give information to the skin """
        logger.log(9, "refresh()")
        if not self.visible:
            return
        if not self.running:
            return

        elapsed = int(time.time() - self.start_time + 0.5)
        hr = elapsed / (60 * 60)
        mn = elapsed % (60 * 60) / 60
        sc = elapsed % (60 * 60) % 60
        # Is there any point is having elapsed?
        # if hr > 0:
        #    self.item.elapsed = '%d:%02d:%02d' % (hr, mn, sc)
        # else:
        #    self.item.elapsed = '%d:%02d' % (mn, sc)

        skin.draw("player", self.item)
コード例 #17
0
ファイル: mpd.py プロジェクト: adozenlines/freevo1
    def __init__(self, iArg=None, iMenuw=None, iWeather=None ):
        print iMenuw
        print iWeather
        self.arg     = iArg
        self.menuw   = iMenuw
        self.mpd = iWeather
        self.menuw.hide(clear=False)
        rc.add_app(self)

        self.skins     = ('mpd')
        self.subtitles = (_('mpd'))
        self.curSkin   = 0

        print self.mpd.name
        self.title    = self.mpd.name
        self.subtitle = self.subtitles[0]

        # Fire up splashscreen and load the plugins
        skin.draw('mpd', self)
コード例 #18
0
ファイル: mpd.py プロジェクト: 1147279/SoftwareProject
    def __init__(self, iArg=None, iMenuw=None, iWeather=None):
        print iMenuw
        print iWeather
        self.arg = iArg
        self.menuw = iMenuw
        self.mpd = iWeather
        self.menuw.hide(clear=False)
        rc.app(self)

        self.skins = ('mpd')
        self.subtitles = (_('mpd'))
        self.curSkin = 0

        print self.mpd.name
        self.title = self.mpd.name
        self.subtitle = self.subtitles[0]

        # Fire up splashscreen and load the plugins
        skin.draw('mpd', self)
コード例 #19
0
ファイル: weather.py プロジェクト: 1147279/SoftwareProject
    def __init__(self, iArg=None, iMenuw=None, iWeather=None):
        self.arg = iArg
        self.menuw = iMenuw
        self.weather = iWeather
        self.menuw.hide(clear=False)
        rc.app(self)

        self.skins = ('day', 'forecast', 'week', 'doplar')

        self.subtitles = (_('Current Conditions'), _("Today's Forecast"),
                          _("Extended Forecast"), _("Radar Map"))

        self.curSkin = 0

        self.title = self.weather.name
        self.subtitle = self.subtitles[0]

        # Fire up splashscreen and load the plugins
        skin.draw('weather', self)
コード例 #20
0
ファイル: radio.py プロジェクト: spartrekus/freevo1
    def refresh(self):
        """ Give information to the skin """
        logger.log(9, 'refresh()')
        if not self.visible:
            return
        if not self.running:
            return

        elapsed = int(time.time() - self.start_time + 0.5)
        hr = elapsed / (60 * 60)
        mn = elapsed % (60 * 60) / 60
        sc = elapsed % (60 * 60) % 60
        # Is there any point is having elapsed?
        #if hr > 0:
        #    self.item.elapsed = '%d:%02d:%02d' % (hr, mn, sc)
        #else:
        #    self.item.elapsed = '%d:%02d' % (mn, sc)

        skin.draw('player', self.item)
コード例 #21
0
ファイル: oneclick.py プロジェクト: 1147279/SoftwareProject
    def __init__(self, arg=None, menu=None, weather=None):
        """ """
        _debug_('WeatherDetailHandler.__init__(arg=%r, menu=%r, weather=%r)' % (arg, menu, weather), 2)
        self.arg = arg
        self.menuw = menu
        self.weather = weather
        self.menuw.hide(clear=False)
        rc.app(self)

        self.skins = ('day', 'forecast', 'week', 'map')

        self.skin_num = 0
        self.subtitles = (_('Current Conditions'), _('Today\'s Forecast'),
                          _('Extended Forecast'), _('Radar Map'))

        self.title = ''
        self.subtitle = self.getSubtitle(self.skin_num)

        # Fire up splashscreen and load the plugins
        skin.draw('oneclick', self)
コード例 #22
0
ファイル: oneclick.py プロジェクト: golaizola/freevo1
    def __init__(self, arg=None, menu=None, weather=None):
        """ """
        logger.log( 9, 'WeatherDetailHandler.__init__(arg=%r, menu=%r, weather=%r)', arg, menu, weather)
        self.arg = arg
        self.menuw = menu
        self.weather = weather
        self.menuw.hide(clear=False)
        rc.add_app(self)

        self.skins = ('day', 'forecast', 'week', 'map')

        self.skin_num = 0
        self.subtitles = (_('Current Conditions'), _('Today\'s Forecast'),
                          _('Extended Forecast'), _('Radar Map'))

        self.title = ''
        self.subtitle = self.getSubtitle(self.skin_num)

        # Fire up splashscreen and load the plugins
        skin.draw('oneclick', self, transition=skin.TRANSITION_IN)
コード例 #23
0
ファイル: player.py プロジェクト: golaizola/freevo1
    def refresh(self):
        """
        Give information to the skin
        """
        logger.log(8, 'refresh() visible=%r running=%r', self.visible,
                   self.running)
        if not self.visible:
            return

        if not self.running:
            return

        # Calculate some new values
        if not self.item.length:
            self.item.remain = 0
        else:
            self.item.remain = self.item.length - self.item.elapsed

        if self.first_drawing:
            transition = skin.TRANSITION_IN
            self.first_drawing = False
        else:
            transition = skin.TRANSITION_NONE
        skin.draw('player', self.item, transition=transition)

        if self.visible and self.dialog and self.seeking >= 0:
            if self.seeking > 0:
                self.seeking = self.seeking - 1
                return

            if self.paused:
                self.dialog = audio.show_play_state(dialog.PLAY_STATE_PAUSE,
                                                    self.item,
                                                    self.get_time_info)
            else:
                self.dialog = audio.show_play_state(dialog.PLAY_STATE_PLAY,
                                                    self.item,
                                                    self.get_time_info)

            self.dialog.show()
            self.seeking = -1
コード例 #24
0
ファイル: mpd.py プロジェクト: adozenlines/freevo1
    def eventhandler(self, event, menuw=None):
        '''eventhandler'''
        if event == 'MENU_BACK_ONE_MENU':
            rc.remove_app(self)
            self.menuw.show()
            return True

        elif event == 'MENU_SELECT':
            # toggle mpc off on
            execMPC("mpc toggle","")
            skin.draw( 'mpd', self )
            return True

        elif event in ('MENU_DOWN', 'MENU_RIGHT'):
            # Skip to the next track.
            print execMPC("mpc next","")
            skin.draw( 'mpd', self )
            return True

        elif event in ('MENU_UP', 'MENU_LEFT'):
            # Move to the previous track.
            execMPC("mpc prev","")
            skin.draw( 'mpd', self )
            return True

        return False
コード例 #25
0
ファイル: oneclick.py プロジェクト: 1147279/SoftwareProject
    def eventhandler(self, event, menuw=None):
        """eventhandler"""
        _debug_('eventhandler(event=%s, menuw=%r)' % (event, menuw), 2)
        if event == 'MENU_BACK_ONE_MENU':
            rc.app(None)
            self.menuw.show()
            return True

        elif event == 'MENU_SELECT':
            self.weather.getForecast(force=1)
            skin.clear()
            skin.draw('oneclick', self)
            return True

        elif event in ('MENU_DOWN', 'MENU_RIGHT'):
            self.nextSkin()
            skin.draw('oneclick', self)
            return True

        elif event in ('MENU_UP', 'MENU_LEFT'):
            self.prevSkin()
            skin.draw('oneclick', self)
            return True

        return False
コード例 #26
0
ファイル: weather.py プロジェクト: 1147279/SoftwareProject
    def eventhandler(self, event, menuw=None):
        '''eventhandler'''
        if event == 'MENU_BACK_ONE_MENU':
            rc.app(None)
            self.menuw.show()
            return True

        elif event == 'MENU_SELECT':
            # TODO: update the current forecast data, and refresh
            self.weather.getForecast(force=1)
            skin.clear()
            skin.draw('weather', self)
            return True

        elif event in ('MENU_DOWN', 'MENU_RIGHT'):
            # Fire up the next skin
            self.nextSkin()
            skin.draw('weather', self)
            return True

        elif event in ('MENU_UP', 'MENU_LEFT'):
            # Fire up the previous skin
            self.prevSkin()
            skin.draw('weather', self)
            return True

        return False
コード例 #27
0
ファイル: weather.py プロジェクト: adozenlines/freevo1
    def eventhandler(self, event, menuw=None):
        '''eventhandler'''
        if event == 'MENU_BACK_ONE_MENU':
            rc.app(None)
            self.menuw.show()
            return True

        elif event == 'MENU_SELECT':
            # TODO: update the current forecast data, and refresh
            self.weather.getForecast(force=1)
            skin.clear()
            skin.draw('weather', self)
            return True

        elif event in ('MENU_DOWN', 'MENU_RIGHT'):
            # Fire up the next skin
            self.nextSkin()
            skin.draw('weather', self)
            return True

        elif event in ('MENU_UP', 'MENU_LEFT'):
            # Fire up the previous skin
            self.prevSkin()
            skin.draw('weather', self)
            return True

        return False
コード例 #28
0
ファイル: oneclick.py プロジェクト: freevo/freevo1
    def eventhandler(self, event, menuw=None):
        """eventhandler"""
        logger.log(9, "eventhandler(event=%s, menuw=%r)", event, menuw)
        if event == "MENU_BACK_ONE_MENU":
            rc.remove_app(self)
            self.menuw.show()
            return True

        elif event == "MENU_SELECT":
            self.weather.getForecast(force=1)
            skin.clear()
            skin.draw("oneclick", self, transition=skin.TRANSITION_IN)
            return True

        elif event in ("MENU_DOWN", "MENU_RIGHT"):
            self.nextSkin()
            skin.draw("oneclick", self, transition=skin.TRANSITION_PAGE)
            return True

        elif event in ("MENU_UP", "MENU_LEFT"):
            self.prevSkin()
            skin.draw("oneclick", self, transition=skin.TRANSITION_PAGE)
            return True

        return False
コード例 #29
0
ファイル: mpd.py プロジェクト: 1147279/SoftwareProject
    def eventhandler(self, event, menuw=None):
        '''eventhandler'''
        if event == 'MENU_BACK_ONE_MENU':
            rc.app(None)
            self.menuw.show()
            return True

        elif event == 'MENU_SELECT':
            # toggle mpc off on
            execMPC("mpc toggle", "")
            skin.draw('mpd', self)
            return True

        elif event in ('MENU_DOWN', 'MENU_RIGHT'):
            # Skip to the next track.
            print execMPC("mpc next", "")
            skin.draw('mpd', self)
            return True

        elif event in ('MENU_UP', 'MENU_LEFT'):
            # Move to the previous track.
            execMPC("mpc prev", "")
            skin.draw('mpd', self)
            return True

        return False
コード例 #30
0
ファイル: oneclick.py プロジェクト: golaizola/freevo1
    def eventhandler(self, event, menuw=None):
        """eventhandler"""
        logger.log( 9, 'eventhandler(event=%s, menuw=%r)', event, menuw)
        if event == 'MENU_BACK_ONE_MENU':
            rc.remove_app(self)
            self.menuw.show()
            return True

        elif event == 'MENU_SELECT':
            self.weather.getForecast(force=1)
            skin.clear()
            skin.draw('oneclick', self, transition=skin.TRANSITION_IN)
            return True

        elif event in ('MENU_DOWN', 'MENU_RIGHT'):
            self.nextSkin()
            skin.draw('oneclick', self, transition=skin.TRANSITION_PAGE)
            return True

        elif event in ('MENU_UP', 'MENU_LEFT'):
            self.prevSkin()
            skin.draw('oneclick', self, transition=skin.TRANSITION_PAGE)
            return True

        return False
コード例 #31
0
    def eventhandler(self, event, menuw=None):
        """eventhandler"""
        logger.log(9, 'eventhandler(event=%s, menuw=%r)', event, menuw)
        if event == 'MENU_BACK_ONE_MENU':
            rc.remove_app(self)
            self.menuw.show()
            return True

        elif event == 'MENU_SELECT':
            self.weather.getForecast(force=1)
            skin.clear()
            skin.draw('oneclick', self, transition=skin.TRANSITION_IN)
            return True

        elif event in ('MENU_DOWN', 'MENU_RIGHT'):
            self.nextSkin()
            skin.draw('oneclick', self, transition=skin.TRANSITION_PAGE)
            return True

        elif event in ('MENU_UP', 'MENU_LEFT'):
            self.prevSkin()
            skin.draw('oneclick', self, transition=skin.TRANSITION_PAGE)
            return True

        return False
コード例 #32
0
ファイル: player.py プロジェクト: golaizola/freevo1
    def refresh(self):
        """
        Give information to the skin
        """
        logger.log( 8, 'refresh() visible=%r running=%r', self.visible, self.running)
        if not self.visible:
            return

        if not self.running:
            return

        # Calculate some new values
        if not self.item.length:
            self.item.remain = 0
        else:
            self.item.remain = self.item.length - self.item.elapsed

        if self.first_drawing:
            transition = skin.TRANSITION_IN
            self.first_drawing = False
        else:
            transition = skin.TRANSITION_NONE
        skin.draw('player', self.item, transition=transition)

        if self.visible and self.dialog and self.seeking >= 0:
            if self.seeking > 0:
                self.seeking = self.seeking - 1
                return

            if self.paused:
                self.dialog = audio.show_play_state(dialog.PLAY_STATE_PAUSE, 
                    self.item, self.get_time_info)
            else:
                self.dialog = audio.show_play_state(dialog.PLAY_STATE_PLAY, 
                    self.item, self.get_time_info)

            self.dialog.show()
            self.seeking = -1
コード例 #33
0
ファイル: player.py プロジェクト: freevo/freevo1
    def refresh(self):
        """
        Give information to the skin
        """
        logger.log(8, "refresh() visible=%r running=%r", self.visible, self.running)
        if not self.visible:
            return

        if not self.running:
            return

        # Calculate some new values
        if not self.item.length:
            self.item.remain = 0
        else:
            self.item.remain = self.item.length - self.item.elapsed

        if self.first_drawing:
            transition = skin.TRANSITION_IN
            self.first_drawing = False
        else:
            transition = skin.TRANSITION_NONE
        skin.draw("player", self.item, transition=transition)
コード例 #34
0
    def refresh(self, reload=0):
        menu = self.menustack[-1]

        if not isinstance(menu, Menu):
            # Do not draw if there are any children
            if self.children:
                return False

            return skin.draw(menu.type, menu)

        if self.menustack[-1].umount_all == 1:
            util.umount_all()

        if reload:
            if menu.reload_func:
                reload = menu.reload_func()
                if reload:
                    self.menustack[-1] = reload
            if self.force_page_rebuild:
                self.force_page_rebuild = False
                self.rebuild_page()
            self.init_page()

        skin.draw('menu', self, self.menustack[-1])
コード例 #35
0
ファイル: player.py プロジェクト: spartrekus/freevo1
    def refresh(self):
        """
        Give information to the skin
        """
        logger.log(8, 'refresh() visible=%r running=%r', self.visible,
                   self.running)
        if not self.visible:
            return

        if not self.running:
            return

        # Calculate some new values
        if not self.item.length:
            self.item.remain = 0
        else:
            self.item.remain = self.item.length - self.item.elapsed

        if self.first_drawing:
            transition = skin.TRANSITION_IN
            self.first_drawing = False
        else:
            transition = skin.TRANSITION_NONE
        skin.draw('player', self.item, transition=transition)
コード例 #36
0
ファイル: main.py プロジェクト: 1147279/SoftwareProject
 def progress(self, pos):
     """
     set the progress position and refresh the screen
     """
     self.pos = pos
     skin.draw('splashscreen', None)
コード例 #37
0
ファイル: main.py プロジェクト: golaizola/freevo1
 def progress(self, pos):
     """
     set the progress position and refresh the screen
     """
     self.pos = pos
     skin.draw('splashscreen', None)
コード例 #38
0
ファイル: skype.py プロジェクト: adozenlines/freevo1
 def DrawCallInfo(self):
     skin.draw()
コード例 #39
0
ファイル: tvguide.py プロジェクト: spartrekus/freevo1
    def rebuild(self, start_time, stop_time, selected_fn, force=False):
        """ rebuild the guide

        This is neccessary we change the set of programs that have to be
        displayed, this is the case when the user moves around in the menu.
        """
        logger.log(9, 'rebuild(start_time=%r, stop_time=%r, selected_fn=%r)',
                   start_time, stop_time, selected_fn)
        start_channel_idx = self.start_channel_idx
        if self.selected_channel_idx > self.start_channel_idx + (self.n_items -
                                                                 1):
            self.start_channel_idx = self.selected_channel_idx - (
                self.n_items - 1)

        elif self.selected_channel_idx < self.start_channel_idx:
            self.start_channel_idx = self.selected_channel_idx

        if force or self.start_time != start_time or self.start_channel_idx != start_channel_idx:

            end_idx = self.start_channel_idx + self.n_items

            channel_list = self.channels[self.start_channel_idx:end_idx]
            self.display_up_arrow = self.start_channel_idx > 0
            self.display_down_arrow = end_idx < len(self.channels)

            channels = tv.epg.get_grid(start_time + 1, stop_time - 1,
                                       channel_list)

            self.start_time = start_time
            self.stop_time = stop_time

            # table header
            header = ['Chan']
            for i in range(int(self.n_cols)):
                header.append(start_time + self.col_time * i * 60)

            table = [header, self.selected]

            for chan in channels:
                if not chan.programs:
                    prg = TvProgram(chan.id,
                                    0,
                                    0,
                                    2147483647,
                                    CHAN_NO_DATA,
                                    desc='')
                    chan.programs = [prg]
                table.append(chan)

            self.table = table

        flag_selected = False

        selected_channel_offset = (self.selected_channel_idx -
                                   self.start_channel_idx) + 2
        if selected_fn:
            for p in self.table[selected_channel_offset].programs:
                if selected_fn(p):
                    flag_selected = True
                    self.selected = p
                    self.table[1] = p
                    break

        if not flag_selected:
            p = self.table[selected_channel_offset].programs[0]
            self.table[1] = p
            self.selected = p

        skin.draw(self.type, self, transition=self.transition)
        self.transition = skin.TRANSITION_NONE
コード例 #40
0
 def DrawCallInfo(self):
     skin.draw()