void menu_info_subitem_clicked(GtkWidget* item, GdkEvent* event, menu_info_item_t* mii) { #ifdef DEBUG g_message("move %s %s to %s %s", menu_info_type_name(mii->menu_info->parent->menu_info->type), mii->menu_info->parent->desc, menu_info_type_name(mii->menu_info->type), mii->desc); #endif switch(mii->menu_info->type) { case MENU_SERVER: break; case MENU_SINK: pulseaudio_move_input_to_sink(mii->menu_info->parent, mii); break; case MENU_SOURCE: pulseaudio_move_output_to_source(mii->menu_info->parent, mii); break; case MENU_INPUT: case MENU_OUTPUT: break; } }
void menu_info_subitem_clicked(GtkWidget* item, GdkEventButton* event, menu_info_item_t* mii) { g_debug("[menu_info] subitem clicked mod:%s%s button:%i", (event->state & GDK_CONTROL_MASK) ? "[ctrl]" : "", (event->state & GDK_MOD1_MASK) ? "[alt]" : "", event->button); switch(mii->menu_info->type) { case MENU_SERVER: case MENU_INPUT: case MENU_OUTPUT: case MENU_MODULE: break; case MENU_SINK: pulseaudio_move_input_to_sink(mii->menu_info->parent, mii); break; case MENU_SOURCE: pulseaudio_move_output_to_source(mii->menu_info->parent, mii); break; } }
void pulseaudio_move_all(menu_info_item_t* mii) { menu_infos_t* mis = mii->menu_info->menu_infos; menu_type_t target_type = mii->menu_info->type; menu_type_t source_type = (target_type == MENU_SINK) ? MENU_INPUT : MENU_OUTPUT; g_debug("[pulseaudio_action] move all %s to %s %s", menu_info_type_name(source_type), menu_info_type_name(target_type), mii->desc); GHashTableIter iter; gpointer key; gpointer value; g_hash_table_iter_init(&iter, mis->menu_info[MENU_INPUT].items); while (g_hash_table_iter_next(&iter, &key, &value)) { if (target_type == MENU_SINK) pulseaudio_move_input_to_sink(value, mii); else if (target_type == MENU_SOURCE) pulseaudio_move_output_to_source(value, mii); } }