9#ifndef ITCCCDeviceManager_h
10# define ITCCCDeviceManager_h
14# include <TargetConditionals.h>
35 TCCCAudioRouteSpeakerphone = 0,
38 TCCCAudioRouteEarpiece = 1,
47enum TCCCMediaDeviceType {
50 TCCCMediaDeviceTypeUnknown = -1,
53 TCCCMediaDeviceTypeMic = 0,
56 TCCCMediaDeviceTypeSpeaker = 1,
59 TCCCMediaDeviceTypeCamera = 2,
68enum TCCCMediaDeviceState {
71 TCCCMediaDeviceStateAdd = 0,
74 TCCCMediaDeviceStateRemove = 1,
77 TCCCMediaDeviceStateActive = 2,
100 virtual void release() = 0;
138# if (__APPLE__ && TARGET_OS_MAC && !TARGET_OS_IPHONE) || _WIN32
139class ITXDeviceObserver {
141 virtual ~ITXDeviceObserver() {}
151 virtual void onDeviceChanged(
const char* deviceId, TCCCMediaDeviceType type, TCCCMediaDeviceState state) {}
207# if __ANDROID__ || (__APPLE__ && TARGET_OS_IOS)
225 virtual int setAudioRoute(TCCCAudioRoute route) = 0;
235# if (__APPLE__ && TARGET_OS_MAC && !TARGET_OS_IPHONE) || _WIN32
256 virtual int setCurrentDevice(TCCCMediaDeviceType type,
const char* deviceId) = 0;
261 virtual ITCCCDeviceInfo* getCurrentDevice(TCCCMediaDeviceType type) = 0;
271 virtual int setCurrentDeviceVolume(TCCCMediaDeviceType type, uint32_t volume) = 0;
278 virtual uint32_t getCurrentDeviceVolume(TCCCMediaDeviceType type) = 0;
285 virtual int setCurrentDeviceMute(TCCCMediaDeviceType type,
bool mute) = 0;
292 virtual bool getCurrentDeviceMute(TCCCMediaDeviceType type) = 0;
304 virtual int enableFollowingDefaultAudioDevice(TCCCMediaDeviceType type,
bool enable) = 0;
Definition: ITCCCDeviceManager.h:114
virtual const char * getDeviceProperties(uint32_t index)=0
virtual void release()=0
释放设备列表,请不要使用 delete 释放资源 !!!
virtual uint32_t getCount()=0
设备数量
virtual const char * getDeviceName(uint32_t index)=0
设备名字 (UTF-8),index 为设备索引,值为 [0,getCount)。返回值为设备名称 (UTF-8)
virtual const char * getDevicePID(uint32_t index)=0
设备唯一标识 (UTF-8) index 为设备索引,值为 [0,getCount)
Definition: ITCCCDeviceManager.h:95
virtual const char * getDevicePID()=0
设备 id (UTF-8)
virtual const char * getDeviceName()=0
设备名称 (UTF-8)
Definition: ITCCCDeviceManager.h:155
virtual int getAudioCaptureVolume()=0
virtual void setAudioCaptureVolume(int volume)=0
virtual void setAudioPlayoutVolume(int volume)=0
virtual int getAudioPlayoutVolume()=0