From eb45a7913d83fe2a3dc03033230950e78fb9755d Mon Sep 17 00:00:00 2001 From: Wohlstand Date: Fri, 20 Oct 2017 04:28:53 +0300 Subject: Added CMake support --- utils/gen_adldata/progs_cache.h | 85 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 utils/gen_adldata/progs_cache.h (limited to 'utils/gen_adldata/progs_cache.h') diff --git a/utils/gen_adldata/progs_cache.h b/utils/gen_adldata/progs_cache.h new file mode 100644 index 0000000..007c3b4 --- /dev/null +++ b/utils/gen_adldata/progs_cache.h @@ -0,0 +1,85 @@ +#ifndef PROGS_H +#define PROGS_H + +#include +#include +#include +#include +#include +#include +#include + +struct insdata +{ + uint8_t data[11]; + int8_t finetune; + bool diff; + bool operator==(const insdata &b) const + { + return std::memcmp(data, b.data, 11) == 0 && finetune == b.finetune && diff == b.diff; + } + bool operator< (const insdata &b) const + { + int c = std::memcmp(data, b.data, 11); + if(c != 0) return c < 0; + if(finetune != b.finetune) return finetune < b.finetune; + if(diff != b.diff) return (!diff) == (b.diff); + return 0; + } + bool operator!=(const insdata &b) const + { + return !operator==(b); + } +}; + +struct ins +{ + size_t insno1, insno2; + unsigned char notenum; + bool pseudo4op; + double voice2_fine_tune; + + bool operator==(const ins &b) const + { + return notenum == b.notenum + && insno1 == b.insno1 + && insno2 == b.insno2 + && pseudo4op == b.pseudo4op + && voice2_fine_tune == b.voice2_fine_tune; + } + bool operator< (const ins &b) const + { + if(insno1 != b.insno1) return insno1 < b.insno1; + if(insno2 != b.insno2) return insno2 < b.insno2; + if(notenum != b.notenum) return notenum < b.notenum; + if(pseudo4op != b.pseudo4op) return pseudo4op < b.pseudo4op; + if(voice2_fine_tune != b.voice2_fine_tune) return voice2_fine_tune < b.voice2_fine_tune; + return 0; + } + bool operator!=(const ins &b) const + { + return !operator==(b); + } +}; + +typedef std::map > > InstrumentDataTab; +extern InstrumentDataTab insdatatab; + +typedef std::map > > InstrumentsData; +extern InstrumentsData instab; + +typedef std::map > InstProgsData; +extern InstProgsData progs; + +extern std::vector banknames; + +//static std::map > Correlate; +//extern unsigned maxvalues[30]; + +void SetBank(unsigned bank, unsigned patch, size_t insno); + +size_t InsertIns(const insdata &id, const insdata &id2, ins &in, + const std::string &name, const std::string &name2 = ""); +size_t InsertNoSoundIns(); + +#endif // PROGS_H -- cgit v1.2.3