diff options
-rw-r--r-- | Makefile.am | 2 | ||||
-rw-r--r-- | configure.in | 3 | ||||
-rw-r--r-- | deadbeef.h | 1 | ||||
-rw-r--r-- | plugins/ape/Makefile.am | 7 | ||||
-rw-r--r-- | plugins/ape/ape.c | 55 | ||||
-rw-r--r-- | plugins/ape/apewrapper.cpp | 39 | ||||
-rw-r--r-- | plugins/ape/apewrapper.h | 73 | ||||
-rw-r--r-- | web/index.html | 2 |
8 files changed, 179 insertions, 3 deletions
diff --git a/Makefile.am b/Makefile.am index a268aa7e..2b18197c 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,7 +1,7 @@ ## Process this file with automake to produce Makefile.in ACLOCAL_AMFLAGS = -I m4 -SUBDIRS = gme/Game_Music_Emu-0.5.2 gme/Game_Music_Emu-0.5.2/gme sid/sidplay-libs-2.1.0 dumb pixmaps plugins/lastfm +SUBDIRS = gme/Game_Music_Emu-0.5.2 gme/Game_Music_Emu-0.5.2/gme sid/sidplay-libs-2.1.0 dumb pixmaps plugins/lastfm plugins/ape dumbpath=@top_srcdir@/dumb sidpath=@top_srcdir@/sid/sidplay-libs-2.1.0 diff --git a/configure.in b/configure.in index b98b80e4..554ec099 100644 --- a/configure.in +++ b/configure.in @@ -26,7 +26,7 @@ fi CFLAGS="$CFLAGS -D_GNU_SOURCE -O2 -DHAVE_UNIX" CPPFLAGS="$CFLAGS" -PKG_CHECK_MODULES(DEPS, gtk+-2.0 gthread-2.0 glib-2.0 vorbis vorbisfile mad samplerate alsa) +PKG_CHECK_MODULES(DEPS, gtk+-2.0 >= 2.14 gthread-2.0 glib-2.0 vorbis vorbisfile mad samplerate alsa) PKG_CHECK_MODULES(LASTFM_DEPS, libcurl) AX_EXT() @@ -43,5 +43,6 @@ gme/Game_Music_Emu-0.5.2/gme/Makefile sid/sidplay-libs-2.1.0/Makefile dumb/Makefile plugins/lastfm/Makefile +plugins/ape/Makefile ]) @@ -28,6 +28,7 @@ #define __DEADBEEF_H #include <stdint.h> +#include <time.h> #ifdef __cplusplus extern "C" { diff --git a/plugins/ape/Makefile.am b/plugins/ape/Makefile.am new file mode 100644 index 00000000..b7d0b805 --- /dev/null +++ b/plugins/ape/Makefile.am @@ -0,0 +1,7 @@ +apedir = $(libdir)/$(PACKAGE) +pkglib_LTLIBRARIES = ape.la +ape_la_SOURCES = ape.c apewrapper.cpp apewrapper.h +ape_la_LDFLAGS = -module + +ape_la_LIBADD = $(LDADD) $(APE_DEPS_LIBS) -lmac +AM_CFLAGS = $(APE_DEPS_CFLAGS) -std=c99 diff --git a/plugins/ape/ape.c b/plugins/ape/ape.c new file mode 100644 index 00000000..8a84a248 --- /dev/null +++ b/plugins/ape/ape.c @@ -0,0 +1,55 @@ +#include "../../deadbeef.h" + +static DB_decoder_t plugin; +static DB_functions_t *deadbeef; + +int +ape_init (DB_playItem_t *it) { + return 0; +} + +void +ape_free (void) { +} + +int +ape_read (char *buffer, int size) { + return 0; +} + +int +ape_seek (float seconds) { +} + +DB_playItem_t * +ape_insert (DB_playItem_t *after, const char *fname) { +} + +static const char * exts[] = { "ape", NULL }; +static const char *filetypes[] = { "APE", NULL }; + +// define plugin interface +static DB_decoder_t plugin = { + .plugin.version_major = 0, + .plugin.version_minor = 1, + .plugin.type = DB_PLUGIN_DECODER, + .plugin.name = "Monkey's Audio decoder", + .plugin.author = "Alexey Yakovenko", + .plugin.email = "waker@users.sourceforge.net", + .plugin.website = "http://deadbeef.sf.net", + .init = ape_init, + .free = ape_free, + .read_int16 = ape_read, + .seek = ape_seek, + .insert = ape_insert, + .exts = exts, + .id = "stdape", + .filetypes = filetypes +}; + +DB_plugin_t * +oggvorbis_load (DB_functions_t *api) { + deadbeef = api; + return DB_PLUGIN (&plugin); +} + diff --git a/plugins/ape/apewrapper.cpp b/plugins/ape/apewrapper.cpp new file mode 100644 index 00000000..8cb46268 --- /dev/null +++ b/plugins/ape/apewrapper.cpp @@ -0,0 +1,39 @@ +#include <mac/All.h> +#include <mac/GlobalFunctions.h> +#include <mac/MACLib.h> +#include <mac/CharacterHelper.h> +#include <mac/APETag.h> +#include "apewrapper.h" + +void * +ape_decompress_create (const char *fname) { + int ret; + CSmartPtr<wchar_t> str; + str.Assign (GetUTF16FromUTF8 ((const str_utf8 *)fname), TRUE); + IAPEDecompress *dec = CreateIAPEDecompress(str, &ret); + return dec; +} + +void +ape_decompress_destroy (void *d) { + IAPEDecompress *dec = (IAPEDecompress *)d; + delete dec; +} + +int +ape_decompress_info (void *d, int id) { + IAPEDecompress *dec = (IAPEDecompress *)d; + return dec->GetInfo ((APE_DECOMPRESS_FIELDS)id); +} + +int +ape_decompress_getdata (void *d, char *buffer, int nblocks, int *retr) { + IAPEDecompress *dec = (IAPEDecompress *)d; + return dec->GetData (buffer, nblocks, retr); +} + +int +ape_decompress_seek (void *d, int nblockoffs) { + IAPEDecompress *dec = (IAPEDecompress *)d; + return dec->Seek (nblockoffs); +} diff --git a/plugins/ape/apewrapper.h b/plugins/ape/apewrapper.h new file mode 100644 index 00000000..a5675798 --- /dev/null +++ b/plugins/ape/apewrapper.h @@ -0,0 +1,73 @@ +#ifndef __APEWRAPPER_H +#define __APEWRAPPER_H + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef APE_MACLIB_H +enum APE_DECOMPRESS_FIELDS +{ + APE_INFO_FILE_VERSION = 1000, // version of the APE file * 1000 (3.93 = 3930) [ignored, ignored] + APE_INFO_COMPRESSION_LEVEL = 1001, // compression level of the APE file [ignored, ignored] + APE_INFO_FORMAT_FLAGS = 1002, // format flags of the APE file [ignored, ignored] + APE_INFO_SAMPLE_RATE = 1003, // sample rate (Hz) [ignored, ignored] + APE_INFO_BITS_PER_SAMPLE = 1004, // bits per sample [ignored, ignored] + APE_INFO_BYTES_PER_SAMPLE = 1005, // number of bytes per sample [ignored, ignored] + APE_INFO_CHANNELS = 1006, // channels [ignored, ignored] + APE_INFO_BLOCK_ALIGN = 1007, // block alignment [ignored, ignored] + APE_INFO_BLOCKS_PER_FRAME = 1008, // number of blocks in a frame (frames are used internally) [ignored, ignored] + APE_INFO_FINAL_FRAME_BLOCKS = 1009, // blocks in the final frame (frames are used internally) [ignored, ignored] + APE_INFO_TOTAL_FRAMES = 1010, // total number frames (frames are used internally) [ignored, ignored] + APE_INFO_WAV_HEADER_BYTES = 1011, // header bytes of the decompressed WAV [ignored, ignored] + APE_INFO_WAV_TERMINATING_BYTES = 1012, // terminating bytes of the decompressed WAV [ignored, ignored] + APE_INFO_WAV_DATA_BYTES = 1013, // data bytes of the decompressed WAV [ignored, ignored] + APE_INFO_WAV_TOTAL_BYTES = 1014, // total bytes of the decompressed WAV [ignored, ignored] + APE_INFO_APE_TOTAL_BYTES = 1015, // total bytes of the APE file [ignored, ignored] + APE_INFO_TOTAL_BLOCKS = 1016, // total blocks of audio data [ignored, ignored] + APE_INFO_LENGTH_MS = 1017, // length in ms (1 sec = 1000 ms) [ignored, ignored] + APE_INFO_AVERAGE_BITRATE = 1018, // average bitrate of the APE [ignored, ignored] + APE_INFO_FRAME_BITRATE = 1019, // bitrate of specified APE frame [frame index, ignored] + APE_INFO_DECOMPRESSED_BITRATE = 1020, // bitrate of the decompressed WAV [ignored, ignored] + APE_INFO_PEAK_LEVEL = 1021, // peak audio level (obsolete) (-1 is unknown) [ignored, ignored] + APE_INFO_SEEK_BIT = 1022, // bit offset [frame index, ignored] + APE_INFO_SEEK_BYTE = 1023, // byte offset [frame index, ignored] + APE_INFO_WAV_HEADER_DATA = 1024, // error code [buffer *, max bytes] + APE_INFO_WAV_TERMINATING_DATA = 1025, // error code [buffer *, max bytes] + APE_INFO_WAVEFORMATEX = 1026, // error code [waveformatex *, ignored] + APE_INFO_IO_SOURCE = 1027, // I/O source (CIO *) [ignored, ignored] + APE_INFO_FRAME_BYTES = 1028, // bytes (compressed) of the frame [frame index, ignored] + APE_INFO_FRAME_BLOCKS = 1029, // blocks in a given frame [frame index, ignored] + APE_INFO_TAG = 1030, // point to tag (CAPETag *) [ignored, ignored] + + APE_DECOMPRESS_CURRENT_BLOCK = 2000, // current block location [ignored, ignored] + APE_DECOMPRESS_CURRENT_MS = 2001, // current millisecond location [ignored, ignored] + APE_DECOMPRESS_TOTAL_BLOCKS = 2002, // total blocks in the decompressors range [ignored, ignored] + APE_DECOMPRESS_LENGTH_MS = 2003, // total blocks in the decompressors range [ignored, ignored] + APE_DECOMPRESS_CURRENT_BITRATE = 2004, // current bitrate [ignored, ignored] + APE_DECOMPRESS_AVERAGE_BITRATE = 2005, // average bitrate (works with ranges) [ignored, ignored] + + APE_INTERNAL_INFO = 3000 // for internal use -- don't use (returns APE_FILE_INFO *) [ignored, ignored] +}; +#endif + +void * +ape_decompress_create (const char *fname); + +void +ape_decompress_destroy (void *d); + +int +ape_decompress_info (void *d, int id); + +int +ape_decompress_getdata (void *d, char *buffer, int nblocks, int *retr); + +int +ape_decompress_seek (void *d, int nblockoffs); + +#ifdef __cplusplus +} +#endif + +#endif // __APEWRAPPER_H diff --git a/web/index.html b/web/index.html index a60006ba..e0620b8b 100644 --- a/web/index.html +++ b/web/index.html @@ -14,7 +14,7 @@ <h1 id="news">News</h1> -<h2></h2> +<h2>Slackware Packages</h2> <p>2009/08/30</p> <p><a href="mailto:sftp.mtuci@gmail.com">happy user</a> provided packages for Slackware 12.1 and 12.2</p> <p>check <a href="#download">download section</a></p> |