aboutsummaryrefslogtreecommitdiff
path: root/tonedata/tonedata.h
diff options
context:
space:
mode:
authorTakamichi Horikawa <takamichiho@gmail.com>2017-04-03 22:25:21 +0900
committerTakamichi Horikawa <takamichiho@gmail.com>2017-04-03 22:25:21 +0900
commit813ed6d6c17d4b3c99e3d237872041f1a0047f97 (patch)
tree8dbb1431ebc2c6e14010689bcad6fe42ede0480b /tonedata/tonedata.h
parent21c6232b797baaad10c305f98cd96765876505c1 (diff)
add VOPM tone format
Diffstat (limited to 'tonedata/tonedata.h')
-rw-r--r--tonedata/tonedata.h26
1 files changed, 25 insertions, 1 deletions
diff --git a/tonedata/tonedata.h b/tonedata/tonedata.h
index c8dd03c..5a7cd12 100644
--- a/tonedata/tonedata.h
+++ b/tonedata/tonedata.h
@@ -2,6 +2,7 @@
#define MYON_FMPLAYER_TONEDATA_H_INCLUDED
#include <stdint.h>
+#include <stdbool.h>
struct fmplayer_tonedata {
struct fmplayer_tonedata_channel {
@@ -22,6 +23,28 @@ struct fmplayer_tonedata {
} 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,
@@ -30,7 +53,8 @@ void tonedata_from_opna(
enum fmplayer_tonedata_format {
FMPLAYER_TONEDATA_FMT_PMD,
- FMPLAYER_TONEDATA_FMT_FMP
+ FMPLAYER_TONEDATA_FMT_FMP,
+ FMPLAYER_TONEDATA_FMT_VOPM,
};
enum {