void __sound_stream_ducking_state_changed_cb(sound_stream_ducking_h stream_ducking, bool is_ducked, void *user_data)
{
SLOG(LOG_DEBUG, tts_tag(), "@@@ ducking state changed cb");
- SLOG(LOG_DEBUG, tts_tag(), "[Player] is ducked : %d", is_ducked);
+ SLOG(LOG_ERROR, tts_tag(), "[Player] ducking_h(%p) is ducked : %d", stream_ducking, is_ducked);
// ducking_flag = true;
return;
}
static void __set_policy_for_playing(int volume)
{
- __change_background_volume();
-
/* Set stream info */
int ret;
ttsd_mode_e mode = ttsd_get_mode();
SLOG(LOG_WARN, tts_tag(), "[Player WARNING] Fail to set stream info");
}
+ __change_background_volume();
g_is_set_policy = true;
+ SLOG(LOG_ERROR, tts_tag(), "[BG] g_is_set_policy(%d)", g_is_set_policy);
SLOG(LOG_DEBUG, tts_tag(), "[Player DEBUG] set policy for playing");
}
__recover_background_volume();
-
g_is_set_policy = false;
+ SLOG(LOG_ERROR, tts_tag(), "[BG] g_is_set_policy(%d)", g_is_set_policy);
+
SLOG(LOG_DEBUG, tts_tag(), "[Player DEBUG] unset policy for playing");
double prev_ratio = g_bg_volume_ratio;
g_bg_volume_ratio = ratio;
- if (g_bg_volume_ratio != prev_ratio) {
- SLOG(LOG_DEBUG, tts_tag(), "[Player DEBUG] Check whether sound is ducked and Change volume. as-is(%lf), to-be(%lf)", prev_ratio, g_bg_volume_ratio);
+ SLOG(LOG_DEBUG, tts_tag(), "[Player DEBUG] Check whether sound is ducked and Change volume. as-is(%lf), to-be(%lf)", prev_ratio, g_bg_volume_ratio);
- bool is_ducked = false;
- int ret = sound_manager_is_ducked(g_media_stream_ducking, &is_ducked);
- if (0 == ret && true == is_ducked) {
- __deactivate_ducking_sound_stream(SOUND_STREAM_TYPE_MEDIA, g_media_stream_ducking);
- __activate_ducking_sound_stream(SOUND_STREAM_TYPE_MEDIA, g_media_stream_ducking);
- }
- ret = sound_manager_is_ducked(g_system_stream_ducking, &is_ducked);
- if (0 == ret && true == is_ducked) {
- __deactivate_ducking_sound_stream(SOUND_STREAM_TYPE_SYSTEM, g_system_stream_ducking);
- __activate_ducking_sound_stream(SOUND_STREAM_TYPE_SYSTEM, g_system_stream_ducking);
- }
- ret = sound_manager_is_ducked(g_notification_stream_ducking, &is_ducked);
- if (0 == ret && true == is_ducked) {
- __deactivate_ducking_sound_stream(SOUND_STREAM_TYPE_NOTIFICATION, g_notification_stream_ducking);
- __activate_ducking_sound_stream(SOUND_STREAM_TYPE_NOTIFICATION, g_notification_stream_ducking);
- }
- ret = sound_manager_is_ducked(g_alarm_stream_ducking, &is_ducked);
- if (0 == ret && true == is_ducked) {
- __deactivate_ducking_sound_stream(SOUND_STREAM_TYPE_ALARM, g_alarm_stream_ducking);
- __activate_ducking_sound_stream(SOUND_STREAM_TYPE_ALARM, g_alarm_stream_ducking);
- }
- }
return TTSD_ERROR_NONE;
}