Пример #1
0
static void
xplayer_screensaver_update_from_state (XplayerObject *xplayer,
				     XplayerScreensaverPlugin *pi)
{
	gboolean lock_screensaver_on_audio, has_video_frames;
	BaconVideoWidget *bvw;

	bvw = BACON_VIDEO_WIDGET (xplayer_get_video_widget ((Xplayer *)(xplayer)));

	lock_screensaver_on_audio = g_settings_get_boolean (pi->priv->settings, "lock-screensaver-on-audio");
	has_video_frames = has_video (bvw);

	if ((xplayer_is_playing (xplayer) != FALSE && has_video_frames) ||
	    (xplayer_is_playing (xplayer) != FALSE && !lock_screensaver_on_audio)) {
		if (pi->priv->inhibit_cookie == 0) {
			GtkWindow *window;

			window = xplayer_get_main_window (xplayer);
			pi->priv->inhibit_cookie = gtk_application_inhibit (GTK_APPLICATION (xplayer),
										window,
										GTK_APPLICATION_INHIBIT_IDLE,
										_("Playing a movie"));
			g_object_unref (window);
		}
	} else {
		if (pi->priv->inhibit_cookie != 0) {
			gtk_application_uninhibit (GTK_APPLICATION (pi->priv->xplayer), pi->priv->inhibit_cookie);
			pi->priv->inhibit_cookie = 0;
		}
	}
}
Пример #2
0
static void
impl_activate (PeasActivatable *plugin)
{
	XplayerScreensaverPlugin *pi = XPLAYER_SCREENSAVER_PLUGIN (plugin);
	XplayerObject *xplayer;

	xplayer = g_object_get_data (G_OBJECT (plugin), "object");
	pi->priv->bvw = BACON_VIDEO_WIDGET (xplayer_get_video_widget (xplayer));

	pi->priv->settings = g_settings_new (XPLAYER_GSETTINGS_SCHEMA);
	g_signal_connect (pi->priv->settings, "changed::lock-screensaver-on-audio", (GCallback) lock_screensaver_on_audio_changed_cb, plugin);

	pi->priv->handler_id_playing = g_signal_connect (G_OBJECT (xplayer),
						   "notify::playing",
						   G_CALLBACK (property_notify_cb),
						   pi);
	pi->priv->handler_id_metadata = g_signal_connect (G_OBJECT (pi->priv->bvw),
						    "got-metadata",
						    G_CALLBACK (got_metadata_cb),
						    pi);

	pi->priv->xplayer = g_object_ref (xplayer);

	/* Force setting the current status */
	xplayer_screensaver_update_from_state (xplayer, pi);
}
static void
xplayer_movie_properties_plugin_file_opened (XplayerObject *xplayer,
					   const char *mrl,
					   XplayerMoviePropertiesPlugin *plugin)
{
	GtkWidget *bvw;

	bvw = xplayer_get_video_widget (xplayer);
	update_properties_from_bvw
		(BACON_VIDEO_WIDGET_PROPERTIES (plugin->priv->props), bvw);
	g_object_unref (bvw);
	gtk_widget_set_sensitive (plugin->priv->props, TRUE);
}
static void
xplayer_movie_properties_plugin_metadata_updated (XplayerObject *xplayer,
						const char *artist, 
						const char *title, 
						const char *album,
						guint track_num,
						XplayerMoviePropertiesPlugin *plugin)
{
	GtkWidget *bvw;

	bvw = xplayer_get_video_widget (xplayer);
	update_properties_from_bvw
		(BACON_VIDEO_WIDGET_PROPERTIES (plugin->priv->props), bvw);
	g_object_unref (bvw);
}
Пример #5
0
static void
impl_activate (PeasActivatable *plugin)
{
	XplayerOntopPlugin *pi = XPLAYER_ONTOP_PLUGIN (plugin);

	pi->priv->xplayer = g_object_get_data (G_OBJECT (plugin), "object");
	pi->priv->window = xplayer_get_main_window (pi->priv->xplayer);
	pi->priv->bvw = BACON_VIDEO_WIDGET (xplayer_get_video_widget (pi->priv->xplayer));

	pi->priv->handler_id = g_signal_connect (G_OBJECT (pi->priv->xplayer),
					   "notify::playing",
					   G_CALLBACK (property_notify_cb),
					   pi);
	pi->priv->handler_id_metadata = g_signal_connect (G_OBJECT (pi->priv->bvw),
						    "got-metadata",
						    G_CALLBACK (got_metadata_cb),
						    pi);

	update_from_state (pi->priv);
}