コード例 #1
0
ファイル: audio_player.py プロジェクト: rayman18/wydev
	def event_wheel_fwd(self, event):
		play = self.player
		if play.active_list == 'edit_list':
			Menu.select(play, event.arg['count'])
			return True
		self.player.action_seek(HMI_MUSIC['right'])
		return True
コード例 #2
0
ファイル: search.py プロジェクト: rayman18/wydev
 def __init__(self,
              name='Search menu',
              eventhandler=None,
              type='media_search',
              pattern=None,
              universe=None):
     self.eventhandler = SearchMenuEventHandler(self)
     Menu.__init__(self, name, type=type, universe=universe)
     self.kbd = SearchKeyboardWindow(_('Search'),
                                     text='',
                                     confirm_action=self.search,
                                     search_menu=self)
     self.pattern = pattern
     self.navigator = pygui_globs['menustack'].get_navigator()
     self.positions_dict = dict()
     self.pattern = None
     self._wil_result = None
     self._getitems_keywords['result_count'] = (
         lambda: self.get_result_count())
     self._getitems_keywords['title'] = (lambda: self.get_title())
     self.show()
     if not hasattr(self, 'move_navigator'):
         mn = Task(self._move_navigator)
         mn.delay = config.HMI_BASE['search_navigator_delay']
         self.move_navigator = mn.start
         self.move_navigator_task = mn
     if not self.pattern:
         self.ask_pattern()
     else:
         self.search()
     return None
コード例 #3
0
ファイル: scheduled_record.py プロジェクト: rayman18/wydev
 def show(self, *args, **kw):
     Menu.show(self, *args, **kw)
     if self.is_only_this_time():
         louie_send('frequency_only_this_time_on', sender=self)
     else:
         louie_send('frequency_only_this_time_off', sender=self)
     return None
コード例 #4
0
ファイル: core.py プロジェクト: rayman18/wydev
 def stop(self):
     self.status = None
     self.total_time = 0.0
     self.time_elapsed = 0.0
     if self._idle_timer is not None:
         self._idle_timer.stop()
     try:
         nav = self.stack.get_navigator()
         if nav:
             nav.force_preview = True
     except:
         PRINT_EXCEPTION()
     Menu.stop(self)
     return None
コード例 #5
0
ファイル: search.py プロジェクト: rayman18/wydev
 def select(self, item, list_name=None, force_select=False):
     ret = Menu.select(self, item, list_name)
     if (ret is not False and self.navigator) or force_select:
         louie_send('result_count',
                    sender=self,
                    value=self.get_result_count())
         self.move_navigator()
     return None
コード例 #6
0
ファイル: core.py プロジェクト: rayman18/wydev
 def __init__(self, type_, universe=None):
     self.stack = pygui_globs['menustack']
     self.total_time = 0.0
     self.time_elapsed = 0.0
     Menu.__init__(self, [], type=type_, universe=universe)
     self._getitems_keywords.update(
         dict(time_elapsed=(
             lambda: _seconds_to_hhmmss(round(self.time_elapsed))),
              time_remaining=(lambda: _guarded_seconds_to_hhmmss(
                  round(self.total_time) - round(self.time_elapsed))),
              time_total=(lambda: _guarded_seconds_to_hhmmss(
                  round(self.total_time))),
              progressbar=self._get_progressbar,
              status_icon=self._get_status_icon,
              playmode_icon=self._get_playmode_icon,
              subtitles=(lambda: '')))
     self.tasks['tick'] = Task(self.tick_callback)
     self.tasks['screensaver_block'] = Task((lambda: None))
     return None
コード例 #7
0
ファイル: audio_player.py プロジェクト: rayman18/wydev
	def event_down(self, event):
		al = self.player.active_list
		if al == 'main_list':
			if not self.player.random_mode:
				ret = self.player.select(event.arg['count'], list_name=al)
				if self.player.repeat_mode == 'track':
					self.player.repeat_mode = False
			else:
				ret = self.player.select_random()
		else:
			ret = Menu.select(self.player, event.arg['count'], list_name=al)
		return True
コード例 #8
0
ファイル: core.py プロジェクト: rayman18/wydev
 def select(self, item_or_pos, list_name='main_list', force_pos=False):
     if self.get_item_list(list_name).selected == item_or_pos:
         return False
     ret = Menu.select(self,
                       item_or_pos,
                       list_name=list_name,
                       force_pos=force_pos)
     if list_name != 'main_list':
         return None
     if ret:
         self.time_elapsed = 0.0
         self.total_time = 0.0
     if self.stack.is_on_top(self):
         self.stack.back_to_menu(self)
     louie_send('main_list',
                sender=self,
                action='reset',
                value=self['main_list'],
                position=self['main_list'].selected_pos)
     return ret
