diff options
-rw-r--r-- | apps/plugin.c | 1 | ||||
-rw-r--r-- | apps/plugin.h | 3 | ||||
-rw-r--r-- | apps/plugins/lib/SOURCES | 3 | ||||
-rw-r--r-- | apps/plugins/lib/pluginlib_albumart.c | 27 | ||||
-rw-r--r-- | apps/plugins/lib/wrappers.h | 13 | ||||
-rw-r--r-- | apps/recorder/albumart.c | 2 |
6 files changed, 48 insertions, 1 deletions
diff --git a/apps/plugin.c b/apps/plugin.c index 1e86b4d07e..98bbd2956f 100644 --- a/apps/plugin.c +++ b/apps/plugin.c | |||
@@ -630,6 +630,7 @@ static const struct plugin_api rockbox_api = { | |||
630 | #ifdef CPU_ARM | 630 | #ifdef CPU_ARM |
631 | __div0, | 631 | __div0, |
632 | #endif | 632 | #endif |
633 | strip_extension | ||
633 | }; | 634 | }; |
634 | 635 | ||
635 | int plugin_load(const char* plugin, const void* parameter) | 636 | int plugin_load(const char* plugin, const void* parameter) |
diff --git a/apps/plugin.h b/apps/plugin.h index 472daeafe4..a83a9788e9 100644 --- a/apps/plugin.h +++ b/apps/plugin.h | |||
@@ -126,7 +126,7 @@ void* plugin_get_buffer(size_t *buffer_size); | |||
126 | #define PLUGIN_MAGIC 0x526F634B /* RocK */ | 126 | #define PLUGIN_MAGIC 0x526F634B /* RocK */ |
127 | 127 | ||
128 | /* increase this every time the api struct changes */ | 128 | /* increase this every time the api struct changes */ |
129 | #define PLUGIN_API_VERSION 138 | 129 | #define PLUGIN_API_VERSION 139 |
130 | 130 | ||
131 | /* update this to latest version if a change to the api struct breaks | 131 | /* update this to latest version if a change to the api struct breaks |
132 | backwards compatibility (and please take the opportunity to sort in any | 132 | backwards compatibility (and please take the opportunity to sort in any |
@@ -785,6 +785,7 @@ struct plugin_api { | |||
785 | #ifdef CPU_ARM | 785 | #ifdef CPU_ARM |
786 | void (*__div0)(void); | 786 | void (*__div0)(void); |
787 | #endif | 787 | #endif |
788 | char* (*strip_extension)(char* buffer, int buffer_size, const char *filename); | ||
788 | }; | 789 | }; |
789 | 790 | ||
790 | /* plugin header */ | 791 | /* plugin header */ |
diff --git a/apps/plugins/lib/SOURCES b/apps/plugins/lib/SOURCES index c90613623c..e99a449e98 100644 --- a/apps/plugins/lib/SOURCES +++ b/apps/plugins/lib/SOURCES | |||
@@ -51,4 +51,7 @@ helper.c | |||
51 | #ifdef HAVE_TOUCHSCREEN | 51 | #ifdef HAVE_TOUCHSCREEN |
52 | touchscreen.c | 52 | touchscreen.c |
53 | #endif | 53 | #endif |
54 | #ifndef HAVE_ALBUMART | ||
55 | pluginlib_albumart.c | ||
56 | #endif | ||
54 | md5.c | 57 | md5.c |
diff --git a/apps/plugins/lib/pluginlib_albumart.c b/apps/plugins/lib/pluginlib_albumart.c new file mode 100644 index 0000000000..25c6716097 --- /dev/null +++ b/apps/plugins/lib/pluginlib_albumart.c | |||
@@ -0,0 +1,27 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2009 by Andrew Mahone | ||
11 | * | ||
12 | * This is a wrapper for the core albumart.c | ||
13 | * | ||
14 | * This program is free software; you can redistribute it and/or | ||
15 | * modify it under the terms of the GNU General Public License | ||
16 | * as published by the Free Software Foundation; either version 2 | ||
17 | * of the License, or (at your option) any later version. | ||
18 | * | ||
19 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
20 | * KIND, either express or implied. | ||
21 | * | ||
22 | ****************************************************************************/ | ||
23 | |||
24 | #include <plugin.h> | ||
25 | #include "wrappers.h" | ||
26 | |||
27 | #include "../../recorder/albumart.c" | ||
diff --git a/apps/plugins/lib/wrappers.h b/apps/plugins/lib/wrappers.h index 385cd5d613..bb904ff946 100644 --- a/apps/plugins/lib/wrappers.h +++ b/apps/plugins/lib/wrappers.h | |||
@@ -27,6 +27,9 @@ | |||
27 | #ifndef _LIB_WRAPPERS_H_ | 27 | #ifndef _LIB_WRAPPERS_H_ |
28 | #define _LIB_WRAPPERS_H_ | 28 | #define _LIB_WRAPPERS_H_ |
29 | 29 | ||
30 | #define DEBUG_H | ||
31 | #define __SPRINTF_H__ | ||
32 | |||
30 | #define open rb->open | 33 | #define open rb->open |
31 | #define close rb->close | 34 | #define close rb->close |
32 | #define read rb->read | 35 | #define read rb->read |
@@ -36,6 +39,16 @@ | |||
36 | #define cpu_boost rb->cpu_boost | 39 | #define cpu_boost rb->cpu_boost |
37 | #endif | 40 | #endif |
38 | #define yield rb->yield | 41 | #define yield rb->yield |
42 | #define file_exists rb->file_exists | ||
43 | #define snprintf rb->snprintf | ||
44 | #define strcat rb->strcat | ||
45 | #define strchr rb->strchr | ||
46 | #define strcmp rb->strcmp | ||
47 | #define strcpy rb->strcpy | ||
48 | #define strip_extension rb->strip_extension | ||
49 | #define strlen rb->strlen | ||
50 | #define strncpy rb->strncpy | ||
51 | #define strrchr rb->strrchr | ||
39 | 52 | ||
40 | #endif | 53 | #endif |
41 | 54 | ||
diff --git a/apps/recorder/albumart.c b/apps/recorder/albumart.c index babf63ef1c..e0977f738a 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, | |||
204 | return true; | 204 | return true; |
205 | } | 205 | } |
206 | 206 | ||
207 | #ifdef HAVE_ALBUMART | ||
207 | /* Look for albumart bitmap in the same dir as the track and in its parent dir. | 208 | /* Look for albumart bitmap in the same dir as the track and in its parent dir. |
208 | * Stores the found filename in the buf parameter. | 209 | * Stores the found filename in the buf parameter. |
209 | * Returns true if a bitmap was found, false otherwise */ | 210 | * Returns true if a bitmap was found, false otherwise */ |
@@ -306,3 +307,4 @@ void get_albumart_size(struct bitmap *bmp) | |||
306 | bmp->width = data->albumart_max_width; | 307 | bmp->width = data->albumart_max_width; |
307 | bmp->height = data->albumart_max_height; | 308 | bmp->height = data->albumart_max_height; |
308 | } | 309 | } |
310 | #endif /* HAVE_ALBUMART */ | ||