Пример #1
0
 public static DeviceProvider GetDeviceProviderMock(IDeviceEnumerator deviceEnum, IDeviceStateNotificationHandler deviceState)
 {
     return((DeviceProvider)Activator.CreateInstance(typeof(DeviceProvider),
                                                     BindingFlags.NonPublic | BindingFlags.Instance, null,
                                                     new object[] { deviceEnum, deviceState }, CultureInfo.InvariantCulture,
                                                     null));
 }
 /// <summary>
 /// Gets the <see cref="IInputDeviceInstance"/> specifid by the given <see cref="IEmulatedPortDeviceEntry"/>
 /// if it is connected to the system, or null if it does not.
 /// </summary>
 /// <param name="this">The <see cref="IDeviceEnumerator"/> to use.</param>
 /// <param name="portDevice">The <see cref="IEmulatedPortDeviceEntry"/> to check if connected.</param>
 /// <returns>The <see cref="IInputDeviceInstance"/> specifid by the given <see cref="IEmulatedPortDeviceEntry"/>
 /// if it is connected to the system, or null if it does not.</returns>
 public static IInputDeviceInstance?GetPortDeviceInstance(this IDeviceEnumerator @this,
                                                          IEmulatedPortDeviceEntry portDevice)
 {
     return(@this.QueryConnectedDevices()
            .FirstOrDefault(d => d.InstanceGuid == portDevice.InstanceGuid)?.Instances?
            .FirstOrDefault(i => i.Driver == portDevice.Driver));
 }
Пример #3
0
        protected AudioController(IDeviceEnumerator enumerator)
        {
            DeviceEnumerator = enumerator;
            DeviceEnumerator.AudioDeviceChanged += DeviceEnumerator_AudioDeviceChanged;

            enumerator.Controller = this;
        }
        protected AudioController(IDeviceEnumerator enumerator)
        {
            DeviceEnumerator = enumerator;
            DeviceEnumerator.AudioDeviceChanged += DeviceEnumerator_AudioDeviceChanged;

            enumerator.Controller = this;
        }
        internal SystemAudioDevice(MMDevice device, IDeviceEnumerator<SystemAudioDevice> enumerator)
            : base(enumerator)
        {
            if (device == null)
                throw new ArgumentNullException("device", "Device cannot be null. Something bad went wrong");

            Device = device;
        }
Пример #6
0
 public EmulatedPortsManager(IEmulatedPortStore portsStore,
                             IDeviceEnumerator deviceEnumerator,
                             IControllerElementMappingProfileStore mappingsStore,
                             IStoneProvider stoneProvider)
 {
     this.Ports         = portsStore;
     this.Devices       = deviceEnumerator;
     this.Mappings      = mappingsStore;
     this.StoneProvider = stoneProvider;
 }
Пример #7
0
        internal SystemAudioDevice(MMDevice device, IDeviceEnumerator <SystemAudioDevice> enumerator)
            : base(enumerator)
        {
            if (device == null)
            {
                throw new ArgumentNullException("device", "Device cannot be null. Something bad went wrong");
            }

            Device = device;
        }
Пример #8
0
 public IsolatedAudioDevice(IDeviceEnumerator enumerator)
     : base(enumerator)
 {
 }
Пример #9
0
 public TestAudioDevice(Guid id, DataFlow dFlow, IDeviceEnumerator enumerator)
     : base(enumerator)
 {
 }
 protected AudioDevice(IDeviceEnumerator enumerator)
 {
     Enumerator = enumerator;
 }
 protected AudioController(IDeviceEnumerator <T> devEnum)
     : base(devEnum)
 {
 }
Пример #12
0
 protected AudioDevice(IDeviceEnumerator enumerator)
 {
     Enumerator = enumerator;
 }
 /// <summary>
 /// Checks if the <see cref="IInputDeviceInstance"/> specified by the given
 /// <see cref="IEmulatedPortDeviceEntry"/> is connected to the system.
 /// </summary>
 /// <param name="this">The <see cref="IDeviceEnumerator"/> to use.</param>
 /// <param name="portDevice">The <see cref="IEmulatedPortDeviceEntry"/> to check if connected.</param>
 /// <returns>Whether or not the given <see cref="IEmulatedPortDeviceEntry"/> is connected.</returns>
 public static bool IsPortDeviceConnected(this IDeviceEnumerator @this,
                                          IEmulatedPortDeviceEntry portDevice)
 {
     return(@this.QueryConnectedDevices().Any(d => d.InstanceGuid == portDevice.InstanceGuid));
 }
Пример #14
0
 public TestAudioController(IDeviceEnumerator enumerator)
     : base(enumerator)
 {
 }
        public IsolatedAudioDevice(IDeviceEnumerator enumerator)
            : base(enumerator)
        {

        }