コード例 #9
0
ファイル: audio_player.py プロジェクト: rayman18/wydev
	def event_wheel_rwd(self, event):
		play = self.player
		if play.active_list == 'edit_list':
			return Menu.select(play, -event.arg['count'])
		self.player.action_seek(HMI_MUSIC['left'])
		return True
コード例 #10
0
ファイル: audio_player.py プロジェクト: rayman18/wydev
	forward_steps = f_list(HMI_MUSIC['forward'])
	backward_steps = f_list(HMI_MUSIC['backward'])
	def event_action_menu(self, event):
		GenericPlayerEventHandler.event_action_menu(self, event)

	def event_up(self, event):
		al = self.player.active_list
		if al == 'main_list':
			if not self.player.random_mode:
				ret = self.player.select(-event.arg['count'], list_name=al)
				if self.player.repeat_mode == 'track':
					self.player.repeat_mode = False
			else:
				ret = self.player.select_random()
		else:
			ret = Menu.select(self.player, -event.arg['count'], list_name=al)
		return True

	def event_down(self, event):
		al = self.player.active_list
		if al == 'main_list':
			if not self.player.random_mode:
				ret = self.player.select(event.arg['count'], list_name=al)
				if self.player.repeat_mode == 'track':
					self.player.repeat_mode = False
			else:
				ret = self.player.select_random()
		else:
			ret = Menu.select(self.player, event.arg['count'], list_name=al)
		return True
コード例 #11
0
ファイル: search.py プロジェクト: rayman18/wydev
 def show(self):
     return Menu.show(self, False)
コード例 #12
0
	def __init__(self, name='ScreenSaver', type='screensaver'):
		self.eventhandler = ScreenSaverMenuEventHandler(self)
		Menu.__init__(self, name, type=type, universe=None)
		self._getitems_keywords = dict()
		set_idle_callback(self.idle, self.busy, user_config['power']['screensaver_threshold'])
		return None
