Skip to content

Commit

Permalink
fix bad upload
Browse files Browse the repository at this point in the history
  • Loading branch information
3ll3d00d committed Aug 4, 2024
1 parent c47dd44 commit a9103ca
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 22 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ See [examples](examples)
|-----------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Camilla DSP | [ezbeq_cdsp.yml](examples/ezbeq_cdsp.yml) |
| J River Media Center | [ezbeq_mc.yml](examples/ezbeq_mc.yml) |
| Minidsp 2x4HD | [ezbeq_md.yml](examples/ezbeq_md.yml) or [using multiple devices](examples/ezbeq_md2.yml) |
| Minidsp 2x4HD | [ezbeq_md.yml](examples/ezbeq_md.yml), [using multiple devices](examples/ezbeq_md2.yml) or [with custom slot names](examples/ezbeq_named.yml) |
| Minidsp 4x10 | [ezbeq_4x10.yml](examples/ezbeq_4x10.yml) |
| Minidsp 10x10 | [without use of XO](examples/ezbeq_10x10.yml), [with](examples/ezbeq_10x10_xo.yml) or [using a custom mapping across input, output and xo](examples/ezbeq_10x10_custom.yml) |
| Minidsp DDRC-24 | [ezbeq_ddrc24.yml](examples/ezbeq_ddrc24.yml) |
Expand Down Expand Up @@ -150,7 +150,11 @@ Using, and controlling, multiple devices independently is supported but does req

For reference, a community provided example configuration guide can be found via [avs](https://www.avsforum.com/threads/ezbeq-use-and-development-discussion.3181732/page-170#post-62257128)

A full list of supported models is provided below.
##### Naming Slots

By default, the slots are numbered 1-4 as per the minidsp console.

To override, extend the device configuration with the `slotNames` key. It is not necessary to list every slot, just those that require an explicit name.

##### Minidsp Variants

Expand Down
3 changes: 3 additions & 0 deletions examples/ezbeq_named.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,7 @@ devices:
exe: minidsp
options: ''
type: minidsp
slotNames:
1: Hot
3: Normal
port: 8080
46 changes: 28 additions & 18 deletions ezbeq/minidsp.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ def __init__(self, name: str, descriptor: 'MinidspDescriptor', **kwargs):
MinidspSlotState(c_id,
c_id == self.active_slot,
0 if not descriptor.input else len(descriptor.input.channels),
0 if not descriptor.output else len(descriptor.output.channels)) for c_id in slot_ids
0 if not descriptor.output else len(descriptor.output.channels),
slot_name=descriptor.slot_names.get(c_id, None))
for c_id in slot_ids
]

def update_master_state(self, mute: bool, gain: float):
Expand Down Expand Up @@ -118,13 +120,14 @@ def merge_with(self, cached: dict) -> None:

class MinidspSlotState(SlotState['MinidspSlotState']):

def __init__(self, slot_id: str, active: bool, input_channels: int, output_channels: int):
def __init__(self, slot_id: str, active: bool, input_channels: int, output_channels: int, slot_name: str = None):
super().__init__(slot_id)
self.__input_channels = input_channels
self.__output_channels = output_channels
self.gains = self.__make_vals(0.0)
self.mutes = self.__make_vals(False)
self.active = active
self.slot_name = slot_name

def clear(self):
super().clear()
Expand Down Expand Up @@ -177,13 +180,15 @@ def merge_with(self, state: dict) -> None:

def as_dict(self) -> dict:
sup = super().as_dict()
if self.slot_name:
sup['name'] = self.slot_name
return {
**sup,
'gains': self.gains,
'mutes': self.mutes,
'canActivate': True,
'inputs': self.__input_channels,
'outputs': self.__output_channels
'outputs': self.__output_channels,
}

def __repr__(self):
Expand Down Expand Up @@ -256,13 +261,14 @@ def __repr__(self):
class MinidspDescriptor:

def __init__(self, name: str, fs: str, i: Optional[PeqRoutes] = None, xo: Optional[PeqRoutes] = None,
o: Optional[PeqRoutes] = None, extra: List[PeqRoutes] = None):
o: Optional[PeqRoutes] = None, extra: List[PeqRoutes] = None, slot_names: dict[str, str] = None):
self.name = name
self.fs = str(int(fs))
self.input = i
self.crossover = xo
self.output = o
self.extra = extra
self.slot_names = slot_names if slot_names else {}

@property
def peq_routes(self) -> List[PeqRoutes]:
Expand All @@ -280,6 +286,8 @@ def __repr__(self):
s = f"{s}, crossovers: {self.crossover}"
if self.output:
s = f"{s}, outputs: {self.output}"
if self.slot_names:
s = f"{s}, slot_names: {self.slot_names}"
return s


Expand All @@ -289,17 +297,18 @@ def zero_til(count: int) -> List[int]:

class Minidsp24HD(MinidspDescriptor):

