public AudioSession(IAudioSessionControl2 control)
 {
     _control = control;
     control.GetState(out var state);
     State = state;
     control.GetGroupingParam(out var guid);
     GroupingParam = guid;
     IconPath = GetString(control.GetIconPath);
     DisplayName = GetString(control.GetDisplayName);
     _icon = new Lazy<Icon>(GetIcon, true);
     _process = new Lazy<Process>(() => Process.GetProcessById(ProcessId), true);
     Id = GetString(control.GetSessionIdentifier);
     InstanceId = GetString(control.GetSessionInstanceIdentifier);
     control.GetProcessId(out var pid);
     ProcessId = pid;
     IsSystemSounds = control.IsSystemSoundsSession() == 0;
 }
예제 #2
0
 private static bool IsNotSystemSounds(this IAudioSessionControl2 sc) => sc.IsSystemSoundsSession().Equals(0x1);