From 145364a8af6a1fec06556221e66d4b724a62fc9a Mon Sep 17 00:00:00 2001 From: tpearson Date: Mon, 1 Mar 2010 18:37:05 +0000 Subject: Added old abandoned KDE3 version of the RoseGarden MIDI tool git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/rosegarden@1097595 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- src/base/ControlParameter.h | 124 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 124 insertions(+) create mode 100644 src/base/ControlParameter.h (limited to 'src/base/ControlParameter.h') diff --git a/src/base/ControlParameter.h b/src/base/ControlParameter.h new file mode 100644 index 0000000..d9e487f --- /dev/null +++ b/src/base/ControlParameter.h @@ -0,0 +1,124 @@ +// -*- c-basic-offset: 4 -*- + +/* + Rosegarden + A sequencer and musical notation editor. + + This program is Copyright 2000-2008 + Guillaume Laurent , + Chris Cannam , + Richard Bown + + The moral right of the authors to claim authorship of this work + has been asserted. + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. See the file + COPYING included with this distribution for more information. +*/ + +#ifndef _CONTROLPARAMETER_H_ +#define _CONTROLPARAMETER_H_ + +#include + +#include "XmlExportable.h" +#include "MidiProgram.h" + +namespace Rosegarden +{ + +class ControlParameter : public XmlExportable +{ +public: + ControlParameter(); + ControlParameter(const std::string &name, + const std::string &type, + const std::string &description, + int min = 0, + int max = 127, + int def = 0, + MidiByte controllerValue = 0, + unsigned int colour = 0, + int ipbPositon = -1); + ControlParameter(const ControlParameter &control); + ControlParameter& operator=(const ControlParameter &control); + bool operator==(const ControlParameter &control); + + friend bool operator<(const ControlParameter &a, const ControlParameter &b); + + // ControlParameter comparison on IPB position + // + struct ControlPositionCmp + { + bool operator()(ControlParameter *c1, + ControlParameter *c2) + { + return (c1->getIPBPosition() < c2->getIPBPosition()); + } + + bool operator()(const ControlParameter &c1, + const ControlParameter &c2) + { + return (c1.getIPBPosition() < c2.getIPBPosition()); + } + }; + + std::string getName() const { return m_name; } + std::string getType() const { return m_type; } + std::string getDescription() const { return m_description; } + + int getMin() const { return m_min; } + int getMax() const { return m_max; } + int getDefault() const { return m_default; } + + MidiByte getControllerValue() const { return m_controllerValue; } + + unsigned int getColourIndex() const { return m_colourIndex; } + + int getIPBPosition() const { return m_ipbPosition; } + + void setName(const std::string &name) { m_name = name; } + void setType(const std::string &type) { m_type = type; } + void setDescription(const std::string &des) { m_description = des; } + + void setMin(int min) { m_min = min; } + void setMax(int max) { m_max = max; } + void setDefault(int def) { m_default = def; } + + void setControllerValue(MidiByte con) { m_controllerValue = con; } + + void setColourIndex(unsigned int colour) { m_colourIndex = colour; } + + void setIPBPosition(int position) { m_ipbPosition = position; } + + virtual std::string toXmlString(); + +protected: + + // ControlParameter name as it's displayed ("Velocity", "Controller") + std::string m_name; + + // use event types in here ("controller", "pitchbend"); + std::string m_type; + + std::string m_description; + + int m_min; + int m_max; + int m_default; + + MidiByte m_controllerValue; + + unsigned int m_colourIndex; + + int m_ipbPosition; // position on Instrument Parameter Box + + +}; + +} + +#endif // _CONTROLPARAMETER_H_ -- cgit v1.2.1