aboutsummaryrefslogtreecommitdiff
path: root/composer/Pattern.hpp
diff options
context:
space:
mode:
authormescalinum <mescalinum@users.sourceforge.net>2009-09-25 17:19:25 +0000
committermescalinum <mescalinum@users.sourceforge.net>2009-09-25 17:19:25 +0000
commitf8ac52e520aa5e20a256a3fd9a649b461f3afeef (patch)
tree25198f6081892058a8ba46b838bfa1f14076c565 /composer/Pattern.hpp
parent2815cb8c2ff0edd77efcc071b65fed1e60c1c6bc (diff)
rewrite in C++
svn path=/trunk/externals/ffext/; revision=12451
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