From: NAMJEONGYOON Date: Thu, 7 Jan 2016 07:11:20 +0000 (+0900) Subject: convert volume_type to stream_type for backward compatibility X-Git-Tag: accepted/tizen/mobile/20160108.005916^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=676d1c6e91602fbadc92ede27826ebd402b79154;p=platform%2Fcore%2Fapi%2Fplayer.git convert volume_type to stream_type for backward compatibility Change-Id: I1f6bf61845bd20feec6d356214934bf3cecdc94c --- diff --git a/src/player.c b/src/player.c index 9a09aa8..f1c2192 100644 --- a/src/player.c +++ b/src/player.c @@ -1411,15 +1411,45 @@ int player_set_sound_type(player_h player, sound_type_e type) PLAYER_STATE_CHECK(handle, PLAYER_STATE_IDLE); int sig_value = 0; + char *stream_type = NULL; + int stream_index = -1; /* check if focus is released */ mm_sound_get_signal_value(MM_SOUND_SIGNAL_RELEASE_INTERNAL_FOCUS, &sig_value); if(sig_value) return PLAYER_ERROR_SOUND_POLICY; - LOGI("[%s] sound type = %d", __FUNCTION__, type); + /* convert volume_type to stream_type */ + switch(type) { + case SOUND_TYPE_SYSTEM: + stream_type = "system"; + break; + case SOUND_TYPE_NOTIFICATION: + stream_type = "notification"; + break; + case SOUND_TYPE_ALARM: + stream_type = "alarm"; + break; + case SOUND_TYPE_RINGTONE: + stream_type = "ringtone-voip"; + break; + case SOUND_TYPE_MEDIA: + case SOUND_TYPE_CALL: + stream_type = "media"; + break; + case SOUND_TYPE_VOIP: + stream_type = "voip"; + break; + case SOUND_TYPE_VOICE: + stream_type = "voice-information"; + break; + default: + LOGW("check the value[%d].\n", type); + return PLAYER_ERROR_INVALID_PARAMETER; + } + LOGI("[%s] sound type = %s", __FUNCTION__, stream_type); - int ret = mm_player_set_attribute(handle->mm_handle, NULL, "sound_volume_type", type, (char *)NULL); + int ret = mm_player_set_attribute(handle->mm_handle, NULL, "sound_stream_type", stream_type, strlen(stream_type), "sound_stream_index", stream_index, (char *)NULL); if (ret != MM_ERROR_NONE) return __player_convert_error_code(ret, (char *)__FUNCTION__); else