blob: 5a7cd12fa1df922182963fb2175c411fc5c519a6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
|
#ifndef MYON_FMPLAYER_TONEDATA_H_INCLUDED
#define MYON_FMPLAYER_TONEDATA_H_INCLUDED
#include <stdint.h>
#include <stdbool.h>
struct fmplayer_tonedata {
struct fmplayer_tonedata_channel {
struct fmplayer_tonedata_slot {
uint8_t ar;
uint8_t dr;
uint8_t sr;
uint8_t rr;
uint8_t sl;
uint8_t tl;
uint8_t ks;
uint8_t ml;
uint8_t dt;
uint8_t ams;
} slot[4];
uint8_t fb;
uint8_t alg;
} ch[6];
};
static inline bool fmplayer_tonedata_channel_isequal(
const struct fmplayer_tonedata_channel *a,
const struct fmplayer_tonedata_channel *b) {
if (a->fb != b->fb) return false;
if (a->alg != b->alg) return false;
for (int s = 0; s < 4; s++) {
const struct fmplayer_tonedata_slot *sa = &a->slot[s];
const struct fmplayer_tonedata_slot *sb = &b->slot[s];
if (sa->ar != sb->ar) return false;
if (sa->dr != sb->dr) return false;
if (sa->sr != sb->sr) return false;
if (sa->rr != sb->rr) return false;
if (sa->sl != sb->sl) return false;
if (sa->tl != sb->tl) return false;
if (sa->ks != sb->ks) return false;
if (sa->ml != sb->ml) return false;
if (sa->dt != sb->dt) return false;
if (sa->ams != sb->ams) return false;
}
return true;
}
struct opna;
void tonedata_from_opna(
struct fmplayer_tonedata *tonedata,
const struct opna *opna
);
enum fmplayer_tonedata_format {
FMPLAYER_TONEDATA_FMT_PMD,
FMPLAYER_TONEDATA_FMT_FMP,
FMPLAYER_TONEDATA_FMT_VOPM,
};
enum {
FMPLAYER_TONEDATA_STR_SIZE = 0x100
};
void tonedata_ch_normalize_tl(struct fmplayer_tonedata_channel *ch);
void tonedata_ch_string(
enum fmplayer_tonedata_format format,
char *buf,
const struct fmplayer_tonedata_channel *ch,
uint8_t tonenum
);
#endif // MYON_FMPLAYER_TONEDATA_H_INCLUDED
|