예제 #1
0
파일: InChannel.cs 프로젝트: desla/AS
        private InputDevice device; // Ссылка на физическое устройство

        #endregion Fields

        #region Constructors

        /// <summary>
        /// Канал на звуковом устройстве.
        /// </summary>
        /// <param name="aChannelInfo">Данные канала, отношения.</param>
        /// <param name="aDevice">Физическое устройство.</param>
        /// <param name="aGroup">Группа, к которой принадлежит канал.</param>        
        public InChannel(InChannelInfo aChannelInfo, InputDevice aDevice)
        {
            if (aChannelInfo == null) {
                throw new ArgumentNullException("aChannelInfo");
            }

            if (aDevice == null) {
                throw new ArgumentNullException("aDevice");
            }

            device = aDevice;
            channelInfo = aChannelInfo;
        }
예제 #2
0
        /// <summary>
        /// Заполняет входные каналы.
        /// </summary>
        /// <param name="aDeviceInfo">Описание устройства ввода.</param>
        /// <param name="aDevice">Устройство ввода.</param>
        private void FillInChannels(InputDeviceInfo aDeviceInfo, InputDevice aDevice)
        {
            var channelsCount = aDeviceInfo.GetChannelsCount();
            if (channelsCount > aDevice.GetChannelsCount()) {
                throw new ArgumentException("Сhannels count on phisical device is less than in configuration");
            }

            for (var channelIndex = 0; channelIndex < channelsCount; ++channelIndex) {
                var channelInfo = aDeviceInfo.GetChannel(channelIndex);

                var channel = new InChannel(channelInfo, aDevice);
                inChannels.Add(channel);
            }
        }