コード例 #1
0
 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);
     }
 }
コード例 #2
0
 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);
     }
 }
コード例 #3
0
 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);
     }
 }
コード例 #4
0
 public static DisplayMode ToDisplayMode(this DeviceFlow d)
 {
     return(d == DeviceFlow.Input ? DisplayMode.MODE_INPUT : DisplayMode.MODE_OUTPUT);
 }
コード例 #5
0
 public static DataFlow ToDataFlow(this DeviceFlow d)
 {
     return(d == DeviceFlow.Input ? DataFlow.Capture : DataFlow.Render);
 }
コード例 #6
0
 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);
     }
 }