2006-02-02 20:42:56 +00:00
|
|
|
/***************************************************************************
|
|
|
|
* __________ __ ___.
|
|
|
|
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
|
|
|
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
|
|
|
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
|
|
|
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
|
|
|
* \/ \/ \/ \/ \/
|
|
|
|
* $Id$
|
|
|
|
*
|
|
|
|
* Copyright (C) 2006 Dave Chapman
|
|
|
|
*
|
2008-06-28 18:10:04 +00:00
|
|
|
* 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.
|
2006-02-02 20:42:56 +00:00
|
|
|
*
|
|
|
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
|
|
|
* KIND, either express or implied.
|
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include "config.h"
|
|
|
|
#include "lcd.h"
|
2007-04-25 21:44:56 +00:00
|
|
|
#ifdef HAVE_REMOTE_LCD
|
|
|
|
#include "lcd-remote.h"
|
|
|
|
#endif
|
2006-02-02 20:42:56 +00:00
|
|
|
#include "backdrop.h"
|
|
|
|
|
2010-01-29 07:52:13 +00:00
|
|
|
bool backdrop_load(const char* filename, char *backdrop_buffer)
|
2006-02-02 20:42:56 +00:00
|
|
|
{
|
|
|
|
struct bitmap bm;
|
|
|
|
int ret;
|
|
|
|
|
|
|
|
/* load the image */
|
2010-01-29 07:52:13 +00:00
|
|
|
bm.data = backdrop_buffer;
|
|
|
|
ret = read_bmp_file(filename, &bm, LCD_BACKDROP_BYTES,
|
2008-12-26 07:05:13 +00:00
|
|
|
FORMAT_NATIVE | FORMAT_DITHER, NULL);
|
2006-02-02 20:42:56 +00:00
|
|
|
|
2009-08-06 00:14:40 +00:00
|
|
|
return ((ret > 0)
|
|
|
|
&& (bm.width == LCD_WIDTH) && (bm.height == LCD_HEIGHT));
|
2006-02-02 20:42:56 +00:00
|
|
|
}
|
2010-01-29 07:52:13 +00:00
|
|
|
|
|
|
|
|
|
|
|
void backdrop_show(char *backdrop_buffer)
|
2006-05-21 11:00:02 +00:00
|
|
|
{
|
2010-01-29 07:52:13 +00:00
|
|
|
lcd_set_backdrop((fb_data*)backdrop_buffer);
|
2006-05-21 11:00:02 +00:00
|
|
|
}
|
2010-01-29 07:52:13 +00:00
|
|
|
|
2006-05-21 11:00:02 +00:00
|
|
|
|
2010-01-29 07:52:13 +00:00
|
|
|
#if defined(HAVE_REMOTE_LCD)
|
2007-04-25 21:44:56 +00:00
|
|
|
|
2010-01-29 07:52:13 +00:00
|
|
|
#if LCD_REMOTE_DEPTH > 1
|
2009-08-06 00:14:40 +00:00
|
|
|
/* api functions */
|
2010-01-29 07:52:13 +00:00
|
|
|
bool remote_backdrop_load(const char *filename, char* backdrop_buffer)
|
2007-04-25 21:44:56 +00:00
|
|
|
{
|
|
|
|
struct bitmap bm;
|
|
|
|
int ret;
|
|
|
|
|
|
|
|
/* load the image */
|
2010-01-29 07:52:13 +00:00
|
|
|
bm.data = backdrop_buffer;
|
|
|
|
ret = read_bmp_file(filename, &bm, REMOTE_LCD_BACKDROP_BYTES,
|
2008-12-26 07:05:13 +00:00
|
|
|
FORMAT_NATIVE | FORMAT_DITHER | FORMAT_REMOTE, NULL);
|
2009-08-06 00:14:40 +00:00
|
|
|
return ((ret > 0)
|
2010-01-29 08:39:08 +00:00
|
|
|
&& (bm.width == LCD_REMOTE_WIDTH) && (bm.height == LCD_REMOTE_HEIGHT));
|
2010-01-28 06:54:37 +00:00
|
|
|
}
|
2010-01-29 08:39:08 +00:00
|
|
|
|
|
|
|
void remote_backdrop_show(char *backdrop_buffer)
|
|
|
|
{
|
|
|
|
lcd_remote_set_backdrop((fb_remote_data*)backdrop_buffer);
|
|
|
|
}
|
|
|
|
|
2010-01-29 07:52:13 +00:00
|
|
|
#else /* needs stubs */
|
2010-01-28 06:54:37 +00:00
|
|
|
|
2010-01-29 07:52:13 +00:00
|
|
|
bool remote_backdrop_load(const char *filename, char* backdrop_buffer)
|
2010-01-28 06:54:37 +00:00
|
|
|
{
|
2010-01-29 07:52:13 +00:00
|
|
|
(void)filename; (void) backdrop_buffer;
|
|
|
|
return false;
|
2010-01-28 06:54:37 +00:00
|
|
|
}
|
2010-01-29 07:52:13 +00:00
|
|
|
void remote_backdrop_show(char* backdrop_buffer)
|
2010-01-28 06:54:37 +00:00
|
|
|
{
|
2010-01-29 07:52:13 +00:00
|
|
|
(void)backdrop_buffer;
|
2010-01-28 06:54:37 +00:00
|
|
|
}
|
2007-04-25 21:44:56 +00:00
|
|
|
#endif
|
2010-01-29 07:52:13 +00:00
|
|
|
#endif
|