A modern Music Player Daemon based on Rockbox open source high quality audio player
libadwaita audio rust zig deno mpris rockbox mpd
at master 85 lines 2.4 kB view raw
1/*************************************************************************** 2 * __________ __ ___. 3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___ 4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / 5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < 6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ 7 * \/ \/ \/ \/ \/ 8 * $Id$ 9 * 10 * Copyright (C) 2006 Dave Chapman 11 * 12 * This program is free software; you can redistribute it and/or 13 * modify it under the terms of the GNU General Public License 14 * as published by the Free Software Foundation; either version 2 15 * of the License, or (at your option) any later version. 16 * 17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 18 * KIND, either express or implied. 19 * 20 ****************************************************************************/ 21 22#include <stdio.h> 23#include "config.h" 24#include "lcd.h" 25#ifdef HAVE_REMOTE_LCD 26#include "lcd-remote.h" 27#endif 28#include "backdrop.h" 29 30bool backdrop_load(const char* filename, char *backdrop_buffer) 31{ 32 struct bitmap bm; 33 int ret; 34 35 /* load the image */ 36 bm.data = backdrop_buffer; 37 ret = read_bmp_file(filename, &bm, LCD_BACKDROP_BYTES, 38 FORMAT_NATIVE | FORMAT_DITHER, NULL); 39 40 return ((ret > 0) 41 && (bm.width == LCD_WIDTH) && (bm.height == LCD_HEIGHT)); 42} 43 44 45void backdrop_show(char *backdrop_buffer) 46{ 47 lcd_set_backdrop((fb_data*)backdrop_buffer); 48} 49 50 51#if defined(HAVE_REMOTE_LCD) 52 53#if LCD_REMOTE_DEPTH > 1 54/* api functions */ 55bool remote_backdrop_load(const char *filename, char* backdrop_buffer) 56{ 57 struct bitmap bm; 58 int ret; 59 60 /* load the image */ 61 bm.data = backdrop_buffer; 62 ret = read_bmp_file(filename, &bm, REMOTE_LCD_BACKDROP_BYTES, 63 FORMAT_NATIVE | FORMAT_DITHER | FORMAT_REMOTE, NULL); 64 return ((ret > 0) 65 && (bm.width == LCD_REMOTE_WIDTH) && (bm.height == LCD_REMOTE_HEIGHT)); 66} 67 68void remote_backdrop_show(char *backdrop_buffer) 69{ 70 lcd_remote_set_backdrop((fb_remote_data*)backdrop_buffer); 71} 72 73#else /* needs stubs */ 74 75bool remote_backdrop_load(const char *filename, char* backdrop_buffer) 76{ 77 (void)filename; (void) backdrop_buffer; 78 return false; 79} 80void remote_backdrop_show(char* backdrop_buffer) 81{ 82 (void)backdrop_buffer; 83} 84#endif 85#endif