introduce MDESound
This commit is contained in:
parent
04651ea59b
commit
b2e83e695d
10 changed files with 318 additions and 9 deletions
18
include/MDE/Sound/ID3.h
Normal file
18
include/MDE/Sound/ID3.h
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
#ifndef __MDE_SOUND_ID3_H__
|
||||
#define __MDE_SOUND_ID3_H__
|
||||
|
||||
#include <MDE/MachDep.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
char* MDEID3GetTag(const char* path, const char* name, size_t* size);
|
||||
|
||||
char* MDEID3GetString(const char* path, const char* name);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
54
include/MDE/Sound/Sound.h
Normal file
54
include/MDE/Sound/Sound.h
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
#ifndef __MDE_SOUND_SOUND_H__
|
||||
#define __MDE_SOUND_SOUND_H__
|
||||
|
||||
#include <MDE/MachDep.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct _MDESoundDriver MDESoundDriverRec, *MDESoundDriver;
|
||||
typedef struct _MDESoundContext* MDESoundContext;
|
||||
typedef struct _MDESound* MDESound;
|
||||
|
||||
struct _MDESoundContext {
|
||||
int sample_rate;
|
||||
int channels;
|
||||
int frames;
|
||||
void* opaque;
|
||||
|
||||
char* title;
|
||||
char* album;
|
||||
char* artist;
|
||||
char* genre;
|
||||
};
|
||||
|
||||
struct _MDESoundDriver {
|
||||
MDESoundContext (*open)(const char* path);
|
||||
void (*close)(MDESoundContext context);
|
||||
int (*read)(MDESoundContext context, short* out, int frames);
|
||||
void (*seek)(MDESoundContext context, int frames);
|
||||
};
|
||||
|
||||
struct _MDESound {
|
||||
MDESoundContext context;
|
||||
MDESoundDriver driver;
|
||||
};
|
||||
|
||||
extern MDESoundDriver MDESoundDriverMP3;
|
||||
|
||||
MDESound MDESoundOpen(const char* path);
|
||||
|
||||
int MDESoundRead(MDESound sound, short* out, int frames);
|
||||
|
||||
int MDESoundReadFloat(MDESound sound, float* out, int frames);
|
||||
|
||||
void MDESoundSeek(MDESound sound, int frames);
|
||||
|
||||
void MDESoundClose(MDESound sound);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue