use session stripable selection API
[ardour.git] / libs / surfaces / mackie / device_profile.h
1 /*
2         Copyright (C) 2012 Paul Davis
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
15         along with this program; if not, write to the Free Software
16         Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17 */
18
19 #ifndef __ardour_mackie_control_protocol_device_profile_h__
20 #define __ardour_mackie_control_protocol_device_profile_h__
21
22 #include <iostream>
23 #include <stdint.h>
24 #include <string>
25 #include <map>
26
27 #include "button.h"
28
29 class XMLNode;
30
31 namespace ArdourSurface {
32
33 namespace Mackie {
34
35 class DeviceProfile
36 {
37   public:
38         DeviceProfile (const std::string& name = "");
39         ~DeviceProfile();
40
41         std::string get_button_action (Button::ID, int modifier_state) const;
42         void set_button_action (Button::ID, int modifier_state, const std::string&);
43
44         std::string name() const;
45         void set_path (const std::string&);
46
47         static void reload_device_profiles ();
48         static std::map<std::string,DeviceProfile> device_profiles;
49         static std::string name_when_edited (std::string const& name);
50         static const std::string default_profile_name;
51
52   private:
53         struct ButtonActions {
54             std::string plain;
55             std::string control;
56             std::string shift;
57             std::string option;
58             std::string cmdalt;
59             std::string shiftcontrol;
60         };
61
62         typedef std::map<Button::ID,ButtonActions> ButtonActionMap;
63
64         std::string _name;
65         std::string _path;
66         ButtonActionMap _button_map;
67         bool edited;
68
69         static const std::string edited_indicator;
70
71         int set_state (const XMLNode&, int version);
72         XMLNode& get_state () const;
73
74         void save ();
75 };
76
77 }
78 }
79
80 #endif /* __ardour_mackie_control_protocol_device_profile_h__ */