blob: 2d40b2f250a52a2696c0f230e0f085d3787cef3f [file] [log] [blame]
agsantos5aa39652020-08-11 18:18:04 -04001/**
2 * Copyright (C) 2020 Savoir-faire Linux Inc.
agsantosef9f8562020-06-25 16:43:25 -04003 *
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
agsantosac1940d2020-09-17 10:18:40 -040021#include "pluginParameters.h" // Logger
AGS555248cd2020-05-13 11:15:19 -040022#include "pluglog.h"
23
24PluginParameters pluginParameters;
25
agsantos5aa39652020-08-11 18:18:04 -040026void
27setGlobalPluginParameters(std::map<std::string, std::string> pp)
AGS555248cd2020-05-13 11:15:19 -040028{
agsantos5aa39652020-08-11 18:18:04 -040029 if (!pp.empty()) {
agsantosac1940d2020-09-17 10:18:40 -040030 if (pp.find("streamslist") != pp.end()) {
AGS555248cd2020-05-13 11:15:19 -040031 pluginParameters.stream = pp.at("streamslist");
32 Plog::log(Plog::LogPriority::INFO, "GLOBAL STREAM ", pluginParameters.stream);
33 }
agsantosac1940d2020-09-17 10:18:40 -040034 if (pp.find("modellist") != pp.end()) {
AGS555248cd2020-05-13 11:15:19 -040035 pluginParameters.model = pp.at("modellist");
36 Plog::log(Plog::LogPriority::INFO, "GLOBAL MODEL ", pluginParameters.model);
37 }
agsantosac1940d2020-09-17 10:18:40 -040038 if (pp.find("background") != pp.end()) {
agsantos9dcf4302020-09-01 18:21:48 -040039 pluginParameters.image = pp.at("background");
AGS555248cd2020-05-13 11:15:19 -040040 Plog::log(Plog::LogPriority::INFO, "GLOBAL IMAGE ", pluginParameters.image);
41 }
42 }
43}
44
agsantosac1940d2020-09-17 10:18:40 -040045void
46getGlobalPluginParameters(PluginParameters* mPluginParameters)
AGS555248cd2020-05-13 11:15:19 -040047{
48 mPluginParameters->image = pluginParameters.image;
49 mPluginParameters->model = pluginParameters.model;
50 mPluginParameters->stream = pluginParameters.stream;
51}
52
agsantosac1940d2020-09-17 10:18:40 -040053PluginParameters*
54getGlobalPluginParameters()
AGS555248cd2020-05-13 11:15:19 -040055{
56 return &pluginParameters;
57}