def __init__(self, selection=None, browser_component=None, browser_mode=None, browser_hotswap_mode=None, insert_left=False, *a, **k): super(CreateDeviceComponent, self).__init__(*a, **k) self._selection = selection self._add_effect_mode = BrowserAddEffectMode( selection=selection, browser=self.application().browser, application_view=self.application().view, insert_left=insert_left) self._create_device_modes = self.register_component(ModesComponent()) self._create_device_modes.add_mode('create', [ SetAttributeMode(browser_component, 'do_load_item', self._do_browser_load_item), self._add_effect_mode, browser_mode, browser_component.reset_load_memory ]) self._create_device_modes.add_mode( 'hotswap', [browser_hotswap_mode, browser_mode]) self._go_to_hotswap_task = self._tasks.add( Task.sequence(Task.delay(1), Task.run(self._go_to_hotswap))) self._go_to_hotswap_task.kill()
def __init__(self, selection=None, browser_mode=None, browser_component=None, browser_hotswap_mode=None, *a, **k): super(CreateInstrumentTrackComponent, self).__init__(*a, **k) self._selection = selection self._with_browser_modes = self.register_component(ModesComponent()) self._with_browser_modes.add_mode('create', [ self._prepare_browser, SetAttributeMode(self.application().browser, 'filter_type', Live.Browser.FilterType.instrument_hotswap), SetAttributeMode(browser_component, 'do_load_item', self._do_browser_load_item), browser_mode, browser_component.reset_load_memory ]) self._with_browser_modes.add_mode('hotswap', [browser_hotswap_mode, browser_mode]) self._go_to_hotswap_task = self._tasks.add( Task.sequence(Task.delay(1), Task.run(self._go_to_hotswap))) self._go_to_hotswap_task.kill()