2 Copyright (C) 2006,2007 John Anderson
3 Copyright (C) 2012 Paul Davis
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 #include "pbd/xml++.h"
22 #include "device_info.h"
26 using namespace Mackie;
30 DeviceInfo::DeviceInfo()
32 , _has_two_character_display (true)
33 , _has_master_fader (true)
34 , _has_segmented_display (false)
35 , _has_timecode_display (true)
36 , _name (X_("Mackie Control Universal Pro"))
41 DeviceInfo::~DeviceInfo()
46 DeviceInfo::set_state (const XMLNode& node, int /* version */)
48 const XMLProperty* prop;
50 if ((prop = node.property ("strips")) != 0) {
51 if ((_strip_cnt = atoi (prop->value())) == 0) {
56 if ((prop = node.property ("two-character-display")) != 0) {
57 _has_two_character_display = string_is_affirmative (prop->value());
60 if ((prop = node.property ("master-fader")) != 0) {
61 _has_master_fader = string_is_affirmative (prop->value());
64 if ((prop = node.property ("display-segmented")) != 0) {
65 _has_segmented_display = string_is_affirmative (prop->value());
68 if ((prop = node.property ("timecode-display")) != 0) {
69 _has_timecode_display = string_is_affirmative (prop->value());
72 if ((prop = node.property ("name")) != 0) {
73 _name = prop->value();
80 DeviceInfo::strip_cnt() const
86 DeviceInfo::has_master_fader() const
88 return _has_master_fader;
92 DeviceInfo::has_two_character_display() const
94 return _has_two_character_display;
98 DeviceInfo::has_segmented_display() const
100 return _has_segmented_display;
104 DeviceInfo::has_timecode_display () const
106 return _has_timecode_display;