def __create_multiple_option_initial_cache(self, cache): default_params = { 'line-in': '-10dB', 'line-out': '-10dB', 'primary-clk-src': FFClkLabels.SPDIF.value, } for target, value in default_params.items(): FFOptionReg.build_multiple_option(cache, target, value)
def __load_option_settings(self): # Assist ALSA fireface driver to handle MIDI messages from Fireface 400. if self.__name == 'Fireface400': FFOptionReg.build_single_option(self.__option_cache, 'midi-low-addr', '0x00000000', True) req = Hinawa.FwReq() frames = pack('<3I', *self.__option_cache) req.transaction(self.get_node(), Hinawa.FwTcode.WRITE_BLOCK_REQUEST, self.__regs[0], len(frames), frames)
def __create_single_option_initial_cache(self, cache): default_params = { 'auto-sync': { 'internal': True, 'base-441': True, 'base-480': True, 'double': True, 'quadruple': True, }, 'front-input': { 'in-1': False, 'in-7': False, 'in-8': False, }, 'rear-input': { 'in-1': True, 'in-7': True, 'in-8': True, }, 'phantom-power': { 'mic-7': False, 'mic-8': False, 'mic-9': False, 'mic-10': False, }, 'spdif-in': { 'optical': False, 'track-maker': False, }, 'spdif-out': { 'professional': False, 'emphasis': False, 'non-audio': False, 'optical': False, }, 'instruments': { 'drive': False, 'limit': True, 'speaker-emu': False, }, 'wdclk-out': { 'single-speed': True, }, 'in-error': { 'continue': True, }, } for target, params in default_params.items(): for item, enable in params.items(): FFOptionReg.build_single_option(cache, target, item, enable)
def get_single_option(self, target, item): return FFOptionReg.parse_single_option(self.__option_cache, target, item)
def set_single_option(self, target, item, enable): FFOptionReg.build_single_option(self.__option_cache, target, item, enable) self.__write_cache_to_file() self.__load_option_settings()
def get_single_option_item_labels(self, target): return FFOptionReg.get_single_option_item_labels(target)
def get_single_option_labels(self): return FFOptionReg.get_single_option_labels()
def get_multiple_option(self, target): return FFOptionReg.parse_multiple_option(self.__option_cache, target)
def set_multiple_option(self, target, val): FFOptionReg.build_multiple_option(self.__option_cache, target, val) self.__write_cache_to_file() self.__load_option_settings()
def get_multiple_option_value_labels(self, target): return FFOptionReg.get_multiple_option_value_labels(target)
def get_multiple_option_labels(self): return FFOptionReg.get_multiple_option_labels()