1 // Copyright © 2015, Peter Atashian 2 // Licensed under the MIT License <LICENSE.md> 3 //! this ALWAYS GENERATED file contains the definitions for the interfaces 4 pub const DEVICE_STATE_ACTIVE: ::DWORD = 0x00000001; 5 pub const DEVICE_STATE_DISABLED: ::DWORD = 0x00000002; 6 pub const DEVICE_STATE_NOTPRESENT: ::DWORD = 0x00000004; 7 pub const DEVICE_STATE_UNPLUGGED: ::DWORD = 0x00000008; 8 pub const DEVICE_STATEMASK_ALL: ::DWORD = 0x0000000F; 9 ENUM!{enum EDataFlow { 10 eRender, 11 eCapture, 12 eAll, 13 EDataFlow_enum_count, 14 }} 15 ENUM!{enum ERole { 16 eConsole, 17 eMultimedia, 18 eCommunications, 19 ERole_enum_count, 20 }} 21 DEFINE_GUID!(CLSID_MMDeviceEnumerator, 0xBCDE0395, 0xE52F, 0x467C, 22 0x8E, 0x3D, 0xC4, 0x57, 0x92, 0x91, 0x69, 0x2E); 23 DEFINE_GUID!(IID_IMMDeviceEnumerator, 0xA95664D2, 0x9614, 0x4F35, 24 0xA7, 0x46, 0xDE, 0x8D, 0xB6, 0x36, 0x17, 0xE6); 25 RIDL!( 26 interface IMMDevice(IMMDeviceVtbl): IUnknown(IUnknownVtbl) { 27 fn Activate( 28 &mut self, iid: ::REFIID, dwClsCtx: ::DWORD, pActivationParams: *mut ::PROPVARIANT, 29 ppInterface: *mut ::LPVOID 30 ) -> ::HRESULT, 31 fn OpenPropertyStore( 32 &mut self, stgmAccess: ::DWORD, ppProperties: *mut *mut ::IPropertyStore 33 ) -> ::HRESULT, 34 fn GetId(&mut self, ppstrId: *mut ::LPWSTR) -> ::HRESULT, 35 fn GetState(&mut self, pdwState: *mut ::DWORD) -> ::HRESULT 36 } 37 ); 38 RIDL!( 39 interface IMMDeviceEnumerator(IMMDeviceEnumeratorVtbl): IUnknown(IUnknownVtbl) { 40 fn EnumAudioEndpoints( 41 &mut self, dataFlow: EDataFlow, dwStateMask: ::DWORD, 42 ppDevices: *mut *mut IMMDeviceCollection 43 ) -> ::HRESULT, 44 fn GetDefaultAudioEndpoint( 45 &mut self, dataFlow: EDataFlow, role: ERole, ppEndpoint: *mut *mut IMMDevice 46 ) -> ::HRESULT, 47 fn GetDevice(&mut self, pwstrId: ::LPCWSTR, ppDevices: *mut *mut IMMDevice) -> ::HRESULT, 48 fn RegisterEndpointNotificationCallback( 49 &mut self, pClient: *mut IMMNotificationClient 50 ) -> ::HRESULT, 51 fn UnregisterEndpointNotificationCallback( 52 &mut self, pClient: *mut IMMNotificationClient 53 ) -> ::HRESULT 54 } 55 ); 56 RIDL!( 57 interface IMMDeviceCollection(IMMDeviceCollectionVtbl): IUnknown(IUnknownVtbl) { 58 fn GetCount(&mut self, pcDevices: *const ::UINT) -> ::HRESULT, 59 fn Item(&mut self, nDevice: ::UINT, ppDevice: *mut *mut IMMDevice) -> ::HRESULT 60 } 61 ); 62 #[repr(C)] #[derive(Clone, Copy, Debug)] 63 pub struct IMMNotificationClient; 64