Skip to content

Commit

Permalink
build: Provide an option to disable the idle background loop video
Browse files Browse the repository at this point in the history
  • Loading branch information
Damien Lespiau committed Jun 8, 2011
1 parent ad80334 commit 5f4db71
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 8 deletions.
13 changes: 13 additions & 0 deletions configure.ac
Expand Up @@ -209,6 +209,18 @@ AS_CASE(["$with_online"],
[AC_MSG_ERROR([Unknown argument "$with_online" to --with-online])]
)

# enable idle video
AC_ARG_ENABLE([idle-video],
[AC_HELP_STRING([--enable-idle-video=@<:@no/yes@:>@],
[Play the idle video in the background @<:@default=yes@:>@])],
[],
[enable_idle_video=yes])

AS_IF([test "x$enable_idle_video" = "xyes"],
[AC_DEFINE([ENABLE_IDLE_VIDEO], 1,
[Play the idle video in the background])])
AM_CONDITIONAL([ENABLE_IDLE_VIDEO], [test "x$enable_idle_video" = "xyes"])

# enable strict compiler flags
AC_ARG_ENABLE([maintainer-flags],
[AC_HELP_STRING([--enable-maintainer-flags=@<:@no/yes@:>@],
Expand Down Expand Up @@ -404,5 +416,6 @@ echo " Webremote : ${enable_webremote}"
echo ""
echo " • Extra:"
echo " Enable LIRC support: ${enable_lirc}"
echo " Play the idle video: ${enable_idle_video}"
echo " Media playback : ${with_player}"
echo ""
5 changes: 4 additions & 1 deletion data/Makefile.am
Expand Up @@ -36,11 +36,14 @@ dist_style_DATA = \
style/queue-spinner-highlight.png \
style/scroll-bg.png \
style/scroll-bar.png \
style/background-loop.mkv \
style/thumb-noContent.png \
style/spinner.png \
style.css

if ENABLE_IDLE_VIDEO
dist_style_DATA +=style/background-loop.mkv
endif

shellstyledir = $(pkgdatadir)/shell/style
dist_shellstyle_DATA = \
shell/style.css \
Expand Down
23 changes: 16 additions & 7 deletions mex/mex-player.c
Expand Up @@ -937,8 +937,6 @@ mex_player_set_idle_mode (MexPlayer *player,

if (idle)
{
gchar *tmp;

clutter_actor_hide (priv->controls);
clutter_actor_hide (priv->info_panel);
mx_widget_set_disabled (MX_WIDGET (player), TRUE);
Expand All @@ -950,12 +948,20 @@ mex_player_set_idle_mode (MexPlayer *player,
priv->content = NULL;
}

tmp = g_strconcat ("file://", mex_get_data_dir (),
"/common/style/background-loop.mkv", NULL);
clutter_media_set_uri (priv->media, tmp);
g_free (tmp);
#ifdef ENABLE_IDLE_VIDEO
{
gchar *tmp;

clutter_media_set_playing (priv->media, TRUE);
tmp = g_strconcat ("file://", mex_get_data_dir (),
"/common/style/background-loop.mkv", NULL);
clutter_media_set_uri (priv->media, tmp);
g_free (tmp);

clutter_media_set_playing (priv->media, TRUE);
}
#else
clutter_media_set_uri (priv->media, NULL);
#endif

/* we're idle so we don't mind the screensaver coming on */
mex_screensaver_uninhibit (priv->screensaver);
Expand All @@ -966,8 +972,11 @@ mex_player_set_idle_mode (MexPlayer *player,
clutter_actor_show (priv->info_panel);
mx_widget_set_disabled (MX_WIDGET (player), FALSE);
clutter_actor_set_reactive (CLUTTER_ACTOR (player), TRUE);

#ifdef ENABLE_IDLE_VIDEO
clutter_media_set_playing (priv->media, FALSE);
clutter_media_set_uri (priv->media, NULL);
#endif

/* we're playing real content so don't allow the screensaver */
mex_screensaver_inhibit (priv->screensaver);
Expand Down

0 comments on commit 5f4db71

Please sign in to comment.