mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-08 12:45:26 -05:00
The much-anticipated queue patch by Hardeep Sidhu. Queue a file by holding down PLAY on it while playing other music.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@3040 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
0e342181c3
commit
c78e1b07fe
10 changed files with 492 additions and 129 deletions
|
|
@ -21,13 +21,18 @@
|
|||
#include <sys/types.h>
|
||||
|
||||
int x11_open(char *name, int opts);
|
||||
int x11_creat(char *name, int mode);
|
||||
int x11_remove(char *name);
|
||||
|
||||
#define open(x,y) x11_open(x,y)
|
||||
#define creat(x,y) x11_open(x,y)
|
||||
#define remove(x) x11_remove(x)
|
||||
|
||||
#include "../../firmware/common/file.h"
|
||||
|
||||
extern int open(char* pathname, int flags);
|
||||
extern int close(int fd);
|
||||
extern int read(int fd, void* buf, int count);
|
||||
extern int write(int fd, void* buf, int count);
|
||||
extern int lseek(int fd, int offset, int whence);
|
||||
extern int printf(const char *format, ...);
|
||||
|
|
|
|||
|
|
@ -109,6 +109,32 @@ int x11_open(char *name, int opts)
|
|||
return open(name, opts);
|
||||
}
|
||||
|
||||
int x11_creat(char *name, int mode)
|
||||
{
|
||||
char buffer[256]; /* sufficiently big */
|
||||
|
||||
if(name[0] == '/') {
|
||||
sprintf(buffer, "%s%s", SIMULATOR_ARCHOS_ROOT, name);
|
||||
|
||||
debugf("We open the real file '%s'\n", buffer);
|
||||
return creat(buffer, mode);
|
||||
}
|
||||
return creat(name, mode);
|
||||
}
|
||||
|
||||
int x11_remove(char *name)
|
||||
{
|
||||
char buffer[256]; /* sufficiently big */
|
||||
|
||||
if(name[0] == '/') {
|
||||
sprintf(buffer, "%s%s", SIMULATOR_ARCHOS_ROOT, name);
|
||||
|
||||
debugf("We open the real file '%s'\n", buffer);
|
||||
return remove(buffer);
|
||||
}
|
||||
return remove(name);
|
||||
}
|
||||
|
||||
void fat_size(unsigned int* size, unsigned int* free)
|
||||
{
|
||||
struct statfs fs;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue