From: Enlightenment S. <no-...@en...> - 2011-01-26 21:53:04
|
Log: [enjoy] Add fso support, to request CPU resource at startup so mobile doesn't suspend while listening to music Patch by pespin. Author: acidx Date: 2011-01-26 10:15:47 -0800 (Wed, 26 Jan 2011) New Revision: 56308 Trac: http://trac.enlightenment.org/e/changeset/56308 Added: trunk/enjoy/src/bin/fso.c trunk/enjoy/src/bin/fso.h Modified: trunk/enjoy/configure.ac trunk/enjoy/src/bin/Makefile.am trunk/enjoy/src/bin/main.c Modified: trunk/enjoy/configure.ac =================================================================== --- trunk/enjoy/configure.ac 2011-01-26 16:58:36 UTC (rev 56307) +++ trunk/enjoy/configure.ac 2011-01-26 18:15:47 UTC (rev 56308) @@ -111,6 +111,22 @@ AM_CONDITIONAL(BUILD_QUICKLAUNCH, test "x${want_quicklaunch}" = "xyes") +AC_ARG_ENABLE([fso], + [AC_HELP_STRING([--enable-fso], [enable FSO support])], + [ + if test "x${enableval}" = "xyes" ; then + enable_fso="yes" + else + enable_fso="no" + fi + ], + [enable_fso="no"]) + +if test "x$enable_fso" = "xyes" ; then + CFLAGS="$CFLAGS -D_HAVE_FSO_" + AC_SUBST(CFLAGS) +fi + AC_OUTPUT([ Makefile enjoy.spec Modified: trunk/enjoy/src/bin/Makefile.am =================================================================== --- trunk/enjoy/src/bin/Makefile.am 2011-01-26 16:58:36 UTC (rev 56307) +++ trunk/enjoy/src/bin/Makefile.am 2011-01-26 18:15:47 UTC (rev 56308) @@ -18,7 +18,7 @@ endif enjoy_LDADD = @ELEMENTARY_LIBS@ @EMOTION_LIBS@ @LMS_LIBS@ @SQLITE3_LIBS@ @EDBUS_LIBS@ -enjoy_SOURCES = main.c win.c db.c list.c page.c cover.c nowplaying.c libmanager.c mpris.c coverart-lastfm.c +enjoy_SOURCES = main.c win.c db.c list.c page.c cover.c nowplaying.c libmanager.c mpris.c coverart-lastfm.c fso.c if BUILD_QUICKLAUNCH ############################################################################ Modified: trunk/enjoy/src/bin/main.c =================================================================== --- trunk/enjoy/src/bin/main.c 2011-01-26 16:58:36 UTC (rev 56307) +++ trunk/enjoy/src/bin/main.c 2011-01-26 18:15:47 UTC (rev 56308) @@ -6,6 +6,9 @@ #include "private.h" #include "mpris.h" +#ifdef _HAVE_FSO_ + #include "fso.h" +#endif #include <Ecore_Getopt.h> #include <Ecore_File.h> @@ -148,6 +151,12 @@ app.win = win_new(&app); if (!app.win) goto end; + +#ifdef _HAVE_FSO_ + fso_init(); + fso_request_resource("CPU"); +#endif + mpris_init(); cover_init(); elm_run(); @@ -167,6 +176,11 @@ mpris_shutdown(); cover_shutdown(); +#ifdef _HAVE_FSO_ + fso_release_resource("CPU"); + fso_shutdown(); +#endif + return r; } |