def ServerInfo(self): """ Info: Gets server and device info Args: None Returns: dict Errors: None """ info = {} info["pa_count_devices"] = pyo.pa_count_devices() # type: ignore info["pa_get_default_input"] = pyo.pa_get_default_input( ) # type: ignore info["pa_get_default_output"] = pyo.pa_get_default_output( ) # type: ignore info["pm_get_input_devices"] = pyo.pm_get_input_devices( ) # type: ignore info["pa_count_host_apis"] = pyo.pa_count_host_apis() # type: ignore info["pa_get_default_host_api"] = pyo.pa_get_default_host_api( ) # type: ignore info["pm_count_devices"] = pyo.pm_count_devices() # type: ignore info["pa_get_input_devices"] = pyo.pa_get_input_devices( ) # type: ignore info["pm_get_default_input"] = pyo.pm_get_default_input( ) # type: ignore info["pm_get_output_devices"] = pyo.pm_get_output_devices( ) # type: ignore info["pm_get_default_output"] = pyo.pm_get_default_output( ) # type: ignore info["pa_get_devices_infos"] = pyo.pa_get_devices_infos( ) # type: ignore info["pa_get_version"] = pyo.pa_get_version() # type: ignore info["pa_get_version_text"] = pyo.pa_get_version_text() # type: ignore return info
def GetMidiInputs(self): if not hasattr(self, '_midi_inputs'): input_device_names, input_device_indexes = pyo.pm_get_input_devices() default_input_index = pyo.pm_get_default_input() midi_inputs = {} for input_index, input_name in zip(input_device_indexes, input_device_names): midi_inputs[input_index] = { 'name': input_name, 'default': bool(input_index == default_input_index), } setattr(self, '_midi_inputs', midi_inputs) return getattr(self, '_midi_inputs')
def getAvailableAudioMidiDrivers(self): inputDriverList, inputDriverIndexes = pa_get_input_devices() selectedInputDriver = inputDriverList[inputDriverIndexes.index( pa_get_default_input())] outputDriverList, outputDriverIndexes = pa_get_output_devices() selectedOutputDriver = outputDriverList[outputDriverIndexes.index( pa_get_default_output())] midiDriverList, midiDriverIndexes = pm_get_input_devices() if midiDriverList == []: selectedMidiDriver = "" else: selectedMidiDriver = midiDriverList[midiDriverIndexes.index( pm_get_default_input())] return inputDriverList, selectedInputDriver, outputDriverList, selectedOutputDriver, midiDriverList, selectedMidiDriver
def getAvailableAudioMidiDrivers(): inputDriverList, inputDriverIndexes = pa_get_input_devices() defaultInputDriver = inputDriverList[inputDriverIndexes.index( pa_get_default_input())] outputDriverList, outputDriverIndexes = pa_get_output_devices() defaultOutputDriver = outputDriverList[outputDriverIndexes.index( pa_get_default_output())] midiDriverList, midiDriverIndexes = pm_get_input_devices() if midiDriverList == []: defaultMidiDriver = "" else: defaultMidiDriver = midiDriverList[midiDriverIndexes.index( pm_get_default_input())] return inputDriverList, inputDriverIndexes, defaultInputDriver, outputDriverList, outputDriverIndexes, \ defaultOutputDriver, midiDriverList, midiDriverIndexes, defaultMidiDriver
def getAvailableAudioMidiDrivers(): inDefault = pa_get_default_input() inDriverList, inDriverIndexes = pa_get_input_devices() if inDefault in inDriverIndexes: defaultInputDriver = inDriverList[inDriverIndexes.index(inDefault)] else: defaultInputDriver = "" outDriverList, outDriverIndexes = pa_get_output_devices() outDefault = pa_get_default_output() if outDefault in outDriverIndexes: defaultOutputDriver = outDriverList[outDriverIndexes.index(outDefault)] else: defaultOutputDriver = "" midiDefault = pm_get_default_input() midiDriverList, midiDriverIndexes = pm_get_input_devices() if midiDefault in midiDriverIndexes: defaultMidiDriver = midiDriverList[midiDriverIndexes.index(midiDefault)] else: defaultMidiDriver = "" return (inDriverList, inDriverIndexes, defaultInputDriver, outDriverList, outDriverIndexes, defaultOutputDriver, midiDriverList, midiDriverIndexes, defaultMidiDriver)