#ifndef __USE_Audio_H__
#define __USE_Audio_H__
#include "com_audio.h"
#include "api/maudio.h"

class Use_Audio :public Com_Audio
{
public:
	Q_OBJECT
public:
	 Use_Audio(QWidget *parent = 0);
	~Use_Audio();
public:
	void onAttach(rtc::IRoom* room);
	void onDetach(); 
protected:
	void updateLocalMicrophones();
	void updateLocalSpeakers();
protected: // c or cpp api imp
	bool   isAttach() const { return NULL != module_; }
	bool   api_engineSetOption(rtc::EngineOption option, void* value);
	bool   api_roomSetOption(rtc::RoomOption option, std::string& value);
	Result api_openMicrophone(bool open);
	Result api_muteMicrophone(bool mute);
	Result api_muteSpeaker(bool mute);
	Result api_monitorAudioLevel(bool enable);
    Result api_setRecordingMicrophone(const rtc::DeviceId& curId);
    Result api_setPlayoutSpeaker(const rtc::DeviceId& curId);
	Result api_applyPlayoutGain(float gain);

private:
	rtc::IMAudio* module_;

};

#endif //__USE_Audio_H__
