aboutsummaryrefslogtreecommitdiff
path: root/tonedata/tonedata.h
diff options
context:
space:
mode:
authorTakamichi Horikawa <takamichiho@gmail.com>2017-03-01 00:22:33 +0900
committerTakamichi Horikawa <takamichiho@gmail.com>2017-03-01 00:22:33 +0900
commit23dc19065c182e61bce9c997f31e23b001a85f2c (patch)
treeec4dc1d49362b1fc95c2608bb40651cc6f8f2917 /tonedata/tonedata.h
parent2432f71b1e1b1e474a2ff5b833107246a3e3762a (diff)
gtk: add tone viewer
Diffstat (limited to 'tonedata/tonedata.h')
-rw-r--r--tonedata/tonedata.h48
1 files changed, 48 insertions, 0 deletions
diff --git a/tonedata/tonedata.h b/tonedata/tonedata.h
new file mode 100644
index 0000000..c8dd03c
--- /dev/null
+++ b/tonedata/tonedata.h
@@ -0,0 +1,48 @@
+#ifndef MYON_FMPLAYER_TONEDATA_H_INCLUDED
+#define MYON_FMPLAYER_TONEDATA_H_INCLUDED
+
+#include <stdint.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];
+};
+
+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
+};
+
+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
+