def _register_listeners(self):
     self.register_slot(
         MultiSlot(subject=self._song.view,
                   event_name_list=('selected_track',
                                    self._current_target_property),
                   listener=self.__on_current_routing_changed))
     self.register_slot(
         MultiSlot(subject=self._song.view,
                   event_name_list=('selected_track', 'available_%ss' %
                                    self._current_target_property),
                   listener=self.__on_routings_changed))
Пример #2
0
 def __init__(self, routing_level = None, routing_direction = None, song = None, *a, **k):
     raise song is not None or AssertionError
     raise routing_level is not None or AssertionError
     raise routing_direction is not None or AssertionError
     super(Router, self).__init__(*a, **k)
     self._song = song
     self._current_target_property = '%s_routing_%s' % (routing_direction, routing_level)
     self.register_slot(MultiSlot(subject=song.view, event_name_list=('selected_track', self._current_target_property), listener=self.__on_current_routing_changed))
     self.register_slot(MultiSlot(subject=song.view, event_name_list=('selected_track', 'available_%s_routing_%ss' % (routing_direction, routing_level)), listener=self.__on_routings_changed))
     self.current_target_index = self._current_target_index()
     return
Пример #3
0
 def __init__(self, item_provider=None, track_property=None, property_active_color=None, song=None, *a, **k):
     super(TrackStateColorIndicator, self).__init__(*a, **k)
     self._provider = item_provider
     self._active_color = property_active_color
     self._property = track_property
     self._song = song
     self.__on_items_changed.subject = item_provider
     self.register_slot(MultiSlot(listener=self.__on_property_changed, event_name_list=(
      b'selected_item', track_property), subject=item_provider))
     self._update_color()