diff options
-rw-r--r-- | configure.ac | 34 | ||||
-rw-r--r-- | messagepump.h | 2 | ||||
-rw-r--r-- | playlist.c | 16 | ||||
-rw-r--r-- | plugins/aac/aac.c | 2 | ||||
-rw-r--r-- | plugins/ao/Makefile | 33 | ||||
-rw-r--r-- | plugins/ao/Makefile.am | 27 | ||||
-rw-r--r-- | plugins/ao/main.c | 2 | ||||
-rw-r--r-- | plugins/ao/plugin.c | 2 | ||||
-rw-r--r-- | plugins/artwork/Makefile.am | 9 | ||||
-rw-r--r-- | plugins/artwork/artwork.c | 77 | ||||
-rw-r--r-- | plugins/dumb/Makefile.am (renamed from plugins/dumb/Makefile) | 53 | ||||
-rw-r--r-- | plugins/dumb/cdumb.c | 2 | ||||
-rw-r--r-- | plugins/gme/cgme.c | 28 | ||||
-rw-r--r-- | plugins/mono2stereo/Makefile | 23 | ||||
-rw-r--r-- | plugins/mono2stereo/Makefile.am | 8 | ||||
-rw-r--r-- | plugins/mono2stereo/mono2stereo.c | 2 | ||||
-rw-r--r-- | plugins/pulse/pulse.c | 2 | ||||
-rw-r--r-- | plugins/shn/Makefile | 23 | ||||
-rw-r--r-- | plugins/shn/Makefile.am | 10 | ||||
-rw-r--r-- | plugins/shn/shn.c | 2 | ||||
-rw-r--r-- | plugins/shn/shn.h | 2 | ||||
-rwxr-xr-x | scripts/quickinstall.sh | 8 | ||||
-rw-r--r-- | streamer.c | 24 | ||||
-rw-r--r-- | streamer.h | 3 |
24 files changed, 270 insertions, 124 deletions
diff --git a/configure.ac b/configure.ac index 0acd0c92..0b5d538a 100644 --- a/configure.ac +++ b/configure.ac @@ -105,6 +105,10 @@ AC_ARG_ENABLE(vfs-zip, [AS_HELP_STRING([--enable-vfs-zip ], [build vfs AC_ARG_ENABLE(converter, [AS_HELP_STRING([--enable-converter ], [build converter plugin (default: auto)])], [enable_converter=$enableval], [enable_converter=yes]) AC_ARG_ENABLE(artwork-imlib2, [AS_HELP_STRING([--enable-artwork-imlib2 ], [use imlib2 in artwork plugin (default: auto)])], [enable_artwork_imlib2=$enableval], [enable_artwork_imlib2=yes]) AC_ARG_ENABLE(medialib, [AS_HELP_STRING([--enable-medialib ], [build medialibrary plugin (default: auto)])], [enable_medialib=$enableval], [enable_medialib=yes]) +AC_ARG_ENABLE(dumb, [AS_HELP_STRING([--enable-dumb ], [build DUMB plugin (default: auto)])], [enable_dumb=$enableval], [enable_dumb=yes]) +AC_ARG_ENABLE(shn, [AS_HELP_STRING([--enable-shn ], [build SHN plugin (default: auto)])], [enable_shn=$enableval], [enable_shn=yes]) +AC_ARG_ENABLE(psf, [AS_HELP_STRING([--enable-psf ], [build AOSDK-based PSF(,QSF,SSF,DSF) plugin (default: auto)])], [enable_psf=$enableval], [enable_psf=yes]) +AC_ARG_ENABLE(mono2stereo, [AS_HELP_STRING([--enable-mono2stereo ], [build mono2stereo DSP plugin (default: auto)])], [enable_mono2stereo=$enableval], [enable_mono2stereo=yes]) if test "x$enable_staticlink" != "xno" ; then AC_DEFINE_UNQUOTED([STATICLINK], [1], [Define if building static version]) @@ -552,7 +556,23 @@ if test "x$enable_medialib" != "xno" ; then HAVE_MEDIALIB=yes fi -PLUGINS_DIRS="plugins/lastfm plugins/mpgmad plugins/vorbis plugins/flac plugins/wavpack plugins/sndfile plugins/vfs_curl plugins/cdda plugins/gtkui plugins/alsa plugins/ffmpeg plugins/hotkeys plugins/oss plugins/artwork plugins/adplug plugins/ffap plugins/sid plugins/nullout plugins/supereq plugins/vtx plugins/gme plugins/pulse plugins/notify plugins/musepack plugins/wildmidi plugins/tta plugins/dca plugins/aac plugins/mms plugins/shellexec plugins/dsp_libsrc plugins/m3u plugins/vfs_zip plugins/converter plugins/medialib" +if test "x$enable_dumb" != "xno" ; then + HAVE_DUMB=yes +fi + +if test "x$enable_shn" != "xno" ; then + HAVE_SHN=yes +fi + +if test "x$enable_psf" != "xno" ; then + HAVE_PSF=yes +fi + +if test "x$enable_mono2stereo" != "xno" ; then + HAVE_MONO2STEREO=yes +fi + +PLUGINS_DIRS="plugins/lastfm plugins/mpgmad plugins/vorbis plugins/flac plugins/wavpack plugins/sndfile plugins/vfs_curl plugins/cdda plugins/gtkui plugins/alsa plugins/ffmpeg plugins/hotkeys plugins/oss plugins/artwork plugins/adplug plugins/ffap plugins/sid plugins/nullout plugins/supereq plugins/vtx plugins/gme plugins/pulse plugins/notify plugins/musepack plugins/wildmidi plugins/tta plugins/dca plugins/aac plugins/mms plugins/shellexec plugins/dsp_libsrc plugins/m3u plugins/vfs_zip plugins/converter plugins/dumb plugins/shn plugins/ao plugins/mono2stereo plugins/medialib" AM_CONDITIONAL(HAVE_VORBIS, test "x$HAVE_VORBISPLUGIN" = "xyes") AM_CONDITIONAL(HAVE_FLAC, test "x$HAVE_FLACPLUGIN" = "xyes") @@ -598,6 +618,10 @@ AM_CONDITIONAL(HAVE_JPEG, test "x$HAVE_JPEG" = "xyes") AM_CONDITIONAL(HAVE_PNG, test "x$HAVE_PNG" = "xyes") AM_CONDITIONAL(HAVE_YASM, test "x$HAVE_YASM" = "xyes") AM_CONDITIONAL(HAVE_MEDIALIB, test "x$HAVE_MEDIALIB" = "xyes") +AM_CONDITIONAL(HAVE_DUMB, test "x$HAVE_DUMB" = "xyes") +AM_CONDITIONAL(HAVE_PSF, test "x$HAVE_PSF" = "xyes") +AM_CONDITIONAL(HAVE_SHN, test "x$HAVE_SHN" = "xyes") +AM_CONDITIONAL(HAVE_MONO2STEREO, test "x$HAVE_MONO2STEREO" = "xyes") AC_SUBST(PLUGINS_DIRS) @@ -659,6 +683,10 @@ PRINT_PLUGIN_INFO([m3u],[M3U and PLS playlist support],[test "x$HAVE_M3U" = "xye PRINT_PLUGIN_INFO([vfs_zip],[zip archive support],[test "x$HAVE_VFS_ZIP" = "xyes"]) PRINT_PLUGIN_INFO([converter],[plugin for converting files to any formats],[test "x$HAVE_CONVERTER" = "xyes"]) PRINT_PLUGIN_INFO([medialib],[media library support plugin],[test "x$HAVE_MEDIALIB" = "xyes"]) +PRINT_PLUGIN_INFO([psf],[PSF format plugin, using AOSDK],[test "x$HAVE_PSF" = "xyes"]) +PRINT_PLUGIN_INFO([dumb],[DUMB module plugin, for MOD, S3M, etc],[test "x$HAVE_DUMB" = "xyes"]) +PRINT_PLUGIN_INFO([shn],[SHN plugin based on xmms-shn],[test "x$HAVE_SHN" = "xyes"]) +PRINT_PLUGIN_INFO([mono2stereo],[mono2stereo DSP plugin],[test "x$HAVE_MONO2STEREO" = "xyes"]) echo @@ -701,6 +729,10 @@ plugins/m3u/Makefile plugins/vfs_zip/Makefile plugins/converter/Makefile plugins/medialib/Makefile +plugins/dumb/Makefile +plugins/ao/Makefile +plugins/shn/Makefile +plugins/mono2stereo/Makefile intl/Makefile po/Makefile.in deadbeef.desktop diff --git a/messagepump.h b/messagepump.h index 30f43c5e..b044b72c 100644 --- a/messagepump.h +++ b/messagepump.h @@ -19,7 +19,7 @@ #define __MESSAGEPUMP_H #include <stdint.h> -#include <deadbeef.h> +#include "deadbeef.h" int messagepump_init (void); void messagepump_free (void); @@ -105,7 +105,7 @@ static playlist_t dummy_playlist = { .refc = 1 }; -static int pl_order; // mirrors "playback.order" config variable +static int pl_order = -1; // mirrors "playback.order" config variable static int no_remove_notify; @@ -113,12 +113,16 @@ static playlist_t *addfiles_playlist; // current playlist for adding files/folde void pl_set_order (int order) { - if (pl_order != order || pl_order == PLAYBACK_ORDER_SHUFFLE_TRACKS || pl_order == PLAYBACK_ORDER_SHUFFLE_ALBUMS) { + int prev_order = pl_order; + + if (pl_order != order) { pl_order = order; for (playlist_t *plt = playlists_head; plt; plt = plt->next) { plt_reshuffle (plt, NULL, NULL); } } + + streamer_notify_order_changed (prev_order, pl_order); } int @@ -2724,12 +2728,17 @@ plt_reshuffle (playlist_t *playlist, playItem_t **ppmin, playItem_t **ppmax) { playItem_t *pmin = NULL; playItem_t *pmax = NULL; playItem_t *prev = NULL; + const char *alb = NULL; + const char *art = NULL; for (playItem_t *it = playlist->head[PL_MAIN]; it; it = it->next[PL_MAIN]) { - if (pl_order == PLAYBACK_ORDER_SHUFFLE_ALBUMS && prev && pl_find_meta_raw (prev, "album") == pl_find_meta_raw (it, "album") && pl_find_meta_raw (prev, "artist") == pl_find_meta_raw (it, "artist")) { + if (pl_order == PLAYBACK_ORDER_SHUFFLE_ALBUMS && prev && alb == pl_find_meta_raw (it, "album") && art == pl_find_meta_raw (it, "artist")) { it->shufflerating = prev->shufflerating; } else { + prev = it; it->shufflerating = rand (); + alb = pl_find_meta_raw (it, "album"); + art = pl_find_meta_raw (it, "artist"); } if (!pmin || it->shufflerating < pmin->shufflerating) { pmin = it; @@ -2738,7 +2747,6 @@ plt_reshuffle (playlist_t *playlist, playItem_t **ppmin, playItem_t **ppmax) { pmax = it; } it->played = 0; - prev = it; } if (ppmin) { *ppmin = pmin; diff --git a/plugins/aac/aac.c b/plugins/aac/aac.c index f42b9d2f..db3280dd 100644 --- a/plugins/aac/aac.c +++ b/plugins/aac/aac.c @@ -598,7 +598,7 @@ aac_init (DB_fileinfo_t *_info, DB_playItem_t *it) { return -1; } trace("parse_aac_stream returned %x\n", offs); - deadbeef->pl_replace_meta (it, ":FILETYPE", "AAC"); + deadbeef->pl_replace_meta (it, "!FILETYPE", "AAC"); } if (offs >= 0) { diff --git a/plugins/ao/Makefile b/plugins/ao/Makefile deleted file mode 100644 index d188294d..00000000 --- a/plugins/ao/Makefile +++ /dev/null @@ -1,33 +0,0 @@ -OUT=ddb_aopsf.so - -CC?=gcc - -ZLIB_LIBS?=-lz - -CFLAGS?=-O2 -fomit-frame-pointer -CFLAGS+=-Wall -fPIC -DPATH_MAX=1024 -DHAS_PSXCPU=1 -I../.. -I./ -Ieng_ssf -Ieng_qsf -Ieng_dsf -CFLAGS+=$(STATIC_CFLAGS) - -LDFLAGS+=-module -shared -lm - -SOURCES=plugin.c main.c corlett.c\ -eng_dsf/eng_dsf.c eng_dsf/dc_hw.c eng_dsf/aica.c eng_dsf/aicadsp.c eng_dsf/arm7.c eng_dsf/arm7i.c\ -eng_ssf/m68kcpu.c eng_ssf/m68kopac.c eng_ssf/m68kopdm.c eng_ssf/m68kopnz.c eng_ssf/m68kops.c \ -eng_ssf/scsp.c eng_ssf/scspdsp.c eng_ssf/sat_hw.c eng_ssf/eng_ssf.c\ -eng_qsf/eng_qsf.c eng_qsf/kabuki.c eng_qsf/qsound.c eng_qsf/z80.c eng_qsf/z80dasm.c\ -eng_psf/eng_psf.c eng_psf/psx.c eng_psf/psx_hw.c eng_psf/peops/spu.c \ -eng_psf/eng_psf2.c eng_psf/peops2/spu2.c eng_psf/peops2/dma2.c eng_psf/peops2/registers2.c\ -eng_psf/eng_spu.c - -OBJECTS=$(SOURCES:.c=.o) - -all: $(SOURCES) $(OUT) - -$(OUT): $(OBJECTS) - $(CC) $(LDFLAGS) $(OBJECTS) -o $@ $(ZLIB_LIBS) - -.c.o: - $(CC) $(CFLAGS) $< -c -o $@ - -clean: - rm $(OBJECTS) $(OUT) diff --git a/plugins/ao/Makefile.am b/plugins/ao/Makefile.am new file mode 100644 index 00000000..62df2b2c --- /dev/null +++ b/plugins/ao/Makefile.am @@ -0,0 +1,27 @@ +if HAVE_PSF +aodir = $(libdir)/$(PACKAGE) +pkglib_LTLIBRARIES = ddb_aopsf.la +ddb_aopsf_la_SOURCES = plugin.c main.c corlett.c\ +eng_dsf/eng_dsf.c eng_dsf/dc_hw.c eng_dsf/aica.c eng_dsf/aicadsp.c eng_dsf/arm7.c eng_dsf/arm7i.c\ +eng_ssf/m68kcpu.c eng_ssf/m68kopac.c eng_ssf/m68kopdm.c eng_ssf/m68kopnz.c eng_ssf/m68kops.c \ +eng_ssf/scsp.c eng_ssf/scspdsp.c eng_ssf/sat_hw.c eng_ssf/eng_ssf.c\ +eng_qsf/eng_qsf.c eng_qsf/kabuki.c eng_qsf/qsound.c eng_qsf/z80.c eng_qsf/z80dasm.c\ +eng_psf/eng_psf.c eng_psf/psx.c eng_psf/psx_hw.c eng_psf/peops/spu.c \ +eng_psf/eng_psf2.c eng_psf/peops2/spu2.c eng_psf/peops2/dma2.c eng_psf/peops2/registers2.c\ +eng_psf/eng_spu.c\ +ao.h corlett.h cpuintrf.h eng_protos.h mem.h osd_cpu.h\ +eng_dsf/aicadsp.h eng_dsf/aica.h eng_dsf/arm7.h eng_dsf/arm7i.h eng_dsf/arm7thumb.h eng_dsf/dc_hw.h\ +eng_ssf/m68kconf.h eng_ssf/m68kcpu.h eng_ssf/m68k.h eng_ssf/m68kmame.h eng_ssf/m68kops.h eng_ssf/sat_hw.h eng_ssf/scspdsp.h eng_ssf/scsp.h \ +eng_qsf/qsound.h eng_qsf/z80dasm.h eng_qsf/z80.h\ +eng_psf/cpuintrf.h eng_psf/mamemem.h eng_psf/psx.h\ +eng_psf/peops/adsr.h eng_psf/peops/dma.h eng_psf/peops/externals.h eng_psf/peops/gauss_i.h eng_psf/peops/registers.h eng_psf/peops/regs.h eng_psf/peops/spu.h eng_psf/peops/stdafx.h\ +eng_psf/peops2/adsr.h eng_psf/peops2/dma.h eng_psf/peops2/externals.h eng_psf/peops2/gauss_i.h eng_psf/peops2/psemuxa.h eng_psf/peops2/registers.h eng_psf/peops2/regs.h eng_psf/peops2/reverb.h eng_psf/peops2/spu.h eng_psf/peops2/stdafx.h + +ddb_aopsf_la_LDFLAGS = -module -fPIC + +EXTRA_DIST=eng_psf/peops/reverb.c eng_psf/peops/adsr.c eng_psf/peops/registers.c eng_psf/peops/dma.c eng_psf/peops2/spu2.c eng_psf/peops2/reverb2.c eng_psf/peops2/adsr2.c eng_dsf/arm7memil.c eng_dsf/aicalfo.c eng_ssf/scsplfo.c + +ddb_aopsf_la_LIBADD = $(LDADD) +AM_CFLAGS = $(CFLAGS) -Wall -DPATH_MAX=1024 -DHAS_PSXCPU=1 -I.. -Ieng_ssf -Ieng_qsf -Ieng_dsf -lm $(ZLIB_LIBS) +endif + diff --git a/plugins/ao/main.c b/plugins/ao/main.c index 18067410..a4da36d0 100644 --- a/plugins/ao/main.c +++ b/plugins/ao/main.c @@ -27,7 +27,7 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> -#include <deadbeef/deadbeef.h> +#include "../../deadbeef.h" #include "ao.h" #include "eng_protos.h" diff --git a/plugins/ao/plugin.c b/plugins/ao/plugin.c index 65b3e1c8..dee8c4a6 100644 --- a/plugins/ao/plugin.c +++ b/plugins/ao/plugin.c @@ -18,7 +18,7 @@ */ #include <stdlib.h> #include <string.h> -#include <deadbeef/deadbeef.h> +#include "../../deadbeef.h" #include "ao.h" #include "eng_protos.h" diff --git a/plugins/artwork/Makefile.am b/plugins/artwork/Makefile.am index 53cda944..74155a1c 100644 --- a/plugins/artwork/Makefile.am +++ b/plugins/artwork/Makefile.am @@ -12,6 +12,11 @@ else ARTWORK_DEPS=$(JPEG_DEPS_LIBS) $(PNG_DEPS_LIBS) endif -AM_CFLAGS = $(CFLAGS) $(ARTWORK_CFLAGS) -std=c99 -artwork_la_LIBADD = $(LDADD) $(ARTWORK_DEPS) +if HAVE_FLAC +FLAC_DEPS=$(FLAC_LIBS) +FLAC_CFLAGS=-DUSE_METAFLAC +endif + +AM_CFLAGS = $(CFLAGS) $(ARTWORK_CFLAGS) $(FLAC_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 458737fb..19bc0ede 100644 --- a/plugins/artwork/artwork.c +++ b/plugins/artwork/artwork.c @@ -25,6 +25,10 @@ static uintptr_t imlib_mutex; #include <png.h> #endif +#ifdef USE_METAFLAC +#include <FLAC/metadata.h> +#endif + #define min(x,y) ((x)<(y)?(x):(y)) //#define trace(...) { fprintf(stderr, __VA_ARGS__); } @@ -964,6 +968,79 @@ fetcher_thread (void *none) deadbeef->fclose (fp); } } + +#ifdef USE_METAFLAC + { + // try to load embedded from flac metadata + FLAC__StreamMetadata *meta = NULL; + do { + trace ("trying to load artwork flac metadata for %s\n", param->fname); + + if (!FLAC__metadata_get_picture ( + param->fname, // filename + &meta, // picture + FLAC__STREAM_METADATA_PICTURE_TYPE_FRONT_COVER, // type + NULL, // mime_type + NULL, // description + (unsigned)(-1), // max_width + (unsigned)(-1), // max_height + (unsigned)(-1), // max_depth + (unsigned)(-1) // max_colors + )){ + trace ("%s don't have an embedded cover\n",param->fname); + + if (!FLAC__metadata_get_picture ( + param->fname, // filename + &meta, // picture + -1, // type + NULL, // mime_type + NULL, // description + (unsigned)(-1), // max_width + (unsigned)(-1), // max_height + (unsigned)(-1), // max_depth + (unsigned)(-1) // max_colors + )){ + trace ("%s don't have an embedded album art\n",param->fname); + break; + } + + } + FLAC__StreamMetadata_Picture *pic = &meta->data.picture; + + trace ("found flac cover art of %d bytes (%s)\n", pic->data_length, pic->description); + char tmp_path[1024]; + char cache_path[1024]; + make_cache_path (cache_path, sizeof (cache_path), param->album, param->artist, -1); + trace ("will write flac cover art into %s\n", cache_path); + snprintf (tmp_path, sizeof (tmp_path), "%s.part", cache_path); + FILE *out = fopen (tmp_path, "w+b"); + if (!out) { + trace ("artwork: failed to open %s for writing\n", tmp_path); + break; + } + if (fwrite (pic->data, 1, pic->data_length, out) != pic->data_length) { + trace ("artwork: failed to write flac picture into %s\n", tmp_path); + fclose (out); + unlink (tmp_path); + break; + } + fclose (out); + int err = rename (tmp_path, cache_path); + if (err != 0) { + trace ("Failed not move %s to %s: %s\n", tmp_path, cache_path, strerror (err)); + unlink (tmp_path); + break; + } + unlink (tmp_path); + got_pic = 1; + } while (0); + + if (meta != NULL) { + trace ("release flac metadata block\n"); + FLAC__metadata_object_delete (meta); + } + } +#endif } if (!got_pic && artwork_enable_local) { diff --git a/plugins/dumb/Makefile b/plugins/dumb/Makefile.am index e993012f..38e6d830 100644 --- a/plugins/dumb/Makefile +++ b/plugins/dumb/Makefile.am @@ -1,14 +1,14 @@ -OUT=ddb_dumb.so +if HAVE_DUMB +dumbpath=@top_srcdir@/plugins/dumb/dumb-kode54 -CC?=gcc +EXTRA_DIST = $(dumbpath)/readme.txt $(dumbpath)/ChangeLog $(dumbpath)/licence.txt $(dumbpath)/release.txt $(dumbpath)/todo.txt -dumbpath=dumb-kode54 +pkglib_LTLIBRARIES = ddb_dumb.la -CFLAGS+=-Wall -fPIC -D_GNU_SOURCE -I$(dumbpath)/include -std=c99 +AM_CFLAGS = $(CFLAGS) -I$(dumbpath)/include -std=c99 +ddb_dumb_la_LDFLAGS = -module -lm -LDFLAGS+=-module -shared -lm - -SOURCES=\ +ddb_dumb_la_SOURCES =\ dumb-kode54/src/it/readam.c\ dumb-kode54/src/it/readstm.c\ dumb-kode54/src/it/loads3m.c\ @@ -79,18 +79,29 @@ dumb-kode54/src/helpers/riff.c\ dumb-kode54/src/helpers/memfile.c\ dumb-kode54/src/helpers/sampbuf.c\ dumb-kode54/src/helpers/barray.c\ +dumb-kode54/studio/include/guitop.h\ +dumb-kode54/studio/include/dumbgui.h\ +dumb-kode54/studio/include/options.h\ +dumb-kode54/studio/include/subclip.h\ +dumb-kode54/studio/include/main.h\ +dumb-kode54/studio/include/guiproc.h\ +dumb-kode54/studio/include/dumbmenu.h\ +dumb-kode54/studio/include/dumbdesk.h\ +dumb-kode54/src/tools/it/modulus.h\ +dumb-kode54/include/internal/it.h\ +dumb-kode54/include/internal/dumb.h\ +dumb-kode54/include/internal/barray.h\ +dumb-kode54/include/internal/riff.h\ +dumb-kode54/include/internal/aldumb.h\ +dumb-kode54/include/dumb.h\ +dumb-kode54/include/aldumb.h\ +dumb-kode54/winamp/in_duh.h\ +dumb-kode54/winamp/in2.h\ +dumb-kode54/winamp/resource.h\ +dumb-kode54/winamp/out.h\ +dumb-kode54/winamp/gui.h\ +dumb-kode54/src/helpers/resample.inc\ +dumb-kode54/src/helpers/resamp2.inc\ +dumb-kode54/src/helpers/resamp3.inc\ cdumb.c - -OBJECTS=$(SOURCES:.c=.o) - -all: $(SOURCES) $(OUT) - -$(OUT): $(OBJECTS) - $(CC) $(LDFLAGS) $(OBJECTS) -o $@ - -.c.o: - $(CC) $(CFLAGS) $< -c -o $@ - -clean: - rm $(OBJECTS) $(OUT) - +endif diff --git a/plugins/dumb/cdumb.c b/plugins/dumb/cdumb.c index f947d94a..0ae7f4d4 100644 --- a/plugins/dumb/cdumb.c +++ b/plugins/dumb/cdumb.c @@ -23,7 +23,7 @@ #include <string.h> #include "dumb.h" #include "internal/it.h" -#include <deadbeef/deadbeef.h> +#include "../../deadbeef.h" //#define trace(...) { fprintf(stderr, __VA_ARGS__); } #define trace(fmt,...) diff --git a/plugins/gme/cgme.c b/plugins/gme/cgme.c index 6a28a878..e94a4773 100644 --- a/plugins/gme/cgme.c +++ b/plugins/gme/cgme.c @@ -41,6 +41,7 @@ int _Unwind_GetIPInfo; static DB_decoder_t plugin; static DB_functions_t *deadbeef; static int conf_fadeout = 10; +static int conf_loopcount = 2; typedef struct { DB_fileinfo_t info; @@ -322,10 +323,10 @@ cgme_insert (ddb_playlist_t *plt, DB_playItem_t *after, const char *fname) { DB_playItem_t *it = deadbeef->pl_item_alloc_init (fname, plugin.plugin.id); char str[1024]; if (inf->song[0]) { - snprintf (str, 1024, "%d %s - %s", i, inf->game, inf->song); + snprintf (str, sizeof(str), "%d %s - %s", i, inf->game, inf->song); } else { - snprintf (str, 1024, "%d %s - ?", i, inf->game); + snprintf (str, sizeof(str), "%d %s - ?", i, inf->game); } trace ("track subtune %d %s, length=%d\n", i, str, inf->length); deadbeef->pl_set_meta_int (it, ":TRACKNUM", i); @@ -349,9 +350,26 @@ cgme_insert (ddb_playlist_t *plt, DB_playItem_t *after, const char *fname) { char trk[10]; snprintf (trk, 10, "%d", i+1); cgme_add_meta (it, "track", trk); + snprintf (str, sizeof(str), "%d", inf->length); + deadbeef->pl_add_meta (it, ":GME_LENGTH", str); + snprintf (str, sizeof(str), "%d", inf->intro_length); + deadbeef->pl_add_meta (it, ":GME_INTRO_LENGTH", str); + snprintf (str, sizeof(str), "%d", inf->loop_length); + deadbeef->pl_add_meta (it, ":GME_LOOP_LENGTH", str); if (inf->length == -1 || inf->length == 0) { - float songlength = deadbeef->conf_get_float ("gme.songlength", 3); - deadbeef->plt_set_item_duration (plt, it, songlength * 60.f); + float songlength; + + if (inf->loop_length > 0 && conf_loopcount > 0) { + songlength = inf->intro_length / 1000.f; + if (songlength < 0) { + songlength = 0; + } + songlength += (inf->loop_length * conf_loopcount) / 1000.f; + } + else { + songlength = deadbeef->conf_get_float ("gme.songlength", 3) * 60.f; + } + deadbeef->plt_set_item_duration (plt, it, songlength); } else { deadbeef->plt_set_item_duration (plt, it, (float)inf->length/1000.f); @@ -425,6 +443,7 @@ cgme_message (uint32_t id, uintptr_t ctx, uint32_t p1, uint32_t p2) { switch (id) { case DB_EV_CONFIGCHANGED: conf_fadeout = deadbeef->conf_get_int ("gme.fadeout", 10); + conf_loopcount = deadbeef->conf_get_int ("gme.loopcount", 2); break; } return 0; @@ -433,6 +452,7 @@ cgme_message (uint32_t id, uintptr_t ctx, uint32_t p1, uint32_t p2) { static const char settings_dlg[] = "property \"Max song length (in minutes)\" entry gme.songlength 3;\n" "property \"Fadeout length (seconds)\" entry gme.fadeout 10;\n" + "property \"Play loops nr. of times (if available)\" entry gme.loopcount 2;\n" ; // define plugin interface diff --git a/plugins/mono2stereo/Makefile b/plugins/mono2stereo/Makefile deleted file mode 100644 index 0dceaa3a..00000000 --- a/plugins/mono2stereo/Makefile +++ /dev/null @@ -1,23 +0,0 @@ -CC?=gcc - -CFLAGS+=-Wall -fPIC -D_GNU_SOURCE -std=c99 - -LDFLAGS+=-module -shared -lm - -SOURCES=mono2stereo.c - -OBJECTS=$(SOURCES:.c=.o) - -OUT?=ddb_mono2stereo.so - -all: $(SOURCES) $(OUT) - -$(OUT): $(OBJECTS) - $(CC) $(LDFLAGS) $(OBJECTS) -o $@ - -.c.o: - $(CC) $(CFLAGS) $< -c -o $@ - -clean: - rm $(OBJECTS) $(OUT) - diff --git a/plugins/mono2stereo/Makefile.am b/plugins/mono2stereo/Makefile.am new file mode 100644 index 00000000..ccbbf846 --- /dev/null +++ b/plugins/mono2stereo/Makefile.am @@ -0,0 +1,8 @@ +if HAVE_MONO2STEREO +pkglib_LTLIBRARIES = ddb_mono2stereo.la +ddb_mono2stereo_la_SOURCES = mono2stereo.c +ddb_mono2stereo_la_LDFLAGS = -module + +ddb_mono2stereo_la_LIBADD = $(LDADD) +AM_CFLAGS = $(CFLAGS) -std=c99 +endif diff --git a/plugins/mono2stereo/mono2stereo.c b/plugins/mono2stereo/mono2stereo.c index 23d0b0d5..66168bed 100644 --- a/plugins/mono2stereo/mono2stereo.c +++ b/plugins/mono2stereo/mono2stereo.c @@ -19,7 +19,7 @@ #include <stdlib.h> #include <string.h> #include <assert.h> -#include <deadbeef/deadbeef.h> +#include "../../deadbeef.h" enum { M2S_PARAM_LEFTMIX, diff --git a/plugins/pulse/pulse.c b/plugins/pulse/pulse.c index 98f446ca..76baf98c 100644 --- a/plugins/pulse/pulse.c +++ b/plugins/pulse/pulse.c @@ -353,7 +353,7 @@ DB_plugin_t * pulse_load(DB_functions_t *api) static const char settings_dlg[] = "property \"PulseAudio server\" entry " CONFSTR_PULSE_SERVERADDR " default;\n" - "property \"Preferred buffer size\" entry " CONFSTR_PULSE_BUFFERSIZE " 4096;\n"; + "property \"Preferred buffer size\" entry " CONFSTR_PULSE_BUFFERSIZE " 8192;\n"; static DB_output_t plugin = { diff --git a/plugins/shn/Makefile b/plugins/shn/Makefile deleted file mode 100644 index d76c8427..00000000 --- a/plugins/shn/Makefile +++ /dev/null @@ -1,23 +0,0 @@ -OUT=ddb_shn.so - -CC?=gcc - -CFLAGS?=-I../.. -CFLAGS+=-Wall -fPIC -std=c99 -D_GNU_SOURCE -DHAVE_CONFIG_H -I. - -LDFLAGS+=-module -shared -lm - -SOURCES=array.c convert.c misc.c output.c seek.c shn.c shorten.c sulawalaw.c vario.c wave.c - -OBJECTS=$(SOURCES:.c=.o) - -all: $(SOURCES) $(OUT) - -$(OUT): $(OBJECTS) - $(CC) $(LDFLAGS) $(OBJECTS) -o $@ - -.c.o: - $(CC) $(CFLAGS) $< -c -o $@ - -clean: - rm $(OBJECTS) $(OUT) diff --git a/plugins/shn/Makefile.am b/plugins/shn/Makefile.am new file mode 100644 index 00000000..acc597ef --- /dev/null +++ b/plugins/shn/Makefile.am @@ -0,0 +1,10 @@ +if HAVE_SHN +shndir = $(libdir)/$(PACKAGE) +pkglib_LTLIBRARIES = ddb_shn.la +ddb_shn_la_SOURCES = array.c convert.c misc.c output.c seek.c shn.c shn.h shorten.c shorten.h sulawalaw.c vario.c wave.c bitshift.h + +ddb_shn_la_LDFLAGS = -module + +ddb_shn_la_LIBADD = $(LDADD) -lm +AM_CFLAGS = $(CFLAGS) -std=c99 +endif diff --git a/plugins/shn/shn.c b/plugins/shn/shn.c index 504f283c..c9d4acaf 100644 --- a/plugins/shn/shn.c +++ b/plugins/shn/shn.c @@ -23,7 +23,7 @@ #include <stdlib.h> #include <math.h> #include "shorten.h" -#include <deadbeef/deadbeef.h> +#include "../../deadbeef.h" #include "bitshift.h" //#define trace(...) { fprintf(stderr, __VA_ARGS__); } diff --git a/plugins/shn/shn.h b/plugins/shn/shn.h index e7d3bba8..518334bc 100644 --- a/plugins/shn/shn.h +++ b/plugins/shn/shn.h @@ -28,7 +28,7 @@ #include <stdio.h> #include <unistd.h> #include <sys/stat.h> -#include <deadbeef/deadbeef.h> +#include "../../deadbeef.h" extern DB_functions_t *deadbeef; diff --git a/scripts/quickinstall.sh b/scripts/quickinstall.sh index 61c08cd3..38f1ac7e 100755 --- a/scripts/quickinstall.sh +++ b/scripts/quickinstall.sh @@ -24,7 +24,7 @@ cp ./plugins/pulse/.libs/pulse.so /usr/local/lib/deadbeef/ cp ./plugins/artwork/.libs/artwork.so /usr/local/lib/deadbeef/ cp ./plugins/supereq/.libs/supereq.so /usr/local/lib/deadbeef/ cp ./plugins/gme/.libs/gme.so /usr/local/lib/deadbeef/ -cp ./plugins/dumb/dumb.so /usr/local/lib/deadbeef/ +cp ./plugins/dumb/.libs/ddb_dumb.so /usr/local/lib/deadbeef/ cp ./plugins/notify/.libs/notify.so /usr/local/lib/deadbeef/ cp ./plugins/musepack/.libs/musepack.so /usr/local/lib/deadbeef/ cp ./plugins/wildmidi/.libs/wildmidi.so /usr/local/lib/deadbeef/ @@ -32,8 +32,8 @@ cp ./plugins/tta/.libs/tta.so /usr/local/lib/deadbeef/ cp ./plugins/dca/.libs/dca.so /usr/local/lib/deadbeef/ cp ./plugins/aac/.libs/aac.so /usr/local/lib/deadbeef/ cp ./plugins/mms/.libs/mms.so /usr/local/lib/deadbeef/ -cp ./plugins/shn/shn.so /usr/local/lib/deadbeef/ -cp ./plugins/ao/ao.so /usr/local/lib/deadbeef/ +cp ./plugins/shn/.libs/ddb_shn.so /usr/local/lib/deadbeef/ +cp ./plugins/ao/.libs/ddb_aopsf.so /usr/local/lib/deadbeef/ cp ./plugins/shellexec/.libs/shellexec.so /usr/local/lib/deadbeef/ cp ./plugins/dsp_libsrc/.libs/dsp_libsrc.so /usr/local/lib/deadbeef/ cp ./plugins/m3u/.libs/m3u.so /usr/local/lib/deadbeef/ @@ -43,5 +43,5 @@ cp ./plugins/converter/.libs/converter_gtk2.so /usr/local/lib/deadbeef/ cp ./plugins/converter/.libs/converter_gtk3.so /usr/local/lib/deadbeef/ cp ./plugins/soundtouch/ddb_soundtouch.so /usr/local/lib/deadbeef/ cp ./plugins/vfs_zip/.libs/vfs_zip.so /usr/local/lib/deadbeef/ -cp ./plugins/mono2stereo/mono2stereo.so /usr/local/lib/deadbeef/ cp ./plugins/medialib/.libs/medialib.so /usr/local/lib/deadbeef/ +cp ./plugins/mono2stereo/.libs/ddb_mono2stereo.so /usr/local/lib/deadbeef/ @@ -2243,3 +2243,27 @@ void streamer_get_output_format (ddb_waveformat_t *fmt) { memcpy (fmt, &output_format, sizeof (ddb_waveformat_t)); } + +void +streamer_notify_order_changed (int prev_order, int new_order) { + if (prev_order != PLAYBACK_ORDER_SHUFFLE_ALBUMS && new_order == PLAYBACK_ORDER_SHUFFLE_ALBUMS) { + streamer_lock (); + playItem_t *curr = playing_track; + if (curr) { + + const char *alb = pl_find_meta_raw (curr, "album"); + const char *art = pl_find_meta_raw (curr, "artist"); + playItem_t *next = curr->prev[PL_MAIN]; + while (next) { + if (alb == pl_find_meta_raw (next, "album") && art == pl_find_meta_raw (next, "artist")) { + next->played = 1; + next = next->prev[PL_MAIN]; + } + else { + break; + } + } + } + streamer_unlock (); + } +} @@ -127,4 +127,7 @@ streamer_dsp_postinit (void); int streamer_dsp_chain_save (const char *fname, ddb_dsp_context_t *chain); +void +streamer_notify_order_changed (int prev_order, int new_order); + #endif // __STREAMER_H |