annotate Source/Mappings/MultiFingerTrigger/TouchkeyMultiFingerTriggerMappingFactory.cpp @ 36:0deac2806a7b

Preset support for the rest of the mappings.
author Andrew McPherson <andrewm@eecs.qmul.ac.uk>
date Fri, 21 Mar 2014 12:53:50 +0000
parents 3580ffe87dc8
children 1526d2fbe01e
rev   line source
andrewm@0 1 /*
andrewm@0 2 TouchKeys: multi-touch musical keyboard control software
andrewm@0 3 Copyright (c) 2013 Andrew McPherson
andrewm@0 4
andrewm@0 5 This program is free software: you can redistribute it and/or modify
andrewm@0 6 it under the terms of the GNU General Public License as published by
andrewm@0 7 the Free Software Foundation, either version 3 of the License, or
andrewm@0 8 (at your option) any later version.
andrewm@0 9
andrewm@0 10 This program is distributed in the hope that it will be useful,
andrewm@0 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
andrewm@0 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
andrewm@0 13 GNU General Public License for more details.
andrewm@0 14
andrewm@0 15 You should have received a copy of the GNU General Public License
andrewm@0 16 along with this program. If not, see <http://www.gnu.org/licenses/>.
andrewm@0 17
andrewm@0 18 =====================================================================
andrewm@0 19
andrewm@0 20 TouchkeyMultiFingerTriggerMappingFactory.cpp: factory for the multiple-
andrewm@0 21 finger trigger mapping, which performs actions when two or more fingers
andrewm@0 22 are added or removed from the key.
andrewm@0 23 */
andrewm@0 24
andrewm@0 25 #include "TouchkeyMultiFingerTriggerMappingFactory.h"
andrewm@36 26
andrewm@36 27 // ****** Preset Save/Load ******
andrewm@36 28 XmlElement* TouchkeyMultiFingerTriggerMappingFactory::getPreset() {
andrewm@36 29 PropertySet properties;
andrewm@36 30
andrewm@36 31 storeCommonProperties(properties);
andrewm@36 32
andrewm@36 33 // No properties for now
andrewm@36 34
andrewm@36 35 XmlElement* preset = properties.createXml("MappingFactory");
andrewm@36 36 preset->setAttribute("type", "MultiFingerTrigger");
andrewm@36 37
andrewm@36 38 return preset;
andrewm@36 39 }
andrewm@36 40
andrewm@36 41 bool TouchkeyMultiFingerTriggerMappingFactory::loadPreset(XmlElement const* preset) {
andrewm@36 42 if(preset == 0)
andrewm@36 43 return false;
andrewm@36 44
andrewm@36 45 PropertySet properties;
andrewm@36 46 properties.restoreFromXml(*preset);
andrewm@36 47
andrewm@36 48 if(!loadCommonProperties(properties))
andrewm@36 49 return false;
andrewm@36 50
andrewm@36 51 // Nothing specific to do for now
andrewm@36 52
andrewm@36 53 return true;
andrewm@36 54 }