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));
 }
Beispiel #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;
        }
 public EmulatedPortsManager(IEmulatedPortStore portsStore,
                             IDeviceEnumerator deviceEnumerator,
                             IControllerElementMappingProfileStore mappingsStore,
                             IStoneProvider stoneProvider)
 {
     this.Ports         = portsStore;
     this.Devices       = deviceEnumerator;
     this.Mappings      = mappingsStore;
     this.StoneProvider = stoneProvider;
 }
Beispiel #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;
        }
Beispiel #8
0
 public IsolatedAudioDevice(IDeviceEnumerator enumerator)
     : base(enumerator)
 {
 }
Beispiel #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)
 {
 }
Beispiel #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));
 }
Beispiel #14
0
 public TestAudioController(IDeviceEnumerator enumerator)
     : base(enumerator)
 {
 }
        public IsolatedAudioDevice(IDeviceEnumerator enumerator)
            : base(enumerator)
        {

        }