forked from len0rd/rockbox
Made the code compile. Added header. Fixed spacing.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@1172 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
caebbcd77f
commit
7f08462821
2 changed files with 96 additions and 60 deletions
30
apps/wps.c
30
apps/wps.c
|
@ -1,3 +1,21 @@
|
||||||
|
/***************************************************************************
|
||||||
|
* __________ __ ___.
|
||||||
|
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
||||||
|
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
||||||
|
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||||
|
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||||
|
* \/ \/ \/ \/ \/
|
||||||
|
* $Id$
|
||||||
|
*
|
||||||
|
* Copyright (C) 2002 Jerome Kuptz
|
||||||
|
*
|
||||||
|
* 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.
|
||||||
|
*
|
||||||
|
****************************************************************************/
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
@ -22,10 +40,10 @@
|
||||||
/* demonstrates showing different formats from playtune */
|
/* demonstrates showing different formats from playtune */
|
||||||
void wps_show_play(char* filename)
|
void wps_show_play(char* filename)
|
||||||
{
|
{
|
||||||
|
char buffer[256];
|
||||||
mp3entry mp3;
|
mp3entry mp3;
|
||||||
mp3info(&mp3,filename);
|
mp3info(&mp3,filename);
|
||||||
|
|
||||||
char buffer[256];
|
|
||||||
snprintf(buffer,sizeof(buffer), "%s", mp3.path);
|
snprintf(buffer,sizeof(buffer), "%s", mp3.path);
|
||||||
|
|
||||||
lcd_clear_display();
|
lcd_clear_display();
|
||||||
|
@ -34,17 +52,18 @@ void wps_show_play(char* filename)
|
||||||
{
|
{
|
||||||
case PLAY_DISPLAY_TRACK_TITLE:
|
case PLAY_DISPLAY_TRACK_TITLE:
|
||||||
{
|
{
|
||||||
int ch = '/';
|
char ch = '/';
|
||||||
char* end;
|
char* end;
|
||||||
char szArtist[26];
|
char* szDelimit;
|
||||||
|
char szArtist[32];
|
||||||
|
|
||||||
char* szTok = strtok_r(buffer, "/", &end);
|
char* szTok = strtok_r(buffer, "/", &end);
|
||||||
szTok = strtok_r(NULL, "/", &end);
|
szTok = strtok_r(NULL, "/", &end);
|
||||||
|
|
||||||
// Assume path format of: Genre/Artist/Album/Mp3_file
|
/* Assume path format of: Genre/Artist/Album/Mp3_file */
|
||||||
strncpy(szArtist,szTok,sizeof(szArtist));
|
strncpy(szArtist,szTok,sizeof(szArtist));
|
||||||
szArtist[sizeof(szArtist)-1] = 0;
|
szArtist[sizeof(szArtist)-1] = 0;
|
||||||
char* szDelimit = strrchr(buffer, ch);
|
szDelimit = strrchr(buffer, ch);
|
||||||
|
|
||||||
#ifdef HAVE_LCD_BITMAP
|
#ifdef HAVE_LCD_BITMAP
|
||||||
lcd_puts(0,0, szArtist?szArtist:"<nothing>");
|
lcd_puts(0,0, szArtist?szArtist:"<nothing>");
|
||||||
|
@ -105,7 +124,6 @@ void wps_show_play(char* filename)
|
||||||
#if 0
|
#if 0
|
||||||
void wps_show_playlist(char* current, playlist_info_t *list)
|
void wps_show_playlist(char* current, playlist_info_t *list)
|
||||||
{
|
{
|
||||||
|
|
||||||
int ch = '/';
|
int ch = '/';
|
||||||
char* szLast = strrchr(current, ch);
|
char* szLast = strrchr(current, ch);
|
||||||
char buf[16];
|
char buf[16];
|
||||||
|
|
18
apps/wps.h
18
apps/wps.h
|
@ -1,3 +1,21 @@
|
||||||
|
/***************************************************************************
|
||||||
|
* __________ __ ___.
|
||||||
|
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
||||||
|
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
||||||
|
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||||
|
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||||
|
* \/ \/ \/ \/ \/
|
||||||
|
* $Id$
|
||||||
|
*
|
||||||
|
* Copyright (C) 2002 Jerome Kuptz
|
||||||
|
*
|
||||||
|
* 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
|
#ifndef _WPS_H
|
||||||
#define _WPS_H
|
#define _WPS_H
|
||||||
#include "id3.h"
|
#include "id3.h"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue