* @since_tizen 3.0
* @param[in] stream_info The handle of stream information
* @param[out] sound_type The sound type
- *
+ *
+ * @remarks In case of the stream_info made with #SOUND_STREAM_TYPE_EMERGENCY, it'll return #SOUND_MANAGER_ERROR_NO_DATA.\n
+ * Because there is no sound_type_e matched to this stream_info.
+ *
* @return @c 0 on success,
* otherwise a negative error value
* @retval #SOUND_MANAGER_ERROR_NONE Success
* @retval #SOUND_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #SOUND_MANAGER_ERROR_NO_DATA No data
* @pre Call sound_manager_create_stream_information() before calling this function.
* @see sound_manager_create_stream_information()
* @see sound_manager_destroy_stream_information()
SM_INSTANCE_CHECK(stream_h);
SM_NULL_ARG_CHECK(sound_type);
- ret = _convert_sound_type_to_enum(stream_h->stream_conf_info.volume_type, sound_type);
+ if (stream_h->stream_conf_info.volume_type == NULL)
+ ret = MM_ERROR_SOUND_NO_DATA;
+ else {
+ ret = _convert_sound_type_to_enum(stream_h->stream_conf_info.volume_type, sound_type);
+ LOGI("sound type(%d)", *sound_type);
+ }
LOGI("<< leave : sound type(%d)", *sound_type);
else if (g_menu_state == CURRENT_STATUS_UNSET_DEVICE_INFO_CHANGED_CB)
g_print("*** press enter to unset device information changed cb\n");
else if (g_menu_state == CURRENT_STATUS_CREATE_STREAM_INFO)
- g_print("*** input stream type to create stream information (0:media, 1:alarm, 2:notification, 3:ringtone-call, 4:voice-call, 5:voip, 6:media-ext-only)\n");
+ g_print("*** input stream type to create stream information\n(0:media, 1:system, 2:alarm, 3:notification, 4:emergency, 5:ringtone-call, 6:voice-call, 7:voip, 8:media-ext-only)\n");
else if (g_menu_state == CURRENT_STATUS_ADD_DEVICE_FOR_STREAM_ROUTING)
g_print("*** input device type to add (0:built-in mic, 1:built-in spk, 2:built-in rcv, 3:audio-jack, 4:bt)\n");
else if (g_menu_state == CURRENT_STATUS_REMOVE_DEVICE_FOR_STREAM_ROUTING)
case 0: /* media */
type = SOUND_STREAM_TYPE_MEDIA;
break;
- case 1: /* alarm */
+ case 1: /* system */
+ type = SOUND_STREAM_TYPE_SYSTEM;
+ break;
+ case 2: /* alarm */
type = SOUND_STREAM_TYPE_ALARM;
break;
- case 2: /* notification */
+ case 3: /* notification */
type = SOUND_STREAM_TYPE_NOTIFICATION;
break;
- case 3: /* ringtone for call*/
+ case 4: /* emergency */
+ type = SOUND_STREAM_TYPE_EMERGENCY;
+ break;
+ case 5: /* ringtone for call*/
type = SOUND_STREAM_TYPE_RINGTONE_CALL;
break;
- case 4: /* voice call */
+ case 6: /* voice call */
type = SOUND_STREAM_TYPE_VOICE_CALL;
break;
- case 5: /* voip */
+ case 7: /* voip */
type = SOUND_STREAM_TYPE_VOIP;
break;
- case 6: /* media only for external devices */
+ case 8: /* media only for external devices */
type = SOUND_STREAM_TYPE_MEDIA_EXTERNAL_ONLY;
break;
default: