/** * Update the tray icon according to the current preferences * and the current audio status. Both can't be separated. * This has to be called each time the preferences are modified. * * @param icon a TrayIcon instance. */ void tray_icon_reload(TrayIcon *icon) { const gchar *card, *channel; gdouble volume; gboolean muted; pixbuf_array_free(icon->pixbufs); icon->pixbufs = pixbuf_array_new(icon->status_icon_size); vol_meter_free(icon->vol_meter); icon->vol_meter = vol_meter_new(); card = audio_get_card(icon->audio); channel = audio_get_channel(icon->audio); volume = audio_get_volume(icon->audio); muted = audio_is_muted(icon->audio); update_status_icon_pixbuf(icon->status_icon, icon->pixbufs, icon->vol_meter, volume, muted); update_status_icon_tooltip(icon->status_icon, card, channel, volume, muted); }
/** * Shows the popup window, and grab the focus. * * @param window a PopupWindow instance. */ void popup_window_show(PopupWindow *window) { GtkWidget *popup_window = window->popup_window; GtkWidget *vol_scale = window->vol_scale; /* Update window elements at first */ update_mute_check(GTK_TOGGLE_BUTTON(window->mute_check), G_CALLBACK(on_mute_check_toggled), window, audio_is_muted(window->audio)); update_volume_slider(window->vol_scale_adj, audio_get_volume(window->audio)); /* Show the window */ gtk_widget_show_now(popup_window); /* Give focus to volume scale */ gtk_widget_grab_focus(vol_scale); /* Grab mouse and keyboard */ grab_devices(popup_window); }
static javacall_result video_get_volume(javacall_handle handle, long* level){ return audio_get_volume(handle, level); }