CURRENT_STATUS_SET_DEVICE_MASK,
CURRENT_STATUS_GET_DEVICE_MASK,
CURRENT_STATUS_GET_DEVICE_LIST,
+ CURRENT_STATUS_PRINT_DEVICE_LIST,
CURRENT_STATUS_FREE_DEVICE_LIST,
CURRENT_STATUS_GET_DEVICE_NEXT,
CURRENT_STATUS_GET_DEVICE_PREV,
g_menu_state = CURRENT_STATUS_GET_DEVICE_MASK;
else if (strncmp(cmd, "gl", 3) == 0)
g_menu_state = CURRENT_STATUS_GET_DEVICE_LIST;
+ else if (strncmp(cmd, "pl", 3) == 0)
+ g_menu_state = CURRENT_STATUS_PRINT_DEVICE_LIST;
else if (strncmp(cmd, "fl", 3) == 0)
g_menu_state = CURRENT_STATUS_FREE_DEVICE_LIST;
else if (strncmp(cmd, "gn", 3) == 0)
g_print("sk. Set Devices Mask(default ALL)\t");
g_print("gk. Get Devices Mask\n");
g_print("gl. Get Devices List\t");
+ g_print("pl. Print Devices List\t");
g_print("fl. Free Devices List\n");
g_print("gn. Get Next Device\t\t");
g_print("gp. Get Prev Device\n");
g_print("*** press enter to get device mask\n");
else if (g_menu_state == CURRENT_STATUS_GET_DEVICE_LIST)
g_print("*** press enter to get device list\n");
+ else if (g_menu_state == CURRENT_STATUS_PRINT_DEVICE_LIST)
+ g_print("*** press enter to print device list\n");
else if (g_menu_state == CURRENT_STATUS_FREE_DEVICE_LIST)
g_print("*** press enter to free device list\n");
else if (g_menu_state == CURRENT_STATUS_GET_DEVICE_NEXT)
reset_menu_state();
break;
}
+ case CURRENT_STATUS_PRINT_DEVICE_LIST: {
+ sound_device_list_h device_list;
+ sound_device_h device;
+ int ret = SOUND_MANAGER_ERROR_NONE;
+ int id = -1;
+ char *type;
+ char *name;
+ const char *direc;
+ const char *state;
+ const char *avail_modes;
+ if (!(ret = sound_manager_get_current_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, &direc, &state, &avail_modes);
+ g_print("[ Device #%d %s %s ]\n", id, type, name);
+ g_print(" Direc[ %-4s ] State[ %-12s ] Avail-Modes[ %s ]\n", direc, state, avail_modes);
+ }
+ if ((ret = sound_manager_free_device_list(device_list)))
+ g_print("fail to free device list, ret[0x%x]\n", ret);
+ } else {
+ g_print("fail to get current device list, ret[0x%x]\n", ret);
+ }
+ reset_menu_state();
+ break;
+ }
case CURRENT_STATUS_FREE_DEVICE_LIST: {
int ret = SOUND_MANAGER_ERROR_NONE;
if (!(ret = sound_manager_free_device_list(g_device_list))) {