Hi zusammen,
mühsam ernährt sich das Eichhörnchen - habe leider wahnsinnig wenig Zeit aktuell und arbeite somit Häppchen für Häppchen. Folgendes kann ich mit Euch teilen, vielleicht ist es auch für Euch nützlich:
Initialisieren:
var
OnAir1000Remote: ISASRemote;
MicrophoneActiveCount: Integer;
procedure OnLoad;
begin
OnAir1000Remote := SASRemote(0);
OnAir1000Remote.SendCommand(1,chr(0))
MicrophoneActiveCount:=0;
end;
Das Folgende passiert im OnSASCOmmand:
Kanalaktivierung und Deaktivierung monitoren (On/Off) und wenn ein Kanal mit “MIC” oder “MOD” anfängt zählen, wieviele Mikrofonkanäle offen sind. Falls mindestens einer geöffnet wurde, entsprechende Kommandos für Aircheck start und Rotlicht an ausführen, sobald alle geschlossen sind Aircheck stoppen und Rotlicht abschalten (Rotlicht läuft über mein Home Assistant, der dann die entsprechenden LEDs und Zigbee-Steckdosen ansteuert)
if (Command=36) then
begin
if (Data[9]=chr(1)) then
begin
SystemLog('Channel Activation: '+Copy(Data,1,8));
// Check if Microphone was activated by channel label
if (Copy(Data,1,3)='MIC') or (Copy(Data,1,3)='MOD') then
begin
MicrophoneActiveCount:=MicrophoneActiveCount+1;
if (MicrophoneActiveCount=1) then
begin
MicChange:=true;
end;
end;
end;
if (Data[9]=chr(0)) then
begin
SystemLog('Channel Deactivation: '+Copy(Data,1,8));
// Check if Microphone was deactivated by channel label
if (Copy(Data,1,3)='MIC') or (Copy(Data,1,3)='MOD') then
begin
MicrophoneActiveCount:=MicrophoneActiveCount-1;
if (MicrophoneActiveCount=0) then
begin
MicChange:=true;
end;
end;
end;
if (MicrophoneActiveCount>0) then
begin
ExecuteCommand('AIRCHECK OPEN');
ExecuteCommand('TALKTIMER RESET');
ExecuteCommand('AIRCHECK ON');
ExecuteCommand('TALKTIMER START');
HTTPGet('https://MeinHomeAssistant/api/webhook/StudioMic-On');
end else
begin
ExecuteCommand('AIRCHECK OFF');
ExecuteCommand('AIRCHECK CLOSE');
ExecuteCommand('TALKTIMER STOP');
HTTPGet('https://MeinHomeAssistant/api/webhook/StudioMic-Off');
end;
end;
if MicChange then
begin
SystemLog('Microphone change');
end;
Ausserdem hab ich noch das hier, damit das Pult automatisch auf “EXT PFL” schaltet, sobald ich vorhöre, den Mix-Editor aktiviere etc.:
// Called when cue editor, mix editor... (but not a player) starts playback
// ExtPFLCount is the number of active such ExtPFL sources
procedure OnExtPFLOn(Item: IPlaylistItem; ExtPFLCount: integer);
begin
SystemLog('Number of Ext-PFL Source: '+Inttostr(ExtPFLCount))
if(ExtPFLCount>0) then
begin
OnAir1000Remote.SendCommand(22,chr(254));
end;
end;
// Called when cue editor, mix editor... (but not a player) stops playback
// ExtPFLCount is the number of active such ExtPFL sources
procedure OnExtPFLOff(Item: IPlaylistItem; ExtPFLCount: integer);
begin
SystemLog('Number of Ext-PFL Source: '+Inttostr(ExtPFLCount))
if(ExtPFLCount=0) then
begin
OnAir1000Remote.SendCommand(23,chr(254));
end;
end;
Noch nicht weitergekommen bin ich mit der Uhrzeitsynchronisierung.
Ich hoffe die Scripte nützen jemandem schonmal etwas!
Viele Grüsse,
Christoph