diff options
author | Alexey Yakovenko <waker@users.sourceforge.net> | 2014-02-12 11:28:36 +0100 |
---|---|---|
committer | Alexey Yakovenko <waker@users.sourceforge.net> | 2014-02-12 11:28:36 +0100 |
commit | 1c2464304743732edc342f94d227cebfdfb33ed6 (patch) | |
tree | 88643074b6c4a50ae8089aeb5fbdd84c7498e4b4 | |
parent | 32080655635dc0f508272c86d76bee1c07260021 (diff) |
artwork: added configure option to build artwork without network support
-rw-r--r-- | configure.ac | 12 | ||||
-rw-r--r-- | plugins/artwork/Makefile.am | 10 | ||||
-rw-r--r-- | plugins/artwork/artwork.c | 17 |
3 files changed, 34 insertions, 5 deletions
diff --git a/configure.ac b/configure.ac index 7fd7f68c..176c3c04 100644 --- a/configure.ac +++ b/configure.ac @@ -4,7 +4,7 @@ AC_INIT([deadbeef], [devel]) AC_CONFIG_HEADER(config.h) AM_INIT_AUTOMAKE([1.11 dist-bzip2 tar-ustar]) -AM_SILENT_RULES([yes]) +dnl AM_SILENT_RULES([yes]) AM_MAINTAINER_MODE() AC_USE_SYSTEM_EXTENSIONS @@ -87,6 +87,7 @@ AC_ARG_ENABLE(gtk2, [AS_HELP_STRING([--disable-gtk2 ], [build GTK2 versi AC_ARG_ENABLE(vfs_curl, [AS_HELP_STRING([--disable-vfs-curl], [disable HTTP streaming vfs plugin (default: enabled)])], [enable_vfs_curl=$enableval], [enable_vfs_curl=yes]) AC_ARG_ENABLE(lfm, [AS_HELP_STRING([--disable-lfm ], [disable last.fm/libre.fm scrobbler plugin (default: enabled)])], [enable_lfm=$enableval], [enable_lfm=yes]) AC_ARG_ENABLE(artwork, [AS_HELP_STRING([--disable-artwork ], [disable album art loader plugin (default: enabled)])], [enable_artwork=$enableval], [enable_artwork=yes]) +AC_ARG_ENABLE(artwork-network, [AS_HELP_STRING([--disable-artwork-network ], [disable album art network loading support (default: enabled)])], [enable_artwork_network=$enableval], [enable_artwork_network=yes]) AC_ARG_ENABLE(supereq, [AS_HELP_STRING([--disable-supereq ], [disable SuperEQ DSP plugin (default: enabled)])], [enable_supereq=$enableval], [enable_supereq=yes]) AC_ARG_ENABLE(sid, [AS_HELP_STRING([--disable-sid ], [disable commodore64 SID music player plugin (default: enabled)])], [enable_sid=$enableval], [enable_sid=yes]) AC_ARG_ENABLE(mad, [AS_HELP_STRING([--disable-mad ], [disable mpeg (mad) plugin (default: enabled)])], [enable_mpgmad=$enableval], [enable_mpgmad=yes]) @@ -570,8 +571,12 @@ AS_IF([test "${enable_artwork}" != "no"], [ ]) ]) - AS_IF([test "${HAVE_VFS_CURL}" = "yes"], [ - AS_IF([test "${HAVE_JPEG}" = "yes" -o "${HAVE_IMLIB2}" == "yes"], [ + AS_IF([test "${enable_artwork_network}" = "yes"], [ + ARTWORK_USE_VFS_CURL=yes + ]) + + AS_IF([test "${HAVE_VFS_CURL}" = "yes" -o "${enable_artwork_network}" = "no" ], [ + AS_IF([test "${HAVE_JPEG}" = "yes" -o "${HAVE_IMLIB2}" = "yes"], [ HAVE_ARTWORK=yes ]) ]) @@ -732,6 +737,7 @@ AM_CONDITIONAL(HAVE_COREAUDIO, test "x$HAVE_COREAUDIO" = "xyes") AM_CONDITIONAL(HAVE_FFMPEG, test "x$HAVE_FFMPEGPLUGIN" = "xyes") AM_CONDITIONAL(HAVE_PULSE, test "x$HAVE_PULSEPLUGIN" = "xyes") AM_CONDITIONAL(HAVE_ARTWORK, test "x$HAVE_ARTWORK" = "xyes") +AM_CONDITIONAL(ARTWORK_USE_VFS_CURL, test "x$ARTWORK_USE_VFS_CURL" = "xyes") AM_CONDITIONAL(HAVE_ADPLUG, test "x$HAVE_ADPLUG" = "xyes") AM_CONDITIONAL(HAVE_FFAP, test "x$HAVE_FFAP" = "xyes") AM_CONDITIONAL(HAVE_SID, test "x$HAVE_SID" = "xyes") diff --git a/plugins/artwork/Makefile.am b/plugins/artwork/Makefile.am index d0f54a57..9fb8bea8 100644 --- a/plugins/artwork/Makefile.am +++ b/plugins/artwork/Makefile.am @@ -1,7 +1,13 @@ if HAVE_ARTWORK artworkdir = $(libdir)/$(PACKAGE) pkglib_LTLIBRARIES = artwork.la -artwork_la_SOURCES = artwork.c artwork.h albumartorg.c albumartorg.h lastfm.c lastfm.h wos.c wos.h escape.c escape.h + +if ARTWORK_USE_VFS_CURL +artwork_net_cflags = -DUSE_VFS_CURL +artwork_net_sources = albumartorg.c albumartorg.h lastfm.c lastfm.h wos.c wos.h escape.c escape.h +endif + +artwork_la_SOURCES = artwork.c artwork.h $(artwork_net_sources) artwork_la_LDFLAGS = -module -avoid-version @@ -18,6 +24,6 @@ FLAC_DEPS=$(FLAC_LIBS) flac_clags=-DUSE_METAFLAC $(FLAC_CFLAGS) endif -AM_CFLAGS = $(CFLAGS) $(ARTWORK_CFLAGS) $(flac_cflags) -std=c99 +AM_CFLAGS = $(CFLAGS) $(ARTWORK_CFLAGS) $(flac_cflags) $(artwork_net_cflags) -std=c99 artwork_la_LIBADD = $(LDADD) $(ARTWORK_DEPS) $(FLAC_DEPS) endif diff --git a/plugins/artwork/artwork.c b/plugins/artwork/artwork.c index b503a569..35bcbedb 100644 --- a/plugins/artwork/artwork.c +++ b/plugins/artwork/artwork.c @@ -46,9 +46,11 @@ #include <assert.h> #include "../../deadbeef.h" #include "artwork.h" +#ifdef USE_VFS_CURL #include "lastfm.h" #include "albumartorg.h" #include "wos.h" +#endif #ifdef USE_IMLIB2 #include <Imlib2.h> @@ -109,9 +111,11 @@ static intptr_t tid; static int artwork_enable_embedded; static int artwork_enable_local; +#ifdef USE_VFS_CURL static int artwork_enable_lfm; static int artwork_enable_aao; static int artwork_enable_wos; +#endif static time_t artwork_reset_time; static char artwork_filemask[200]; @@ -1160,6 +1164,7 @@ fetcher_thread (void *none) } } +#ifdef USE_VFS_CURL if (!got_pic) { if (artwork_enable_wos) { @@ -1188,6 +1193,7 @@ fetcher_thread (void *none) got_pic = 1; } } +#endif if (got_pic) { trace ("downloaded art for %s %s\n", param->album, param->artist); @@ -1382,25 +1388,31 @@ static int artwork_configchanged (void) { int new_artwork_enable_embedded = deadbeef->conf_get_int ("artwork.enable_embedded", 1); int new_artwork_enable_local = deadbeef->conf_get_int ("artwork.enable_localfolder", 1); +#ifdef USE_VFS_CURL int new_artwork_enable_lfm = deadbeef->conf_get_int ("artwork.enable_lastfm", 0); int new_artwork_enable_aao = deadbeef->conf_get_int ("artwork.enable_albumartorg", 0); int new_artwork_enable_wos = deadbeef->conf_get_int ("artwork.enable_wos", 0); +#endif char new_artwork_filemask[200]; deadbeef->conf_get_str ("artwork.filemask", DEFAULT_FILEMASK, new_artwork_filemask, sizeof (new_artwork_filemask)); if (new_artwork_enable_embedded != artwork_enable_embedded || new_artwork_enable_local != artwork_enable_local +#ifdef USE_VFS_CURL || new_artwork_enable_lfm != artwork_enable_lfm || new_artwork_enable_aao != artwork_enable_aao || new_artwork_enable_wos != artwork_enable_wos +#endif || strcmp (new_artwork_filemask, artwork_filemask)) { trace ("artwork config changed, invalidating cache...\n"); artwork_enable_embedded = new_artwork_enable_embedded; artwork_enable_local = new_artwork_enable_local; +#ifdef USE_VFS_CURL artwork_enable_lfm = new_artwork_enable_lfm; artwork_enable_aao = new_artwork_enable_aao; artwork_enable_wos = new_artwork_enable_wos; +#endif artwork_reset_time = time (NULL); strcpy (artwork_filemask, new_artwork_filemask); deadbeef->conf_set_int64 ("artwork.cache_reset_time", artwork_reset_time); @@ -1437,8 +1449,11 @@ artwork_plugin_start (void) artwork_enable_embedded = deadbeef->conf_get_int ("artwork.enable_embedded", 1); artwork_enable_local = deadbeef->conf_get_int ("artwork.enable_localfolder", 1); +#ifdef USE_VFS_CURL artwork_enable_lfm = deadbeef->conf_get_int ("artwork.enable_lastfm", 0); artwork_enable_aao = deadbeef->conf_get_int ("artwork.enable_albumartorg", 0); + artwork_enable_wos = deadbeef->conf_get_int ("artwork.enable_wos", 0); +#endif artwork_reset_time = deadbeef->conf_get_int64 ("artwork.cache_reset_time", 0); deadbeef->conf_get_str ("artwork.filemask", DEFAULT_FILEMASK, artwork_filemask, sizeof (artwork_filemask)); @@ -1495,9 +1510,11 @@ static const char settings_dlg[] = "property \"Fetch from embedded tags\" checkbox artwork.enable_embedded 1;\n" "property \"Fetch from local folder\" checkbox artwork.enable_localfolder 1;\n" "property \"Local cover file mask\" entry artwork.filemask \"" DEFAULT_FILEMASK "\";\n" +#ifdef USE_VFS_CURL "property \"Fetch from last.fm\" checkbox artwork.enable_lastfm 0;\n" "property \"Fetch from albumart.org\" checkbox artwork.enable_albumartorg 0;\n" "property \"Fetch from worldofspectrum.org (AY only)\" checkbox artwork.enable_wos 0;\n" +#endif "property \"Scale artwork towards longer side\" checkbox artwork.scale_towards_longer 1;\n" ; |