summaryrefslogtreecommitdiffstats
path: root/apps/recorder
diff options
context:
space:
mode:
Diffstat (limited to 'apps/recorder')
-rw-r--r--apps/recorder/albumart.c80
-rw-r--r--apps/recorder/albumart.h6
-rw-r--r--apps/recorder/keyboard.c4
-rw-r--r--apps/recorder/pcm_record.c7
-rw-r--r--apps/recorder/recording.c2
-rw-r--r--apps/recorder/resize.c2
6 files changed, 15 insertions, 86 deletions
diff --git a/apps/recorder/albumart.c b/apps/recorder/albumart.c
index 9ff9c72f80..c0d9e6d86f 100644
--- a/apps/recorder/albumart.c
+++ b/apps/recorder/albumart.c
@@ -39,6 +39,12 @@
#define USE_JPEG_COVER
#endif
+#ifdef PLUGIN
+ #define strmemccpy strlcpy
+ /* Note we don't use the return value so this works */
+ /* FIXME if strmemccpy gets added to the rb->plugin struct */
+#endif
+
/* Strip filename from a full path
*
* buf - buffer to extract directory to.
@@ -67,7 +73,7 @@ static char* strip_filename(char* buf, int buf_size, const char* fullpath)
}
len = MIN(sep - fullpath + 1, buf_size - 1);
- strlcpy(buf, fullpath, len + 1);
+ strmemccpy(buf, fullpath, len + 1);
return (sep + 1);
}
@@ -266,7 +272,7 @@ bool search_albumart_files(const struct mp3entry *id3, const char *size_string,
if (!found)
return false;
- strlcpy(buf, path, buflen);
+ strmemccpy(buf, path, buflen);
logf("Album art found: %s", path);
return true;
}
@@ -297,74 +303,4 @@ bool find_albumart(const struct mp3entry *id3, char *buf, int buflen,
return search_albumart_files(id3, size_string, buf, buflen);
}
-/* Draw the album art bitmap from the given handle ID onto the given WPS.
- Call with clear = true to clear the bitmap instead of drawing it. */
-void draw_album_art(struct gui_wps *gwps, int handle_id, bool clear)
-{
- if (!gwps || !gwps->data || !gwps->display || handle_id < 0)
- return;
-
- struct wps_data *data = gwps->data;
- struct skin_albumart *aa = SKINOFFSETTOPTR(get_skin_buffer(data), data->albumart);
-
- if (!aa)
- return;
-
- struct bitmap *bmp;
- if (bufgetdata(handle_id, 0, (void *)&bmp) <= 0)
- return;
-
- short x = aa->x;
- short y = aa->y;
- short width = bmp->width;
- short height = bmp->height;
-
- if (aa->width > 0)
- {
- /* Crop if the bitmap is too wide */
- width = MIN(bmp->width, aa->width);
-
- /* Align */
- if (aa->xalign & WPS_ALBUMART_ALIGN_RIGHT)
- x += aa->width - width;
- else if (aa->xalign & WPS_ALBUMART_ALIGN_CENTER)
- x += (aa->width - width) / 2;
- }
-
- if (aa->height > 0)
- {
- /* Crop if the bitmap is too high */
- height = MIN(bmp->height, aa->height);
-
- /* Align */
- if (aa->yalign & WPS_ALBUMART_ALIGN_BOTTOM)
- y += aa->height - height;
- else if (aa->yalign & WPS_ALBUMART_ALIGN_CENTER)
- y += (aa->height - height) / 2;
- }
-
- if (!clear)
- {
- /* Draw the bitmap */
- gwps->display->bitmap_part((fb_data*)bmp->data, 0, 0,
- STRIDE(gwps->display->screen_type,
- bmp->width, bmp->height),
- x, y, width, height);
-#ifdef HAVE_LCD_INVERT
- if (global_settings.invert) {
- gwps->display->set_drawmode(DRMODE_COMPLEMENT);
- gwps->display->fillrect(x, y, width, height);
- gwps->display->set_drawmode(DRMODE_SOLID);
- }
-#endif
- }
- else
- {
- /* Clear the bitmap */
- gwps->display->set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID);
- gwps->display->fillrect(x, y, width, height);
- gwps->display->set_drawmode(DRMODE_SOLID);
- }
-}
-
#endif /* PLUGIN */
diff --git a/apps/recorder/albumart.h b/apps/recorder/albumart.h
index 80cacaf5f0..0d663d3d92 100644
--- a/apps/recorder/albumart.h
+++ b/apps/recorder/albumart.h
@@ -35,12 +35,6 @@
bool find_albumart(const struct mp3entry *id3, char *buf, int buflen,
const struct dim *dim);
-#ifndef PLUGIN
-/* Draw the album art bitmap from the given handle ID onto the given Skin.
- Call with clear = true to clear the bitmap instead of drawing it. */
-void draw_album_art(struct gui_wps *gwps, int handle_id, bool clear);
-#endif
-
bool search_albumart_files(const struct mp3entry *id3, const char *size_string,
char *buf, int buflen);
diff --git a/apps/recorder/keyboard.c b/apps/recorder/keyboard.c
index b6b5affb6a..f64061d303 100644
--- a/apps/recorder/keyboard.c
+++ b/apps/recorder/keyboard.c
@@ -549,8 +549,8 @@ int kbd_input(char* text, int buflen, unsigned short *kbd)
{
/* declare scoped pointers inside screen loops - hide the
declarations from previous block level */
- struct keyboard_parameters *pm = &param[l];
struct screen *sc = &screens[l];
+ pm = &param[l];
sc->clear_display();
kbd_draw_picker(pm, sc, &state);
kbd_draw_edit_line(pm, sc, &state);
@@ -1063,7 +1063,7 @@ static void kbd_draw_edit_line(struct keyboard_parameters *pm,
while (*utf8 && i < pm->max_chars_text)
{
j = utf8seek(utf8, 1);
- strlcpy(outline, utf8, j+1);
+ strmemccpy(outline, utf8, j+1);
sc->getstringsize(outline, &w, NULL);
sc->putsxy(text_margin + i*pm->text_w + (pm->text_w-w)/2,
y, outline);
diff --git a/apps/recorder/pcm_record.c b/apps/recorder/pcm_record.c
index 0f6e8469ec..f7f4c77928 100644
--- a/apps/recorder/pcm_record.c
+++ b/apps/recorder/pcm_record.c
@@ -1352,7 +1352,7 @@ static void mark_stream(const char *path, enum mark_stream_action action)
file->hdr.type = CHUNK_T_STREAM_START;
file->hdr.size = count;
- strlcpy(file->path, path, MAX_PATH);
+ strmemccpy(file->path, path, MAX_PATH);
}
}
@@ -1437,8 +1437,7 @@ static void on_close_recording(void)
audio_set_output_source(AUDIO_SRC_PLAYBACK);
pcm_apply_settings();
- if (pcmrec_handle > 0)
- pcmrec_handle = core_free(pcmrec_handle);
+ pcmrec_handle = core_free(pcmrec_handle);
talk_buffer_set_policy(TALK_BUFFER_DEFAULT);
send_event(RECORDING_EVENT_STOP, NULL);
@@ -1583,7 +1582,7 @@ static void on_record(const char *filename)
/* Copy path and let caller go */
char path[MAX_PATH];
- strlcpy(path, filename, MAX_PATH);
+ strmemccpy(path, filename, MAX_PATH);
queue_reply(&audio_queue, 0);
diff --git a/apps/recorder/recording.c b/apps/recorder/recording.c
index 0a3c7af494..6c52adf5d3 100644
--- a/apps/recorder/recording.c
+++ b/apps/recorder/recording.c
@@ -1265,7 +1265,7 @@ bool recording_screen(bool no_source)
}
/* let list handle the button */
- gui_synclist_do_button(&lists, &button, LIST_WRAP_UNLESS_HELD);
+ gui_synclist_do_button(&lists, &button);
switch(button)
diff --git a/apps/recorder/resize.c b/apps/recorder/resize.c
index 6f561039c3..c16cec9dc9 100644
--- a/apps/recorder/resize.c
+++ b/apps/recorder/resize.c
@@ -593,7 +593,7 @@ static inline bool scale_v_linear(struct rowset *rset,
static void output_row_32_native_fromyuv(uint32_t row, void * row_in,
struct scaler_context *ctx)
{
-#if defined(LCD_STRIDEFORMAT) && LCD_STRIDEFORMAT == VERTICAL_STRIDE
+#if LCD_STRIDEFORMAT == VERTICAL_STRIDE
#define DEST_STEP (ctx->bm->height)
#define Y_STEP (1)
#else