summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
Diffstat (limited to 'apps')
-rw-r--r--apps/plugin.c1
-rw-r--r--apps/plugin.h3
-rw-r--r--apps/plugins/lib/SOURCES3
-rw-r--r--apps/plugins/lib/pluginlib_albumart.c27
-rw-r--r--apps/plugins/lib/wrappers.h13
-rw-r--r--apps/recorder/albumart.c2
6 files changed, 48 insertions, 1 deletions
diff --git a/apps/plugin.c b/apps/plugin.c
index 1e86b4d..98bbd29 100644
--- a/apps/plugin.c
+++ b/apps/plugin.c
@@ -630,6 +630,7 @@ static const struct plugin_api rockbox_api = {
#ifdef CPU_ARM
__div0,
#endif
+ strip_extension
};
int plugin_load(const char* plugin, const void* parameter)
diff --git a/apps/plugin.h b/apps/plugin.h
index 472daea..a83a978 100644
--- a/apps/plugin.h
+++ b/apps/plugin.h
@@ -126,7 +126,7 @@ void* plugin_get_buffer(size_t *buffer_size);
#define PLUGIN_MAGIC 0x526F634B /* RocK */
/* increase this every time the api struct changes */
-#define PLUGIN_API_VERSION 138
+#define PLUGIN_API_VERSION 139
/* update this to latest version if a change to the api struct breaks
backwards compatibility (and please take the opportunity to sort in any
@@ -785,6 +785,7 @@ struct plugin_api {
#ifdef CPU_ARM
void (*__div0)(void);
#endif
+ char* (*strip_extension)(char* buffer, int buffer_size, const char *filename);
};
/* plugin header */
diff --git a/apps/plugins/lib/SOURCES b/apps/plugins/lib/SOURCES
index c906136..e99a449 100644
--- a/apps/plugins/lib/SOURCES
+++ b/apps/plugins/lib/SOURCES
@@ -51,4 +51,7 @@ helper.c
#ifdef HAVE_TOUCHSCREEN
touchscreen.c
#endif
+#ifndef HAVE_ALBUMART
+pluginlib_albumart.c
+#endif
md5.c
diff --git a/apps/plugins/lib/pluginlib_albumart.c b/apps/plugins/lib/pluginlib_albumart.c
new file mode 100644
index 0000000..25c6716
--- /dev/null
+++ b/apps/plugins/lib/pluginlib_albumart.c
@@ -0,0 +1,27 @@
+/***************************************************************************
+* __________ __ ___.
+* Open \______ \ ____ ____ | | _\_ |__ _______ ___
+* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
+* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
+* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
+* \/ \/ \/ \/ \/
+* $Id$
+*
+* Copyright (C) 2009 by Andrew Mahone
+*
+* This is a wrapper for the core albumart.c
+*
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+*
+* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+* KIND, either express or implied.
+*
+****************************************************************************/
+
+#include <plugin.h>
+#include "wrappers.h"
+
+#include "../../recorder/albumart.c"
diff --git a/apps/plugins/lib/wrappers.h b/apps/plugins/lib/wrappers.h
index 385cd5d..bb904ff 100644
--- a/apps/plugins/lib/wrappers.h
+++ b/apps/plugins/lib/wrappers.h
@@ -27,6 +27,9 @@
#ifndef _LIB_WRAPPERS_H_
#define _LIB_WRAPPERS_H_
+#define DEBUG_H
+#define __SPRINTF_H__
+
#define open rb->open
#define close rb->close
#define read rb->read
@@ -36,6 +39,16 @@
#define cpu_boost rb->cpu_boost
#endif
#define yield rb->yield
+#define file_exists rb->file_exists
+#define snprintf rb->snprintf
+#define strcat rb->strcat
+#define strchr rb->strchr
+#define strcmp rb->strcmp
+#define strcpy rb->strcpy
+#define strip_extension rb->strip_extension
+#define strlen rb->strlen
+#define strncpy rb->strncpy
+#define strrchr rb->strrchr
#endif
diff --git a/apps/recorder/albumart.c b/apps/recorder/albumart.c
index babf63e..e0977f7 100644
--- a/apps/recorder/albumart.c
+++ b/apps/recorder/albumart.c
@@ -204,6 +204,7 @@ bool search_albumart_files(const struct mp3entry *id3, const char *size_string,
return true;
}
+#ifdef HAVE_ALBUMART
/* Look for albumart bitmap in the same dir as the track and in its parent dir.
* Stores the found filename in the buf parameter.
* Returns true if a bitmap was found, false otherwise */
@@ -306,3 +307,4 @@ void get_albumart_size(struct bitmap *bmp)
bmp->width = data->albumart_max_width;
bmp->height = data->albumart_max_height;
}
+#endif /* HAVE_ALBUMART */