#ifndef __undo_h
#define __undo_h

#ifndef MAXPM
#define MAXPM 163
#endif

class undoRec
{
	public: 
	int action;
	int key;
	float* oldpmL;
	float* oldpmR;

	undoRec()
	{
		action = key = 0;
		oldpmL = oldpmR = NULL;
	}

	undoRec(float* _a, float* _b, int _c, int _d)
	{
		int i;
		if (_a) { oldpmL = new float[MAXPM]; for (i = 0; i<MAXPM; i++) oldpmL[i] = _a[i]; }
		if (_b) { oldpmR = new float[MAXPM]; for (i = 0; i<MAXPM; i++) oldpmR[i] = _b[i]; }
		action = _c;
		key = _d;
	}

	~undoRec()
	{
		if (oldpmL) delete[] oldpmL;
		if (oldpmR) delete[] oldpmR;
	}
};

#endif