summaryrefslogtreecommitdiff
path: root/note_compiler/parser.h
diff options
context:
space:
mode:
authorFlorian Jung <flo@thinkpad.(none)>2010-12-31 16:33:17 +0100
committerFlorian Jung <flo@thinkpad.(none)>2010-12-31 16:33:17 +0100
commitff2f14ab35cf1cb2ded11b4ae86d24dda738b445 (patch)
tree3e35d112243bf987f66359a53e4ff9261bdc6d1b /note_compiler/parser.h
parentd46f6ee0a6298ff58c6f4f0647d49fb4a76f9ea9 (diff)
Add initial code for the note-compiler
The note-compiler now has a Parser class which knows about possible parameter changes (by controller, velocity or simply user definition). Furthermore, several files were adapted (by stripping unneeded code, adding the bool foo_const variables etc.). Small fix in util.c which causes extract_var("foo") to return "foo" instead of "". Fixes in both Makefiles.
Diffstat (limited to 'note_compiler/parser.h')
-rw-r--r--note_compiler/parser.h40
1 files changed, 40 insertions, 0 deletions
diff --git a/note_compiler/parser.h b/note_compiler/parser.h
new file mode 100644
index 0000000..3e60051
--- /dev/null
+++ b/note_compiler/parser.h
@@ -0,0 +1,40 @@
+#ifndef __PARSER_H__
+#define __PARSET_H__
+
+
+#include <set>
+#include <map>
+#include <list>
+#include <string>
+
+#include "../synth/fixed.h"
+#include "programs.h"
+
+using namespace std;
+
+class Parser
+{
+ public:
+ Parser();
+ ~Parser();
+ void parse(string fn);
+
+ program_t get_result();
+
+ private:
+ void init_stuff();
+ void uninit_stuff();
+ static string extract_array_name(string s);
+ static int extract_array_index(string s, int dim);
+
+ int n_osc;
+ oscillator_t *osc;
+ env_settings_t *env;
+ filter_params_t filter;
+
+ fixed_t sync_factor;
+ bool sync_factor_const;
+};
+
+
+#endif