#ifndef CONTROLLER_H #define CONTROLLER_H class Controller : public AbsInput { public: Controller(PadDefinition* p=NULL) : AbsInput(p, CONTROLLER) {m_value=-1;} Controller(const Controller& b) : AbsInput(b.m_parent, b.type) { m_value=-1; } virtual const Controller& operator=(const AbsInput& b) { AbsInput::operator=(b); m_value=(dynamic_cast(&b))->m_value; return *this; } virtual ~Controller(){} int get_value() const { return m_value; } protected: int m_value; virtual void _on_event(const MidiMessage* m){ int size=m_actions.size(); for(int i=0; itype){ case MidiMessage::CONTROLLER_CHANGE: { const ControllerChange* cc =dynamic_cast(m) ; m_value=cc->velocity; l->on_control_change(this, *cc); break; } } } } }; #endif // CONTROLLER_H