libdragon
Loading...
Searching...
No Matches
ym64.h
Go to the documentation of this file.
1#ifndef __LIBDRAGON_YM64_H
2#define __LIBDRAGON_YM64_H
3
4#ifdef __cplusplus
5extern "C" {
6#endif
7
8#include <stdint.h>
9#include <stdio.h>
10#include <stdbool.h>
11#include "mixer.h"
12#include "ay8910.h"
13
58typedef struct {
60
61 FILE *f;
62 void *decoder;
64
66 uint8_t regs[16];
67 uint32_t nframes;
68 uint32_t chipfreq;
69 uint16_t playfreq;
71
74
76typedef struct {
77 char name[128];
78 char author[128];
79 char comment[128];
81
90void ym64player_open(ym64player_t *player, const char *fn, ym64player_songinfo_t *info);
91
104
111void ym64player_play(ym64player_t *player, int first_ch);
112
124void ym64player_duration(ym64player_t *player, int *len, float *secs);
125
137void ym64player_tell(ym64player_t *player, int *pos, float *secs);
138
151bool ym64player_seek(ym64player_t *player, int pos);
152
159void ym64player_stop(ym64player_t *player);
160
164void ym64player_close(ym64player_t *player);
165
166#ifdef __cplusplus
167}
168#endif
169
170#endif
RSP Audio mixer.
A waveform that can be played back through the mixer.
Definition mixer.h:439
A AY-3-8910 emulator.
Definition ay8910.h:100
FILE * f
Open file handle.
Definition ym64.h:61
int ym64player_num_channels(ym64player_t *player)
Return the number of channels used in the mixer for playback.
Definition ym64.c:213
void ym64player_play(ym64player_t *player, int first_ch)
Start playback of a YM file.
Definition ym64.c:217
int start_off
Starting offset of the first audio frame.
Definition ym64.h:63
uint16_t playfreq
Frequency of an audio frame (typically 50Hz or 60Hz)
Definition ym64.h:69
void ym64player_tell(ym64player_t *player, int *pos, float *secs)
Read the current position of the YM module.
Definition ym64.c:236
uint32_t nframes
Number of YM audio frames.
Definition ym64.h:67
void ym64player_duration(ym64player_t *player, int *len, float *secs)
Read the total duration the YM module.
Definition ym64.c:231
waveform_t wave
waveform for playback with the mixer
Definition ym64.h:59
int first_ch
First channel used in the mixer for playback.
Definition ym64.h:72
void ym64player_close(ym64player_t *player)
Close and deallocate the YM64 player.
Definition ym64.c:255
void * decoder
Optional LHA decoder (compressed YM files)
Definition ym64.h:62
bool ym64player_seek(ym64player_t *player, int pos)
Seek to a specific position in the YM module.
Definition ym64.c:241
void ym64player_stop(ym64player_t *player)
Stop YM playback.
Definition ym64.c:224
void ym64player_open(ym64player_t *player, const char *fn, ym64player_songinfo_t *info)
Open a YM64 file for playback.
Definition ym64.c:103
AY8910 ay
AY8910 emulator.
Definition ym64.h:65
uint32_t chipfreq
Operating frequency of the AY chip.
Definition ym64.h:68
int curframe
Current audio frame being played.
Definition ym64.h:70
Structure containing information about a YM song.
Definition ym64.h:76
Player of a .YM64 file.
Definition ym64.h:58