2019-12-25 16:41:38 +01:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
# Enumerate available devices and show their capabilities
|
2020-01-01 17:00:26 +01:00
|
|
|
# Copyright (C) 2019, 2020 Nguyễn Gia Phong
|
2019-12-25 16:41:38 +01:00
|
|
|
#
|
2020-01-04 05:55:49 +01:00
|
|
|
# This file is part of palace.
|
2019-12-25 16:41:38 +01:00
|
|
|
#
|
2020-01-04 05:55:49 +01:00
|
|
|
# palace is free software: you can redistribute it and/or modify it
|
2019-12-25 16:41:38 +01:00
|
|
|
# under the terms of the GNU Lesser General Public License as published
|
|
|
|
# by the Free Software Foundation, either version 3 of the License,
|
|
|
|
# or (at your option) any later version.
|
|
|
|
#
|
2020-01-04 05:55:49 +01:00
|
|
|
# palace is distributed in the hope that it will be useful,
|
2019-12-25 16:41:38 +01:00
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU Lesser General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU Lesser General Public License
|
2020-01-04 05:55:49 +01:00
|
|
|
# along with palace. If not, see <https://www.gnu.org/licenses/>.
|
2019-12-25 16:41:38 +01:00
|
|
|
|
|
|
|
from argparse import ArgumentParser
|
|
|
|
|
2020-01-04 05:55:49 +01:00
|
|
|
from palace import device_names, device_name_default, Device
|
2019-12-25 16:41:38 +01:00
|
|
|
|
|
|
|
|
|
|
|
parser = ArgumentParser()
|
2020-01-01 17:00:26 +01:00
|
|
|
parser.add_argument('device', type=Device, default='', nargs='?',
|
2019-12-25 16:41:38 +01:00
|
|
|
help='name of device to give extra info')
|
|
|
|
args = parser.parse_args()
|
|
|
|
|
2020-01-01 17:00:26 +01:00
|
|
|
with args.device:
|
|
|
|
names = device_names.copy()
|
|
|
|
for kind, default in device_name_default.items():
|
|
|
|
i = names[kind].index(default)
|
|
|
|
names[kind][i] += ' [DEFAULT]'
|
|
|
|
print('Available basic devices:', *names['basic'], sep='\n ')
|
|
|
|
print('\nAvailable devices:', *names['full'], sep='\n ')
|
|
|
|
print('\nAvailable capture devices:', *names['capture'], sep='\n ')
|
2019-12-25 16:41:38 +01:00
|
|
|
|
2020-01-01 17:00:26 +01:00
|
|
|
print(f'\nInfo of device "{args.device.name["full"]}":')
|
|
|
|
print('ALC version: {}.{}'.format(*args.device.alc_version))
|
|
|
|
efx = args.device.efx_version
|
2019-12-25 16:41:38 +01:00
|
|
|
if efx == (0, 0):
|
|
|
|
print('EFX not supported!')
|
|
|
|
else:
|
|
|
|
print('EFX version: {}.{}'.format(*efx))
|
2020-01-01 17:00:26 +01:00
|
|
|
print('Max auxiliary sends:', args.device.max_auxiliary_sends)
|