Init for linux
This commit is contained in:
@@ -77,8 +77,9 @@ def write_config_file(**kwargs):
|
||||
|
||||
|
||||
def get_device_list():
|
||||
return sound.query_devices().items()
|
||||
|
||||
list_of_devices = sound.query_devices().items()
|
||||
print(list_of_devices)
|
||||
return list_of_devices
|
||||
|
||||
def get_user_device_selection():
|
||||
device_list = get_device_list()
|
||||
@@ -86,32 +87,38 @@ def get_user_device_selection():
|
||||
for device, dev_id in device_list:
|
||||
print(f"{dev_id + 1}\t-\t{device}")
|
||||
org_device_list.append((dev_id, device))
|
||||
selected_id = None
|
||||
while not selected_id:
|
||||
selected_list_id = None
|
||||
selected_device = None
|
||||
while not selected_list_id:
|
||||
print(f"selected device: {selected_list_id}")
|
||||
print((device_list))
|
||||
|
||||
try:
|
||||
selected_id = int(input(f"Please select the input device from above:\t")) - 1
|
||||
selected_list_id = int(input(f"Please select the input device from above:\t"))
|
||||
|
||||
except Exception as e:
|
||||
print(e)
|
||||
continue
|
||||
continue
|
||||
|
||||
if selected_id and not selected_id + 1 > int(len(device_list)):
|
||||
if int(selected_list_id) < int(len(device_list)):
|
||||
print("ford")
|
||||
continue
|
||||
elif selected_id > int(len(device_list)):
|
||||
elif selected_list_id > int(len(device_list)):
|
||||
print("Out of range, try again...")
|
||||
selected_id = None
|
||||
selected_list_id = None
|
||||
continue
|
||||
else:
|
||||
selected_id = None
|
||||
selected_list_id = None
|
||||
print("Internal error, try again")
|
||||
continue
|
||||
|
||||
for dev_dict in org_device_list:
|
||||
if dev_dict[0] == selected_id:
|
||||
selected_id = dev_dict
|
||||
print(list(device_list)[selected_list_id-1][0])
|
||||
if dev_dict[1] == list(device_list)[selected_list_id-1][0]:
|
||||
selected_device = dev_dict
|
||||
print(selected_device)
|
||||
|
||||
return selected_id
|
||||
return selected_device
|
||||
|
||||
|
||||
def get_user_token():
|
||||
|
||||
Reference in New Issue
Block a user