2012-04-17 16:41:31 -04:00
|
|
|
/*
|
2019-08-03 08:34:29 -04:00
|
|
|
* Copyright (C) 2006-2007 John Anderson
|
|
|
|
* Copyright (C) 2012-2016 Paul Davis <paul@linuxaudiosystems.com>
|
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
* with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
*/
|
2012-04-17 16:41:31 -04:00
|
|
|
|
|
|
|
#ifndef __ardour_mackie_control_protocol_device_profile_h__
|
|
|
|
#define __ardour_mackie_control_protocol_device_profile_h__
|
|
|
|
|
|
|
|
#include <iostream>
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <string>
|
|
|
|
#include <map>
|
|
|
|
|
|
|
|
#include "button.h"
|
|
|
|
|
|
|
|
class XMLNode;
|
|
|
|
|
2015-04-15 20:37:20 -04:00
|
|
|
namespace ArdourSurface {
|
|
|
|
|
2012-04-17 16:41:31 -04:00
|
|
|
namespace Mackie {
|
|
|
|
|
|
|
|
class DeviceProfile
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
DeviceProfile (const std::string& name = "");
|
|
|
|
~DeviceProfile();
|
2015-10-05 10:17:49 -04:00
|
|
|
|
2012-04-17 16:41:31 -04:00
|
|
|
std::string get_button_action (Button::ID, int modifier_state) const;
|
|
|
|
void set_button_action (Button::ID, int modifier_state, const std::string&);
|
2015-10-05 10:17:49 -04:00
|
|
|
|
2016-02-04 11:23:54 -05:00
|
|
|
std::string name() const;
|
2012-04-17 23:24:59 -04:00
|
|
|
void set_path (const std::string&);
|
|
|
|
|
2012-04-17 16:41:31 -04:00
|
|
|
static void reload_device_profiles ();
|
|
|
|
static std::map<std::string,DeviceProfile> device_profiles;
|
2016-02-04 11:23:54 -05:00
|
|
|
static std::string name_when_edited (std::string const& name);
|
|
|
|
static const std::string default_profile_name;
|
2015-10-05 10:17:49 -04:00
|
|
|
|
2012-04-17 16:41:31 -04:00
|
|
|
private:
|
|
|
|
struct ButtonActions {
|
|
|
|
std::string plain;
|
|
|
|
std::string control;
|
|
|
|
std::string shift;
|
|
|
|
std::string option;
|
|
|
|
std::string cmdalt;
|
|
|
|
std::string shiftcontrol;
|
|
|
|
};
|
2015-10-05 10:17:49 -04:00
|
|
|
|
2012-04-17 16:41:31 -04:00
|
|
|
typedef std::map<Button::ID,ButtonActions> ButtonActionMap;
|
2015-10-05 10:17:49 -04:00
|
|
|
|
2012-04-17 16:41:31 -04:00
|
|
|
std::string _name;
|
2012-04-17 23:24:59 -04:00
|
|
|
std::string _path;
|
2012-04-17 16:41:31 -04:00
|
|
|
ButtonActionMap _button_map;
|
2016-02-04 11:23:54 -05:00
|
|
|
bool edited;
|
|
|
|
|
|
|
|
static const std::string edited_indicator;
|
2015-10-05 10:17:49 -04:00
|
|
|
|
2012-04-17 16:41:31 -04:00
|
|
|
int set_state (const XMLNode&, int version);
|
|
|
|
XMLNode& get_state () const;
|
2012-04-17 23:24:59 -04:00
|
|
|
|
|
|
|
void save ();
|
2012-04-17 16:41:31 -04:00
|
|
|
};
|
|
|
|
|
2015-04-15 20:37:20 -04:00
|
|
|
}
|
2012-04-17 16:41:31 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif /* __ardour_mackie_control_protocol_device_profile_h__ */
|