int data;
} focus_idle_event_t;
-void _system_signal_handler(int signo)
+void _system_signal_handler(int signo, siginfo_t *siginfo, void *context)
{
int ret = MM_ERROR_NONE;
sigset_t old_mask, all_mask;
if (g_need_emergent_exit) {
ret = mm_sound_proxy_emergent_exit(getpid());
if (ret == MM_ERROR_NONE)
- debug_msg("[Client] Success to emergnet_exit\n");
+ debug_msg("Success to emergnet_exit");
else
- debug_error("[Client] Error occurred : 0x%x \n",ret);
+ debug_error("Error occurred : 0x%x", ret);
}
sigprocmask(SIG_SETMASK, &old_mask, NULL);
switch (signo) {
case SIGINT:
- sigaction(SIGINT, &system_int_old_action, NULL);
- raise( signo);
+ if (system_int_old_action.sa_sigaction)
+ system_int_old_action.sa_sigaction(signo, siginfo, context);
+ else
+ sigaction(signo, &system_int_old_action, NULL);
break;
case SIGABRT:
- sigaction(SIGABRT, &system_abrt_old_action, NULL);
- raise( signo);
+ if (system_abrt_old_action.sa_sigaction)
+ system_abrt_old_action.sa_sigaction(signo, siginfo, context);
+ else
+ sigaction(signo, &system_abrt_old_action, NULL);
break;
case SIGSEGV:
- sigaction(SIGSEGV, &system_segv_old_action, NULL);
- raise( signo);
+ if (system_segv_old_action.sa_sigaction)
+ system_segv_old_action.sa_sigaction(signo, siginfo, context);
+ else
+ sigaction(signo, &system_segv_old_action, NULL);
break;
case SIGTERM:
- sigaction(SIGTERM, &system_term_old_action, NULL);
- raise( signo);
+ if (system_term_old_action.sa_sigaction)
+ system_term_old_action.sa_sigaction(signo, siginfo, context);
+ else
+ sigaction(signo, &system_term_old_action, NULL);
break;
case SIGSYS:
- sigaction(SIGSYS, &system_sys_old_action, NULL);
- raise( signo);
+ if (system_sys_old_action.sa_sigaction)
+ system_sys_old_action.sa_sigaction(signo, siginfo, context);
+ else
+ sigaction(signo, &system_sys_old_action, NULL);
break;
case SIGXCPU:
- sigaction(SIGXCPU, &system_xcpu_old_action, NULL);
- raise( signo);
+ if (system_xcpu_old_action.sa_sigaction)
+ system_xcpu_old_action.sa_sigaction(signo, siginfo, context);
+ else
+ sigaction(signo, &system_xcpu_old_action, NULL);
break;
default:
break;
struct sigaction system_action;
- system_action.sa_handler = _system_signal_handler;
- system_action.sa_flags = SA_NOCLDSTOP;
+ system_action.sa_sigaction = _system_signal_handler;
+ system_action.sa_flags = SA_NOCLDSTOP | SA_SIGINFO;
sigemptyset(&system_action.sa_mask);
if (g_need_emergent_exit) {
ret = mm_sound_proxy_emergent_exit(getpid());
if (ret == MM_ERROR_NONE)
- debug_msg("[Client] Success to emergnet_exit\n");
+ debug_msg("Success to emergent_exit");
else
- debug_error("[Client] Error occurred : 0x%x \n",ret);
+ debug_error("Error occurred : 0x%x", ret);
}
sigaction(SIGINT, &system_int_old_action, NULL);
if (enable_session) {
if (MM_ERROR_NONE != _mm_session_util_read_information(-1, &session_type, &session_options)) {
- debug_warning("[Client] Read Session Information failed. use default \"media\" type\n");
+ debug_warning("Read Session Information failed. use default \"media\" type");
session_type = MM_SESSION_TYPE_MEDIA;
if(MM_ERROR_NONE != mm_session_init(session_type)) {
- debug_critical("[Client] MMSessionInit() failed\n");
+ debug_critical("MMSessionInit() failed");
return MM_ERROR_POLICY_INTERNAL;
}
}
}
// instance = getpid();
- //debug_log("[Client] pid for client ::: [%d]\n", instance);
+ //debug_log("pid for client ::: [%d]", instance);
/* Send msg */
- debug_msg("[Client] Input number : %d\n", number);
+ debug_msg("Input number : %d", number);
/* Send req memory */
mm_sound_convert_volume_type_to_stream_type(volume_type, stream_type);
struct callback_data *cb_data = (struct callback_data*) userdata;
play_sound_end_callback_data_t *end_cb_data;
- debug_log("[Wrapper CB][Play Stop] ended_handle : %d", ended_handle);
+ debug_log("ended_handle : %d", ended_handle);
if (cb_data == NULL) {
debug_warning("stop callback data null");
if (param->skip_session == false) {
if(MM_ERROR_NONE != _mm_session_util_read_information(-1, &session_type, &session_options)) {
- debug_warning("[Client] Read MMSession Type failed. use default \"media\" type\n");
+ debug_warning("Read MMSession Type failed. use default \"media\" type");
session_type = MM_SESSION_TYPE_MEDIA;
if(MM_ERROR_NONE != mm_session_init(session_type)) {
- debug_critical("[Client] MMSessionInit() failed\n");
+ debug_critical("MMSessionInit() failed");
return MM_ERROR_POLICY_INTERNAL;
}
}
return MM_ERROR_SOUND_INTERNAL;
}
- debug_log("======================== device list : start ==========================\n");
+ debug_log("======================== device list : start ==========================");
for (list = device_list; list != NULL; list = list->next) {
device_node = (mm_sound_device_t *)list->data;
if (device_node) {
- debug_log(" list idx[%d]: type[%17s], id[%02d], io_direction[%d], state[%d], name[%s]\n",
+ debug_log(" list idx[%d]: type[%17s], id[%02d], io_direction[%d], state[%d], name[%s]",
count++, device_node->type, device_node->id, device_node->io_direction,
device_node->state, device_node->name);
}
}
- debug_log("======================== device list : end ============================\n");
+ debug_log("======================== device list : end ============================");
return ret;
}
}
if ((ret = mm_sound_proxy_get_current_connected_device_list(device_flags, &device_list->list)) != MM_ERROR_NONE) {
- debug_error("[Client] failed to get current connected device list with dbus, ret[0x%x]", ret);
+ debug_error("failed to get current connected device list with dbus, ret[0x%x]", ret);
goto failed;
}
if (!device_list->list) {
return ret;
}
+int mm_sound_client_get_device_by_id(int device_id, mm_sound_device_t **device)
+{
+ int ret = MM_ERROR_NONE;
+
+ debug_fenter();
+
+ if ((ret = mm_sound_proxy_get_device_by_id(device_id, device)) != MM_ERROR_NONE)
+ debug_error("failed to get device by id");
+
+ debug_fleave();
+
+ return ret;
+}
+
static bool device_is_match_direction(int direction, int mask)
{
if (mask == DEVICE_IO_DIRECTION_FLAGS || mask == 0)
}
static int _fill_sound_device(mm_sound_device_t *device_h, int device_id, const char *device_type,
- int direction, int state, const char *name, int *stream_id, int stream_num)
+ int direction, int state, const char *name, int vendor_id, int product_id,
+ int *stream_id, int stream_num)
{
int i;
device_h->state = state;
MMSOUND_STRNCPY(device_h->name, name, MAX_DEVICE_NAME_NUM);
MMSOUND_STRNCPY(device_h->type, device_type, MAX_DEVICE_TYPE_STR_LEN);
+ device_h->vendor_id = vendor_id;
+ device_h->product_id = product_id;
if (stream_num > 0) {
device_h->stream_num = stream_num;
}
static void _mm_sound_device_connected_callback_wrapper_func(int device_id, const char *device_type, int io_direction,
- int state, const char *name, int *stream_id, int stream_num,
- gboolean is_connected, void *userdata)
+ int state, const char *name, int vendor_id, int product_id, int *stream_id, int stream_num,
+ gboolean is_connected, void *userdata)
{
mm_sound_device_t device_h;
struct callback_data *cb_data = (struct callback_data*) userdata;
int device_flags;
- debug_log("[Device %s] id(%d) type(%s) direction(%d) state(%d) name(%s)",
+ debug_log("[Device %s] id(%d) type(%s) direction(%d) state(%d) name(%s) vendor-id(%04x) product-id(%04x)",
is_connected ? "Connected" : "Disconnected", device_id, device_type, io_direction,
- state, name, is_connected);
+ state, name, vendor_id, product_id, is_connected);
if (cb_data == NULL) {
debug_warning("device connected changed callback data null");
if (!device_is_match_with_mask(device_type, io_direction, state, device_flags))
return;
- if (_fill_sound_device(&device_h, device_id, device_type, io_direction, state, name, stream_id, stream_num) < 0) {
+ if (_fill_sound_device(&device_h, device_id, device_type, io_direction, state, name,
+ vendor_id, product_id, stream_id, stream_num) < 0) {
debug_error("Failed to fill sound device");
return;
}
}
static void _mm_sound_device_info_changed_callback_wrapper_func(int device_id, const char *device_type, int io_direction,
- int state, const char *name, int *stream_id, int stream_num,
- int changed_device_info_type, void *userdata)
+ int state, const char *name, int vendor_id, int product_id, int *stream_id, int stream_num,
+ int changed_device_info_type, void *userdata)
{
mm_sound_device_t device_h;
struct callback_data *cb_data = (struct callback_data*) userdata;
int device_flags;
- debug_log("[Device Info Changed] id(%d) type(%s) direction(%d) state(%d) name(%s) changed_info_type(%d)",
- device_id, device_type, io_direction, state, name, changed_device_info_type);
+ debug_log("[Device Info Changed] id(%d) type(%s) direction(%d) state(%d) name(%s) "
+ "vendor-id(%04x) product-id(%04x) changed_info_type(%d)",
+ device_id, device_type, io_direction, state, name, vendor_id, product_id, changed_device_info_type);
if (cb_data == NULL) {
debug_warning("device info changed callback data null");
if (!device_is_match_with_mask(device_type, io_direction, state, device_flags))
return;
- if (_fill_sound_device(&device_h, device_id, device_type, io_direction, state, name, stream_id, stream_num) < 0) {
+ if (_fill_sound_device(&device_h, device_id, device_type, io_direction, state, name,
+ vendor_id, product_id, stream_id, stream_num) < 0) {
debug_error("Failed to fill sound device");
return;
}
}
static void _mm_sound_device_state_changed_callback_wrapper_func(int device_id, const char *device_type,
- int io_direction, int state, const char *name,
- int *stream_id, int stream_num, void *userdata)
+ int io_direction, int state, const char *name, int vendor_id, int product_id,
+ int *stream_id, int stream_num, void *userdata)
{
mm_sound_device_t device_h;
struct callback_data *cb_data = (struct callback_data*) userdata;
int device_flags;
- debug_log("[Device State Changed] id(%d) type(%s) direction(%d) state(%d) name(%s)",
- device_id, device_type, io_direction, state, name);
+ debug_log("[Device State Changed] id(%d) type(%s) direction(%d) state(%d) name(%s)"
+ "vendor-id(%04x), product-id(%04x)",
+ device_id, device_type, io_direction, state, name, vendor_id, product_id);
if (cb_data == NULL) {
debug_warning("device state changed callback data null");
if (!device_is_match_with_mask(device_type, io_direction, state, device_flags))
return;
- if (_fill_sound_device(&device_h, device_id, device_type, io_direction, state, name, stream_id, stream_num) < 0) {
+ if (_fill_sound_device(&device_h, device_id, device_type, io_direction, state, name,
+ vendor_id, product_id, stream_id, stream_num) < 0) {
debug_error("Failed to fill sound device");
return;
}
}
if ((ret = mm_sound_proxy_is_stream_on_device(stream_id, device_id, is_on)) != MM_ERROR_NONE) {
- debug_error("[Client] failed to query is stream on device, ret[0x%x]", ret);
+ debug_error("failed to query is stream on device, ret[0x%x]", ret);
goto failed;
}
volume_type_t volume_type = 0;
struct callback_data *cb_data = (struct callback_data *) userdata;
- debug_log("[Wrapper CB][Volume Changed] direction : %s, volume_type : %s, volume_level : %d",
+ debug_log("direction : %s, volume_type : %s, volume_level : %d",
direction, volume_type_str, volume_level);
if (cb_data == NULL) {
static void _session_interrupted_cb(int id, mm_sound_focus_type_e focus_type, mm_sound_focus_state_e state,
const char *reason_for_change, const char *ext_info, void *user_data)
{
- debug_msg("SESSION INTERRUPTED CB is called : id(%d), focus_type(%d), state(%d), reason(%s)", id, focus_type, state, reason_for_change);
+ debug_msg("id(%d), focus_type(%d), state(%d), reason(%s)", id, focus_type, state, reason_for_change);
if (id != g_focus_session_interrupt_info.watch_cb_id) {
debug_error("id is not valid(param id:%d, g_focus_session_interrupt_watch_cb_id:%d)",
}
debug_msg(" >>> invoking session interrupt callback(%p)", g_focus_session_interrupt_info.user_cb);
- if (state == FOCUS_IS_ACQUIRED)
- (g_focus_session_interrupt_info.user_cb)(state, reason_for_change, g_focus_session_interrupt_info.user_data);
+ if (state == FOCUS_IS_RELEASED)
+ (g_focus_session_interrupt_info.user_cb)(FOCUS_IS_ACQUIRED, reason_for_change, g_focus_session_interrupt_info.user_data);
else {
debug_msg("INTERRUPTED COMPLETED case, append it to idle");
g_idle_add((GSourceFunc)_interrupted_completed, strdup(reason_for_change));
unsigned int thread_id = (unsigned int)pthread_self();
GMainLoop *focus_loop = (GMainLoop*)data;
- debug_warning(">>> thread func : thread id(%u), mainloop[%p]", thread_id, focus_loop);
+ debug_warning(">>> thread id(%u), mainloop[%p]", thread_id, focus_loop);
if (focus_loop)
g_main_loop_run(focus_loop);
- debug_warning("<<< quit thread func : thread id(%u), mainloop[%p]", thread_id, focus_loop);
+ debug_warning("<<< quit : thread id(%u), mainloop[%p]", thread_id, focus_loop);
return NULL;
}
int tid = 0;
focus_cb_data_lib cb_data;
- debug_log(">>> _focus_callback_handler(), this thread id(%u)\n", (unsigned int)pthread_self());
+ debug_log(">>> thread id(%u)", (unsigned int)pthread_self());
if (!focus_handle) {
debug_error("focus_handle is null");
if (tmpfd < 0) {
char str_error[256];
strerror_r(errno, str_error, sizeof(str_error));
- debug_warning("[RETCB][Failed(May Server Close First)]tid(%d) fd(%d) %s errno=%d(%s)\n",
+ debug_warning("[RETCB][Failed(May Server Close First)]tid(%d) fd(%d) %s errno=%d(%s)",
tid, tmpfd, filename2, errno, str_error);
g_free(filename2);
g_mutex_unlock(&focus_handle->focus_lock);
rett = write(tmpfd, &buf, sizeof(buf));
close(tmpfd);
g_free(filename2);
- debug_msg("[RETCB] tid(%d) finishing CB (write=%d)\n", tid, rett);
+ debug_msg("[RETCB] tid(%d) finishing CB (write=%d)", tid, rett);
}
#endif
}
int tid = 0;
focus_cb_data_lib cb_data;
- debug_log(">>> _focus_watch_callback_handler(), this thread id(%u)\n", (unsigned int)pthread_self());
+ debug_log(">>> thread id(%u)", (unsigned int)pthread_self());
if (!focus_handle) {
debug_error("focus_handle is null");
if (tmpfd < 0) {
char str_error[256];
strerror_r(errno, str_error, sizeof(str_error));
- debug_warning("[RETCB][Failed(May Server Close First)]tid(%d) fd(%d) %s errno=%d(%s)\n",
+ debug_warning("[RETCB][Failed(May Server Close First)]tid(%d) fd(%d) %s errno=%d(%s)",
tid, tmpfd, filename2, errno, str_error);
g_free(filename2);
g_mutex_unlock(&focus_handle->focus_lock);
rett = write(tmpfd, &buf, sizeof(buf));
close(tmpfd);
g_free(filename2);
- debug_msg("[RETCB] tid(%d) finishing CB (write=%d)\n", tid, rett);
+ debug_msg("[RETCB] tid(%d) finishing CB (write=%d)", tid, rett);
}
#endif
}
ret = mm_sound_proxy_register_focus(id, pid, stream_type, callback, is_for_session, user_data);
if (ret == MM_ERROR_NONE) {
- debug_msg("[Client] Success to register focus\n");
+ debug_msg("Success to register focus");
g_need_emergent_exit = TRUE;
if (_focus_init_context(index)) {
ret = MM_ERROR_SOUND_INTERNAL;
goto cleanup;
}
} else {
- debug_error("[Client] Error occurred : 0x%x \n",ret);
+ debug_error("Error occurred : 0x%x",ret);
goto cleanup;
}
ret = mm_sound_proxy_unregister_focus(instance, id, g_focus_sound_handle[index].is_for_session);
if (ret == MM_ERROR_NONE)
- debug_msg("[Client] Success to unregister focus\n");
+ debug_msg("Success to unregister focus");
else
- debug_error("[Client] Error occurred : 0x%x \n",ret);
+ debug_error("Error occurred : 0x%x", ret);
g_mutex_unlock(&g_focus_sound_handle[index].focus_lock);
bool result;
debug_fenter();
- MMSOUND_ENTER_CRITICAL_SECTION_WITH_RETURN(&g_index_mutex, MM_ERROR_SOUND_INTERNAL);
+
+ /* Since the muse server which uses this library for multiple handles executes requests from clients serially,
+ * we can skip locking/unlocking the mutex for this case. */
+ if (!is_for_session)
+ MMSOUND_ENTER_CRITICAL_SECTION_WITH_RETURN(&g_index_mutex, MM_ERROR_SOUND_INTERNAL);
index = _focus_find_index_by_handle(id);
if (index == -1) {
ret = mm_sound_client_is_focus_cb_thread(g_thread_self(), &result);
if (ret) {
- debug_error("[Client] mm_sound_client_is_focus_cb_thread failed");
+ debug_error("mm_sound_client_is_focus_cb_thread failed");
goto cleanup;
} else if (!result) {
ret = mm_sound_proxy_set_focus_reacquisition(instance, id, reacquisition, is_for_session);
if (ret == MM_ERROR_NONE) {
- debug_msg("[Client] Success to set focus reacquisition to [%d]\n", reacquisition);
+ debug_msg("Success to set focus reacquisition to [%d]", reacquisition);
} else {
- debug_error("[Client] Error occurred : 0x%x \n",ret);
+ debug_error("Error occurred : 0x%x",ret);
goto cleanup;
}
} else {
- debug_warning("[Client] Inside the focus cb thread, set focus reacquisition to [%d]\n", reacquisition);
+ debug_warning("Inside the focus cb thread, set focus reacquisition to [%d]", reacquisition);
}
g_focus_sound_handle[index].auto_reacquire = reacquisition;
- debug_msg("[Client] set focus reacquisition(%d) for id(%d)\n", reacquisition, id);
+ debug_msg("set focus reacquisition(%d) for id(%d)", reacquisition, id);
cleanup:
- MMSOUND_LEAVE_CRITICAL_SECTION(&g_index_mutex);
+ if (!is_for_session)
+ MMSOUND_LEAVE_CRITICAL_SECTION(&g_index_mutex);
debug_fleave();
return ret;
}
}
*reacquisition = g_focus_sound_handle[index].auto_reacquire;
- debug_msg("[Client] get focus reacquisition(%d) for id(%d)\n", *reacquisition, id);
+ debug_msg("get focus reacquisition(%d) for id(%d)", *reacquisition, id);
cleanup:
MMSOUND_LEAVE_CRITICAL_SECTION(&g_index_mutex);
int mm_sound_client_get_acquired_focus_stream_type(int focus_type, char **stream_type, int *option, char **ext_info)
{
int ret = MM_ERROR_NONE;
- char *ext_str = NULL;
+ char *stream_type_str = NULL;
+ char *ext_info_str = NULL;
debug_fenter();
- ret = mm_sound_proxy_get_acquired_focus_stream_type(focus_type, stream_type, option, &ext_str);
+ ret = mm_sound_proxy_get_acquired_focus_stream_type(focus_type, &stream_type_str, option, &ext_info_str);
if (ret == MM_ERROR_NONE) {
- debug_msg("[Client] Success to get stream type of acquired focus, stream_type(%s), ext_info(%s)\n",
- *stream_type, ext_str);
- *ext_info = strdup(ext_str);
- g_free(ext_str);
+ debug_msg("Success to get stream type of acquired focus, stream_type(%s), ext_info(%s)",
+ stream_type_str, ext_info_str);
+ *stream_type = strdup(stream_type_str);
+ *ext_info = strdup(ext_info_str);
+ g_free(stream_type_str);
+ g_free(ext_info_str);
} else {
- debug_error("[Client] Error occurred : 0x%x \n",ret);
+ debug_error("Error occurred : 0x%x",ret);
}
debug_fleave();
ret = mm_sound_proxy_acquire_focus(instance, id, type, option, ext_info, g_focus_sound_handle[index].is_for_session);
if (ret == MM_ERROR_NONE)
- debug_msg("[Client] Success to acquire focus\n");
+ debug_msg("Success to acquire focus");
else
- debug_error("[Client] Error occurred : 0x%x \n",ret);
+ debug_error("Error occurred : 0x%x", ret);
cleanup:
MMSOUND_LEAVE_CRITICAL_SECTION(&g_index_mutex);
ret = mm_sound_proxy_release_focus(instance, id, type, option, ext_info, g_focus_sound_handle[index].is_for_session);
if (ret == MM_ERROR_NONE)
- debug_msg("[Client] Success to release focus\n");
+ debug_msg("Success to release focus");
else
- debug_error("[Client] Error occurred : 0x%x \n",ret);
+ debug_error("Error occurred : 0x%x",ret);
cleanup:
MMSOUND_LEAVE_CRITICAL_SECTION(&g_index_mutex);
debug_fenter();
if ((ret = mm_sound_proxy_update_stream_focus_status(id, status)) != MM_ERROR_NONE)
- debug_error("[Client] failed to update stream focus status, ret[0x%x]", ret);
+ debug_error("failed to update stream focus status, ret[0x%x]", ret);
+
+ debug_fleave();
+ return ret;
+}
+
+int mm_sound_client_deliver_focus(int pid, int src_id, int dst_id, mm_sound_focus_type_e focus_type)
+{
+ int ret = MM_ERROR_NONE;
+ debug_fenter();
+
+ if ((ret = mm_sound_proxy_deliver_focus(pid, src_id, dst_id, focus_type)) != MM_ERROR_NONE)
+ debug_error("failed to deliver focus, ret[0x%x]", ret);
debug_fleave();
return ret;
is_for_session, is_for_monitor, callback, user_data);
if (ret == MM_ERROR_NONE) {
- debug_msg("[Client] Success to watch focus");
+ debug_msg("Success to watch focus");
g_need_emergent_exit = TRUE;
if (_focus_init_context(index)) {
ret = MM_ERROR_SOUND_INTERNAL;
goto cleanup;
}
} else {
- debug_error("[Client] Error occurred : 0x%x",ret);
+ debug_error("Error occurred : 0x%x",ret);
goto cleanup;
}
g_focus_sound_handle[index].is_for_session);
if (ret == MM_ERROR_NONE)
- debug_msg("[Client] Success to unwatch focus\n");
+ debug_msg("Success to unwatch focus");
else
- debug_error("[Client] Error occurred : 0x%x \n",ret);
+ debug_error("Error occurred : 0x%x",ret);
g_mutex_unlock(&g_focus_sound_handle[index].focus_lock);
switch (idle_event_data->type) {
case IDLE_EVENT_TYPE_UNSET_FOCUS_WATCH_CB:
if ((ret = mm_sound_client_unset_focus_watch_callback(idle_event_data->data)))
- debug_error("Could not unset focus watch callback, id(%d), ret = %x\n", idle_event_data->data, ret);
+ debug_error("Could not unset focus watch callback, id(%d), ret = %x", idle_event_data->data, ret);
break;
case IDLE_EVENT_TYPE_UNREGISTER_FOCUS:
if ((ret = mm_sound_client_unregister_focus(idle_event_data->data)))
- debug_error("Could not unregister focus, id(%d), ret = %x\n", idle_event_data->data, ret);
+ debug_error("Could not unregister focus, id(%d), ret = %x", idle_event_data->data, ret);
break;
default:
debug_warning("invalid type(%d)", idle_event_data->type);
{
focus_idle_event_t *idle_event_data = NULL;
- if (IDLE_EVENT_TYPE_UNSET_FOCUS_WATCH_CB > type || IDLE_EVENT_TYPE_MAX < type)
+ if (IDLE_EVENT_TYPE_MAX < type)
return MM_ERROR_INVALID_ARGUMENT;
MMSOUND_ENTER_CRITICAL_SECTION_WITH_RETURN(&g_event_mutex, MM_ERROR_SOUND_INTERNAL);