def _set_device(self, device):
     super(DeviceComponent, self)._set_device(device)
     simpler = self.device() if is_simpler(self.device()) else None
     if liveobj_valid(simpler):
         simpler.zoom.reset_focus_and_animation()
     self.__on_sample_or_file_path_changed.subject = simpler
     self.__on_waveform_visible_region_changed.subject = simpler
     self._playhead_real_time_data.set_data(device)
     self._waveform_real_time_data.set_data(device)
     self.notify_options()
 def set_parameter_host(self, parameter_host):
     new_parameter_host = parameter_host if is_simpler(parameter_host) else None
     if liveobj_changed(self._parameter_host, new_parameter_host):
         old_zoom = self.zoom
         self._parameter_host = new_parameter_host
         with self._updating_zoom_scaling():
             self._set_zoom_parameter()
         self._on_zoom_changed.subject = self._zoom_parameter
         self._on_sample_changed.subject = self._parameter_host
         if self.zoom != old_zoom:
             self.notify_zoom()
 def _set_device(self, device):
     super(DeviceComponent, self)._set_device(device)
     simpler = self.device() if is_simpler(self.device()) else None
     if liveobj_valid(simpler):
         simpler.zoom.reset_focus_and_animation()
     self.__on_sample_or_file_path_changed.subject = simpler
     self.__on_waveform_visible_region_changed.subject = simpler
     self._playhead_real_time_data.set_data(device)
     self._waveform_real_time_data.set_data(device)
     self.notify_options()
     return
 def _sensitivity(self, sensitivity_key, parameter):
     device = self.device()
     sensitivity = parameter_sensitivities(device.class_name, parameter)[sensitivity_key]
     if liveobj_valid(parameter) and is_simpler(device) and liveobj_valid(device.sample):
         if parameter.name in self.ZOOM_SENSITIVE_PARAMETERS:
             if device.waveform_navigation is not None:
                 sensitivity *= device.waveform_navigation.visible_proportion
         if parameter.name in self.PARAMETERS_RELATIVE_TO_ACTIVE_AREA:
             active_area_quotient = device.sample.length / float(device.sample.end_marker - device.sample.start_marker + 1)
             sensitivity *= active_area_quotient
     return sensitivity
 def _sensitivity(self, sensitivity_key, parameter):
     device = self.device()
     sensitivity = parameter_sensitivities(device.class_name,
                                           parameter)[sensitivity_key]
     if liveobj_valid(parameter) and is_simpler(device) and liveobj_valid(
             device.sample):
         if parameter.name in self.ZOOM_SENSITIVE_PARAMETERS:
             if device.waveform_navigation is not None:
                 sensitivity *= device.waveform_navigation.visible_proportion
         if parameter.name in self.PARAMETERS_RELATIVE_TO_ACTIVE_AREA:
             active_area_quotient = device.sample.length / float(
                 device.sample.end_marker - device.sample.start_marker + 1)
             sensitivity *= active_area_quotient
     return sensitivity
 def _update_real_time_channel(self, channel_name):
     device = self.device()
     if is_simpler(device):
         rt_data = getattr(self, '_%s_real_time_data' % channel_name)
         setattr(device, channel_name + '_real_time_channel_id', rt_data.channel_id)
 def parameter_touch_buttons(self, button):
     if is_simpler(self.device()):
         parameter = self._provided_parameters[button.index].parameter
         if parameter is not None:
             self.device().zoom.release_object(parameter)
 def _has_simpler_in_multi_sample_mode(self):
     device = self.device()
     return is_simpler(device) and device.multi_sample_mode
 def parameter_touch_buttons(self, button):
     if is_simpler(self.device()):
         parameter = self._provided_parameters[button.index].parameter
         if parameter is not None:
             self.device().zoom.release_object(parameter)
     return
 def _has_simpler_in_multi_sample_mode(self):
     device = self.device()
     return is_simpler(device) and device.multi_sample_mode
 def _update_real_time_channel(self, channel_name):
     device = self.device()
     if is_simpler(device):
         rt_data = getattr(self, '_%s_real_time_data' % channel_name)
         setattr(device, channel_name + '_real_time_channel_id',
                 rt_data.channel_id)