示例#1
0
 public bool GetInputEnabled(string hostAddress, int input)
 {
     // Works only on Quantum codec, not Quantum ST
     using (var socket = GetConnectedSocket(hostAddress))
     {
         SendCommand(socket, new CommandIkusNetGetInputEnabled {
             Input = input
         });
         var response = new IkusNetGetInputEnabledResponse(socket);
         return(response.Enabled);
     }
 }
示例#2
0
 public override async Task <bool> GetInputEnabledAsync(string hostAddress, int input)
 {
     // Works only on Quantum codec, not Quantum ST
     using (var socket = await ProdysSocketPool.TakeSocket(hostAddress))
     {
         SendCommand(socket, new CommandIkusNetGetInputEnabled {
             Input = input
         });
         var enabledResponse = new IkusNetGetInputEnabledResponse(socket);
         return(enabledResponse.Enabled);
     }
 }
示例#3
0
        public override async Task <(bool, int)> GetInputGainAndStatusAsync(string hostAddress, int input)
        {
            // Works only on Quantum codec, not Quantum ST
            using (var socket = await ProdysSocketPool.TakeSocket(hostAddress))
            {
                SendCommand(socket, new CommandIkusNetGetInputEnabled {
                    Input = input
                });
                var enabledResponse = new IkusNetGetInputEnabledResponse(socket);
                var enabled         = enabledResponse.Enabled;

                SendCommand(socket, new CommandIkusNetGetInputGainLevel {
                    Input = input
                });
                var gainLevelResponse = new IkusNetGetInputGainLevelResponse(socket);
                var gain = gainLevelResponse.GainLeveldB;
                return(enabled, gain);
            }
        }
示例#4
0
        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);
            }
        }
示例#5
0
        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);
        }