From 6d36df7b43aa7b5acead72a35a7588fd9c4c4416 Mon Sep 17 00:00:00 2001 From: Matthew Stratford Date: Wed, 14 Apr 2021 14:39:53 +0100 Subject: [PATCH] Show all host APIs, but only allow selection of some. --- helpers/device_manager.py | 8 ++++---- templates/config.html | 6 ++++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/helpers/device_manager.py b/helpers/device_manager.py index 578535a..7cdb576 100644 --- a/helpers/device_manager.py +++ b/helpers/device_manager.py @@ -31,18 +31,18 @@ class DeviceManager: host_apis = sd.query_hostapis() devices: sd.DeviceList = cls._getAudioDevices() - valid_host_apis = [] for host_api_id in range(len(host_apis)): if isWindows() and host_apis[host_api_id]["name"] not in WINDOWS_APIS: - continue + host_apis[host_api_id]["usable"] = False + else: + host_apis[host_api_id]["usable"] = True host_api_devices = (device for device in devices if device["hostapi"] == host_api_id) outputs: List[Dict] = list(filter(cls._isOutput, host_api_devices)) outputs = sorted(outputs, key=lambda k: k["name"]) - valid_host_apis.append(host_apis[host_api_id]) - valid_host_apis[-1]["output_devices"] = outputs + host_apis[host_api_id]["output_devices"] = outputs return host_apis diff --git a/templates/config.html b/templates/config.html index b5b4eec..ba1babb 100644 --- a/templates/config.html +++ b/templates/config.html @@ -1,7 +1,7 @@ {% extends 'base.html' %} {% block content_inner %}

Audio Outputs

-

Please note: Currently BAPSicle does not support choosing which Host API is used. This list is for reference.

+

Please note: Currently BAPSicle does not support choosing which Host API is used. Only supported options can be selected.

{% for host_api in data.outputs %}
@@ -9,11 +9,13 @@
{% for output in host_api.output_devices %} + {% if host_api.usable %} Set for: {% for channel in data.channels %} Channel {{channel.channel}} {% endfor %} - - {% if output.name %}{{output.name}}{% else %}System Default Output{% endif %}
+ - + {% endif %}{% if output.name %}{{output.name}}{% else %}System Default Output{% endif %}
{% endfor %}
{% endfor %}