def __init__(self):
def __init__(self, slot_names: dict[str, str] = None):
super().__init__('2x4HD',
'96000',
i=PeqRoutes(INPUT_NAME, 10, zero_til(2), zero_til(10)),
xo=PeqRoutes(CROSSOVER_NAME, 4, zero_til(4), [], groups=zero_til(2)),
o=PeqRoutes(OUTPUT_NAME, 10, zero_til(4), []))
o=PeqRoutes(OUTPUT_NAME, 10, zero_til(4), []),
slot_names=slot_names)


class MinidspDDRC24(MinidspDescriptor):

def __init__(self):
def __init__(self, slot_names: dict[str, str] = None):
super().__init__('DDRC24',
'48000',
xo=PeqRoutes(CROSSOVER_NAME, 4, zero_til(4), [], zero_til(2)),
Expand All @@ -308,7 +317,7 @@ def __init__(self):

class MinidspDDRC88(MinidspDescriptor):

def __init__(self, sw_channels: List[int] = None):
def __init__(self, slot_names: dict[str, str] = None, sw_channels: List[int] = None):
c = sw_channels if sw_channels is not None else [3]
if any(ch for ch in c if ch < 0 or ch > 7):
raise ValueError(f"Invalid channels {c}")
Expand All @@ -322,7 +331,7 @@ def __init__(self, sw_channels: List[int] = None):

class Minidsp410(MinidspDescriptor):

def __init__(self):
def __init__(self, slot_names: dict[str, str] = None):
super().__init__('4x10',
'96000',
i=PeqRoutes(INPUT_NAME, 5, zero_til(2), zero_til(5)),
Expand All @@ -331,7 +340,7 @@ def __init__(self):

class Minidsp1010(MinidspDescriptor):

def __init__(self, use_xo: Union[bool, int, str]):
def __init__(self, use_xo: Union[bool, int, str], slot_names: dict[str, str] = None):
if use_xo is True:
secondary = {'xo': PeqRoutes(CROSSOVER_NAME, 4, zero_til(8), zero_til(4), groups=[0])}
elif use_xo is False:
Expand All @@ -351,20 +360,21 @@ def __init__(self, use_xo: Union[bool, int, str]):


def make_peq_layout(cfg: dict) -> MinidspDescriptor:
slot_names: dict[str, str] = {str(k): str(v) for k,v in cfg.get('slotNames', {}).items()}
if 'device_type' in cfg:
device_type = cfg['device_type']
if device_type == '24HD':
return Minidsp24HD()
return Minidsp24HD(slot_names=slot_names)
elif device_type == 'DDRC24':
return MinidspDDRC24()
return MinidspDDRC24(slot_names=slot_names)
elif device_type == 'DDRC88':
return MinidspDDRC88(sw_channels=cfg.get('sw_channels', None))
return MinidspDDRC88(sw_channels=cfg.get('sw_channels', None), slot_names=slot_names)
elif device_type == '4x10':
return Minidsp410()
return Minidsp410(slot_names=slot_names)
elif device_type == '10x10':
return Minidsp1010(cfg.get('use_xo', False))
return Minidsp1010(cfg.get('use_xo', False), slot_names=slot_names)
elif device_type == 'SHD':
return MinidspDDRC24()
return MinidspDDRC24(slot_names=slot_names)
elif 'descriptor' in cfg:
desc: dict = cfg['descriptor']
named_args = ['name', 'fs', 'routes']
Expand Down Expand Up @@ -408,9 +418,9 @@ def to_ints(v):
extra.append(route)
if extra:
routes_by_name['extra'] = extra
return MinidspDescriptor(desc['name'], str(desc['fs']), **routes_by_name)
return MinidspDescriptor(desc['name'], str(desc['fs']), **routes_by_name, slot_names=slot_names)
else:
return Minidsp24HD()
return Minidsp24HD(slot_names=slot_names)


class Minidsp(PersistentDevice[MinidspState]):
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "ezbeq"
version = "2.1.0a7"
version = "2.1.0a9"
description = "A webapp which can send beqcatalogue filters to a DSP device"
authors = ["3ll3d00d <mattkhan+ezbeq@gmail.com>"]
license = "MIT"
Expand Down
2 changes: 1 addition & 1 deletion ui/src/components/main/Slots.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ const Slot = ({selected, slot, onSelect, isPending, onClear}) => {
<Paper className={`${classes.paper}`}>
<Grid container justifyContent="space-between" alignItems="center">
<Grid item onClick={onSelect} xs={8} className={`${classes.content}`} zeroMinWidth>
<Typography component="p" variant="body2">{slot.id}: {slot.last}{last_author}</Typography>
<Typography component="p" variant="body2">{slot.name ? slot.name : slot.id}: {slot.last}{last_author}</Typography>
</Grid>
<Grid item xs={4} zeroMinWidth>
<IconButton
Expand Down

0 comments on commit a9103ca

Please sign in to comment.