Пример #1
0
void systray_menu_create(menu_infos_t* mis)
{
    mis->menu = GTK_MENU_SHELL(gtk_menu_new());

    systray_rootmenu_add_submenu(mis, MENU_SERVER, "Default Server", "network-wired");
    systray_rootmenu_add_submenu(mis, MENU_SINK, "Default Sink", "audio-card");
    systray_rootmenu_add_submenu(mis, MENU_SOURCE, "Default Source", "audio-input-microphone");
    systray_rootmenu_add_submenu(mis, MENU_INPUT, "Playback Streams", "player_play");
    systray_rootmenu_add_submenu(mis, MENU_OUTPUT, "Recording Streams", "player_record");
    systray_menu_add_separator(mis->menu);

    static const char* COMMAND_PAMAN = "paman";
    static const char* COMMAND_PAVUCONTROL = "pavucontrol";
    static const char* COMMAND_PAVUMETER = "pavumeter";
    static const char* COMMAND_PAVUMETER_REC = "pavumeter --record";
    static const char* COMMAND_PAPREFS = "paprefs";

    systray_menu_add_application(mis->menu, "_Manager...", NULL, COMMAND_PAMAN);
    systray_menu_add_application(mis->menu, "_Volume Control...", NULL, COMMAND_PAVUCONTROL);
    systray_menu_add_application(mis->menu, "_Volume Meter (Playback)...", NULL, COMMAND_PAVUMETER);
    systray_menu_add_application(mis->menu, "_Volume Meter (Recording)...", NULL, COMMAND_PAVUMETER_REC);
    systray_menu_add_application(mis->menu, "_Configure Local Sound Server...", NULL, COMMAND_PAPREFS);

    /* TODO: settings
    systray_menu_add_separator(mis->menu);
    item = append_menuitem(mis->menu, "_Preferences...", "gtk-preferences");
    g_signal_connect(G_OBJECT(item), "activate", G_CALLBACK(show_preferences), NULL);
    */

    systray_menu_add_separator(mis->menu);
    gtk_menu_shell_append(GTK_MENU_SHELL(mis->menu), systray_menu_item_about());
    gtk_menu_shell_append(GTK_MENU_SHELL(mis->menu), systray_menu_item_quit());
}
Пример #2
0
void systray_menu_create(menu_infos_t* mis)
{
    mis->menu = GTK_MENU_SHELL(gtk_menu_new());

    systray_rootmenu_add_submenu(mis, MENU_SERVER, "Default _Server", "network-server");
    systray_rootmenu_add_submenu(mis, MENU_SINK, "Default S_ink", "audio-card");
    systray_rootmenu_add_submenu(mis, MENU_SOURCE, "Default S_ource", "audio-input-microphone");
    systray_rootmenu_add_submenu(mis, MENU_INPUT, "Playback S_treams", "media-playback-start");
    systray_rootmenu_add_submenu(mis, MENU_OUTPUT, "Recording Stre_ams", "media-record");
    systray_rootmenu_add_submenu(mis, MENU_MODULE, "_Modules", "list-add");
    systray_menu_add_separator(mis->menu);

    systray_menu_add_application(mis->menu, "_Manager...", NULL, COMMAND_PAMAN);
    systray_menu_add_application(mis->menu, "Volume _Control...", NULL, COMMAND_PAVUCONTROL);
    systray_menu_add_application(mis->menu, "Volume Meter (_Playback)...", NULL, COMMAND_PAVUMETER);
    systray_menu_add_application(mis->menu, "Volume Meter (_Recording)...", NULL, COMMAND_PAVUMETER_REC);
    systray_menu_add_application(mis->menu, "Con_figure Local Sound Server...", NULL, COMMAND_PAPREFS);

    /* TODO: settings
    systray_menu_add_separator(mis->menu);
    item = append_menuitem(mis->menu, "_Preferences...", "gtk-preferences");
    g_signal_connect(G_OBJECT(item), "activate", G_CALLBACK(show_preferences), NULL);
    */

    systray_menu_add_separator(mis->menu);

    GtkMenuShell* submenu = GTK_MENU_SHELL(gtk_menu_new());
    GtkWidget* item = systray_add_item(mis->menu, "More...", NULL, NULL);
    gtk_menu_item_set_submenu(GTK_MENU_ITEM(item), GTK_WIDGET(submenu));
    systray_menu_add_action(submenu, "Terminate server", "process-stop",
        G_CALLBACK(pulseaudio_terminate));

    systray_menu_add_action(mis->menu, "About", "help-about", G_CALLBACK(systray_about_dialog));
    systray_menu_add_action(mis->menu, "Quit", "application-exit", G_CALLBACK(quit));
}