From 0936f0e39b1775c1a9df1f5dc3433ebe58b669ef Mon Sep 17 00:00:00 2001 From: Lars Bisballe Jensen Date: Sat, 14 Mar 2015 14:38:31 +0100 Subject: Imported new parser, still broken, a bit confused about id and name --- src/drumkitparser.h | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) (limited to 'src/drumkitparser.h') diff --git a/src/drumkitparser.h b/src/drumkitparser.h index 907b09d..8237cd5 100644 --- a/src/drumkitparser.h +++ b/src/drumkitparser.h @@ -30,28 +30,54 @@ #include "saxparser.h" #include "drumkit.h" +struct MetaData { + std::string version; + std::string title; + std::string description; + std::string notes; + std::string author; + std::string email; + std::string website; + std::vector > channels; // title, microphone + std::vector > instruments; // title, microphone +}; + class DrumKitParser : public SAXParser { public: DrumKitParser(const std::string &kitfile, DrumKit &kit); ~DrumKitParser(); + void characterData(std::string &data); void startTag(std::string name, std::map< std::string, std::string> attributes); void endTag(std::string name); + MetaData getMetaData(); protected: int readData(char *data, size_t size); private: + std::string data; + FILE *fd; DrumKit &kit; + + std::string ch_name; + std::string ch_title; + std::string ch_microphone; + // Instrument *instr; std::string path; std::map channelmap; - std::string instr_file; std::string instr_name; + std::string instr_description; + std::string instr_file; + std::string instr_title; std::string instr_group; + bool in_metadata; + bool in_channel; + bool in_instrument; }; #endif/*__DRUMGIZMO_DRUMKITPARSER_H__*/ -- cgit v1.2.3