kodi
AppParams.h
1 /*
2  * Copyright (C) 2005-202 Team Kodi
3  * This file is part of Kodi - https://kodi.tv
4  *
5  * SPDX-License-Identifier: GPL-2.0-or-later
6  * See LICENSES/README.md for more information.
7  */
8 
9 #pragma once
10 
11 #include "commons/ilog.h"
12 
13 #include <memory>
14 #include <string>
15 #include <string_view>
16 #include <vector>
17 
18 class CFileItemList;
19 
21 {
22 public:
23  CAppParams();
24  virtual ~CAppParams() = default;
25 
26  int GetLogLevel() const { return m_logLevel; }
27  void SetLogLevel(int logLevel) { m_logLevel = logLevel; }
28 
29  bool IsStartFullScreen() const { return m_startFullScreen; }
30  void SetStartFullScreen(bool startFullScreen) { m_startFullScreen = startFullScreen; }
31 
32  bool IsStandAlone() const { return m_standAlone; }
33  void SetStandAlone(bool standAlone) { m_standAlone = standAlone; }
34 
35  bool HasPlatformDirectories() const { return m_platformDirectories; }
36  void SetPlatformDirectories(bool platformDirectories)
37  {
38  m_platformDirectories = platformDirectories;
39  }
40 
41  bool IsTestMode() const { return m_testmode; }
42  void SetTestMode(bool testMode) { m_testmode = testMode; }
43 
44  const std::string& GetSettingsFile() const { return m_settingsFile; }
45  void SetSettingsFile(const std::string& settingsFile) { m_settingsFile = settingsFile; }
46 
47  const std::string& GetWindowing() const { return m_windowing; }
48  void SetWindowing(const std::string& windowing) { m_windowing = windowing; }
49 
50  const std::string& GetLogTarget() const { return m_logTarget; }
51  void SetLogTarget(const std::string& logTarget) { m_logTarget = logTarget; }
52 
53  std::string_view GetAudioBackend() const { return m_audioBackend; }
54  void SetAudioBackend(std::string_view audioBackend) { m_audioBackend = audioBackend; }
55 
56  std::string_view GetGlInterface() const { return m_glInterface; }
57  void SetGlInterface(const std::string& glInterface) { m_glInterface = glInterface; }
58 
59  CFileItemList& GetPlaylist() const { return *m_playlist; }
60 
70  const std::vector<std::string>& GetRawArgs() const { return m_rawArgs; }
71 
78  void SetRawArgs(std::vector<std::string> args);
79 
80 private:
81  int m_logLevel{LOG_LEVEL_NORMAL};
82 
83  bool m_startFullScreen{false};
84  bool m_standAlone{false};
85  bool m_platformDirectories{true};
86  bool m_testmode{false};
87 
88  std::string m_settingsFile;
89  std::string m_windowing;
90  std::string m_logTarget;
91  std::string m_audioBackend;
92  std::string m_glInterface;
93 
94  std::unique_ptr<CFileItemList> m_playlist;
95 
96  // The raw command-line arguments
97  std::vector<std::string> m_rawArgs;
98 };
Represents a list of files.
Definition: FileItem.h:702
const std::vector< std::string > & GetRawArgs() const
Get the raw command-line arguments.
Definition: AppParams.h:70
void SetRawArgs(std::vector< std::string > args)
Set the raw command-line arguments.
Definition: AppParams.cpp:17
Definition: AppParams.h:20