示例#1
0
/* Combo box storing ifname and/or MAC */
void
ce_page_setup_device_combo (CEPage *self,
                            GtkComboBox *combo,
                            GType device_type,
                            const char *ifname,
                            const char *mac,
                            const char *mac_property,
                            gboolean ifname_first)
{
	char **iter, *active_item = NULL;
	int i, active_idx = -1;
	char **device_list;
	char *item;

	device_list = _get_device_list (self, device_type, TRUE, mac_property, ifname_first);

	if (ifname && mac)
		item = g_strdup_printf ("%s (%s)", ifname, mac);
	else if (!ifname && !mac)
		item = NULL;
	else
		item = g_strdup (ifname ? ifname : mac);

	for (iter = device_list, i = 0; iter && *iter; iter++, i++) {
		gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), *iter);
		if (_device_entries_match (ifname, mac, *iter)) {
			active_item = *iter;
			active_idx = i;
		}
	}
	_set_active_combo_item (combo, item, active_item, active_idx);

	g_free (item);
	g_strfreev (device_list);
}
示例#2
0
Array AudioDriverCoreAudio::capture_get_device_list() {

	return _get_device_list(true);
}
示例#3
0
Array AudioDriverCoreAudio::get_device_list() {

	return _get_device_list();
}