36 #include "illegalArgumentException.hpp"
37 #include "exception.hpp"
39 #include "safec_lib.h"
41 #define DEV_NAME "AudioOutput"
42 #define BASE_NAME "Device.Services.STBService.1.Components.AudioOutput"
43 #define UPDATE_FORMAT_STRING "%s.%d.%s"
45 #define STATUS_STRING "Status"
46 #define ENABLED_STRING "Enabled"
47 #define ENABLE_STRING "Enable"
48 #define CANCELMUTE_STRING "CancelMute"
49 #define AUDIOFORMAT_STRING "AudioFormat"
50 #define NAME_STRING "Name"
51 #define AUDIOLEVEL_STRING "AudioLevel"
52 #define COMCAST_AUDIOOPTIMALLEVEL_STRING "X_COMCAST-COM_AudioOptimalLevel"
53 #define COMCAST_MINAUDIODB_STRING "X_COMCAST-COM_MinAudioDB"
54 #define COMCAST_MAXAUDIODB_STRING "X_COMCAST-COM_MaxAudioDB"
55 #define COMCAST_AUDIODB_STRING "X_COMCAST-COM_AudioDB"
56 #define COMCAST_AUDIOSTEREOMODE_STRING "X_COMCAST-COM_AudioStereoMode"
57 #define COMCAST_AUDIOLOOPTHRU_STRING "X_COMCAST-COM_AudioLoopThru"
58 #define COMCAST_AUDIOENCODING_STRING "X_COMCAST-COM_AudioEncoding"
59 #define COMCAST_AUDIOCOMPRESSION_STRING "X_COMCAST-COM_AudioCompression"
60 #define COMCAST_AUDIOGAIN_STRING "X_COMCAST-COM_AudioGain"
61 #define COMCAST_DIALOGENHANCEMENT_STRING "X_COMCAST-COM_DialogEnhancement"
64 GHashTable * hostIf_STBServiceAudioInterface::ifHash = NULL;
65 GMutex * hostIf_STBServiceAudioInterface::m_mutex = NULL;
74 RDK_LOG(RDK_LOG_DEBUG,LOG_TR69HOSTIF,
"[%s:%s:%d]: dev_id=[%d]; pRet=0x%08X\n", __FILE__, __FUNCTION__, __LINE__, dev_id, pRet);
78 ifHash = g_hash_table_new(NULL,NULL);
87 g_hash_table_insert(ifHash, (gpointer)dev_id, pRet);
88 RDK_LOG(RDK_LOG_DEBUG,LOG_TR69HOSTIF,
"[%s:%s:%d]: AudioLevel[%d]=%f\n", __FILE__, __FUNCTION__, __LINE__, dev_id, pRet->aPort.
getLevel());
92 RDK_LOG(RDK_LOG_WARN,LOG_TR69HOSTIF,
"Caught device::IllegalArgumentException, not able create STB service %s Interface instance %d..\n", DEV_NAME, dev_id);
96 RDK_LOG(RDK_LOG_WARN,LOG_TR69HOSTIF,
"Caught exception, not able create STB service %s Interface instance %d..\n", DEV_NAME, dev_id);
100 RDK_LOG(RDK_LOG_WARN,LOG_TR69HOSTIF,
"Caught dsError_t %d, not able create STB service %s Interface instance %d..\n", e, DEV_NAME, dev_id);
104 RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,
"Caught device::Exception %d \"%s\", not able create STB service %s Interface instance %d..\n", e.
getCode(), e.
getMessage().c_str(), DEV_NAME, dev_id);
110 GList* hostIf_STBServiceAudioInterface::getAllInstances()
113 return g_hash_table_get_keys(ifHash);
121 g_hash_table_remove(ifHash, (gconstpointer)pDev->dev_id);
126 void hostIf_STBServiceAudioInterface::closeAllInstances()
130 GList* tmp_list = g_hash_table_get_values (ifHash);
135 tmp_list = tmp_list->next;
141 void hostIf_STBServiceAudioInterface::getLock()
145 m_mutex = g_mutex_new();
147 g_mutex_lock(m_mutex);
150 void hostIf_STBServiceAudioInterface::releaseLock()
152 g_mutex_unlock(m_mutex);
166 rc=strcpy_s(backupStatus,
sizeof(backupStatus),
" ");
171 backupCancelMute =
false;
172 rc=strcpy_s(backupAudioStereoMode,
sizeof(backupAudioStereoMode),
" ");
178 rc=strcpy_s(backupAudioDB,
sizeof(backupAudioDB),
" ");
183 rc=strcpy_s(backupAudioLoopThru,
sizeof(backupAudioLoopThru),
" ");
188 backupAudioCompression=0;
189 rc=strcpy_s(backupAudioEncoding,
sizeof(backupAudioEncoding),
" ");
194 rc=strcpy_s(backupAudioGain,
sizeof(backupAudioGain),
" ");
199 rc=strcpy_s(backupMinAudioDB,
sizeof(backupMinAudioDB),
" ");
204 rc=strcpy_s(backupMaxAudioDB,
sizeof(backupMaxAudioDB),
" ");
209 rc=strcpy_s(backupAudioOptimalLevel,
sizeof(backupAudioOptimalLevel),
" ");
214 backupDialogEnhancement=0;
215 bCalledStatus =
false;
216 bCalledCancelMute =
false;
217 bCalledAudioStereoMode =
false;
218 bCalledAudioLevel =
false;
219 bCalledAudioDB =
false;
220 bCalledAudioLoopThru =
false;
221 bCalledAudioCompression =
false;
222 bCalledAudioEncoding =
false;
223 bCalledAudioGain =
false;
224 bCalledMinAudioDB =
false;
225 bCalledMaxAudioDB =
false;
226 bCalledAudioOptimalLevel =
false;
227 bCalledDialogEnhancement =
false;
245 int ret = NOT_HANDLED;
246 if (strcasecmp(pSetting, CANCELMUTE_STRING) == 0)
248 ret = setCancelMute(stMsgData);
250 else if (strcasecmp(pSetting, AUDIOLEVEL_STRING) == 0)
252 ret = setAudioLevel(stMsgData);
254 else if (strcasecmp(pSetting, COMCAST_AUDIODB_STRING) == 0)
256 ret = setX_COMCAST_COM_AudioDB(stMsgData);
258 else if (strcasecmp(pSetting, COMCAST_AUDIOSTEREOMODE_STRING) == 0)
260 ret = setX_COMCAST_COM_AudioStereoMode(stMsgData);
262 else if (strcasecmp(pSetting, COMCAST_AUDIOLOOPTHRU_STRING) == 0)
264 ret = setX_COMCAST_COM_AudioLoopThru(stMsgData);
266 else if (strcasecmp(pSetting, COMCAST_AUDIOENCODING_STRING) == 0)
268 ret = setAudioEncoding(stMsgData);
270 else if (strcasecmp(pSetting, COMCAST_AUDIOCOMPRESSION_STRING) == 0)
272 ret = setX_COMCAST_COM_AudioCompression(stMsgData);
274 else if (strcasecmp(pSetting, COMCAST_DIALOGENHANCEMENT_STRING) == 0)
276 ret = setX_COMCAST_COM_DialogEnhancement(stMsgData);
297 int ret = NOT_HANDLED;
298 if(strcasecmp(paramName, STATUS_STRING) == 0)
300 ret = getStatus(stMsgData);
302 else if(strcasecmp(paramName, ENABLE_STRING) == 0)
304 ret = getEnable(stMsgData);
306 else if(strcasecmp(paramName, CANCELMUTE_STRING) == 0)
308 ret = getCancelMute(stMsgData);
310 else if(strcasecmp(paramName, AUDIOFORMAT_STRING) == 0)
312 ret = getX_COMCAST_COM_AudioFormat(stMsgData);
314 else if(strcasecmp(paramName, NAME_STRING) == 0)
316 ret = getName(stMsgData);
318 else if(strcasecmp(paramName, AUDIOLEVEL_STRING) == 0)
320 ret = getAudioLevel(stMsgData);
322 else if(strcasecmp(paramName, COMCAST_AUDIOOPTIMALLEVEL_STRING) == 0)
324 ret = getX_COMCAST_COM_AudioOptimalLevel(stMsgData);
326 else if(strcasecmp(paramName, COMCAST_MINAUDIODB_STRING) == 0)
328 ret = getX_COMCAST_COM_MinAudioDB(stMsgData);
330 else if(strcasecmp(paramName, COMCAST_MAXAUDIODB_STRING) == 0)
332 ret = getX_COMCAST_COM_MaxAudioDB(stMsgData);
334 else if(strcasecmp(paramName, COMCAST_AUDIODB_STRING) == 0)
336 ret = getX_COMCAST_COM_AudioDB(stMsgData);
338 else if(strcasecmp(paramName,COMCAST_AUDIOSTEREOMODE_STRING) == 0)
340 ret = getX_COMCAST_COM_AudioStereoMode(stMsgData);
342 else if(strcasecmp(paramName, COMCAST_AUDIOLOOPTHRU_STRING) == 0)
344 ret = getX_COMCAST_COM_AudioLoopThru(stMsgData);
346 else if(strcasecmp(paramName, COMCAST_AUDIOENCODING_STRING) == 0)
348 ret = getX_COMCAST_COM_AudioEncoding(stMsgData);
350 else if(strcasecmp(paramName, COMCAST_AUDIOCOMPRESSION_STRING) == 0)
352 ret = getX_COMCAST_COM_AudioCompression(stMsgData);
354 else if(strcasecmp(paramName, COMCAST_AUDIOGAIN_STRING) == 0)
356 ret = getX_COMCAST_COM_AudioGain(stMsgData);
358 else if(strcasecmp(paramName, COMCAST_DIALOGENHANCEMENT_STRING) == 0)
360 ret = getX_COMCAST_COM_DialogEnhancement(stMsgData);
377 char tmp_buff[PARAM_LEN];
379 memset(&msgData,0,
sizeof(msgData));
380 memset(tmp_buff,0,PARAM_LEN);
383 getCancelMute(&msgData,&bChanged);
386 snprintf(tmp_buff, PARAM_LEN, UPDATE_FORMAT_STRING, BASE_NAME, dev_id, CANCELMUTE_STRING);
392 memset(&msgData,0,
sizeof(msgData));
393 memset(tmp_buff,0,PARAM_LEN);
396 getX_COMCAST_COM_AudioEncoding(&msgData,&bChanged);
399 snprintf(tmp_buff, PARAM_LEN, UPDATE_FORMAT_STRING, BASE_NAME, dev_id, COMCAST_AUDIOENCODING_STRING);
405 memset(&msgData,0,
sizeof(msgData));
406 memset(tmp_buff,0,PARAM_LEN);
409 getAudioLevel(&msgData,&bChanged);
412 snprintf(tmp_buff, PARAM_LEN, UPDATE_FORMAT_STRING, BASE_NAME, dev_id, AUDIOLEVEL_STRING);
418 memset(&msgData,0,
sizeof(msgData));
419 memset(tmp_buff,0,PARAM_LEN);
422 getX_COMCAST_COM_AudioOptimalLevel(&msgData,&bChanged);
425 snprintf(tmp_buff, PARAM_LEN, UPDATE_FORMAT_STRING, BASE_NAME, dev_id, COMCAST_AUDIOOPTIMALLEVEL_STRING);
431 memset(&msgData,0,
sizeof(msgData));
432 memset(tmp_buff,0,PARAM_LEN);
435 getX_COMCAST_COM_MinAudioDB(&msgData,&bChanged);
438 snprintf(tmp_buff, PARAM_LEN, UPDATE_FORMAT_STRING, BASE_NAME, dev_id, COMCAST_MINAUDIODB_STRING);
444 memset(&msgData,0,
sizeof(msgData));
445 memset(tmp_buff,0,PARAM_LEN);
448 getX_COMCAST_COM_MaxAudioDB(&msgData,&bChanged);
451 snprintf(tmp_buff, PARAM_LEN, UPDATE_FORMAT_STRING, BASE_NAME, dev_id, COMCAST_MAXAUDIODB_STRING);
457 memset(&msgData,0,
sizeof(msgData));
458 memset(tmp_buff,0,PARAM_LEN);
461 getX_COMCAST_COM_AudioDB(&msgData,&bChanged);
464 snprintf(tmp_buff, PARAM_LEN, UPDATE_FORMAT_STRING, BASE_NAME, dev_id, COMCAST_AUDIODB_STRING);
470 memset(&msgData,0,
sizeof(msgData));
471 memset(tmp_buff,0,PARAM_LEN);
474 getX_COMCAST_COM_AudioStereoMode(&msgData,&bChanged);
477 snprintf(tmp_buff, PARAM_LEN, UPDATE_FORMAT_STRING, BASE_NAME, dev_id, COMCAST_AUDIOSTEREOMODE_STRING);
483 memset(&msgData,0,
sizeof(msgData));
484 memset(tmp_buff,0,PARAM_LEN);
487 getX_COMCAST_COM_AudioLoopThru(&msgData,&bChanged);
490 snprintf(tmp_buff, PARAM_LEN, UPDATE_FORMAT_STRING, BASE_NAME, dev_id, COMCAST_AUDIOLOOPTHRU_STRING);
496 memset(&msgData,0,
sizeof(msgData));
497 memset(tmp_buff,0,PARAM_LEN);
500 getX_COMCAST_COM_AudioCompression(&msgData,&bChanged);
503 snprintf(tmp_buff, PARAM_LEN, UPDATE_FORMAT_STRING, BASE_NAME, dev_id, COMCAST_AUDIOCOMPRESSION_STRING);
509 memset(&msgData,0,
sizeof(msgData));
510 memset(tmp_buff,0,PARAM_LEN);
513 getX_COMCAST_COM_AudioGain(&msgData,&bChanged);
516 snprintf(tmp_buff, PARAM_LEN, UPDATE_FORMAT_STRING, BASE_NAME, dev_id, COMCAST_AUDIOGAIN_STRING);
522 memset(&msgData,0,
sizeof(msgData));
523 memset(tmp_buff,0,PARAM_LEN);
526 getX_COMCAST_COM_DialogEnhancement(&msgData,&bChanged);
529 snprintf(tmp_buff, PARAM_LEN, UPDATE_FORMAT_STRING, BASE_NAME, dev_id, COMCAST_DIALOGENHANCEMENT_STRING);
538 int hostIf_STBServiceAudioInterface::getNumberOfInstances(
HOSTIF_MsgData_t *stMsgData)
542 stMsgData->
paramtype = hostIf_UnsignedIntType;
543 stMsgData->
paramLen =
sizeof(
unsigned int);
561 int hostIf_STBServiceAudioInterface::getStatus(
HOSTIF_MsgData_t *stMsgData,
bool *pChanged)
565 const char* audioPortStatus = NULL;
567 RDK_LOG(RDK_LOG_DEBUG,LOG_TR69HOSTIF,
"[%s()] dev_id = %d, isEnabled = %s\n", __FUNCTION__, dev_id, isEnabled?
"true":
"false");
568 audioPortStatus = isEnabled?
"Enabled" :
"Disabled";
572 RDK_LOG(RDK_LOG_DEBUG,LOG_TR69HOSTIF,
"[%s()] dev_id = %d, isMute = %s\n", __FUNCTION__, dev_id, isMute?
"true":
"false");
573 audioPortStatus = isMute?
"Muted" :
"Enabled";
576 strncpy(stMsgData->
paramValue, audioPortStatus, PARAM_LEN);
578 stMsgData->
paramtype = hostIf_StringType;
581 if(bCalledStatus && pChanged && strcmp(backupStatus, stMsgData->
paramValue))
585 bCalledStatus =
true;
586 strncpy(backupStatus, stMsgData->
paramValue,
sizeof(backupStatus) -1);
587 backupStatus [
sizeof(backupStatus) -1] =
'\0';
589 RDK_LOG(RDK_LOG_DEBUG,LOG_TR69HOSTIF,
"[%s()] [Value: %s] \n", __FUNCTION__, stMsgData->
paramValue);
591 catch (
const std::exception e) {
592 RDK_LOG(RDK_LOG_WARN,LOG_TR69HOSTIF,
"[%s] Exception\r\n",__FUNCTION__);
608 int hostIf_STBServiceAudioInterface::setCancelMute(
const HOSTIF_MsgData_t *stMsgData)
610 bool toMute = get_boolean(stMsgData->
paramValue);
615 catch (
const std::exception e) {
616 RDK_LOG(RDK_LOG_WARN,LOG_TR69HOSTIF,
"[%s] Exception\r\n",__FUNCTION__);
635 int hostIf_STBServiceAudioInterface::getCancelMute(
HOSTIF_MsgData_t *stMsgData,
bool *pChanged)
642 RDK_LOG(RDK_LOG_DEBUG,LOG_TR69HOSTIF,
"[%s()] getMute = %d\n", __FUNCTION__, getMute);
646 if(bCalledCancelMute && pChanged && (backupCancelMute != get_boolean(stMsgData->
paramValue)))
650 bCalledCancelMute =
true;
651 backupCancelMute = get_boolean(stMsgData->
paramValue);
652 RDK_LOG(RDK_LOG_DEBUG,LOG_TR69HOSTIF,
"[%s()] [Value: %s] \n", __FUNCTION__, stMsgData->
paramValue);
654 catch (
const std::exception e) {
655 RDK_LOG(RDK_LOG_WARN,LOG_TR69HOSTIF,
"[%s] Exception\r\n",__FUNCTION__);
675 stMsgData->
paramtype = hostIf_BooleanType;
693 snprintf(stMsgData->
paramValue, PARAM_LEN,
"AudioOutputPort%s%d", aPort.
getName().c_str(), dev_id);
694 stMsgData->
paramtype = hostIf_StringType;
697 catch (
const std::exception e) {
698 RDK_LOG(RDK_LOG_WARN,LOG_TR69HOSTIF,
"[%s] Exception\r\n",__FUNCTION__);
717 int hostIf_STBServiceAudioInterface::setX_COMCAST_COM_AudioStereoMode(
const HOSTIF_MsgData_t *stMsgData)
722 RDK_LOG(RDK_LOG_DEBUG,LOG_TR69HOSTIF,
"[%s] Value: %s \n",__FUNCTION__, stMsgData->
paramValue);
725 catch (
const std::exception e) {
726 RDK_LOG(RDK_LOG_WARN,LOG_TR69HOSTIF,
"[%s] Exception\r\n",__FUNCTION__);
747 int hostIf_STBServiceAudioInterface::getX_COMCAST_COM_AudioStereoMode(
HOSTIF_MsgData_t *stMsgData,
bool *pChanged)
757 strncpy(stMsgData->
paramValue,
"Unknown", PARAM_LEN);
760 strncpy(stMsgData->
paramValue,
"Mono", PARAM_LEN);
763 strncpy(stMsgData->
paramValue,
"Stereo", PARAM_LEN);
766 strncpy(stMsgData->
paramValue,
"Surround", PARAM_LEN);
769 strncpy(stMsgData->
paramValue,
"Expertmode", PARAM_LEN);
775 stMsgData->
paramtype = hostIf_StringType;
777 RDK_LOG(RDK_LOG_DEBUG,LOG_TR69HOSTIF,
"[%s] Value:%s\n",__FUNCTION__, stMsgData->
paramValue);
778 if(bCalledAudioStereoMode && pChanged && strcmp(backupAudioStereoMode, stMsgData->
paramValue))
782 bCalledAudioStereoMode =
true;
783 strncpy(backupAudioStereoMode, stMsgData->
paramValue,
sizeof(backupAudioStereoMode) -1);
784 backupAudioStereoMode[
sizeof(backupAudioStereoMode) -1] =
'\0';
787 catch (
const std::exception e) {
788 RDK_LOG(RDK_LOG_WARN,LOG_TR69HOSTIF,
"[%s] Exception\r\n",__FUNCTION__);
807 int hostIf_STBServiceAudioInterface::setAudioEncoding(
const HOSTIF_MsgData_t *stMsgData)
809 int newEncoding = atoi((
const char *)stMsgData->
paramValue);
812 RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,
"[%s] Invalid value to setAudioEncoding: %d\n",__FUNCTION__, newEncoding);
817 RDK_LOG(RDK_LOG_DEBUG,LOG_TR69HOSTIF,
"[%s] In setAudioEncoding(): Value: %s \n",__FUNCTION__, stMsgData->
paramValue);
820 catch (
const std::exception e) {
821 RDK_LOG(RDK_LOG_WARN,LOG_TR69HOSTIF,
"[%s] Exception\r\n",__FUNCTION__);
844 int hostIf_STBServiceAudioInterface::getX_COMCAST_COM_AudioEncoding(
HOSTIF_MsgData_t *stMsgData,
bool *pChanged)
850 strncpy(stMsgData->
paramValue,
"None", _BUF_LEN_16);
853 strncpy(stMsgData->
paramValue,
"Display", _BUF_LEN_16);
856 strncpy(stMsgData->
paramValue,
"PCM", _BUF_LEN_16);
859 strncpy(stMsgData->
paramValue,
"AC3", _BUF_LEN_16);
865 stMsgData->
paramtype = hostIf_StringType;
867 if(bCalledAudioEncoding && pChanged && strcmp(backupAudioEncoding, stMsgData->
paramValue))
871 bCalledAudioEncoding =
true;
872 strncpy(backupAudioEncoding,stMsgData->
paramValue, _BUF_LEN_16);
873 backupAudioEncoding[_BUF_LEN_16-1] =
'\0';
874 RDK_LOG(RDK_LOG_DEBUG,LOG_TR69HOSTIF,
"[%s] stMsgData->paramValue [%s]\n",__FUNCTION__, stMsgData->
paramValue);
876 catch (
const std::exception e) {
877 RDK_LOG(RDK_LOG_WARN,LOG_TR69HOSTIF,
"[%s] Exception: %s\r\n",__FUNCTION__, e.what());
898 int hostIf_STBServiceAudioInterface::getX_COMCAST_COM_AudioFormat(
HOSTIF_MsgData_t *stMsgData)
904 strncpy(stMsgData->
paramValue,
"None", PARAM_LEN);
909 strncpy(stMsgData->
paramValue,
"Other", PARAM_LEN);
913 strncpy(stMsgData->
paramValue,
"PCM", PARAM_LEN);
917 strncpy(stMsgData->
paramValue,
"AC3", PARAM_LEN);
921 strncpy(stMsgData->
paramValue,
"EAC3", PARAM_LEN);
929 stMsgData->
paramtype = hostIf_StringType;
932 RDK_LOG(RDK_LOG_DEBUG,LOG_TR69HOSTIF,
"[%s] stMsgData->paramValue [%s]\n",__FUNCTION__, stMsgData->
paramValue);
934 catch (
const std::exception e) {
935 RDK_LOG(RDK_LOG_WARN,LOG_TR69HOSTIF,
"[%s] Exception: %s\r\n",__FUNCTION__, e.what());
953 int hostIf_STBServiceAudioInterface::setX_COMCAST_COM_AudioCompression(
const HOSTIF_MsgData_t *stMsgData)
956 if (newComp < 0 || newComp > 10)
958 RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,
"[%s] Failed due to Invalid value: %d\n",__FUNCTION__, newComp);
963 RDK_LOG(RDK_LOG_DEBUG,LOG_TR69HOSTIF,
"[%s] Value: %s \n",__FUNCTION__, stMsgData->
paramValue);
966 catch (
const std::exception e) {
967 RDK_LOG(RDK_LOG_WARN,LOG_TR69HOSTIF,
"[%s] Exception\r\n",__FUNCTION__);
985 int hostIf_STBServiceAudioInterface::getX_COMCAST_COM_AudioCompression(
HOSTIF_MsgData_t *stMsgData,
bool *pChanged)
991 stMsgData->
paramtype = hostIf_UnsignedIntType;
992 stMsgData->
paramLen =
sizeof(
unsigned int);
993 RDK_LOG(RDK_LOG_DEBUG,LOG_TR69HOSTIF,
"[%s] \n",__FUNCTION__, stMsgData->
paramValue);
994 if(bCalledAudioCompression && pChanged && (backupAudioCompression != get_int(stMsgData->
paramValue)))
998 bCalledAudioCompression =
true;
999 backupAudioCompression = get_int(stMsgData->
paramValue);
1001 catch (
const std::exception e) {
1002 RDK_LOG(RDK_LOG_WARN,LOG_TR69HOSTIF,
"[%s] Exception: %s\r\n",__FUNCTION__, e.what());
1017 int hostIf_STBServiceAudioInterface::setAudioLevel(
const HOSTIF_MsgData_t *stMsgData)
1020 float newLevel = (float)get_int(stMsgData->
paramValue);
1021 if (newLevel < 0.0 || newLevel > 100.0)
1023 RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,
"[%s] Failed due to invalid value : %f\n",__FUNCTION__, newLevel);
1028 RDK_LOG(RDK_LOG_DEBUG,LOG_TR69HOSTIF,
"[%s:%s:%d]: Value=%f \n",__FUNCTION__, __FILE__, __LINE__, newLevel);
1031 catch (
const std::exception e) {
1032 RDK_LOG(RDK_LOG_WARN,LOG_TR69HOSTIF,
"[%s:%s:%d]: Exception caught\r\n",__FUNCTION__, __FILE__, __LINE__);
1051 int hostIf_STBServiceAudioInterface::getAudioLevel(
HOSTIF_MsgData_t *stMsgData,
bool *pChanged)
1055 RDK_LOG(RDK_LOG_DEBUG,LOG_TR69HOSTIF,
"[%s:%s:%d]: getAudioLevel=%f, muted=%s, getOptimalLevel=%f, DB=[%f, %f]:%f, getGain=%f\n", __FUNCTION__, __FILE__, __LINE__, level, aPort.
isMuted()?
"Muted":
"Not Muted", aPort.
getOptimalLevel(), aPort.
getMinDB(), aPort.
getMaxDB(), aPort.
getDB(), aPort.
getGain());
1057 stMsgData->
paramtype=hostIf_UnsignedIntType;
1058 stMsgData->
paramLen =
sizeof(
unsigned int);
1059 if(bCalledAudioLevel && pChanged && (backupAudioLevel != get_int(stMsgData->
paramValue)))
1063 bCalledAudioLevel =
true;
1064 backupAudioLevel = get_int(stMsgData->
paramValue);
1066 catch (
const std::exception e) {
1067 RDK_LOG(RDK_LOG_WARN,LOG_TR69HOSTIF,
"[%s] Exception: %s\r\n",__FUNCTION__, e.what());
1082 int hostIf_STBServiceAudioInterface::setX_COMCAST_COM_AudioDB(
const HOSTIF_MsgData_t *stMsgData)
1085 float newDb = (float)get_int(stMsgData->
paramValue);
1088 RDK_LOG(RDK_LOG_DEBUG,LOG_TR69HOSTIF,
"[%s] : Value: %s \n",__FUNCTION__, stMsgData->
paramValue);
1091 catch (
const std::exception e) {
1092 RDK_LOG(RDK_LOG_WARN,LOG_TR69HOSTIF,
"[%s] Exception\r\n",__FUNCTION__);
1110 int hostIf_STBServiceAudioInterface::getX_COMCAST_COM_AudioDB(
HOSTIF_MsgData_t *stMsgData,
bool *pChanged)
1113 float dbValue = 0.0;
1114 dbValue = aPort.
getDB();
1116 snprintf(stMsgData->
paramValue, PARAM_LEN,
"%f", dbValue);
1117 stMsgData->
paramtype = hostIf_StringType;
1119 RDK_LOG(RDK_LOG_DEBUG,LOG_TR69HOSTIF,
"[%s] \n",__FUNCTION__, stMsgData->
paramValue);
1120 if(bCalledAudioDB && pChanged && strcmp(backupAudioDB, stMsgData->
paramValue))
1124 bCalledAudioDB =
true;
1125 strncpy(backupAudioDB, stMsgData->
paramValue,
sizeof(backupAudioDB) -1);
1126 backupAudioDB[
sizeof(backupAudioDB) -1] =
'\0';
1129 catch (
const std::exception e) {
1130 RDK_LOG(RDK_LOG_WARN,LOG_TR69HOSTIF,
"[%s] Exception\r\n",__FUNCTION__);
1148 int hostIf_STBServiceAudioInterface::getX_COMCAST_COM_MinAudioDB(
HOSTIF_MsgData_t *stMsgData,
bool *pChanged)
1151 float minDbValue = 0.0;
1154 snprintf(stMsgData->
paramValue, PARAM_LEN,
"%f", minDbValue);
1155 stMsgData->
paramtype = hostIf_StringType;
1157 RDK_LOG(RDK_LOG_DEBUG,LOG_TR69HOSTIF,
"[%s] \n",__FUNCTION__, stMsgData->
paramValue);
1158 if(bCalledMinAudioDB && pChanged && strcmp(backupMinAudioDB, stMsgData->
paramValue))
1162 bCalledMinAudioDB =
true;
1163 strncpy(backupMinAudioDB, stMsgData->
paramValue, _BUF_LEN_16-1);
1164 backupMinAudioDB[_BUF_LEN_16-1] =
'\0';
1166 catch (
const std::exception e) {
1167 RDK_LOG(RDK_LOG_WARN,LOG_TR69HOSTIF,
"[%s] Exception\r\n",__FUNCTION__);
1185 int hostIf_STBServiceAudioInterface::getX_COMCAST_COM_MaxAudioDB(
HOSTIF_MsgData_t *stMsgData,
bool *pChanged)
1188 float maxDbValue = 0.0;
1191 snprintf(stMsgData->
paramValue, PARAM_LEN,
"%f", maxDbValue);
1192 stMsgData->
paramtype = hostIf_StringType;
1194 RDK_LOG(RDK_LOG_DEBUG,LOG_TR69HOSTIF,
"[%s] \n",__FUNCTION__, stMsgData->
paramValue);
1195 if(bCalledMaxAudioDB && pChanged && strcmp(backupMaxAudioDB, stMsgData->
paramValue))
1199 bCalledMaxAudioDB =
true;
1200 strncpy(backupMaxAudioDB, stMsgData->
paramValue, _BUF_LEN_16-1);
1201 backupMaxAudioDB[_BUF_LEN_16-1] =
'\0';
1203 catch (
const std::exception e) {
1204 RDK_LOG(RDK_LOG_WARN,LOG_TR69HOSTIF,
"[%s] Exception\r\n",__FUNCTION__);
1222 int hostIf_STBServiceAudioInterface::getX_COMCAST_COM_AudioGain(
HOSTIF_MsgData_t *stMsgData,
bool *pChanged)
1225 float gainValue = 0.0;
1228 snprintf(stMsgData->
paramValue, PARAM_LEN,
"%f", gainValue);
1229 stMsgData->
paramtype = hostIf_StringType;
1231 RDK_LOG(RDK_LOG_DEBUG,LOG_TR69HOSTIF,
"[%s] \n",__FUNCTION__, stMsgData->
paramValue);
1232 if(bCalledAudioGain && pChanged && strcmp(backupAudioGain, stMsgData->
paramValue))
1236 bCalledAudioGain =
true;
1237 strncpy(backupAudioGain,stMsgData->
paramValue, _BUF_LEN_16-1);
1238 backupAudioGain[_BUF_LEN_16-1] =
'\0';
1240 catch (
const std::exception e) {
1241 RDK_LOG(RDK_LOG_WARN,LOG_TR69HOSTIF,
"[%s] Exception\r\n",__FUNCTION__);
1257 int hostIf_STBServiceAudioInterface::setX_COMCAST_COM_AudioLoopThru(
const HOSTIF_MsgData_t *stMsgData)
1259 bool loopThru = get_boolean(stMsgData->
paramValue);
1262 RDK_LOG(RDK_LOG_DEBUG,LOG_TR69HOSTIF,
"[%s] Value: %s \n",__FUNCTION__, stMsgData->
paramValue);
1265 catch (
const std::exception e) {
1266 RDK_LOG(RDK_LOG_WARN,LOG_TR69HOSTIF,
"[%s] Exception\r\n",__FUNCTION__);
1286 int hostIf_STBServiceAudioInterface::getX_COMCAST_COM_AudioLoopThru(
HOSTIF_MsgData_t *stMsgData,
bool *pChanged)
1289 bool isLoopThru = 0;
1292 snprintf(stMsgData->
paramValue, PARAM_LEN,
"%d", isLoopThru);
1293 stMsgData->
paramtype = hostIf_StringType;
1295 if(bCalledAudioLoopThru && pChanged && strcmp(backupAudioLoopThru, stMsgData->
paramValue))
1299 bCalledAudioLoopThru =
true;
1300 strncpy(backupAudioLoopThru, stMsgData->
paramValue,
sizeof(backupAudioLoopThru) -1);
1301 backupAudioLoopThru[
sizeof(backupAudioLoopThru) -1] =
'\0';
1304 catch (
const std::exception e) {
1305 RDK_LOG(RDK_LOG_WARN,LOG_TR69HOSTIF,
"[%s] Exception\r\n",__FUNCTION__);
1323 int hostIf_STBServiceAudioInterface::getX_COMCAST_COM_AudioOptimalLevel(
HOSTIF_MsgData_t *stMsgData,
bool *pChanged)
1326 float optimalLevel = 0.0;
1329 snprintf(stMsgData->
paramValue, PARAM_LEN,
"%f", optimalLevel);
1330 stMsgData->
paramtype = hostIf_StringType;
1332 if(bCalledAudioOptimalLevel && pChanged && strcmp(backupAudioOptimalLevel, stMsgData->
paramValue))
1336 bCalledAudioOptimalLevel =
true;
1337 strncpy(backupAudioOptimalLevel, stMsgData->
paramValue, _BUF_LEN_16-1);
1338 backupAudioOptimalLevel[_BUF_LEN_16-1] =
'\0';
1340 catch (
const std::exception e) {
1341 RDK_LOG(RDK_LOG_WARN,LOG_TR69HOSTIF,
"[%s] Exception\r\n",__FUNCTION__);
1358 int hostIf_STBServiceAudioInterface::setX_COMCAST_COM_DialogEnhancement(
const HOSTIF_MsgData_t *stMsgData)
1360 int newLevel = get_int(stMsgData->
paramValue);
1362 if (newLevel < 0 || newLevel > 16)
1364 RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,
"[%s] Failed due to invalid value : %d\n",__FUNCTION__, newLevel);
1369 RDK_LOG(RDK_LOG_DEBUG,LOG_TR69HOSTIF,
"[%s] Value: %s \n",__FUNCTION__, stMsgData->
paramValue);
1372 catch (
const std::exception e) {
1373 RDK_LOG(RDK_LOG_WARN,LOG_TR69HOSTIF,
"[%s] Exception\r\n",__FUNCTION__);
1391 int hostIf_STBServiceAudioInterface::getX_COMCAST_COM_DialogEnhancement(
HOSTIF_MsgData_t *stMsgData,
bool *pChanged)
1394 int enhancementLevel = 0;
1398 stMsgData->
paramtype = hostIf_UnsignedIntType;
1399 stMsgData->
paramLen =
sizeof(
unsigned int);
1400 RDK_LOG(RDK_LOG_DEBUG,LOG_TR69HOSTIF,
"[%s] \n",__FUNCTION__, stMsgData->
paramValue);
1401 if(bCalledDialogEnhancement && pChanged && (backupDialogEnhancement != get_int(stMsgData->
paramValue)))
1405 bCalledDialogEnhancement =
true;
1406 backupDialogEnhancement = get_int(stMsgData->
paramValue);
1408 catch (
const std::exception e) {
1409 RDK_LOG(RDK_LOG_WARN,LOG_TR69HOSTIF,
"[%s] Exception\r\n",__FUNCTION__);