static gboolean skins_init (void) { plugin_is_active = TRUE; g_log_set_handler(NULL, G_LOG_LEVEL_WARNING, g_log_default_handler, NULL); skins_init_paths(); skins_cfg_load(); audgui_set_default_icon(); audgui_register_stock_icons(); ui_manager_init(); ui_manager_create_menus(); init_skins(config.skin); mainwin_setup_menus(); if (aud_drct_get_playing ()) { ui_main_evlistener_playback_begin (NULL, NULL); if (aud_drct_get_paused ()) ui_main_evlistener_playback_pause (NULL, NULL); } else mainwin_update_song_info (); update_source = g_timeout_add (250, update_cb, NULL); return TRUE; }
static bool_t play_cb (MprisMediaPlayer2Player * object, GDBusMethodInvocation * call, void * unused) { if (! aud_drct_get_playing () || aud_drct_get_paused ()) aud_drct_play (); mpris_media_player2_player_complete_play (object, call); return TRUE; }
static void update_playback_status (void * data, GObject * object) { const char * status; if (aud_drct_get_playing ()) status = aud_drct_get_paused () ? "Paused" : "Playing"; else status = "Stopped"; g_object_set (object, "playback-status", status, NULL); update (object); }
void osd_setup_buttons (NotifyNotification *notification) { notify_notification_clear_actions (notification); if (! aud_get_bool ("notify", "actions")) return; notify_notification_add_action (notification, "default", _("Show"), NOTIFY_ACTION_CALLBACK (show_cb), NULL, NULL); bool_t playing = aud_drct_get_playing (); bool_t paused = aud_drct_get_paused (); if (playing && ! paused) notify_notification_add_action (notification, "media-playback-pause", _("Pause"), NOTIFY_ACTION_CALLBACK (aud_drct_pause), NULL, NULL); else notify_notification_add_action (notification, "media-playback-start", _("Play"), NOTIFY_ACTION_CALLBACK (aud_drct_play), NULL, NULL); if (playing) notify_notification_add_action (notification, "media-skip-forward", _("Next"), NOTIFY_ACTION_CALLBACK (aud_drct_pl_next), NULL, NULL); }
static void pause_cb (void) { gtk_tool_button_set_stock_id ((GtkToolButton *) button_play, aud_drct_get_paused () ? GTK_STOCK_MEDIA_PLAY : GTK_STOCK_MEDIA_PAUSE); }
static void pause_cb (void) { gtk_tool_button_set_icon_name ((GtkToolButton *) button_play, aud_drct_get_paused () ? "media-playback-start" : "media-playback-pause"); }