41 #define _CRT_SECURE_NO_DEPRECATE //do not use windows secure crt 49 #define __FILE_ID__ "audioout" 53 ,_volume(VOLUME_INVALID)
55 ,_volumeRange(VOLUMERANGE_INVALID)
56 ,_signal(SIGNAL_INVALID)
57 ,_noSignalFor(NOSIGNALFOR_INVALID)
58 ,_valueCallbackAudioOut(NULL)
75 if(json_val->
has(
"volume")) {
78 if(json_val->
has(
"mute")) {
81 if(json_val->
has(
"volumeRange")) {
84 if(json_val->
has(
"signal")) {
87 if(json_val->
has(
"noSignalFor")) {
115 }
catch (std::exception) {
138 char buf[32]; sprintf(buf,
"%d", newval); rest_val = string(buf);
140 }
catch (std::exception) {
169 }
catch (std::exception) {
193 rest_val = (newval>0 ?
"1" :
"0");
195 }
catch (std::exception) {
227 }
catch (std::exception) {
256 }
catch (std::exception) {
285 }
catch (std::exception) {
333 }
catch (std::exception) {
355 if (callback != NULL) {
362 if (callback != NULL && this->
isOnline()) {
393 vector<YFUN_DESCR> v_fundescr;
395 string serial, funcId, funcName, funcVal, errmsg;
398 v_fundescr.size() == 0 ||
yCRITICAL_SECTION _this_cs
YAudioOut(const string &func)
YRETCODE _load_unsafe(int msValidity)
static const Y_MUTE_enum MUTE_INVALID
string get_volumeRange(void)
static int DefaultCacheValidity
string getString(const string &key)
int set_mute(Y_MUTE_enum newval)
void yLeaveCriticalSection(yCRITICAL_SECTION *cs)
int set_volume(int newval)
static YRETCODE getFunctionInfo(YFUN_DESCR fundesc, YDEV_DESCR &devdescr, string &serial, string &funcId, string &funcName, string &funcVal, string &errmsg)
Y_MUTE_enum get_mute(void)
#define YAPI_INVALID_STRING
YAudioOutValueCallback _valueCallbackAudioOut
virtual int _parseAttr(YJSONObject *json_val)
static const int VOLUME_INVALID
int getInt(const string &key)
static u64 GetTickCount(void)
static void _AddToCache(const string &classname, const string &func, YFunction *obj)
virtual int _invokeValueCallback(string value)
static const string VOLUMERANGE_INVALID
static YFunction * _FindFromCache(const string &classname, const string &func)
void yEnterCriticalSection(yCRITICAL_SECTION *cs)
static yCRITICAL_SECTION _global_cs
static const int NOSIGNALFOR_INVALID
static YAudioOut * FirstAudioOut(void)
static int getFunctionsByClass(const string &class_str, YFUN_DESCR prevfundesc, vector< YFUN_DESCR > &buffer, int maxsize, string &errmsg)
virtual int registerValueCallback(YAudioOutValueCallback callback)
static YAudioOut * FindAudioOut(string func)
void(* YAudioOutValueCallback)(YAudioOut *func, const string &functionValue)
static bool _apiInitialized
YRETCODE _nextFunction(string &hwId)
static void _UpdateValueCallbackList(YFunction *func, bool add)
int get_noSignalFor(void)
bool has(const string &key)
static const int SIGNAL_INVALID
YAudioOut * nextAudioOut(void)
YRETCODE _setAttr(string attrname, string newvalue)
virtual int _parseAttr(YJSONObject *json_val)
virtual int _invokeValueCallback(string value)