12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- #ifndef PADSELECTION_H
- #define PADSELECTION_H
- #include <vector>
- #include <json/json.h>
- #include "InputAction.h"
- class PadConfiguration;
- class AbsInput;
- class MidiMessage;
- class InputOperation;
- class InputInit
- {
- public:
- InputInit(int i,int j){x=i; y=j;}
- virtual ~InputInit();
- int x;
- int y;
- std::vector<InputAction*> actions;
- };
- class PadSelection
- {
- public:
- PadSelection(const std::string&, Json::Value&, PadConfiguration*);
- virtual ~PadSelection();
- void add(int, int);
- void add(AbsInput*);
- void remove(int, int);
- void remove(AbsInput*);
- AbsInput* at(int,int);
- bool has(int, int) const;
- bool has(AbsInput*) const;
- MidiMessage* execute(AbsInput*, MidiMessage* m) const;
- const std::string& get_name() const {return m_name;}
- int count() const {return m_list.size();}
- int count_x(int x) const;
- int count_y(int y) const;
- int index_at_x(int absindex) const;
- int index_at_y(int absindex) const;
- AbsInput* get_child_from_rel_index(int i){return m_list[i];}
- void send_init();
- protected:
- void _update_matrix();
- //le pad de la sélection
- PadConfiguration* m_pad;
- std::string m_name;
- int m_width;
- int m_height;
- std::vector<AbsInput*> m_matrix;
- std::vector<AbsInput*> m_list;
- //la configuration
- std::vector<InputOperation*> m_operations;
- // les commande d'initialisation pour toute la sélection
- InputActionList m_init;
- friend class PadConfiguration;
- };
- #endif // PADSELECTION_H
|