summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorTeruaki Kawashima <teru@rockbox.org>2010-11-13 14:06:55 +0000
committerTeruaki Kawashima <teru@rockbox.org>2010-11-13 14:06:55 +0000
commit47bbd6a4662d122b00a95bbb7a2e3d80cc45648e (patch)
tree152bc438f75726ee0095320fa4fe5eb3a26f06a8 /apps
parentca494b737e5a1cab03034d262841b774804106a8 (diff)
downloadrockbox-47bbd6a4662d122b00a95bbb7a2e3d80cc45648e.tar.gz
rockbox-47bbd6a4662d122b00a95bbb7a2e3d80cc45648e.tar.bz2
rockbox-47bbd6a4662d122b00a95bbb7a2e3d80cc45648e.zip
rockpaint: disable playback control if the buffer is taken from the audio buffer.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28575 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/plugins/rockpaint.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/apps/plugins/rockpaint.c b/apps/plugins/rockpaint.c
index 4e4791c659..ab1eb5e3db 100644
--- a/apps/plugins/rockpaint.c
+++ b/apps/plugins/rockpaint.c
@@ -418,7 +418,7 @@ struct incdec_ctx incdec_y = { ROWS, { 1, 4}, true };
/* Maximum string size allowed for the text tool */
#define MAX_TEXT 256
-typedef union
+union buf
{
/* Used by fill and gradient algorithms */
struct
@@ -452,9 +452,10 @@ typedef union
int fw_buf[30];
char fontname_buf[30][MAX_PATH];
} text;
-} buf;
+};
-static buf *buffer;
+static union buf *buffer;
+static bool audio_buf = false;
/* Current filename */
static char filename[MAX_PATH];
@@ -2530,7 +2531,10 @@ static void goto_menu(void)
break;
case MAIN_MENU_PLAYBACK_CONTROL:
- playback_control( NULL );
+ if (!audio_buf)
+ playback_control( NULL );
+ else
+ rb->splash(HZ, "Cannot restart playback");
break;
case MAIN_MENU_EXIT:
@@ -2957,19 +2961,20 @@ static int save_bitmap( char *file )
enum plugin_status plugin_start(const void* parameter)
{
size_t buffer_size;
- buffer = (buf*) (((uintptr_t)rb->plugin_get_buffer(&buffer_size) + 3) & ~3);
+ unsigned char *temp;
+ temp = rb->plugin_get_buffer(&buffer_size);
if (buffer_size < sizeof(*buffer) + 3)
{
/* steal from audiobuffer if plugin buffer is too small */
- buffer = (buf*)
- (((uintptr_t)rb->plugin_get_audio_buffer(&buffer_size) + 3) & ~3);
-
+ temp = rb->plugin_get_audio_buffer(&buffer_size);
if (buffer_size < sizeof(*buffer) + 3)
{
rb->splash(HZ, "Not enough memory");
return PLUGIN_ERROR;
}
+ audio_buf = true;
}
+ buffer = (union buf*) (((uintptr_t)temp + 3) & ~3);
rb->lcd_set_foreground(COLOR_WHITE);
rb->lcd_set_backdrop(NULL);