Exemplo n.º 1
0
 public override async Task <int> GetInputGainLevelAsync(string hostAddress, int input)
 {
     // Works only on Quantum codec, not Quantum ST
     using (var socket = await ProdysSocketPool.TakeSocket(hostAddress))
     {
         SendCommand(socket, new CommandIkusNetGetInputGainLevel {
             Input = input
         });
         var response = new IkusNetGetInputGainLevelResponse(socket);
         return(response.GainLeveldB);
     }
 }
Exemplo n.º 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);
     }
 }
Exemplo n.º 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);
            }
        }
Exemplo n.º 4
0
 protected IkusNetApiBase(ProdysSocketPool prodysSocketPool)
 {
     ProdysSocketPool = prodysSocketPool;
 }
Exemplo n.º 5
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);
            }
        }
Exemplo n.º 6
0
 public IkusNetApi(ProdysSocketPool prodysSocketPool) : base(prodysSocketPool)
 {
 }
 public ProdysSocketProxy(ProdysSocket socket, ProdysSocketPool prodysSocketPool)
 {
     _socket           = socket;
     _prodysSocketPool = prodysSocketPool;
 }