added mix control
This commit is contained in:
@@ -37,10 +37,10 @@
|
|||||||
},
|
},
|
||||||
"6": {
|
"6": {
|
||||||
"channel": 6,
|
"channel": 6,
|
||||||
"name": "Vox2",
|
"name": "ON",
|
||||||
"on": true,
|
"on": false,
|
||||||
"level_db": -1.1,
|
"level_db": 0.01,
|
||||||
"pan": 0
|
"pan": 200
|
||||||
},
|
},
|
||||||
"7": {
|
"7": {
|
||||||
"channel": 7,
|
"channel": 7,
|
||||||
|
|||||||
Binary file not shown.
@@ -820,3 +820,99 @@ class TF5MixerController:
|
|||||||
"cache_age_seconds": int(cache_age),
|
"cache_age_seconds": int(cache_age),
|
||||||
"message": f"Riepilogo di {len(mixes)} mix (cache: {int(cache_age)}s fa)"
|
"message": f"Riepilogo di {len(mixes)} mix (cache: {int(cache_age)}s fa)"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def set_channel_to_mix_level(self, channel: int, mix_number: int, level_db: float) -> dict:
|
||||||
|
"""Imposta il livello di invio di un canale verso un mix/aux.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
channel: Numero del canale (1-40)
|
||||||
|
mix_number: Numero del mix (1-20)
|
||||||
|
level_db: Livello in dB (da -inf a +10.0)
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Un dizionario con lo stato dell'operazione
|
||||||
|
"""
|
||||||
|
if not 1 <= channel <= TF5_INPUT_CHANNELS:
|
||||||
|
return {"status": "error", "message": f"Il canale deve essere tra 1 e {TF5_INPUT_CHANNELS}"}
|
||||||
|
if not 1 <= mix_number <= TF5_MIX_BUSSES:
|
||||||
|
return {"status": "error", "message": f"Il mix deve essere tra 1 e {TF5_MIX_BUSSES}"}
|
||||||
|
|
||||||
|
if level_db <= -138:
|
||||||
|
internal_value = -32768
|
||||||
|
else:
|
||||||
|
internal_value = int(level_db * 100)
|
||||||
|
|
||||||
|
command = f"set MIXER:Current/InCh/ToMix/Level {channel-1} {mix_number-1} {internal_value}"
|
||||||
|
response = self._send_command(command)
|
||||||
|
|
||||||
|
return {
|
||||||
|
"status": "success" if "OK" in response else "error",
|
||||||
|
"message": f"Canale {channel} → Mix {mix_number} impostato a {level_db:+.1f} dB",
|
||||||
|
"response": response
|
||||||
|
}
|
||||||
|
|
||||||
|
def set_channel_to_mix_on_off(self, channel: int, mix_number: int, state: bool) -> dict:
|
||||||
|
"""Accende o spegne l'invio di un canale verso un mix/aux.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
channel: Numero del canale (1-40)
|
||||||
|
mix_number: Numero del mix (1-20)
|
||||||
|
state: True per accendere, False per spegnere
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Un dizionario con lo stato dell'operazione
|
||||||
|
"""
|
||||||
|
if not 1 <= channel <= TF5_INPUT_CHANNELS:
|
||||||
|
return {"status": "error", "message": f"Il canale deve essere tra 1 e {TF5_INPUT_CHANNELS}"}
|
||||||
|
if not 1 <= mix_number <= TF5_MIX_BUSSES:
|
||||||
|
return {"status": "error", "message": f"Il mix deve essere tra 1 e {TF5_MIX_BUSSES}"}
|
||||||
|
|
||||||
|
value = 1 if state else 0
|
||||||
|
command = f"set MIXER:Current/InCh/ToMix/On {channel-1} {mix_number-1} {value}"
|
||||||
|
response = self._send_command(command)
|
||||||
|
|
||||||
|
return {
|
||||||
|
"status": "success" if "OK" in response else "error",
|
||||||
|
"message": f"Invio canale {channel} → Mix {mix_number} {'acceso' if state else 'spento'}",
|
||||||
|
"response": response
|
||||||
|
}
|
||||||
|
|
||||||
|
def get_channel_to_mix_info(self, channel: int, mix_number: int) -> dict:
|
||||||
|
"""Legge le informazioni dell'invio di un canale verso un mix.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
channel: Numero del canale (1-40)
|
||||||
|
mix_number: Numero del mix (1-20)
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Un dizionario con le informazioni del send
|
||||||
|
"""
|
||||||
|
if not 1 <= channel <= TF5_INPUT_CHANNELS:
|
||||||
|
return {"status": "error", "message": f"Il canale deve essere tra 1 e {TF5_INPUT_CHANNELS}"}
|
||||||
|
if not 1 <= mix_number <= TF5_MIX_BUSSES:
|
||||||
|
return {"status": "error", "message": f"Il mix deve essere tra 1 e {TF5_MIX_BUSSES}"}
|
||||||
|
|
||||||
|
ch_idx = channel - 1
|
||||||
|
mix_idx = mix_number - 1
|
||||||
|
|
||||||
|
# Leggi livello
|
||||||
|
resp_level = self._send_command(f"get MIXER:Current/InCh/ToMix/Level {ch_idx} {mix_idx}")
|
||||||
|
level_raw = self._parse_value(resp_level)
|
||||||
|
try:
|
||||||
|
level_int = int(level_raw)
|
||||||
|
level_db = level_int / 100.0 if level_int > -32768 else float('-inf')
|
||||||
|
except:
|
||||||
|
level_db = None
|
||||||
|
|
||||||
|
# Leggi stato ON/OFF
|
||||||
|
resp_on = self._send_command(f"get MIXER:Current/InCh/ToMix/On {ch_idx} {mix_idx}")
|
||||||
|
is_on = self._parse_value(resp_on) == "1"
|
||||||
|
|
||||||
|
return {
|
||||||
|
"status": "success",
|
||||||
|
"channel": channel,
|
||||||
|
"mix": mix_number,
|
||||||
|
"on": is_on,
|
||||||
|
"level_db": level_db,
|
||||||
|
"message": f"Canale {channel} → Mix {mix_number}: {level_db:+.1f} dB ({'ON' if is_on else 'OFF'})"
|
||||||
|
}
|
||||||
@@ -129,6 +129,9 @@ class TF5TelegramBot:
|
|||||||
self.controller.get_all_channels_summary,
|
self.controller.get_all_channels_summary,
|
||||||
self.controller.get_all_mixes_summary,
|
self.controller.get_all_mixes_summary,
|
||||||
self.controller.refresh_cache,
|
self.controller.refresh_cache,
|
||||||
|
self.controller.set_channel_to_mix_level,
|
||||||
|
self.controller.set_channel_to_mix_on_off,
|
||||||
|
self.controller.get_channel_to_mix_info,
|
||||||
],
|
],
|
||||||
temperature=0,
|
temperature=0,
|
||||||
)
|
)
|
||||||
@@ -185,6 +188,11 @@ IDENTIFICAZIONE CANALI E MIX:
|
|||||||
- "tutti i mic/tutte le chitarre" → cerca e gestisci multipli
|
- "tutti i mic/tutte le chitarre" → cerca e gestisci multipli
|
||||||
- "il monitor" / "l'aux 2" → cerca tra i mix
|
- "il monitor" / "l'aux 2" → cerca tra i mix
|
||||||
|
|
||||||
|
SEND AI MIX/AUX:
|
||||||
|
- "alza il gelato nell'aux 2" → usa set_channel_to_mix_level
|
||||||
|
- "manda più chitarra nel monitor" → aumenta il send
|
||||||
|
- "togli la voce dal mix 3" → spegni il send o abbassa molto
|
||||||
|
|
||||||
SCENE:
|
SCENE:
|
||||||
- "carica/richiama/vai alla scena X" → recall_scene
|
- "carica/richiama/vai alla scena X" → recall_scene
|
||||||
- Accetta "A5", "scena A 5", "la cinque del banco A", ecc.
|
- Accetta "A5", "scena A 5", "la cinque del banco A", ecc.
|
||||||
|
|||||||
Reference in New Issue
Block a user