コード例 #13
0
ファイル: scheduled_record.py プロジェクト: rayman18/wydev
    def __init__(self,
                 name=_('Scheduled recordings'),
                 type_='scheduled_records'):
        Menu.__init__(self, name, type=type_, universe='tv')
        self.PERIODICITY = {
            'none': (_('Only this time'), 0),
            'daily': (_('Every day'), 1),
            'weekly': (_('Every week'), 7)
        }
        self._favorite_list = [TVRootItem().get_acl(menu=self)]
        self._favorite_list.extend(TVRootItem().browse_favorites(self))
        self._all_channel_list = self._favorite_list[0]
        self.eventhandler = ModifyScheduledRecordMenuEventHandler(self)
        self.channel_list = ItemListItem(_('Channels'),
                                         menu=self,
                                         _list=self._favorite_list,
                                         list_name='channel_name_list')
        self.favorite_list = ItemListItem(
            _('Favorites'),
            menu=self,
            _list=self._all_channel_list.browse(),
            list_name='favorite_name_list')
        self.service_list = ItemListItem(
            _('Channel'),
            menu=self,
            _list=[self.channel_list, self.favorite_list],
            list_name='service_list')
        self.item_lists_dict['service_list'] = self.service_list
        _today = date.today()
        date_list = [[_('Month'), MONTHS],
                     [
                         _('Year'),
                         [IntegerItem(i) for i in xrange(_today.year + 10)]
                     ],
                     [
                         _('Day'),
                         [
                             IntegerItem(i) for i in xrange(
                                 1,
                                 days_in_month(_today.year, _today.month) + 1)
                         ]
                     ]]
        date_order = DATE_ORDERS[user_config['base']['dateformat']]
        self.day_index = date_order.index(2)
        self.month_index = date_order.index(0)
        self.year_index = date_order.index(1)
        self.date_1_list = ItemListItem(date_list[date_order[0]][0],
                                        menu=self,
                                        _list=date_list[date_order[0]][1],
                                        list_name='date_1_list')
        self.date_2_list = ItemListItem(date_list[date_order[1]][0],
                                        menu=self,
                                        _list=date_list[date_order[1]][1],
                                        list_name='date_2_list')
        self.date_3_list = ItemListItem(date_list[date_order[2]][0],
                                        menu=self,
                                        _list=date_list[date_order[2]][1],
                                        list_name='date_3_list')
        self.date_list = ItemListItem(
            _('Date'),
            menu=self,
            _list=[self.date_1_list, self.date_2_list, self.date_3_list],
            list_name='date_list')
        self.item_lists_dict['date_list'] = self.date_list
        self.start_hour_list = ItemListItem(_('Hour'),
                                            menu=self,
                                            _list=HOURS,
                                            list_name='start_hour_list')
        self.start_minute_list = ItemListItem(_('Minute'),
                                              menu=self,
                                              _list=MINUTES,
                                              list_name='start_minute_list')
        self.start_time_list = ItemListItem(
            _('Start time'),
            menu=self,
            _list=[self.start_hour_list, self.start_minute_list],
            list_name='start_time_list')
        self.item_lists_dict['start_time_list'] = self.start_time_list
        self.stop_hour_list = ItemListItem(_('Hour'),
                                           menu=self,
                                           _list=HOURS,
                                           list_name='stop_hour_list')
        self.stop_minute_list = ItemListItem(_('Minute'),
                                             menu=self,
                                             _list=MINUTES,
                                             list_name='stop_minute_list')
        self.stop_time_list = ItemListItem(
            _('End time'),
            menu=self,
            _list=[self.stop_hour_list, self.stop_minute_list],
            list_name='stop_time_list')
        self.item_lists_dict['stop_time_list'] = self.stop_time_list
        self.record_name = ''

        def _fun(key):
            it = Item(self.PERIODICITY[key][0], 'periodic', self)
            it.val = self.PERIODICITY[key]
            it.key = key
            return it

        self.repetition_type_list = ItemListItem(
            _('Frequency'),
            menu=self,
            _list=map(_fun, ['none', 'daily', 'weekly']),
            list_name='repetition_type_list')
        self.repetition_list = ItemListItem(_('Frequency'),
                                            menu=self,
                                            _list=[self.repetition_type_list],
                                            list_name='repetition_list')
        self.item_lists_dict['repetition_list'] = self.repetition_list
        self.repetition_number_list = ItemListItem(
            _('Number of recordings'),
            menu=self,
            _list=REPEAT_NUMBERS,
            list_name='repetition_number_list')
        self.repetition_num_list = ItemListItem(
            _('Number of recordings'),
            menu=self,
            _list=[self.repetition_number_list],
            list_name='repetition_num_list')
        self.item_lists_dict['repetition_num_list'] = self.repetition_num_list
        self.confirm_list = ItemListItem(
            _('Confirm'),
            menu=self,
            list_name='confirmation_option_list',
            _list=[Item(_('Confirm'), 'choice', menu=self)])
        self.cancel_list = ItemListItem(
            _('Cancel'),
            menu=self,
            list_name='cancellation_option_list',
            _list=[Item(_('Cancel'), 'choice', menu=self)])
        self.confirm_list.execute = self._confirm
        self.cancel_list.execute = self.cancel
        self.confirmation_list = ItemListItem(
            _('Actions'),
            menu=self,
            list_name='confirmation_list',
            _list=[self.confirm_list, self.cancel_list])
        self.confirmation_list.select(None, True)
        self.item_lists_dict['confirmation_list'] = self.confirmation_list
        self.set_items([
            self.service_list, self.date_list, self.start_time_list,
            self.stop_time_list, self.repetition_list,
            self.repetition_num_list, self.confirmation_list
        ])
        self._getitems_keywords.update({
            'channel_name': (lambda:
                             (self.channel_list.selected.name
                              if self.channel_list.selected and self.
                              channel_list.selected.name else _('Unknown'))),
            'favorite_name':
            (lambda: (self.favorite_list.selected.name
                      if self.favorite_list.selected and self.favorite_list.
                      selected.name else _('Unknown'))),
            'record_name': (lambda: self.record_name),
            'date_1': (lambda: self.date_1_list.selected.name),
            'date_2': (lambda: self.date_2_list.selected.name),
            'date_3': (lambda: self.date_3_list.selected.name),
            'date_weekday':
            self._get_weekday_from_date,
            'start_hour': (lambda: self.start_hour_list.selected.name),
            'start_minute': (lambda: self.start_minute_list.selected.name),
            'stop_hour': (lambda: self.stop_hour_list.selected.name),
            'stop_minute': (lambda: self.stop_minute_list.selected.name),
            'repetition_type':
            (lambda: self.repetition_type_list.selected.name),
            'repetition_number':
            (lambda: self.repetition_number_list.selected.name),
            'confirmation_list': (lambda: self.confirmation_list)
        })
        self._record_to_remove = None
        self.scheduled_record = None
        return None