blob: 0729cbbd16af990ec88ecfb5b70c997690c72b47 [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
AGS555248cd2020-05-13 11:15:19 -040021#include "pluginParameters.h"// Logger
22#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()) {
30 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 }
agsantos5aa39652020-08-11 18:18:04 -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 }
agsantos9dcf4302020-09-01 18:21:48 -040038 if(pp.find("background") != pp.end()) {
39 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
45void getGlobalPluginParameters(PluginParameters* mPluginParameters)
46{
47 mPluginParameters->image = pluginParameters.image;
48 mPluginParameters->model = pluginParameters.model;
49 mPluginParameters->stream = pluginParameters.stream;
50}
51
52
53PluginParameters* getGlobalPluginParameters()
54{
55 return &pluginParameters;
56}