private void RaiseDeviceVolumeChanged(int id, int volume, bool isMuted, DeviceFlow deviceFlow) { if (SynchronizationContext.Current != _synchronizationContext) { _synchronizationContext.Post(o => DeviceVolumeChanged?.Invoke(this, id, volume, isMuted, deviceFlow), null); } else { DeviceVolumeChanged?.Invoke(this, id, volume, isMuted, deviceFlow); } }
private void RaiseDeviceRemoved(int id, DeviceFlow deviceFlow) { if (SynchronizationContext.Current != _synchronizationContext) { _synchronizationContext.Post(o => DeviceRemoved?.Invoke(this, id, deviceFlow), null); } else { DeviceRemoved?.Invoke(this, id, deviceFlow); } }
private void RaiseDefaultDeviceChanged(int id, DeviceFlow deviceFlow) { if (_stopping) { return; } if (SynchronizationContext.Current != _synchronizationContext) { _synchronizationContext.Post(o => DefaultDeviceChanged?.Invoke(this, id, deviceFlow), null); } else { DefaultDeviceChanged.Invoke(this, id, deviceFlow); } }
public static DisplayMode ToDisplayMode(this DeviceFlow d) { return(d == DeviceFlow.Input ? DisplayMode.MODE_INPUT : DisplayMode.MODE_OUTPUT); }
public static DataFlow ToDataFlow(this DeviceFlow d) { return(d == DeviceFlow.Input ? DataFlow.Capture : DataFlow.Render); }
private void RaiseDeviceCreated(int id, string displayName, int volume, bool isMuted, DeviceFlow deviceFlow) { if (SynchronizationContext.Current != _synchronizationContext) { _synchronizationContext.Post(o => DeviceCreated?.Invoke(this, id, displayName, volume, isMuted, deviceFlow), null); } else { DeviceCreated.Invoke(this, id, displayName, volume, isMuted, deviceFlow); } }