Blame us428control/Cus428_ctls.h

Packit 427e91
/* -*- mode:C++; indent-tabs-mode:t; tab-width:8; c-basic-offset: 8 -*- */
Packit 427e91
/*
Packit 427e91
 * Controller for Tascam US-X2Y
Packit 427e91
 *
Packit 427e91
 * Copyright (c) 2003 by Karsten Wiese <annabellesgarden@yahoo.de>
Packit 427e91
 *
Packit 427e91
 *   This program is free software; you can redistribute it and/or modify
Packit 427e91
 *   it under the terms of the GNU General Public License as published by
Packit 427e91
 *   the Free Software Foundation; either version 2 of the License, or
Packit 427e91
 *   (at your option) any later version.
Packit 427e91
 *
Packit 427e91
 *   This program is distributed in the hope that it will be useful,
Packit 427e91
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 427e91
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Packit 427e91
 *   GNU General Public License for more details.
Packit 427e91
 *
Packit 427e91
 *   You should have received a copy of the GNU General Public License
Packit 427e91
 *   along with this program; if not, write to the Free Software
Packit 427e91
 *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
Packit 427e91
 */
Packit 427e91
Packit 427e91
#ifndef Cus428_ctls_h
Packit 427e91
#define Cus428_ctls_h
Packit 427e91
#include "usbus428ctldefs.h"
Packit 427e91
Packit 427e91
Packit 427e91
class Cus428_ctls: public us428_ctls{
Packit 427e91
public:
Packit 427e91
	Cus428_ctls() {
Packit 427e91
		memset(this, 0, sizeof(*this));
Packit 427e91
	}
Packit 427e91
	void dump(int n = 0);
Packit 427e91
	void analyse(Cus428_ctls *Previous, unsigned n = 0);
Packit 427e91
	bool Knob( int K) {
Packit 427e91
		return ((char*)this)[K / 8] & (1 << K % 8);
Packit 427e91
	}
Packit 427e91
protected:
Packit 427e91
	unsigned char ValAt(int i) {
Packit 427e91
		return ((unsigned char*)this)[i];
Packit 427e91
	}
Packit 427e91
	unsigned char DiffValAt(Cus428_ctls *Other, int i) {
Packit 427e91
		return ValAt(i) - Other->ValAt(i);
Packit 427e91
	}
Packit 427e91
	unsigned char DiffBitAt(Cus428_ctls *Other, int i) {
Packit 427e91
		return ValAt(i) ^ Other->ValAt(i);
Packit 427e91
	}
Packit 427e91
};
Packit 427e91
Packit 427e91
#endif