Ardour  9.0-pre0-380-gbbdb6b0e63
m2controls.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2016 Robin Gareus <robin@gareus.org>
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License along
15  * with this program; if not, write to the Free Software Foundation, Inc.,
16  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17  */
18 
19 #ifndef _ardour_surfaces_m2controls_h_
20 #define _ardour_surfaces_m2controls_h_
21 
22 #include <map>
23 
24 #include "m2_button.h"
25 #include "m2_encoder.h"
26 #include "m2_pad.h"
27 
28 namespace ArdourSurface {
29 
36 class M2Contols
37 {
38  public:
39  M2Contols () {}
40  virtual ~M2Contols () {}
41 
42  typedef enum {
43  ModNone = 0,
45  } Modifier;
46 
47  typedef enum {
48  /* Transport */
57 
58  /* modes */
62  BtnNavigate, // aka. "view" on Mikro
67 
68  /* global */
69 #if 0
70  BtnArrange, // Studio only
71  BtnMix, // Studio only
72 #endif
73 
74  BtnControl, // Studio: "Channel"
75  BtnStep, // Studio: "Plug-In"
82 
83  /* master */
90  BtnNoteRepeat, // Tap
91  BtnWheel, // Encoder Push
92 
93  /* Selectors above display */
94  BtnTop0, BtnTop1, BtnTop2, BtnTop3, // Mikro F1, F2, F3
96 
97  /* Maschine & Studio "Groups" */
100 
101 #if 1 // Studio only -- Edit
110 
113 #endif
115 
116  typedef enum {
131  EncoderWheel, // multi-purpose
142  Panic
144 
145  typedef std::map <PhysicalButtonId, M2ButtonInterface*> PhysicalMap;
146  typedef std::map <SemanticButtonId, M2ButtonInterface*> SematicMap;
147 
149  if (id == BtnShift) {
150  return &_shift;
151  }
152  return &_dummy_button;
153  }
154 
156  return &_dummy_button;
157  }
158 
159  virtual M2EncoderInterface* encoder (unsigned int id) {
160  return &_dummy_encoder;
161  }
162 
163  virtual M2PadInterface* pad (unsigned int id) {
164  return &_dummy_pad;
165  }
166 
167  protected:
171 
173 };
174 
175 } /* namespace */
176 #endif /* _ardour_surfaces_m2controls_h_*/
M2ButtonInterface _dummy_button
Definition: m2controls.h:168
virtual M2PadInterface * pad(unsigned int id)
Definition: m2controls.h:163
virtual M2ButtonInterface * button(SemanticButtonId id)
Definition: m2controls.h:155
std::map< SemanticButtonId, M2ButtonInterface * > SematicMap
Definition: m2controls.h:146
M2PadInterface _dummy_pad
Definition: m2controls.h:170
M2ToggleHoldButton _shift
Definition: m2controls.h:172
M2EncoderInterface _dummy_encoder
Definition: m2controls.h:169
virtual M2ButtonInterface * button(PhysicalButtonId id, Modifier m)
Definition: m2controls.h:148
virtual M2EncoderInterface * encoder(unsigned int id)
Definition: m2controls.h:159
std::map< PhysicalButtonId, M2ButtonInterface * > PhysicalMap
Definition: m2controls.h:145