-
-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changing default device in-app or via hotkeys. New settings layout.
- Loading branch information
Showing
50 changed files
with
1,630 additions
and
487 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
77 changes: 77 additions & 0 deletions
77
Volumey/CoreAudioWrapper/CoreAudio/Interfaces/IPolicyConfig.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
using System; | ||
using System.Runtime.InteropServices; | ||
using Volumey.CoreAudioWrapper.CoreAudio.Enums; | ||
using Volumey.CoreAudioWrapper.Wrapper; | ||
|
||
namespace Volumey.CoreAudioWrapper.CoreAudio.Interfaces | ||
{ | ||
[Guid(GuidValue.External.IPolicyConfig), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] | ||
public interface IPolicyConfig | ||
{ | ||
[PreserveSig] | ||
int GetMixFormat( | ||
[In][MarshalAs(UnmanagedType.LPWStr)] string pszDeviceName, | ||
[In] IntPtr ppFormat); | ||
|
||
[PreserveSig] | ||
int GetDeviceFormat( | ||
[In][MarshalAs(UnmanagedType.LPWStr)] string pszDeviceName, | ||
[In][MarshalAs(UnmanagedType.Bool)] bool bDefault, | ||
[In] IntPtr ppFormat); | ||
|
||
[PreserveSig] | ||
int ResetDeviceFormat([In][MarshalAs(UnmanagedType.LPWStr)] string pszDeviceName); | ||
|
||
[PreserveSig] | ||
int SetDeviceFormat( | ||
[In][MarshalAs(UnmanagedType.LPWStr)] string pszDeviceName, | ||
[In] IntPtr pEndpointFormat, | ||
[In] IntPtr mixFormat); | ||
|
||
[PreserveSig] | ||
int GetProcessingPeriod( | ||
[In][MarshalAs(UnmanagedType.LPWStr)] string pszDeviceName, | ||
[In][MarshalAs(UnmanagedType.Bool)] bool bDefault, | ||
[In] IntPtr pmftDefaultPeriod, | ||
[In] IntPtr pmftMinimumPeriod); | ||
|
||
[PreserveSig] | ||
int SetProcessingPeriod( | ||
[In][MarshalAs(UnmanagedType.LPWStr)] string pszDeviceName, | ||
[In] IntPtr pmftPeriod); | ||
|
||
[PreserveSig] | ||
int GetShareMode( | ||
[In][MarshalAs(UnmanagedType.LPWStr)] string pszDeviceName, | ||
[In] IntPtr pMode); | ||
|
||
[PreserveSig] | ||
int SetShareMode( | ||
[In][MarshalAs(UnmanagedType.LPWStr)] string pszDeviceName, | ||
[In] IntPtr mode); | ||
|
||
[PreserveSig] | ||
int GetPropertyValue( | ||
[In][MarshalAs(UnmanagedType.LPWStr)] string pszDeviceName, | ||
[In][MarshalAs(UnmanagedType.Bool)] bool bFxStore, | ||
[In] IntPtr key, | ||
[In] IntPtr pv); | ||
|
||
[PreserveSig] | ||
int SetPropertyValue( | ||
[In][MarshalAs(UnmanagedType.LPWStr)] string pszDeviceName, | ||
[In][MarshalAs(UnmanagedType.Bool)] bool bFxStore, | ||
[In] IntPtr key, | ||
[In] IntPtr pv); | ||
|
||
[PreserveSig] | ||
int SetDefaultEndpoint( | ||
[In][MarshalAs(UnmanagedType.LPWStr)] string pszDeviceName, | ||
[In][MarshalAs(UnmanagedType.U4)] ERole role); | ||
|
||
[PreserveSig] | ||
int SetEndpointVisibility( | ||
[In][MarshalAs(UnmanagedType.LPWStr)] string pszDeviceName, | ||
[In][MarshalAs(UnmanagedType.Bool)] bool bVisible); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
using System.Runtime.InteropServices; | ||
using Volumey.CoreAudioWrapper.CoreAudio.Enums; | ||
using Volumey.CoreAudioWrapper.CoreAudio.Interfaces; | ||
|
||
namespace Volumey.CoreAudioWrapper.Wrapper | ||
{ | ||
public class PolicyClient | ||
{ | ||
[ComImport, Guid(GuidValue.External.PolicyConfigCOM)] | ||
private class PolicyClientCOM { } | ||
|
||
private IPolicyConfig instance = new PolicyClientCOM() as IPolicyConfig; | ||
|
||
public void SetDefaultEndpointDevice(string deviceId) | ||
{ | ||
this.instance.SetDefaultEndpoint(deviceId, ERole.Console); | ||
this.instance.SetDefaultEndpoint(deviceId, ERole.Multimedia); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.