mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-13 18:17:39 -04:00
Fix Database red, move the cuesheet->token code into the skin engine
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27616 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
1de66faa8e
commit
e63e19b507
4 changed files with 41 additions and 41 deletions
|
@ -346,42 +346,6 @@ bool curr_cuesheet_skip(struct cuesheet *cue, int direction, unsigned long curr_
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
const char *get_cuesheetid3_token(struct wps_token *token, struct mp3entry *id3,
|
|
||||||
int offset_tracks, char *buf, int buf_size)
|
|
||||||
{
|
|
||||||
struct cuesheet *cue = id3?id3->cuesheet:NULL;
|
|
||||||
if (!cue || !cue->curr_track)
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
struct cue_track_info *track = cue->curr_track;
|
|
||||||
if (offset_tracks)
|
|
||||||
{
|
|
||||||
if (cue->curr_track_idx+offset_tracks < cue->track_count)
|
|
||||||
track+=offset_tracks;
|
|
||||||
else
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
switch (token->type)
|
|
||||||
{
|
|
||||||
case SKIN_TOKEN_METADATA_ARTIST:
|
|
||||||
return *track->performer ? track->performer : NULL;
|
|
||||||
case SKIN_TOKEN_METADATA_COMPOSER:
|
|
||||||
return *track->songwriter ? track->songwriter : NULL;
|
|
||||||
case SKIN_TOKEN_METADATA_ALBUM:
|
|
||||||
return *cue->title ? cue->title : NULL;
|
|
||||||
case SKIN_TOKEN_METADATA_ALBUM_ARTIST:
|
|
||||||
return *cue->performer ? cue->performer : NULL;
|
|
||||||
case SKIN_TOKEN_METADATA_TRACK_TITLE:
|
|
||||||
return *track->title ? track->title : NULL;
|
|
||||||
case SKIN_TOKEN_METADATA_TRACK_NUMBER:
|
|
||||||
snprintf(buf, buf_size, "%d/%d",
|
|
||||||
cue->curr_track_idx+offset_tracks+1, cue->track_count);
|
|
||||||
return buf;
|
|
||||||
default:
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef HAVE_LCD_BITMAP
|
#ifdef HAVE_LCD_BITMAP
|
||||||
static inline void draw_veritcal_line_mark(struct screen * screen,
|
static inline void draw_veritcal_line_mark(struct screen * screen,
|
||||||
|
|
|
@ -26,7 +26,6 @@
|
||||||
#include "screens.h"
|
#include "screens.h"
|
||||||
#include "file.h"
|
#include "file.h"
|
||||||
#include "metadata.h"
|
#include "metadata.h"
|
||||||
#include "skin_engine/skin_tokens.h"
|
|
||||||
|
|
||||||
#define MAX_NAME 80 /* Max length of information strings */
|
#define MAX_NAME 80 /* Max length of information strings */
|
||||||
#define MAX_TRACKS 99 /* Max number of tracks in a cuesheet */
|
#define MAX_TRACKS 99 /* Max number of tracks in a cuesheet */
|
||||||
|
@ -70,10 +69,6 @@ bool display_cuesheet_content(char* filename);
|
||||||
/* finds the index of the current track played within a cuesheet */
|
/* finds the index of the current track played within a cuesheet */
|
||||||
int cue_find_current_track(struct cuesheet *cue, unsigned long curpos);
|
int cue_find_current_track(struct cuesheet *cue, unsigned long curpos);
|
||||||
|
|
||||||
/* Get the id3 fields from the cuesheet */
|
|
||||||
const char *get_cuesheetid3_token(struct wps_token *token, struct mp3entry *id3,
|
|
||||||
int offset_tracks, char *buf, int buf_size);
|
|
||||||
|
|
||||||
/* skip to next track in the cuesheet towards "direction" (which is 1 or -1) */
|
/* skip to next track in the cuesheet towards "direction" (which is 1 or -1) */
|
||||||
bool curr_cuesheet_skip(struct cuesheet *cue, int direction, unsigned long curr_pos);
|
bool curr_cuesheet_skip(struct cuesheet *cue, int direction, unsigned long curr_pos);
|
||||||
|
|
||||||
|
|
|
@ -155,6 +155,42 @@ static int pitch_speed_enum(int range, int32_t val, int32_t normval)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
const char *get_cuesheetid3_token(struct wps_token *token, struct mp3entry *id3,
|
||||||
|
int offset_tracks, char *buf, int buf_size)
|
||||||
|
{
|
||||||
|
struct cuesheet *cue = id3?id3->cuesheet:NULL;
|
||||||
|
if (!cue || !cue->curr_track)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
struct cue_track_info *track = cue->curr_track;
|
||||||
|
if (offset_tracks)
|
||||||
|
{
|
||||||
|
if (cue->curr_track_idx+offset_tracks < cue->track_count)
|
||||||
|
track+=offset_tracks;
|
||||||
|
else
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
switch (token->type)
|
||||||
|
{
|
||||||
|
case SKIN_TOKEN_METADATA_ARTIST:
|
||||||
|
return *track->performer ? track->performer : NULL;
|
||||||
|
case SKIN_TOKEN_METADATA_COMPOSER:
|
||||||
|
return *track->songwriter ? track->songwriter : NULL;
|
||||||
|
case SKIN_TOKEN_METADATA_ALBUM:
|
||||||
|
return *cue->title ? cue->title : NULL;
|
||||||
|
case SKIN_TOKEN_METADATA_ALBUM_ARTIST:
|
||||||
|
return *cue->performer ? cue->performer : NULL;
|
||||||
|
case SKIN_TOKEN_METADATA_TRACK_TITLE:
|
||||||
|
return *track->title ? track->title : NULL;
|
||||||
|
case SKIN_TOKEN_METADATA_TRACK_NUMBER:
|
||||||
|
snprintf(buf, buf_size, "%d/%d",
|
||||||
|
cue->curr_track_idx+offset_tracks+1, cue->track_count);
|
||||||
|
return buf;
|
||||||
|
default:
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
/* All tokens which only need the info to return a value go in here */
|
/* All tokens which only need the info to return a value go in here */
|
||||||
const char *get_id3_token(struct wps_token *token, struct mp3entry *id3,
|
const char *get_id3_token(struct wps_token *token, struct mp3entry *id3,
|
||||||
|
@ -1392,3 +1428,5 @@ const char *get_token_value(struct gui_wps *gwps,
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -329,6 +329,9 @@ const char *get_token_value(struct gui_wps *gwps,
|
||||||
char *buf, int buf_size,
|
char *buf, int buf_size,
|
||||||
int *intval);
|
int *intval);
|
||||||
|
|
||||||
|
/* Get the id3 fields from the cuesheet */
|
||||||
|
const char *get_cuesheetid3_token(struct wps_token *token, struct mp3entry *id3,
|
||||||
|
int offset_tracks, char *buf, int buf_size);
|
||||||
const char *get_id3_token(struct wps_token *token, struct mp3entry *id3,
|
const char *get_id3_token(struct wps_token *token, struct mp3entry *id3,
|
||||||
char *buf, int buf_size, int limit, int *intval);
|
char *buf, int buf_size, int limit, int *intval);
|
||||||
#if CONFIG_TUNER
|
#if CONFIG_TUNER
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue