public async Task <VuValues> GetVuValuesAsync(string hostAddress) { using (var socket = await ProdysSocketPool.TakeSocket(hostAddress)) { SendCommand(socket, new CommandIkusNetGetVuMeters()); var response = new IkusNetGetVumetersResponse(socket); return(IkusNetMapper.MapToVuValues(response)); } }
public static VuValues MapToVuValues(IkusNetGetVumetersResponse response) { return(new VuValues { TxLeft = response.ProgramTxLeft, TxRight = response.ProgramTxRight, RxLeft = response.ProgramRxLeft, RxRight = response.ProgramRxRight }); }
public VuValues GetVuValues(string hostAddress) { using (var socket = GetConnectedSocket(hostAddress)) { SendCommand(socket, new CommandIkusNetGetVuMeters()); var response = new IkusNetGetVumetersResponse(socket); return(new VuValues { TxLeft = response.ProgramTxLeft, TxRight = response.ProgramTxRight, RxLeft = response.ProgramRxLeft, RxRight = response.ProgramRxRight }); } }
public async Task <bool> CheckIfAvailableAsync(string ip) { try { using (var socket = await ProdysSocketPool.TakeSocket(ip)) { // Send dummy command to codec. SendCommand(socket, new CommandIkusNetGetVuMeters()); var dummResponse = new IkusNetGetVumetersResponse(socket); return(true); // Success } } catch (Exception) { return(false); } }
public virtual async Task <AudioStatus> GetAudioStatusAsync(string hostAddress, int nrOfInputs, int nrOfGpos) { var audioStatus = new AudioStatus(); using (var socket = await ProdysSocketPool.TakeSocket(hostAddress)) { SendCommand(socket, new CommandIkusNetGetVuMeters()); var vuResponse = new IkusNetGetVumetersResponse(socket); audioStatus.VuValues = IkusNetMapper.MapToVuValues(vuResponse); // // Input status not implemented in Quantum ST audioStatus.InputStatus = new List <InputStatus>(); audioStatus.Gpos = new List <GpoStatus>(); for (int gpo = 0; gpo < nrOfGpos; gpo++) { SendCommand(socket, new CommandIkusNetGetGpo { Gpio = gpo }); var response = new IkusNetGetGpoResponse(socket); var gpoEnable = response.Active; if (!gpoEnable.HasValue) { // Indication of missing GPO for the number. Probably we passed the last one. break; } audioStatus.Gpos.Add(new GpoStatus() { Index = gpo, Active = gpoEnable.Value }); } } return(audioStatus); }
public override async Task <AudioStatus> GetAudioStatusAsync(string hostAddress, int nrOfInputs, int nrOfGpos) { var audioStatus = new AudioStatus(); using (var socket = await ProdysSocketPool.TakeSocket(hostAddress)) { SendCommand(socket, new CommandIkusNetGetVuMeters()); var vuResponse = new IkusNetGetVumetersResponse(socket); audioStatus.VuValues = new VuValues { TxLeft = vuResponse.ProgramTxLeft, TxRight = vuResponse.ProgramTxRight, RxLeft = vuResponse.ProgramRxLeft, RxRight = vuResponse.ProgramRxRight }; audioStatus.InputStatus = new List <InputStatus>(); // Works only on Quantum codec, not Quantum ST for (int input = 0; input < nrOfInputs; input++) { SendCommand(socket, new CommandIkusNetGetInputEnabled { Input = input }); var enabledResponse = new IkusNetGetInputEnabledResponse(socket); var inputEnabled = enabledResponse.Enabled; SendCommand(socket, new CommandIkusNetGetInputGainLevel { Input = input }); var gainLevelResponse = new IkusNetGetInputGainLevelResponse(socket); var gainLevel = gainLevelResponse.GainLeveldB; audioStatus.InputStatus.Add(new InputStatus { Index = input, Enabled = inputEnabled, GainLevel = gainLevel }); } audioStatus.Gpos = new List <GpoStatus>(); for (int gpo = 0; gpo < nrOfGpos; gpo++) { SendCommand(socket, new CommandIkusNetGetGpo { Gpio = gpo }); var response = new IkusNetGetGpoResponse(socket); var gpoEnable = response.Active; if (!gpoEnable.HasValue) { // Indication of missing GPO for the number. Probably we passed the last one. break; } audioStatus.Gpos.Add(new GpoStatus() { Index = gpo, Active = gpoEnable.Value }); } return(audioStatus); } }
public AudioStatus GetAudioStatus(string hostAddress, int nrOfInputs, int nrOfGpos) { var audioStatus = new AudioStatus(); using (var socket = GetConnectedSocket(hostAddress)) { SendCommand(socket, new CommandIkusNetGetVuMeters()); var vuResponse = new IkusNetGetVumetersResponse(socket); audioStatus.VuValues = new VuValues { TxLeft = vuResponse.ProgramTxLeft, TxRight = vuResponse.ProgramTxRight, RxLeft = vuResponse.ProgramRxLeft, RxRight = vuResponse.ProgramRxRight }; audioStatus.InputStatuses = new List <InputStatus>(); for (int input = 0; input < nrOfInputs; input++) { SendCommand(socket, new CommandIkusNetGetInputEnabled { Input = input }); var enabledResponse = new IkusNetGetInputEnabledResponse(socket); var inputEnabled = enabledResponse.Enabled; SendCommand(socket, new CommandIkusNetGetInputGainLevel { Input = input }); var gainLevelResponse = new IkusNetGetInputGainLevelResponse(socket); var gainLevel = gainLevelResponse.GainLeveldB; audioStatus.InputStatuses.Add(new InputStatus { Enabled = inputEnabled, GainLevel = gainLevel }); } //audioStatus.Gpis = new List<bool>(); //for (int gpi = 0; gpi < nrOfGpis; gpi++) //{ // SendCommand(socket, new CommandIkusNetGetGpi { Gpio = gpi }); // var response = new IkusNetGetGpiResponse(socket); // var gpiEnabled = response.Active; // if (!gpiEnabled.HasValue) // { // // Indication of missing GPI for the number. Probably we passed the last one. // break; // } // audioStatus.Gpis.Add(gpiEnabled.Value); //} audioStatus.Gpos = new List <bool>(); for (int gpo = 0; gpo < nrOfGpos; gpo++) { SendCommand(socket, new CommandIkusNetGetGpo { Gpio = gpo }); var response = new IkusNetGetGpoResponse(socket); var gpoEnable = response.Active; if (!gpoEnable.HasValue) { // Indication of missing GPO for the number. Probably we passed the last one. break; } audioStatus.Gpos.Add(gpoEnable.Value); } } return(audioStatus); }