re-run files through ruff formatter

This commit is contained in:
2025-01-20 16:29:47 +00:00
parent b5ea41c604
commit fbd4962fb2
9 changed files with 1202 additions and 1202 deletions

View File

@@ -18,9 +18,9 @@ def get_insert_checkbox_index(kind, channel, num) -> int:
_rejected_ids = (
"VBAudio100VMVAIO3",
"{F5735BD4-6EAF-4758-9710-9886E5AD0FF3}",
"{0239BE07-CEEF-4236-A900-AA778D432FD4}",
'VBAudio100VMVAIO3',
'{F5735BD4-6EAF-4758-9710-9886E5AD0FF3}',
'{0239BE07-CEEF-4236-A900-AA778D432FD4}',
)
@@ -28,8 +28,8 @@ def get_input_device_list(vm) -> list:
devices = []
for j in range(vm.device.ins):
device = vm.device.input(j)
if device["id"] not in _rejected_ids:
devices.append("{type}: {name}".format(**device))
if device['id'] not in _rejected_ids:
devices.append('{type}: {name}'.format(**device))
return devices
@@ -37,37 +37,37 @@ def get_output_device_list(i, vm) -> list:
devices = []
for j in range(vm.device.outs):
device = vm.device.output(j)
if device["id"] not in _rejected_ids:
devices.append("{type}: {name}".format(**device))
if device['id'] not in _rejected_ids:
devices.append('{type}: {name}'.format(**device))
if i == 0:
return devices
devices.append("- remove device selection -")
return [device for device in devices if not device.startswith("asio")]
devices.append('- remove device selection -')
return [device for device in devices if not device.startswith('asio')]
def get_patch_composite_list(kind) -> list:
temp = []
for i in range(kind.phys_out):
[temp.append(f"IN#{i + 1} {channel}") for channel in ("Left", "Right")]
[temp.append(f'IN#{i + 1} {channel}') for channel in ('Left', 'Right')]
for i in range(kind.phys_out, kind.phys_out + kind.virt_out):
[
temp.append(f"IN#{i + 1} {channel}")
for channel in ("Left", "Right", "Center", "LFE", "SL", "SR", "BL", "BR")
temp.append(f'IN#{i + 1} {channel}')
for channel in ('Left', 'Right', 'Center', 'LFE', 'SL', 'SR', 'BL', 'BR')
]
temp.append("BUS Channel")
temp.append('BUS Channel')
return temp
def get_patch_insert_channels() -> list:
return [
"left",
"right",
"center",
"low frequency effect",
"surround left",
"surround right",
"back left",
"back right",
'left',
'right',
'center',
'low frequency effect',
'surround left',
'surround right',
'back left',
'back right',
]
@@ -75,8 +75,8 @@ _patch_insert_channels = get_patch_insert_channels()
def get_asio_samples_list(driver) -> list:
if driver == "MME":
samples = ["2048", "1536", "1024", "896", "768", "704", "640", "576", "512", "480", "441"]
if driver == 'MME':
samples = ['2048', '1536', '1024', '896', '768', '704', '640', '576', '512', '480', '441']
else:
# fmt: off
samples = [
@@ -84,14 +84,14 @@ def get_asio_samples_list(driver) -> list:
"352", "320", "288", "256", "224", "192", "160", "128"
]
# fmt: on
if driver == "ASIO":
samples = [x for x in samples if x not in ("2048", "1536")]
samples.append("Default")
if driver == 'ASIO':
samples = [x for x in samples if x not in ('2048', '1536')]
samples.append('Default')
return samples
def get_tabs_labels() -> list:
return ["Settings", "Physical Strip", "Virtual Strip", "Buses"]
return ['Settings', 'Physical Strip', 'Virtual Strip', 'Buses']
def open_context_menu_for_buttonmenu(window, identifier) -> None:
@@ -106,52 +106,52 @@ def get_channel_identifier_list(vm) -> list:
identifiers = []
for i in range(vm.kind.phys_in):
for j in range(2):
identifiers.append(f"IN{i + 1} {j}")
identifiers.append(f'IN{i + 1} {j}')
for i in range(vm.kind.phys_in, vm.kind.phys_in + vm.kind.virt_in):
for j in range(8):
identifiers.append(f"IN{i + 1} {j}")
identifiers.append(f'IN{i + 1} {j}')
return identifiers
_bus_mode_map = {
"normal": "Normal",
"amix": "Mix Down A",
"bmix": "Mix Down B",
"repeat": "Stereo Repeat",
"composite": "Composite",
"tvmix": "Up Mix TV",
"upmix21": "Up Mix 2.1",
"upmix41": "Up Mix 4.1",
"upmix61": "Up Mix 6.1",
"centeronly": "Center Only",
"lfeonly": "Low Frequency Effect Only",
"rearonly": "Rear Only",
'normal': 'Normal',
'amix': 'Mix Down A',
'bmix': 'Mix Down B',
'repeat': 'Stereo Repeat',
'composite': 'Composite',
'tvmix': 'Up Mix TV',
'upmix21': 'Up Mix 2.1',
'upmix41': 'Up Mix 4.1',
'upmix61': 'Up Mix 6.1',
'centeronly': 'Center Only',
'lfeonly': 'Low Frequency Effect Only',
'rearonly': 'Rear Only',
}
_bus_mode_map_reversed = dict((reversed(item) for item in _bus_mode_map.items()))
def get_bus_modes(vm) -> list:
if vm.kind.name == "basic":
if vm.kind.name == 'basic':
return [
"normal",
"amix",
"repeat",
"composite",
'normal',
'amix',
'repeat',
'composite',
]
return [
"normal",
"amix",
"bmix",
"repeat",
"composite",
"tvmix",
"upmix21",
"upmix41",
"upmix61",
"centeronly",
"lfeonly",
"rearonly",
'normal',
'amix',
'bmix',
'repeat',
'composite',
'tvmix',
'upmix21',
'upmix41',
'upmix61',
'centeronly',
'lfeonly',
'rearonly',
]
@@ -166,77 +166,77 @@ def check_bounds(val, bounds: tuple) -> int | float:
def get_slider_params(i, kind) -> Iterable:
if i < kind.phys_in:
if kind.name == "basic":
return ("AUDIBILITY",)
if kind.name == "banana":
return ("COMP", "GATE")
if kind.name == "potato":
return ("COMP", "GATE", "DENOISER")
return ("BASS", "MID", "TREBLE")
if kind.name == 'basic':
return ('AUDIBILITY',)
if kind.name == 'banana':
return ('COMP', 'GATE')
if kind.name == 'potato':
return ('COMP', 'GATE', 'DENOISER')
return ('BASS', 'MID', 'TREBLE')
def get_full_slider_params(i, kind) -> Iterable:
params = list(get_slider_params(i, kind) + ("GAIN", "LIMIT"))
if kind.name == "basic":
params.remove("LIMIT")
params = list(get_slider_params(i, kind) + ('GAIN', 'LIMIT'))
if kind.name == 'basic':
params.remove('LIMIT')
return params
def get_slider_modes() -> Iterable:
return (
"GAIN MODE",
"BASS MODE",
"MID MODE",
"TREBLE MODE",
"AUDIBILITY MODE",
"COMP MODE",
"GATE MODE",
"DENOISER MODE",
"LIMIT MODE",
'GAIN MODE',
'BASS MODE',
'MID MODE',
'TREBLE MODE',
'AUDIBILITY MODE',
'COMP MODE',
'GATE MODE',
'DENOISER MODE',
'LIMIT MODE',
)
def _get_bus_assignments(kind) -> list:
return [f"A{i}" for i in range(1, kind.phys_out + 1)] + [f"B{i}" for i in range(1, kind.virt_out + 1)]
return [f'A{i}' for i in range(1, kind.phys_out + 1)] + [f'B{i}' for i in range(1, kind.virt_out + 1)]
psg.theme_add_new(
"HighContrast",
'HighContrast',
{
"BACKGROUND": "#FFFFFF",
"TEXT": "#000000",
"INPUT": "#FAF9F6",
"TEXT_INPUT": "#000000",
"SCROLL": "#FAF9F6",
"BUTTON": ("#000000", "#FFFFFF"),
"PROGRESS": ("#000000", "#FFFFFF"),
"BORDER": 2,
"SLIDER_DEPTH": 3,
"PROGRESS_DEPTH": 0,
'BACKGROUND': '#FFFFFF',
'TEXT': '#000000',
'INPUT': '#FAF9F6',
'TEXT_INPUT': '#000000',
'SCROLL': '#FAF9F6',
'BUTTON': ('#000000', '#FFFFFF'),
'PROGRESS': ('#000000', '#FFFFFF'),
'BORDER': 2,
'SLIDER_DEPTH': 3,
'PROGRESS_DEPTH': 0,
},
)
def get_themes_list() -> list:
return [
"Bright Colors",
"Dark Blue 14",
"Dark Brown 2",
"Dark Brown 3",
"Dark Green 2",
"Dark Grey 2",
"Dark Teal1",
"Dark Teal6",
"Kayak",
"Light Blue 2",
"Light Brown 2",
"Light Brown 5",
"Light Green",
"Light Green 3",
"Light Grey 2",
"Light Purple",
"Neutral Blue",
"Reds",
"Sandy Beach",
"High Contrast",
'Bright Colors',
'Dark Blue 14',
'Dark Brown 2',
'Dark Brown 3',
'Dark Green 2',
'Dark Grey 2',
'Dark Teal1',
'Dark Teal6',
'Kayak',
'Light Blue 2',
'Light Brown 2',
'Light Brown 5',
'Light Green',
'Light Green 3',
'Light Grey 2',
'Light Purple',
'Neutral Blue',
'Reds',
'Sandy Beach',
'High Contrast',
]