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)); }
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; }
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 IsolatedAudioDevice(IDeviceEnumerator enumerator) : base(enumerator) { }
public TestAudioDevice(Guid id, DataFlow dFlow, IDeviceEnumerator enumerator) : base(enumerator) { }
protected AudioDevice(IDeviceEnumerator enumerator) { Enumerator = enumerator; }
protected AudioController(IDeviceEnumerator <T> devEnum) : base(devEnum) { }
/// <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)); }
public TestAudioController(IDeviceEnumerator enumerator) : base(enumerator) { }