Documentation ¶
Index ¶
- Constants
- func CLSID_MMDeviceEnumerator() windows.GUID
- func IID_IMMDevice() windows.GUID
- func IID_IMMDeviceCollection() windows.GUID
- func IID_IMMDeviceEnumerator() windows.GUID
- func IID_IMMEndpoint() windows.GUID
- func IID_IMMNotificationClient() windows.GUID
- func ToType[...](v unsafe.Pointer) *T
- type EDataFlow
- type ERole
- type EndpointFormFactor
- type IMMDevice
- func (self *IMMDevice) Activate(iid windows.GUID, clsCtx uint32, activationParams *com.PROPVARIANT) (ppInterface unsafe.Pointer, err error)
- func (self *IMMDevice) GetId() (id string, err error)
- func (self *IMMDevice) GetState() (state uint32, err error)
- func (self *IMMDevice) OpenPropertyStore(stgmAccess uint32) (properties *com.IPropertyStore, err error)
- func (self *IMMDevice) Release() (err error)
- type IMMDeviceCollection
- type IMMDeviceEnumerator
- func (self *IMMDeviceEnumerator) EnumAudioEndpoints(dataFlow EDataFlow, stateMask uint32) (devices *IMMDeviceCollection, err error)
- func (self *IMMDeviceEnumerator) GetDefaultAudioEndpoint(dataFlow EDataFlow, role ERole) (endpoint *IMMDevice, err error)
- func (self *IMMDeviceEnumerator) GetDevice(id string) (device *IMMDevice, err error)
- func (self *IMMDeviceEnumerator) RegisterEndpointNotificationCallback(client *IMMNotificationClient) (err error)
- func (self *IMMDeviceEnumerator) Release() (err error)
- func (self *IMMDeviceEnumerator) UnregisterEndpointNotificationCallback(client *IMMNotificationClient) (err error)
- type IMMEndpoint
- type IMMNotificationClient
- func (self *IMMNotificationClient) OnDefaultDeviceChanged(flow EDataFlow, role ERole, defaultDeviceId string) (err error)
- func (self *IMMNotificationClient) OnDeviceAdded(deviceId string) (err error)
- func (self *IMMNotificationClient) OnDeviceRemoved(deviceId string) (err error)
- func (self *IMMNotificationClient) OnDeviceStateChanged(deviceId string, newState uint32) (err error)
- func (self *IMMNotificationClient) OnPropertyValueChanged(deviceId string, key com.PROPERTYKEY) (err error)
- func (self *IMMNotificationClient) Release() (err error)
Constants ¶
const ( DEVICE_STATE_ACTIVE = 0x00000001 DEVICE_STATE_DISABLED = 0x00000002 DEVICE_STATE_NOTPRESENT = 0x00000004 DEVICE_STATE_UNPLUGGED = 0x00000008 DEVICE_STATEMASK_ALL = 0x0000000F )
Variables ¶
This section is empty.
Functions ¶
func IID_IMMDevice ¶
func IID_IMMDeviceCollection ¶
func IID_IMMDeviceEnumerator ¶
func IID_IMMEndpoint ¶
func ToType ¶
func ToType[T IMMDevice | IMMDeviceCollection | IMMDeviceEnumerator | IMMEndpoint | IMMNotificationClient](v unsafe.Pointer) *T
Types ¶
type EndpointFormFactor ¶
type EndpointFormFactor uint32
const ( RemoteNetworkDevice EndpointFormFactor = iota Speakers LineLevel Headphones Microphone Headset Handset UnknownDigitalPassthrough SPDIF DigitalAudioDisplayDevice UnknownFormFactor EndpointFormFactor_enum_count )
type IMMDevice ¶
type IMMDevice struct {
// contains filtered or unexported fields
}
func (*IMMDevice) Activate ¶
func (self *IMMDevice) Activate(iid windows.GUID, clsCtx uint32, activationParams *com.PROPVARIANT) (ppInterface unsafe.Pointer, err error)
Activate 方法创建具有指定接口的 COM 对象。 不需要时需主动调用 Release 方法。
func (*IMMDevice) OpenPropertyStore ¶
func (self *IMMDevice) OpenPropertyStore(stgmAccess uint32) (properties *com.IPropertyStore, err error)
OpenPropertyStore 方法检索设备属性存储的接口。 不需要时需主动调用 Release 方法。
type IMMDeviceCollection ¶
type IMMDeviceCollection struct {
// contains filtered or unexported fields
}
func (*IMMDeviceCollection) GetCount ¶
func (self *IMMDeviceCollection) GetCount() (pcDevices uint, err error)
GetCount 方法检索设备集合中的设备计数。
func (*IMMDeviceCollection) Item ¶
func (self *IMMDeviceCollection) Item(nDevice uint32) (device *IMMDevice, err error)
Item 方法检索指向设备集合中指定项的指针。 不需要时需主动调用 Release 方法。
func (*IMMDeviceCollection) Release ¶
func (self *IMMDeviceCollection) Release() (err error)
type IMMDeviceEnumerator ¶
type IMMDeviceEnumerator struct {
// contains filtered or unexported fields
}
func (*IMMDeviceEnumerator) EnumAudioEndpoints ¶
func (self *IMMDeviceEnumerator) EnumAudioEndpoints(dataFlow EDataFlow, stateMask uint32) (devices *IMMDeviceCollection, err error)
EnumAudioEndpoints 方法生成符合指定条件的音频终结点设备的集合。 不需要时需主动调用 Release 方法。
func (*IMMDeviceEnumerator) GetDefaultAudioEndpoint ¶
func (self *IMMDeviceEnumerator) GetDefaultAudioEndpoint(dataFlow EDataFlow, role ERole) (endpoint *IMMDevice, err error)
GetDefaultAudioEndpoint 方法检索指定数据流方向和角色的默认音频终结点。
func (*IMMDeviceEnumerator) GetDevice ¶
func (self *IMMDeviceEnumerator) GetDevice(id string) (device *IMMDevice, err error)
GetDevice 方法检索由终结点 ID 字符串标识的音频终结点设备。
func (*IMMDeviceEnumerator) RegisterEndpointNotificationCallback ¶
func (self *IMMDeviceEnumerator) RegisterEndpointNotificationCallback(client *IMMNotificationClient) (err error)
RegisterEndpointNotificationCallback 方法注册客户端的通知回调接口。
func (*IMMDeviceEnumerator) Release ¶
func (self *IMMDeviceEnumerator) Release() (err error)
func (*IMMDeviceEnumerator) UnregisterEndpointNotificationCallback ¶
func (self *IMMDeviceEnumerator) UnregisterEndpointNotificationCallback(client *IMMNotificationClient) (err error)
UnregisterEndpointNotificationCallback 方法删除客户端在对 IMMDeviceEnumerator::RegisterEndpointNotificationCallback 方法的调用中注册的通知接口的注册。
type IMMEndpoint ¶
type IMMEndpoint struct {
// contains filtered or unexported fields
}
func (*IMMEndpoint) GetDataFlow ¶
func (self *IMMEndpoint) GetDataFlow() (dataFlow EDataFlow, err error)
GetDataFlow 方法指示音频端点设备是呈现设备还是捕获设备。
func (*IMMEndpoint) Release ¶
func (self *IMMEndpoint) Release() (err error)
type IMMNotificationClient ¶
type IMMNotificationClient struct {
// contains filtered or unexported fields
}
func (*IMMNotificationClient) OnDefaultDeviceChanged ¶
func (self *IMMNotificationClient) OnDefaultDeviceChanged(flow EDataFlow, role ERole, defaultDeviceId string) (err error)
OnDefaultDeviceChanged 方法通知客户端特定设备的默认音频终结点设备已更改。
func (*IMMNotificationClient) OnDeviceAdded ¶
func (self *IMMNotificationClient) OnDeviceAdded(deviceId string) (err error)
OnDeviceAdded 方法指示已添加新的音频终结点设备。
func (*IMMNotificationClient) OnDeviceRemoved ¶
func (self *IMMNotificationClient) OnDeviceRemoved(deviceId string) (err error)
OnDeviceRemoved 方法指示已删除音频终结点设备。
func (*IMMNotificationClient) OnDeviceStateChanged ¶
func (self *IMMNotificationClient) OnDeviceStateChanged(deviceId string, newState uint32) (err error)
OnDeviceStateChanged 方法指示音频终结点设备的状态已更改。
func (*IMMNotificationClient) OnPropertyValueChanged ¶
func (self *IMMNotificationClient) OnPropertyValueChanged(deviceId string, key com.PROPERTYKEY) (err error)
OnPropertyValueChanged 方法指示属于音频终结点设备的属性的值已更改。
func (*IMMNotificationClient) Release ¶
func (self *IMMNotificationClient) Release() (err error)