Beispiel #1
0
        private void CmdGetOutputLevelResponse(ReaPi.ResponseHandle response, GetIOOutputLevelResponseEventArgs getIOOutputLevelResponseEventArgs)
        {
            int error = 0;
            List <GetIOOutputLevelResponseEventArgs.IOOutput> listIOOutputs = new List <GetIOOutputLevelResponseEventArgs.IOOutput>();
            int count = ReaPi.GetNumberOfOutputs(response, out error);

            for (int i = 1; i <= count; i++)
            {
                GetIOOutputLevelResponseEventArgs.IOOutput ioOutput = new GetIOOutputLevelResponseEventArgs.IOOutput();
                ioOutput.Index = i;
                ioOutput.Level = ReaPi.GetIOOutputLevelValue(response, i, out error);

                listIOOutputs.Add(ioOutput);
            }

            List <bool> outputsState = new List <bool>();

            for (int i = 0; i < getIOOutputLevelResponseEventArgs.IOOutputs.Count; i++)
            {
                outputsState.Add((bool)getIOOutputLevelResponseEventArgs.IOOutputs[i].Level);
            }
            try
            {
                _view.UpdateOutputsState(outputsState);
            }
            catch (Exception) { }
        }