mirror of
https://github.com/wiidev/usbloadergx.git
synced 2024-11-18 17:29:17 +01:00
fa11a745d6
*Rewrote the whole Settings.cpp into 11 classes. Each settings menu has it's own class now *Reworked the whole sound system. Supported formats AIF/MP3/OGG/BNS/WAV now with no file size limit (streaming). *Changed button click/over sounds to wav from raw pcm *Lot's of bug fixes
31 lines
767 B
C++
31 lines
767 B
C++
#ifndef FILE_HPP_
|
|
#define FILE_HPP_
|
|
|
|
#include <stdio.h>
|
|
#include <gctypes.h>
|
|
|
|
class CFile
|
|
{
|
|
public:
|
|
CFile();
|
|
CFile(const char * filepath, const char * mode);
|
|
CFile(const u8 * memory, int memsize);
|
|
~CFile();
|
|
int open(const char * filepath, const char * mode);
|
|
int open(const u8 * memory, int memsize);
|
|
void close();
|
|
int read(u8 * ptr, size_t size);
|
|
int write(const u8 * ptr, size_t size);
|
|
int seek(long int offset, int origin);
|
|
long int tell() { return Pos; };
|
|
long int size() { return filesize; };
|
|
void rewind() { seek(0, SEEK_SET); };
|
|
protected:
|
|
FILE * file_fd;
|
|
const u8 * mem_file;
|
|
u64 filesize;
|
|
long int Pos;
|
|
};
|
|
|
|
#endif
|