libdragon
Loading...
Searching...
No Matches
ym64.h
Go to the documentation of this file.
1
5#ifndef __LIBDRAGON_YM64_H
6#define __LIBDRAGON_YM64_H
7
8#ifdef __cplusplus
9extern "C" {
10#endif
11
12#include <stdint.h>
13#include <stdio.h>
14#include <stdbool.h>
15#include "mixer.h"
16#include "ay8910.h"
17
62typedef struct {
64
65 FILE *f;
66 void *decoder;
68
70 uint8_t regs[16];
71 uint32_t nframes;
72 uint32_t chipfreq;
73 uint16_t playfreq;
75
78
80typedef struct {
81 char name[128];
82 char author[128];
83 char comment[128];
85
94void ym64player_open(ym64player_t *player, const char *fn, ym64player_songinfo_t *info);
95
108
115void ym64player_play(ym64player_t *player, int first_ch);
116
128void ym64player_duration(ym64player_t *player, int *len, float *secs);
129
141void ym64player_tell(ym64player_t *player, int *pos, float *secs);
142
155bool ym64player_seek(ym64player_t *player, int pos);
156
163void ym64player_stop(ym64player_t *player);
164
168void ym64player_close(ym64player_t *player);
169
170#ifdef __cplusplus
171}
172#endif
173
174#endif
RSP Audio mixer.
A waveform that can be played back through the mixer.
Definition mixer.h:440
A AY-3-8910 emulator.
Definition ay8910.h:104
FILE * f
Open file handle.
Definition ym64.h:65
int ym64player_num_channels(ym64player_t *player)
Return the number of channels used in the mixer for playback.
Definition ym64.c:214
void ym64player_play(ym64player_t *player, int first_ch)
Start playback of a YM file.
Definition ym64.c:218
int start_off
Starting offset of the first audio frame.
Definition ym64.h:67
uint16_t playfreq
Frequency of an audio frame (typically 50Hz or 60Hz)
Definition ym64.h:73
void ym64player_tell(ym64player_t *player, int *pos, float *secs)
Read the current position of the YM module.
Definition ym64.c:237
uint32_t nframes
Number of YM audio frames.
Definition ym64.h:71
void ym64player_duration(ym64player_t *player, int *len, float *secs)
Read the total duration the YM module.
Definition ym64.c:232
waveform_t wave
waveform for playback with the mixer
Definition ym64.h:63
int first_ch
First channel used in the mixer for playback.
Definition ym64.h:76
void ym64player_close(ym64player_t *player)
Close and deallocate the YM64 player.
Definition ym64.c:256
void * decoder
Optional LHA decoder (compressed YM files)
Definition ym64.h:66
bool ym64player_seek(ym64player_t *player, int pos)
Seek to a specific position in the YM module.
Definition ym64.c:242
void ym64player_stop(ym64player_t *player)
Stop YM playback.
Definition ym64.c:225
void ym64player_open(ym64player_t *player, const char *fn, ym64player_songinfo_t *info)
Open a YM64 file for playback.
Definition ym64.c:104
AY8910 ay
AY8910 emulator.
Definition ym64.h:69
uint32_t chipfreq
Operating frequency of the AY chip.
Definition ym64.h:72
int curframe
Current audio frame being played.
Definition ym64.h:74
Structure containing information about a YM song.
Definition ym64.h:80
Player of a .YM64 file.
Definition ym64.h:62