agsantos | 5aa3965 | 2020-08-11 18:18:04 -0400 | [diff] [blame] | 1 | /** |
Sébastien Blin | cb783e3 | 2021-02-12 11:34:10 -0500 | [diff] [blame] | 2 | * Copyright (C) 2020-2021 Savoir-faire Linux Inc. |
agsantos | ef9f856 | 2020-06-25 16:43:25 -0400 | [diff] [blame] | 3 | * |
| 4 | * Author: Aline Gondim Santos <aline.gondimsantos@savoirfairelinux.com> |
| 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, write to the Free Software |
| 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
| 19 | */ |
| 20 | |
agsantos | ac1940d | 2020-09-17 10:18:40 -0400 | [diff] [blame] | 21 | #include "pluginParameters.h" // Logger |
AGS5 | 55248cd | 2020-05-13 11:15:19 -0400 | [diff] [blame] | 22 | #include "pluglog.h" |
| 23 | |
| 24 | PluginParameters pluginParameters; |
| 25 | |
agsantos | 5aa3965 | 2020-08-11 18:18:04 -0400 | [diff] [blame] | 26 | void |
| 27 | setGlobalPluginParameters(std::map<std::string, std::string> pp) |
AGS5 | 55248cd | 2020-05-13 11:15:19 -0400 | [diff] [blame] | 28 | { |
agsantos | 5aa3965 | 2020-08-11 18:18:04 -0400 | [diff] [blame] | 29 | if (!pp.empty()) { |
agsantos | ac1940d | 2020-09-17 10:18:40 -0400 | [diff] [blame] | 30 | if (pp.find("streamslist") != pp.end()) { |
AGS5 | 55248cd | 2020-05-13 11:15:19 -0400 | [diff] [blame] | 31 | pluginParameters.stream = pp.at("streamslist"); |
| 32 | Plog::log(Plog::LogPriority::INFO, "GLOBAL STREAM ", pluginParameters.stream); |
| 33 | } |
agsantos | ac1940d | 2020-09-17 10:18:40 -0400 | [diff] [blame] | 34 | if (pp.find("modellist") != pp.end()) { |
AGS5 | 55248cd | 2020-05-13 11:15:19 -0400 | [diff] [blame] | 35 | pluginParameters.model = pp.at("modellist"); |
| 36 | Plog::log(Plog::LogPriority::INFO, "GLOBAL MODEL ", pluginParameters.model); |
| 37 | } |
agsantos | ac1940d | 2020-09-17 10:18:40 -0400 | [diff] [blame] | 38 | if (pp.find("background") != pp.end()) { |
agsantos | 9dcf430 | 2020-09-01 18:21:48 -0400 | [diff] [blame] | 39 | pluginParameters.image = pp.at("background"); |
AGS5 | 55248cd | 2020-05-13 11:15:19 -0400 | [diff] [blame] | 40 | Plog::log(Plog::LogPriority::INFO, "GLOBAL IMAGE ", pluginParameters.image); |
| 41 | } |
| 42 | } |
| 43 | } |
| 44 | |
agsantos | ac1940d | 2020-09-17 10:18:40 -0400 | [diff] [blame] | 45 | void |
| 46 | getGlobalPluginParameters(PluginParameters* mPluginParameters) |
AGS5 | 55248cd | 2020-05-13 11:15:19 -0400 | [diff] [blame] | 47 | { |
| 48 | mPluginParameters->image = pluginParameters.image; |
| 49 | mPluginParameters->model = pluginParameters.model; |
| 50 | mPluginParameters->stream = pluginParameters.stream; |
| 51 | } |
| 52 | |
agsantos | ac1940d | 2020-09-17 10:18:40 -0400 | [diff] [blame] | 53 | PluginParameters* |
| 54 | getGlobalPluginParameters() |
AGS5 | 55248cd | 2020-05-13 11:15:19 -0400 | [diff] [blame] | 55 | { |
| 56 | return &pluginParameters; |
| 57 | } |