41 #define _CRT_SECURE_NO_DEPRECATE //do not use windows secure crt 49 #define __FILE_ID__ "audioin" 53 ,_volume(VOLUME_INVALID)
55 ,_volumeRange(VOLUMERANGE_INVALID)
56 ,_signal(SIGNAL_INVALID)
57 ,_noSignalFor(NOSIGNALFOR_INVALID)
58 ,_valueCallbackAudioIn(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
YAudioInValueCallback _valueCallbackAudioIn
virtual int _invokeValueCallback(string value)
int get_noSignalFor(void)
YRETCODE _load_unsafe(int msValidity)
static const int SIGNAL_INVALID
static YAudioIn * FirstAudioIn(void)
static int DefaultCacheValidity
string getString(const string &key)
YAudioIn * nextAudioIn(void)
void yLeaveCriticalSection(yCRITICAL_SECTION *cs)
static YRETCODE getFunctionInfo(YFUN_DESCR fundesc, YDEV_DESCR &devdescr, string &serial, string &funcId, string &funcName, string &funcVal, string &errmsg)
int set_mute(Y_MUTE_enum newval)
#define YAPI_INVALID_STRING
virtual int _parseAttr(YJSONObject *json_val)
Y_MUTE_enum get_mute(void)
static YAudioIn * FindAudioIn(string func)
int getInt(const string &key)
static u64 GetTickCount(void)
static void _AddToCache(const string &classname, const string &func, YFunction *obj)
static YFunction * _FindFromCache(const string &classname, const string &func)
void(* YAudioInValueCallback)(YAudioIn *func, const string &functionValue)
int set_volume(int newval)
static const int NOSIGNALFOR_INVALID
static const string VOLUMERANGE_INVALID
void yEnterCriticalSection(yCRITICAL_SECTION *cs)
static yCRITICAL_SECTION _global_cs
static int getFunctionsByClass(const string &class_str, YFUN_DESCR prevfundesc, vector< YFUN_DESCR > &buffer, int maxsize, string &errmsg)
virtual int _parseAttr(YJSONObject *json_val)
string get_volumeRange(void)
static const int VOLUME_INVALID
static bool _apiInitialized
YRETCODE _nextFunction(string &hwId)
static void _UpdateValueCallbackList(YFunction *func, bool add)
static const Y_MUTE_enum MUTE_INVALID
virtual int registerValueCallback(YAudioInValueCallback callback)
bool has(const string &key)
YRETCODE _setAttr(string attrname, string newvalue)
YAudioIn(const string &func)
virtual int _invokeValueCallback(string value)