aboutsummaryrefslogtreecommitdiff
path: root/composer/Pattern.hpp
blob: fbafcecca15cdf114ef0352991122e993ade5f6b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#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 void setName(const string &newName) {name = newName;}
	inline unsigned int getRows() {return rows.size();}
	inline unsigned int getColumns() {return columns;}
};

#endif // COMPOSER_PATTERN_H_INCLUDED