static Ecore_Timer* g_m_connect_timer = NULL;
+static Ecore_Timer* g_m_set_volume_timer = NULL;
+
static vc_h g_vc_m = NULL;
static GSList* g_demandable_client_list = NULL;
static float g_volume_db = 0;
+static float g_prev_volume_db = 0;
+
+static float g_cur_volume_db = 0;
+
static int g_daemon_pid = 0;
static int g_feature_enabled = -1;
return ret;
}
+static int g_cnt = 0;
+static Eina_Bool __vc_mgr_set_volume(void* data)
+{
+ g_cnt++;
+ g_volume_db = g_prev_volume_db + (g_cur_volume_db - g_prev_volume_db) / 5 * g_cnt;
+
+ SLOG(LOG_DEBUG, TAG_VCM, "Set volume (%f)(%f)", g_volume_db, g_cur_volume_db);
+
+ if (0 == g_cnt % 5) {
+ return EINA_FALSE;
+ }
+ return EINA_TRUE;
+}
+
int __vc_mgr_cb_set_volume(float volume)
{
- g_volume_db = volume;
- SLOG(LOG_DEBUG, TAG_VCM, "Set volume (%f)", g_volume_db);
+ g_prev_volume_db = g_volume_db;
+ g_cur_volume_db = volume;
+
+ g_volume_db = g_prev_volume_db + (g_cur_volume_db - g_prev_volume_db) / 5;
+
+ SLOG(LOG_DEBUG, TAG_VCM, "Set volume (%f)(%f)", g_volume_db, g_cur_volume_db);
+
+ if (NULL != g_m_set_volume_timer) {
+ SLOG(LOG_DEBUG, TAG_VCM, "Connect Timer is deleted");
+ ecore_timer_del(g_m_set_volume_timer);
+ }
+
+ g_cnt = 1;
+ g_m_set_volume_timer = ecore_timer_add(50, __vc_mgr_set_volume, NULL);
return 0;
}
}
/* Set volume */
- if (0 == g_buffer_count % 30) {
+ if (0 == g_buffer_count % 15) {
float vol_db = get_volume_decibel((char*)voice_data->audio_buf, (unsigned int)voice_data->length);
if (0 != vcdc_send_set_volume(vcd_client_manager_get_pid(), vol_db)) {
SLOG(LOG_ERROR, TAG_VCD, "[Recorder] Fail to send recording volume(%f)", vol_db);