#include <errno.h>
-///////////////////////////////////
-//// MMSOUND VOLUME APIs
-///////////////////////////////////
-#define VCONF_KEY_VOLUME_PREFIX "file/private/sound/volume"
-#define VCONF_KEY_VOLUME_TYPE_SYSTEM VCONF_KEY_VOLUME_PREFIX"/system"
-#define VCONF_KEY_VOLUME_TYPE_NOTIFICATION VCONF_KEY_VOLUME_PREFIX"/notification"
-#define VCONF_KEY_VOLUME_TYPE_ALARM VCONF_KEY_VOLUME_PREFIX"/alarm"
-#define VCONF_KEY_VOLUME_TYPE_RINGTONE VCONF_KEY_VOLUME_PREFIX"/ringtone"
-#define VCONF_KEY_VOLUME_TYPE_MEDIA VCONF_KEY_VOLUME_PREFIX"/media"
-#define VCONF_KEY_VOLUME_TYPE_CALL VCONF_KEY_VOLUME_PREFIX"/call"
-#define VCONF_KEY_VOLUME_TYPE_VOIP VCONF_KEY_VOLUME_PREFIX"/voip"
-#define VCONF_KEY_VOLUME_TYPE_VOICE VCONF_KEY_VOLUME_PREFIX"/voice"
-#define VCONF_KEY_VOLUME_TYPE_ANDROID VCONF_KEY_VOLUME_PREFIX"/fixed"
-
-#define VCONFKEY_SOUND_PRIMARY_VOLUME_TYPE "memory/private/sound/PrimaryVolumeType"
-#ifndef _TIZEN_PUBLIC_
-#ifdef TIZEN_MICRO
-#define VCONF_KEY_VR_LEFTHAND_ENABLED VCONFKEY_SETAPPL_PERFERED_ARM_LEFT_BOOL
-#endif
-#endif
-
#define PA_READY "/tmp/.pa_ready"
+#define SOUND_SERVER_READY "/tmp/.sound_server_ready"
+#define FOCUS_SERVER_READY "/tmp/.focus_server_ready"
#define MMSOUND_ENTER_CRITICAL_SECTION(x_mutex) \
-switch ( pthread_mutex_lock( x_mutex ) ) \
-{ \
+switch (pthread_mutex_lock(x_mutex)) { \
case EINVAL: \
- debug_warning("try mutex init..\n"); \
- if( 0 > pthread_mutex_init( x_mutex, NULL) ) { \
+ debug_warning("try mutex init.."); \
+ if (0 > pthread_mutex_init(x_mutex, NULL)) { \
return; \
} else { \
break; \
case 0: \
break; \
default: \
- debug_error("mutex lock failed\n"); \
+ debug_error("mutex lock failed"); \
return; \
}
-#define MMSOUND_ENTER_CRITICAL_SECTION_WITH_RETURN(x_mutex,x_return) \
-switch ( pthread_mutex_lock( x_mutex ) ) \
-{ \
+#define MMSOUND_ENTER_CRITICAL_SECTION_WITH_RETURN(x_mutex, x_return) \
+switch (pthread_mutex_lock(x_mutex)) { \
case EINVAL: \
- debug_warning("try mutex init..\n"); \
- if( 0 > pthread_mutex_init( x_mutex, NULL) ) { \
+ debug_warning("try mutex init.."); \
+ if (0 > pthread_mutex_init(x_mutex, NULL)) { \
return x_return; \
} else { \
break; \
case 0: \
break; \
default: \
- debug_error("mutex lock failed\n"); \
+ debug_error("mutex lock failed"); \
return x_return; \
}
#define MMSOUND_LEAVE_CRITICAL_SECTION(x_mutex) \
-if( pthread_mutex_unlock( x_mutex ) ) { \
- debug_error("mutex unlock failed\n"); \
+if (pthread_mutex_unlock(x_mutex)) { \
+ debug_error("mutex unlock failed"); \
}
-#define MMSOUND_STRNCPY(dst,src,size)\
+#define MMSOUND_STRNCPY(dst, src, size) \
do { \
- if(src != NULL && dst != NULL && size > 0) {\
- strncpy(dst,src,size); \
- dst[size-1] = '\0';\
- } else if(dst == NULL) { \
- debug_error("STRNCPY ERROR: Destination String is NULL\n"); \
- } \
- else if(size <= 0) { \
- debug_error("STRNCPY ERROR: Destination String is NULL\n"); \
- } \
- else { \
- debug_error("STRNCPY ERROR: Destination String is NULL\n"); \
- } \
-} while(0)
+ if (dst == NULL) \
+ debug_error("STRNCPY ERROR: Destination String is NULL"); \
+ else if (src == NULL) \
+ debug_error("STRNCPY ERROR: Source String is NULL"); \
+ else if (size <= 0) \
+ debug_error("STRNCPY ERROR: Size(%d) <= 0", size); \
+ else { \
+ strncpy(dst, src, size - 1); \
+ dst[size - 1] = '\0';\
+ } \
+} while (0)
#endif /* __MM_SOUND_COMMON_H__ */