aboutsummaryrefslogtreecommitdiff
path: root/composer/Pattern.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'composer/Pattern.hpp')
-rw-r--r--composer/Pattern.hpp33
1 files changed, 33 insertions, 0 deletions
diff --git a/composer/Pattern.hpp b/composer/Pattern.hpp
new file mode 100644
index 0000000..1607414
--- /dev/null
+++ b/composer/Pattern.hpp
@@ -0,0 +1,33 @@
+#ifndef COMPOSER_PATTERN_H_INCLUDED
+#define COMPOSER_PATTERN_H_INCLUDED
+
+#include <string>
+#include <vector>
+
+#include <m_pd.h>
+
+using std::string;
+using std::vector;
+
+typedef t_atom Cell;
+
+typedef vector<Cell> Row;
+
+class Pattern
+{
+private:
+ string name;
+ vector<Row> rows;
+ int columns;
+public:
+ Pattern(int numRows, int numCols, string patternName);
+ void print();
+ void resize(int numRows, int numCols);
+ void setCell(int row, int col, Cell cell);
+ Cell getCell(int row, int col);
+ inline const string &getName() {return name;}
+ inline unsigned int getRows() {return rows.size();}
+ inline unsigned int getColumns() {return columns;}
+};
+
+#endif // COMPOSER_PATTERN_H_INCLUDED