int sound_manager_get_device_state(sound_device_h device, sound_device_state_e *state)
{
- int ret = MM_ERROR_NONE;
-
SM_ARG_CHECK(device);
SM_ARG_CHECK(state);
- LOGI("device[%p]", device);
-
LOGW("DEPRECATION WARNING: %s() is deprecated and will be removed from next release.", __func__);
- ret = mm_sound_get_device_state(device, (mm_sound_device_state_e*)state);
-
- LOGI("state[%d]", *state);
+ *state = SOUND_DEVICE_STATE_DEACTIVATED;
- return _convert_sound_manager_error_code(__func__, ret);
+ return SOUND_MANAGER_ERROR_NONE;
}
int sound_manager_get_supported_sample_formats(sound_device_h device, sound_sample_format_e **formats, unsigned int *num_of_elems)
int sound_manager_add_device_state_changed_cb(int device_mask, sound_device_state_changed_cb callback, void *user_data, int *id)
{
- int ret = MM_ERROR_NONE;
-
LOGW("DEPRECATION WARNING: %s() is deprecated and will be removed from next release.", __func__);
SM_ARG_CHECK(callback);
SM_ARG_CHECK(id);
- LOGI("device_mask[0x%x] callback[%p] user_data[%p]", device_mask, callback, user_data);
-
- ret = mm_sound_add_device_state_changed_callback(device_mask, (mm_sound_device_state_changed_cb)callback, user_data, (unsigned int*)id);
+ *id = -1;
- LOGI("id[%d]", *id);
-
- return _convert_sound_manager_error_code(__func__, ret);
+ return SOUND_MANAGER_ERROR_NONE;
}
int sound_manager_remove_device_state_changed_cb(int id)
{
- int ret = MM_ERROR_NONE;
-
LOGW("DEPRECATION WARNING: %s() is deprecated and will be removed from next release.", __func__);
- SM_ARG_CHECK(id >= 0);
- LOGI("id[%d]", id);
-
- ret = mm_sound_remove_device_state_changed_callback((unsigned int)id);
-
- return _convert_sound_manager_error_code(__func__, ret);
+ return SOUND_MANAGER_ERROR_NONE;
}
int sound_manager_create_stream_ducking(sound_stream_type_e target_stream, sound_stream_ducking_state_changed_cb callback, void *user_data, sound_stream_ducking_h *stream_ducking)
else if (g_menu_state == CURRENT_STATUS_REMOVE_VOLUME_CHANGED_CB_INTERNAL)
g_print("*** press enter to remove volume changed cb for internal\n");
else if (g_menu_state == CURRENT_STATUS_SET_DEVICE_MASK)
- g_print("*** input device mask (0:ALL, 1:INTERNAL, 2:EXTERNAL, 3:INPUT, 4:OUTPUT, 5:BOTH, 6:ACTIVATED, 7:DEACTIVATED, b:back to the menu)\n");
+ g_print("*** input device mask (0:ALL, 1:INTERNAL, 2:EXTERNAL, 3:INPUT, 4:OUTPUT, 5:BOTH, b:back to the menu)\n");
else if (g_menu_state == CURRENT_STATUS_GET_DEVICE_MASK)
g_print("*** press enter to get device mask\n");
else if (g_menu_state == CURRENT_STATUS_GET_DEVICE_LIST)
/* If failed to get some property, just give some default value */
void _get_device_props_simple(sound_device_h device, int *id, const char **type, char **name,
- const char **direction, bool *is_activated, int *vendor_id, int *product_id, bool *is_running)
+ const char **direction, int *vendor_id, int *product_id, bool *is_running)
{
int ret;
sound_device_type_e _type;
sound_device_io_direction_e _direc;
- sound_device_state_e _state;
bool running;
*id = -1;
*direction = g_device_direction_str[_direc];
}
- if ((ret = sound_manager_get_device_state(device, &_state))) {
- g_print("failed to get device state, ret[0x%x]\n", ret);
- *is_activated = false;
- } else {
- *is_activated = (bool)_state;
- }
-
if ((ret = sound_manager_is_device_running(device, &running))) {
g_print("failed to get 'is running', ret[0x%x]\n", ret);
*is_running = false;
int product_id = 0;
char *name;
const char *type, *direction;
- bool is_activated = false;
bool is_running = false;
- _get_device_props_simple(device, &id, &type, &name, &direction, &is_activated, &vendor_id, &product_id, &is_running);
+ _get_device_props_simple(device, &id, &type, &name, &direction, &vendor_id, &product_id, &is_running);
g_print("\n[ Device #%d %-20s ] %15s : ", id, type, is_connected ? "Connected" : "Disconnected");
- g_print("Direction[%-4s] Activated[%d] Running[%d] Vendor/Product ID[%04x/%04x] Name[%s]\n",
- direction, is_activated, is_running, vendor_id, product_id, name);
+ g_print("Direction[%-4s] Running[%d] Vendor/Product ID[%04x/%04x] Name[%s]\n",
+ direction, is_running, vendor_id, product_id, name);
}
void _device_running_changed_cb(sound_device_h device, bool is_running, void *user_data)
int product_id = 0;
char *name;
const char *type, *direction;
- bool is_activated = false;
bool _is_running = false;
- _get_device_props_simple(device, &id, &type, &name, &direction, &is_activated, &vendor_id, &product_id, &_is_running);
+ _get_device_props_simple(device, &id, &type, &name, &direction, &vendor_id, &product_id, &_is_running);
g_print("\n[ Device #%d %-20s ] running changed to [%d] : ", id, type, is_running);
- g_print("Direction [%-4s] Activated[%d] Running[%d] Vendor/Product ID[%04x/%04x] Name[%s]\n",
- direction, is_activated, _is_running, vendor_id, product_id, name);
+ g_print("Direction [%-4s] Running[%d] Vendor/Product ID[%04x/%04x] Name[%s]\n",
+ direction, is_running, vendor_id, product_id, name);
}
void reset_menu_state(void)
else
g_device_mask |= SOUND_DEVICE_IO_DIRECTION_BOTH_MASK;
g_print("add IO_DIRECTION_BOTH MASK\n");
- } else if (strncmp(cmd, "6", 1) == 0) {
- if (g_device_mask == SOUND_DEVICE_ALL_MASK)
- g_device_mask = SOUND_DEVICE_STATE_ACTIVATED_MASK;
- else
- g_device_mask |= SOUND_DEVICE_STATE_ACTIVATED_MASK;
- g_print("add STATE_ACTIVATED MASK\n");
- } else if (strncmp(cmd, "7", 1) == 0) {
- if (g_device_mask == SOUND_DEVICE_ALL_MASK)
- g_device_mask = SOUND_DEVICE_STATE_DEACTIVATED_MASK;
- else
- g_device_mask |= SOUND_DEVICE_STATE_DEACTIVATED_MASK;
- g_print("add STATE_DEACTIVATED MASK\n");
} else if (strncmp(cmd, "b", 1) == 0) {
g_print("device mask[0x%x]\n", g_device_mask);
reset_menu_state();
char *name;
const char *type;
const char *direction;
- bool is_activated;
bool is_running;
unsigned int num;
sound_sample_format_e *formats;
if (!(ret = sound_manager_get_device_list(g_device_mask, &device_list))) {
g_print("success to get current device list\n");
while (!sound_manager_get_next_device(device_list, &device)) {
- _get_device_props_simple(device, &id, &type, &name, &direction, &is_activated, &vendor_id, &product_id, &is_running);
+ _get_device_props_simple(device, &id, &type, &name, &direction, &vendor_id, &product_id, &is_running);
g_print("[ Device #%d %-20s ] : ", id, type);
- g_print("Direction[%-4s] Activated[%d] Running[%d] Vendor/Product ID[%04x/%04x] Name[%s] \n",
- direction, is_activated, is_running, vendor_id, product_id, name);
+ g_print("Direction[%-4s] Running[%d] Vendor/Product ID[%04x/%04x] Name[%s] \n",
+ direction, is_running, vendor_id, product_id, name);
if (!(ret = sound_manager_get_supported_sample_formats(device, &formats, &num))) {
g_print(" => [ ");