4 * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: Seungbae Shin <seungbae.shin@samsung.com>
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
22 #ifndef __MM_SOUND_COMMON_H__
23 #define __MM_SOUND_COMMON_H__
27 ///////////////////////////////////
28 //// MMSOUND VOLUME APIs
29 ///////////////////////////////////
30 #define VCONF_KEY_VOLUME_PREFIX "file/private/sound/volume"
31 #define VCONF_KEY_VOLUME_TYPE_SYSTEM VCONF_KEY_VOLUME_PREFIX"/system"
32 #define VCONF_KEY_VOLUME_TYPE_NOTIFICATION VCONF_KEY_VOLUME_PREFIX"/notification"
33 #define VCONF_KEY_VOLUME_TYPE_ALARM VCONF_KEY_VOLUME_PREFIX"/alarm"
34 #define VCONF_KEY_VOLUME_TYPE_RINGTONE VCONF_KEY_VOLUME_PREFIX"/ringtone"
35 #define VCONF_KEY_VOLUME_TYPE_MEDIA VCONF_KEY_VOLUME_PREFIX"/media"
36 #define VCONF_KEY_VOLUME_TYPE_CALL VCONF_KEY_VOLUME_PREFIX"/call"
37 #define VCONF_KEY_VOLUME_TYPE_VOIP VCONF_KEY_VOLUME_PREFIX"/voip"
38 #define VCONF_KEY_VOLUME_TYPE_VOICE VCONF_KEY_VOLUME_PREFIX"/voice"
39 #define VCONF_KEY_VOLUME_TYPE_ANDROID VCONF_KEY_VOLUME_PREFIX"/fixed"
41 #ifndef _TIZEN_PUBLIC_
43 #define VCONF_KEY_VR_LEFTHAND_ENABLED VCONFKEY_SETAPPL_PERFERED_ARM_LEFT_BOOL
47 #define PA_READY "/tmp/.pa_ready"
49 #define MMSOUND_ENTER_CRITICAL_SECTION(x_mutex) \
50 switch ( pthread_mutex_lock( x_mutex ) ) \
53 debug_warning("try mutex init..\n"); \
54 if( 0 > pthread_mutex_init( x_mutex, NULL) ) { \
63 debug_error("mutex lock failed\n"); \
67 #define MMSOUND_ENTER_CRITICAL_SECTION_WITH_RETURN(x_mutex,x_return) \
68 switch ( pthread_mutex_lock( x_mutex ) ) \
71 debug_warning("try mutex init..\n"); \
72 if( 0 > pthread_mutex_init( x_mutex, NULL) ) { \
81 debug_error("mutex lock failed\n"); \
85 #define MMSOUND_LEAVE_CRITICAL_SECTION(x_mutex) \
86 if( pthread_mutex_unlock( x_mutex ) ) { \
87 debug_error("mutex unlock failed\n"); \
90 #define MMSOUND_STRNCPY(dst,src,size)\
92 if(src != NULL && dst != NULL && size > 0) {\
93 strncpy(dst,src,size); \
95 } else if(dst == NULL) { \
96 debug_error("STRNCPY ERROR: Destination String is NULL\n"); \
98 else if(size <= 0) { \
99 debug_error("STRNCPY ERROR: Destination String is NULL\n"); \
102 debug_error("STRNCPY ERROR: Destination String is NULL\n"); \
106 #endif /* __MM_SOUND_COMMON_H__ */