1 /***************************************************************************
2 **                                                                        **
3 **  Polyphone, a soundfont editor                                         **
4 **  Copyright (C) 2013-2020 Davy Triponney                                **
5 **                                                                        **
6 **  This program is free software: you can redistribute it and/or modify  **
7 **  it under the terms of the GNU General Public License as published by  **
8 **  the Free Software Foundation, either version 3 of the License, or     **
9 **  (at your option) any later version.                                   **
10 **                                                                        **
11 **  This program is distributed in the hope that it will be useful,       **
12 **  but WITHOUT ANY WARRANTY; without even the implied warranty of        **
13 **  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the          **
14 **  GNU General Public License for more details.                          **
15 **                                                                        **
16 **  You should have received a copy of the GNU General Public License     **
17 **  along with this program. If not, see http://www.gnu.org/licenses/.    **
18 **                                                                        **
19 ****************************************************************************
20 **           Author: Davy Triponney                                       **
21 **  Website/Contact: https://www.polyphone-soundfonts.com                 **
22 **             Date: 01.01.2013                                           **
23 ***************************************************************************/
24 
25 #include "toolmonitor_parameters.h"
26 #include "contextmanager.h"
27 
loadConfiguration()28 void ToolMonitor_parameters::loadConfiguration()
29 {
30     _instAttribute = ContextManager::configuration()->getToolValue(ConfManager::TOOL_TYPE_INSTRUMENT, "monitor", "attribute", 0).toInt();
31     _prstAttribute = ContextManager::configuration()->getToolValue(ConfManager::TOOL_TYPE_PRESET, "monitor", "attribute", 0).toInt();
32     _instLog = ContextManager::configuration()->getToolValue(ConfManager::TOOL_TYPE_INSTRUMENT, "monitor", "log", false).toBool();
33     _prstLog = ContextManager::configuration()->getToolValue(ConfManager::TOOL_TYPE_PRESET, "monitor", "log", false).toBool();
34 }
35 
saveConfiguration()36 void ToolMonitor_parameters::saveConfiguration()
37 {
38     ContextManager::configuration()->setToolValue(ConfManager::TOOL_TYPE_INSTRUMENT, "monitor", "attribute", _instAttribute);
39     ContextManager::configuration()->setToolValue(ConfManager::TOOL_TYPE_PRESET, "monitor", "attribute", _prstAttribute);
40     ContextManager::configuration()->setToolValue(ConfManager::TOOL_TYPE_INSTRUMENT, "monitor", "log", _instLog);
41     ContextManager::configuration()->setToolValue(ConfManager::TOOL_TYPE_PRESET, "monitor", "log", _prstLog);
42 }
43