Skip to content

Commit

Permalink
The clear command now resets the channel's mute and gains when removi…
Browse files Browse the repository at this point in the history
…ng the BEQ.
  • Loading branch information
Brad Miller committed May 15, 2021
1 parent 8ca3027 commit bb80c2d
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion ezbeq/device.py
Expand Up @@ -65,6 +65,10 @@ def error(self, slot: str):

def clear(self, slot: str):
self.__update(slot, 'last', 'Empty')
self.__update(slot, f'gain1', '0.0')
self.__update(slot, f'gain2', '0.0')
self.__update(slot, f'mute1', False)
self.__update(slot, f'mute2', False)

def gain(self, slot: str, channel: Optional[str], value: str):
if slot == '0' or channel is None:
Expand Down Expand Up @@ -378,8 +382,12 @@ def send(self, slot: str, entry: Union[Optional[Catalogue], bool, dict], command
state = self.state()
active_slot = int(state['active_slot']) - 1 if state['active_slot'] else None
channel = int(entry['channel']) - 1 if isinstance(entry, dict) and 'channel' in entry else None
if command == 'load' or command == 'clear':
if command == 'load':
cmds = MinidspBeqCommandGenerator.filt(entry, target_slot_idx, active_slot)
elif command == 'clear':
cmds = MinidspBeqCommandGenerator.filt(entry, target_slot_idx, active_slot)
cmds.extend(MinidspBeqCommandGenerator.mute('off', target_slot_idx, -1, target_slot_idx))
cmds.extend(MinidspBeqCommandGenerator.volume('0.0', target_slot_idx, -1, target_slot_idx))
elif command == 'activate':
cmds = MinidspBeqCommandGenerator.activate(target_slot_idx)
elif command == 'mute':
Expand Down

0 comments on commit bb80c2d

Please sign in to comment.