2005-11-17 20:20:01 +00:00
|
|
|
/***************************************************************************
|
|
|
|
* __________ __ ___.
|
|
|
|
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
|
|
|
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
|
|
|
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
|
|
|
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
|
|
|
* \/ \/ \/ \/ \/
|
|
|
|
* $Id$
|
|
|
|
*
|
2007-04-04 14:41:40 +00:00
|
|
|
* Copyright (C) 2007 Nicolas Pennequin
|
2005-11-17 20:20:01 +00:00
|
|
|
*
|
|
|
|
* All files in this archive are subject to the GNU General Public License.
|
|
|
|
* See the file COPYING in the source tree root for full license agreement.
|
|
|
|
*
|
|
|
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
|
|
|
* KIND, either express or implied.
|
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
#ifndef _WPS_H
|
|
|
|
#define _WPS_H
|
|
|
|
|
|
|
|
#include "screen_access.h"
|
2005-11-20 22:13:52 +00:00
|
|
|
#include "statusbar.h"
|
2005-11-17 20:20:01 +00:00
|
|
|
#include "id3.h"
|
|
|
|
#include "playlist.h"
|
|
|
|
|
|
|
|
/* constants used in line_type and as refresh_mode for wps_refresh */
|
|
|
|
#define WPS_REFRESH_STATIC 1 /* line doesn't change over time */
|
|
|
|
#define WPS_REFRESH_DYNAMIC 2 /* line may change (e.g. time flag) */
|
|
|
|
#define WPS_REFRESH_SCROLL 4 /* line scrolls */
|
|
|
|
#define WPS_REFRESH_PLAYER_PROGRESS 8 /* line contains a progress bar */
|
|
|
|
#define WPS_REFRESH_PEAK_METER 16 /* line contains a peak meter */
|
|
|
|
#define WPS_REFRESH_ALL 0xff /* to refresh all line types */
|
|
|
|
/* to refresh only those lines that change over time */
|
|
|
|
#define WPS_REFRESH_NON_STATIC (WPS_REFRESH_ALL & ~WPS_REFRESH_STATIC & ~WPS_REFRESH_SCROLL)
|
|
|
|
|
|
|
|
/* alignments */
|
|
|
|
#define WPS_ALIGN_RIGHT 32
|
|
|
|
#define WPS_ALIGN_CENTER 64
|
|
|
|
#define WPS_ALIGN_LEFT 128
|
|
|
|
|
2007-11-11 12:29:37 +00:00
|
|
|
#ifdef HAVE_ALBUMART
|
|
|
|
|
|
|
|
/* albumart definitions */
|
|
|
|
#define WPS_ALBUMART_NONE 0 /* WPS does not contain AA tag */
|
|
|
|
#define WPS_ALBUMART_CHECK 1 /* WPS contains AA conditional tag */
|
|
|
|
#define WPS_ALBUMART_LOAD 2 /* WPS contains AA tag */
|
|
|
|
|
|
|
|
#define WPS_ALBUMART_ALIGN_RIGHT WPS_ALIGN_RIGHT /* x align: right */
|
|
|
|
#define WPS_ALBUMART_ALIGN_CENTER WPS_ALIGN_CENTER /* x/y align: center */
|
|
|
|
#define WPS_ALBUMART_ALIGN_LEFT WPS_ALIGN_LEFT /* x align: left */
|
|
|
|
#define WPS_ALBUMART_ALIGN_TOP WPS_ALIGN_RIGHT /* y align: top */
|
|
|
|
#define WPS_ALBUMART_ALIGN_BOTTOM WPS_ALIGN_LEFT /* y align: bottom */
|
|
|
|
#define WPS_ALBUMART_INCREASE 8 /* increase if smaller */
|
|
|
|
#define WPS_ALBUMART_DECREASE 16 /* decrease if larger */
|
|
|
|
|
|
|
|
#endif /* HAVE_ALBUMART */
|
|
|
|
|
2005-11-17 20:20:01 +00:00
|
|
|
/* wps_data*/
|
|
|
|
|
|
|
|
#ifdef HAVE_LCD_BITMAP
|
|
|
|
struct gui_img{
|
2006-01-28 12:12:42 +00:00
|
|
|
struct bitmap bm;
|
2005-11-17 20:20:01 +00:00
|
|
|
int x; /* x-pos */
|
|
|
|
int y; /* y-pos */
|
|
|
|
bool loaded; /* load state */
|
|
|
|
bool display; /* is to be displayed */
|
|
|
|
bool always_display; /* not using the preload/display mechanism */
|
|
|
|
};
|
2006-02-10 13:57:11 +00:00
|
|
|
|
|
|
|
struct prog_img{ /*progressbar image*/
|
|
|
|
struct bitmap bm;
|
|
|
|
bool have_bitmap_pb;
|
|
|
|
};
|
2005-11-17 20:20:01 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
struct align_pos {
|
|
|
|
char* left;
|
|
|
|
char* center;
|
|
|
|
char* right;
|
|
|
|
};
|
|
|
|
|
|
|
|
#ifdef HAVE_LCD_BITMAP
|
2007-04-04 14:41:40 +00:00
|
|
|
|
2005-11-17 20:20:01 +00:00
|
|
|
#define MAX_IMAGES (26*2) /* a-z and A-Z */
|
2006-02-26 18:17:47 +00:00
|
|
|
#define IMG_BUFSIZE ((LCD_HEIGHT*LCD_WIDTH*LCD_DEPTH/8) \
|
|
|
|
+ (2*LCD_HEIGHT*LCD_WIDTH/8))
|
2007-04-08 04:01:06 +00:00
|
|
|
|
|
|
|
#define WPS_MAX_LINES (LCD_HEIGHT/5+1)
|
|
|
|
#define WPS_MAX_SUBLINES (WPS_MAX_LINES*3)
|
|
|
|
#define WPS_MAX_TOKENS 1024
|
|
|
|
#define WPS_MAX_STRINGS 128
|
2007-04-15 02:59:34 +00:00
|
|
|
#define STRING_BUFFER_SIZE 1024
|
2007-04-08 04:01:06 +00:00
|
|
|
#define WPS_MAX_COND_LEVEL 10
|
2007-04-04 14:41:40 +00:00
|
|
|
|
2005-11-17 20:20:01 +00:00
|
|
|
#else
|
2007-04-04 14:41:40 +00:00
|
|
|
|
2007-04-08 04:01:06 +00:00
|
|
|
#define WPS_MAX_LINES 2
|
|
|
|
#define WPS_MAX_SUBLINES 12
|
|
|
|
#define WPS_MAX_TOKENS 64
|
|
|
|
#define WPS_MAX_STRINGS 32
|
|
|
|
#define STRING_BUFFER_SIZE 64
|
|
|
|
#define WPS_MAX_COND_LEVEL 5
|
2007-04-04 14:41:40 +00:00
|
|
|
|
2005-11-17 20:20:01 +00:00
|
|
|
#endif
|
2007-04-04 14:41:40 +00:00
|
|
|
|
2005-11-17 20:20:01 +00:00
|
|
|
#define DEFAULT_SUBLINE_TIME_MULTIPLIER 20 /* (10ths of sec) */
|
|
|
|
#define BASE_SUBLINE_TIME 10 /* base time that multiplier is applied to
|
|
|
|
(1/HZ sec, or 100ths of sec) */
|
|
|
|
#define SUBLINE_RESET -1
|
|
|
|
|
2007-04-04 14:41:40 +00:00
|
|
|
enum wps_token_type {
|
|
|
|
WPS_NO_TOKEN, /* for WPS tags we don't want to save as tokens */
|
|
|
|
WPS_TOKEN_UNKNOWN,
|
|
|
|
|
|
|
|
/* Markers */
|
|
|
|
WPS_TOKEN_CHARACTER,
|
|
|
|
WPS_TOKEN_STRING,
|
|
|
|
|
|
|
|
/* Alignment */
|
|
|
|
WPS_TOKEN_ALIGN_LEFT,
|
|
|
|
WPS_TOKEN_ALIGN_CENTER,
|
|
|
|
WPS_TOKEN_ALIGN_RIGHT,
|
2007-11-14 00:45:04 +00:00
|
|
|
WPS_TOKEN_LEFTMARGIN,
|
2007-04-04 14:41:40 +00:00
|
|
|
|
2007-04-08 04:01:06 +00:00
|
|
|
/* Sublines */
|
2007-04-04 14:41:40 +00:00
|
|
|
WPS_TOKEN_SUBLINE_TIMEOUT,
|
|
|
|
|
|
|
|
/* Battery */
|
|
|
|
WPS_TOKEN_BATTERY_PERCENT,
|
|
|
|
WPS_TOKEN_BATTERY_VOLTS,
|
|
|
|
WPS_TOKEN_BATTERY_TIME,
|
|
|
|
WPS_TOKEN_BATTERY_CHARGER_CONNECTED,
|
|
|
|
WPS_TOKEN_BATTERY_CHARGING,
|
|
|
|
WPS_TOKEN_BATTERY_SLEEPTIME,
|
|
|
|
|
|
|
|
/* Sound */
|
2007-04-04 15:47:51 +00:00
|
|
|
#if (CONFIG_CODEC != MAS3507D)
|
2007-04-04 14:41:40 +00:00
|
|
|
WPS_TOKEN_SOUND_PITCH,
|
2007-04-04 15:47:51 +00:00
|
|
|
#endif
|
|
|
|
#if (CONFIG_CODEC == SWCODEC)
|
2007-04-04 14:41:40 +00:00
|
|
|
WPS_TOKEN_REPLAYGAIN,
|
2007-04-12 16:15:34 +00:00
|
|
|
WPS_TOKEN_CROSSFADE,
|
2007-04-04 14:41:40 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
/* Time */
|
2007-04-10 15:27:52 +00:00
|
|
|
|
|
|
|
/* The begin/end values allow us to know if a token is an RTC one.
|
|
|
|
New RTC tokens should be added between the markers. */
|
|
|
|
|
|
|
|
WPS_TOKENS_RTC_BEGIN, /* just the start marker, not an actual token */
|
|
|
|
|
2007-04-04 14:41:40 +00:00
|
|
|
WPS_TOKEN_RTC_DAY_OF_MONTH,
|
|
|
|
WPS_TOKEN_RTC_DAY_OF_MONTH_BLANK_PADDED,
|
2007-11-27 01:41:59 +00:00
|
|
|
WPS_TOKEN_RTC_12HOUR_CFG,
|
2007-04-04 14:41:40 +00:00
|
|
|
WPS_TOKEN_RTC_HOUR_24_ZERO_PADDED,
|
|
|
|
WPS_TOKEN_RTC_HOUR_24,
|
|
|
|
WPS_TOKEN_RTC_HOUR_12_ZERO_PADDED,
|
|
|
|
WPS_TOKEN_RTC_HOUR_12,
|
|
|
|
WPS_TOKEN_RTC_MONTH,
|
|
|
|
WPS_TOKEN_RTC_MINUTE,
|
|
|
|
WPS_TOKEN_RTC_SECOND,
|
|
|
|
WPS_TOKEN_RTC_YEAR_2_DIGITS,
|
|
|
|
WPS_TOKEN_RTC_YEAR_4_DIGITS,
|
|
|
|
WPS_TOKEN_RTC_AM_PM_UPPER,
|
|
|
|
WPS_TOKEN_RTC_AM_PM_LOWER,
|
|
|
|
WPS_TOKEN_RTC_WEEKDAY_NAME,
|
|
|
|
WPS_TOKEN_RTC_MONTH_NAME,
|
|
|
|
WPS_TOKEN_RTC_DAY_OF_WEEK_START_MON,
|
|
|
|
WPS_TOKEN_RTC_DAY_OF_WEEK_START_SUN,
|
2007-04-10 15:27:52 +00:00
|
|
|
|
|
|
|
WPS_TOKENS_RTC_END, /* just the end marker, not an actual token */
|
2007-04-04 14:41:40 +00:00
|
|
|
|
|
|
|
/* Conditional */
|
|
|
|
WPS_TOKEN_CONDITIONAL,
|
|
|
|
WPS_TOKEN_CONDITIONAL_START,
|
|
|
|
WPS_TOKEN_CONDITIONAL_OPTION,
|
|
|
|
WPS_TOKEN_CONDITIONAL_END,
|
|
|
|
|
|
|
|
/* Database */
|
2007-11-14 22:02:41 +00:00
|
|
|
#ifdef HAVE_TAGCACHE
|
2007-04-04 14:41:40 +00:00
|
|
|
WPS_TOKEN_DATABASE_PLAYCOUNT,
|
|
|
|
WPS_TOKEN_DATABASE_RATING,
|
2007-04-15 15:46:46 +00:00
|
|
|
WPS_TOKEN_DATABASE_AUTOSCORE,
|
2007-11-14 22:02:41 +00:00
|
|
|
#endif
|
2007-04-04 14:41:40 +00:00
|
|
|
|
|
|
|
/* File */
|
|
|
|
WPS_TOKEN_FILE_BITRATE,
|
|
|
|
WPS_TOKEN_FILE_CODEC,
|
|
|
|
WPS_TOKEN_FILE_FREQUENCY,
|
2007-05-21 13:41:43 +00:00
|
|
|
WPS_TOKEN_FILE_FREQUENCY_KHZ,
|
2007-04-04 14:41:40 +00:00
|
|
|
WPS_TOKEN_FILE_NAME,
|
|
|
|
WPS_TOKEN_FILE_NAME_WITH_EXTENSION,
|
|
|
|
WPS_TOKEN_FILE_PATH,
|
|
|
|
WPS_TOKEN_FILE_SIZE,
|
|
|
|
WPS_TOKEN_FILE_VBR,
|
|
|
|
WPS_TOKEN_FILE_DIRECTORY,
|
|
|
|
|
|
|
|
#ifdef HAVE_LCD_BITMAP
|
|
|
|
/* Image */
|
|
|
|
WPS_TOKEN_IMAGE_BACKDROP,
|
|
|
|
WPS_TOKEN_IMAGE_PROGRESS_BAR,
|
|
|
|
WPS_TOKEN_IMAGE_PRELOAD,
|
|
|
|
WPS_TOKEN_IMAGE_PRELOAD_DISPLAY,
|
|
|
|
WPS_TOKEN_IMAGE_DISPLAY,
|
|
|
|
#endif
|
|
|
|
|
2007-11-11 12:29:37 +00:00
|
|
|
#ifdef HAVE_ALBUMART
|
|
|
|
/* Albumart */
|
|
|
|
WPS_TOKEN_ALBUMART_DISPLAY,
|
|
|
|
WPS_TOKEN_ALBUMART_FOUND,
|
|
|
|
#endif
|
|
|
|
|
2007-04-04 14:41:40 +00:00
|
|
|
/* Metadata */
|
|
|
|
WPS_TOKEN_METADATA_ARTIST,
|
|
|
|
WPS_TOKEN_METADATA_COMPOSER,
|
|
|
|
WPS_TOKEN_METADATA_ALBUM_ARTIST,
|
2007-08-08 10:19:56 +00:00
|
|
|
WPS_TOKEN_METADATA_GROUPING,
|
2007-04-04 14:41:40 +00:00
|
|
|
WPS_TOKEN_METADATA_ALBUM,
|
|
|
|
WPS_TOKEN_METADATA_GENRE,
|
2007-08-03 10:00:42 +00:00
|
|
|
WPS_TOKEN_METADATA_DISC_NUMBER,
|
2007-04-04 14:41:40 +00:00
|
|
|
WPS_TOKEN_METADATA_TRACK_NUMBER,
|
|
|
|
WPS_TOKEN_METADATA_TRACK_TITLE,
|
|
|
|
WPS_TOKEN_METADATA_VERSION,
|
|
|
|
WPS_TOKEN_METADATA_YEAR,
|
|
|
|
WPS_TOKEN_METADATA_COMMENT,
|
|
|
|
|
|
|
|
/* Mode */
|
|
|
|
WPS_TOKEN_REPEAT_MODE,
|
|
|
|
WPS_TOKEN_PLAYBACK_STATUS,
|
|
|
|
|
|
|
|
WPS_TOKEN_MAIN_HOLD,
|
2007-06-25 20:54:11 +00:00
|
|
|
|
2007-04-04 14:41:40 +00:00
|
|
|
#ifdef HAS_REMOTE_BUTTON_HOLD
|
|
|
|
WPS_TOKEN_REMOTE_HOLD,
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* Progressbar */
|
|
|
|
WPS_TOKEN_PROGRESSBAR,
|
2007-11-14 22:02:41 +00:00
|
|
|
#ifdef HAVE_LCD_CHARCELLS
|
2007-04-04 14:41:40 +00:00
|
|
|
WPS_TOKEN_PLAYER_PROGRESSBAR,
|
2007-11-14 22:02:41 +00:00
|
|
|
#endif
|
2007-04-04 14:41:40 +00:00
|
|
|
|
|
|
|
#ifdef HAVE_LCD_BITMAP
|
|
|
|
/* Peakmeter */
|
|
|
|
WPS_TOKEN_PEAKMETER,
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* Volume level */
|
|
|
|
WPS_TOKEN_VOLUME,
|
|
|
|
|
|
|
|
/* Current track */
|
2007-07-25 14:14:47 +00:00
|
|
|
WPS_TOKEN_TRACK_ELAPSED_PERCENT,
|
2007-04-04 14:41:40 +00:00
|
|
|
WPS_TOKEN_TRACK_TIME_ELAPSED,
|
|
|
|
WPS_TOKEN_TRACK_TIME_REMAINING,
|
|
|
|
WPS_TOKEN_TRACK_LENGTH,
|
|
|
|
|
|
|
|
/* Playlist */
|
|
|
|
WPS_TOKEN_PLAYLIST_ENTRIES,
|
|
|
|
WPS_TOKEN_PLAYLIST_NAME,
|
|
|
|
WPS_TOKEN_PLAYLIST_POSITION,
|
|
|
|
WPS_TOKEN_PLAYLIST_SHUFFLE,
|
|
|
|
|
|
|
|
#if (CONFIG_LED == LED_VIRTUAL) || defined(HAVE_REMOTE_LCD)
|
|
|
|
/* Virtual LED */
|
|
|
|
WPS_TOKEN_VLED_HDD
|
|
|
|
#endif
|
|
|
|
};
|
|
|
|
|
|
|
|
struct wps_token {
|
|
|
|
enum wps_token_type type;
|
2007-04-08 04:01:06 +00:00
|
|
|
|
|
|
|
/* Whether the tag (e.g. track name or the album) refers the
|
|
|
|
current or the next song (false=current, true=next) */
|
2007-04-04 14:41:40 +00:00
|
|
|
bool next;
|
2007-04-08 04:01:06 +00:00
|
|
|
|
2007-04-04 14:41:40 +00:00
|
|
|
union {
|
|
|
|
char c;
|
|
|
|
unsigned short i;
|
|
|
|
} value;
|
|
|
|
};
|
|
|
|
|
2007-04-08 04:01:06 +00:00
|
|
|
/* Description of a subline on the WPS */
|
|
|
|
struct wps_subline {
|
|
|
|
|
|
|
|
/* Index of the first token for this subline in the token array.
|
|
|
|
Tokens of this subline end where tokens for the next subline
|
|
|
|
begin. */
|
|
|
|
unsigned short first_token_idx;
|
|
|
|
|
|
|
|
/* Bit or'ed WPS_REFRESH_xxx */
|
|
|
|
unsigned char line_type;
|
|
|
|
|
|
|
|
/* How long the subline should be displayed, in 10ths of sec */
|
|
|
|
unsigned char time_mult;
|
|
|
|
};
|
|
|
|
|
|
|
|
/* Description of a line on the WPS. A line is a set of sublines.
|
|
|
|
A subline is displayed for a certain amount of time. After that,
|
|
|
|
the next subline of the line is displayed. And so on. */
|
|
|
|
struct wps_line {
|
|
|
|
|
|
|
|
/* Number of sublines in this line */
|
|
|
|
signed char num_sublines;
|
|
|
|
|
|
|
|
/* Number (0-based) of the subline within this line currently being displayed */
|
|
|
|
signed char curr_subline;
|
|
|
|
|
|
|
|
/* Index of the first subline of this line in the subline array.
|
|
|
|
Sublines for this line end where sublines for the next line begin. */
|
|
|
|
unsigned short first_subline_idx;
|
|
|
|
|
|
|
|
/* When the next subline of this line should be displayed
|
|
|
|
(absolute time value in ticks) */
|
|
|
|
long subline_expire_time;
|
|
|
|
};
|
|
|
|
|
2007-04-04 14:41:40 +00:00
|
|
|
|
2005-11-17 20:20:01 +00:00
|
|
|
/* wps_data
|
2007-04-04 14:41:40 +00:00
|
|
|
this struct holds all necessary data which describes the
|
2005-11-17 20:20:01 +00:00
|
|
|
viewable content of a wps */
|
|
|
|
struct wps_data
|
|
|
|
{
|
|
|
|
#ifdef HAVE_LCD_BITMAP
|
|
|
|
struct gui_img img[MAX_IMAGES];
|
2006-02-10 13:57:11 +00:00
|
|
|
struct prog_img progressbar;
|
2005-11-17 20:20:01 +00:00
|
|
|
unsigned char img_buf[IMG_BUFSIZE];
|
2005-12-07 20:42:06 +00:00
|
|
|
unsigned char* img_buf_ptr;
|
|
|
|
int img_buf_free;
|
2005-11-18 09:03:25 +00:00
|
|
|
bool wps_sb_tag;
|
|
|
|
bool show_sb_on_wps;
|
2007-04-04 14:41:40 +00:00
|
|
|
|
|
|
|
short progress_top;
|
|
|
|
short progress_height;
|
|
|
|
short progress_start;
|
|
|
|
short progress_end;
|
|
|
|
bool peak_meter_enabled;
|
2007-11-11 12:29:37 +00:00
|
|
|
|
|
|
|
#ifdef HAVE_ALBUMART
|
|
|
|
/* Album art support */
|
|
|
|
unsigned char wps_uses_albumart; /* WPS_ALBUMART_NONE, _CHECK, _LOAD */
|
|
|
|
short albumart_x;
|
|
|
|
short albumart_y;
|
|
|
|
unsigned short albumart_xalign; /* WPS_ALBUMART_ALIGN_LEFT, _CENTER, _RIGHT,
|
|
|
|
+ .._INCREASE, + .._DECREASE */
|
|
|
|
unsigned short albumart_yalign; /* WPS_ALBUMART_ALIGN_TOP, _CENTER, _BOTTOM,
|
|
|
|
+ .._INCREASE, + .._DECREASE */
|
|
|
|
short albumart_max_width;
|
|
|
|
short albumart_max_height;
|
2007-11-12 01:31:42 +00:00
|
|
|
|
|
|
|
int albumart_cond_index;
|
2007-11-11 12:29:37 +00:00
|
|
|
#endif
|
|
|
|
|
2007-04-04 14:41:40 +00:00
|
|
|
#else /*HAVE_LCD_CHARCELLS */
|
2007-04-01 17:32:12 +00:00
|
|
|
unsigned short wps_progress_pat[8];
|
2005-11-17 20:20:01 +00:00
|
|
|
bool full_line_progressbar;
|
|
|
|
#endif
|
2007-04-25 13:09:56 +00:00
|
|
|
|
|
|
|
#ifdef HAVE_REMOTE_LCD
|
|
|
|
bool remote_wps;
|
|
|
|
#endif
|
|
|
|
|
2007-04-08 04:01:06 +00:00
|
|
|
/* Number of lines in the WPS. During WPS parsing, this is
|
|
|
|
the index of the line being parsed. */
|
|
|
|
int num_lines;
|
|
|
|
struct wps_line lines[WPS_MAX_LINES];
|
|
|
|
|
|
|
|
/* Total number of sublines in the WPS. During WPS parsing, this is
|
|
|
|
the index of the subline where the parsed tokens are added to. */
|
|
|
|
int num_sublines;
|
|
|
|
struct wps_subline sublines[WPS_MAX_SUBLINES];
|
|
|
|
|
|
|
|
/* Total number of tokens in the WPS. During WPS parsing, this is
|
|
|
|
the index of the token being parsed. */
|
|
|
|
int num_tokens;
|
2007-04-04 14:41:40 +00:00
|
|
|
struct wps_token tokens[WPS_MAX_TOKENS];
|
|
|
|
|
|
|
|
char string_buffer[STRING_BUFFER_SIZE];
|
|
|
|
char *strings[WPS_MAX_STRINGS];
|
2007-04-08 04:01:06 +00:00
|
|
|
int num_strings;
|
2007-04-04 14:41:40 +00:00
|
|
|
|
2005-11-17 20:20:01 +00:00
|
|
|
bool wps_loaded;
|
|
|
|
};
|
|
|
|
|
|
|
|
/* initial setup of wps_data */
|
|
|
|
void wps_data_init(struct wps_data *wps_data);
|
|
|
|
|
|
|
|
/* to setup up the wps-data from a format-buffer (isfile = false)
|
|
|
|
from a (wps-)file (isfile = true)*/
|
2005-11-18 09:03:25 +00:00
|
|
|
bool wps_data_load(struct wps_data *wps_data,
|
|
|
|
const char *buf,
|
2005-12-09 01:11:14 +00:00
|
|
|
bool isfile);
|
2005-11-17 20:20:01 +00:00
|
|
|
|
2007-04-08 04:01:06 +00:00
|
|
|
/* Returns the index of the subline in the subline array
|
|
|
|
line - 0-based line number
|
|
|
|
subline - 0-based subline number within the line
|
|
|
|
*/
|
|
|
|
int wps_subline_index(struct wps_data *wps_data, int line, int subline);
|
|
|
|
|
|
|
|
/* Returns the index of the first subline's token in the token array
|
|
|
|
line - 0-based line number
|
|
|
|
subline - 0-based subline number within the line
|
|
|
|
*/
|
|
|
|
int wps_first_token_index(struct wps_data *data, int line, int subline);
|
|
|
|
|
|
|
|
/* Returns the index of the last subline's token in the token array.
|
|
|
|
line - 0-based line number
|
|
|
|
subline - 0-based subline number within the line
|
|
|
|
*/
|
|
|
|
int wps_last_token_index(struct wps_data *data, int line, int subline);
|
|
|
|
|
2005-11-17 20:20:01 +00:00
|
|
|
/* wps_data end */
|
|
|
|
|
|
|
|
/* wps_state
|
|
|
|
holds the data which belongs to the current played track,
|
|
|
|
the track which will be played afterwards, current path to the track
|
|
|
|
and some status infos */
|
|
|
|
struct wps_state
|
|
|
|
{
|
|
|
|
bool ff_rewind;
|
|
|
|
bool paused;
|
|
|
|
int ff_rewind_count;
|
|
|
|
bool wps_time_countup;
|
|
|
|
struct mp3entry* id3;
|
|
|
|
struct mp3entry* nid3;
|
2007-07-06 22:34:18 +00:00
|
|
|
char current_track_path[MAX_PATH];
|
2005-11-17 20:20:01 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/* change the ff/rew-status
|
2006-04-02 10:41:16 +00:00
|
|
|
if ff_rew = true then we are in skipping mode
|
2005-11-17 20:20:01 +00:00
|
|
|
else we are in normal mode */
|
2006-12-13 11:52:21 +00:00
|
|
|
/* void wps_state_update_ff_rew(bool ff_rew); Currently unused */
|
2005-11-17 20:20:01 +00:00
|
|
|
|
|
|
|
/* change the tag-information of the current played track
|
|
|
|
and the following track */
|
2006-12-13 11:52:21 +00:00
|
|
|
/* void wps_state_update_id3_nid3(struct mp3entry *id3, struct mp3entry *nid3); Currently unused */
|
2005-11-17 20:20:01 +00:00
|
|
|
/* wps_state end*/
|
|
|
|
|
|
|
|
/* gui_wps
|
2007-04-08 04:01:06 +00:00
|
|
|
defines a wps with its data, state,
|
2005-11-17 20:20:01 +00:00
|
|
|
and the screen on which the wps-content should be drawn */
|
|
|
|
struct gui_wps
|
|
|
|
{
|
2007-04-08 04:01:06 +00:00
|
|
|
struct screen *display;
|
2005-11-17 20:20:01 +00:00
|
|
|
struct wps_data *data;
|
|
|
|
struct wps_state *state;
|
2005-11-20 22:13:52 +00:00
|
|
|
struct gui_statusbar *statusbar;
|
2005-11-17 20:20:01 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/* gui_wps end */
|
|
|
|
|
|
|
|
long gui_wps_show(void);
|
|
|
|
|
|
|
|
/* currently only on wps_state is needed */
|
|
|
|
extern struct wps_state wps_state;
|
2005-11-18 09:03:25 +00:00
|
|
|
extern struct gui_wps gui_wps[NB_SCREENS];
|
2005-11-17 20:20:01 +00:00
|
|
|
|
|
|
|
void gui_sync_wps_init(void);
|
|
|
|
void gui_sync_wps_screen_init(void);
|
|
|
|
|
2007-11-11 12:29:37 +00:00
|
|
|
#ifdef HAVE_ALBUMART
|
|
|
|
/* gives back if WPS contains an albumart tag */
|
|
|
|
bool gui_sync_wps_uses_albumart(void);
|
|
|
|
#endif
|
|
|
|
|
2005-11-17 20:20:01 +00:00
|
|
|
#endif
|