OpenShot Library | libopenshot  0.2.4
Settings.cpp
Go to the documentation of this file.
1 /**
2  * @file
3  * @brief Source file for global Settings class
4  * @author Jonathan Thomas <jonathan@openshot.org>
5  *
6  * @ref License
7  */
8 
9 /* LICENSE
10  *
11  * Copyright (c) 2008-2019 OpenShot Studios, LLC
12  * <http://www.openshotstudios.com/>. This file is part of
13  * OpenShot Library (libopenshot), an open-source project dedicated to
14  * delivering high quality video editing and animation solutions to the
15  * world. For more information visit <http://www.openshot.org/>.
16  *
17  * OpenShot Library (libopenshot) is free software: you can redistribute it
18  * and/or modify it under the terms of the GNU Lesser General Public License
19  * as published by the Free Software Foundation, either version 3 of the
20  * License, or (at your option) any later version.
21  *
22  * OpenShot Library (libopenshot) is distributed in the hope that it will be
23  * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
24  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25  * GNU Lesser General Public License for more details.
26  *
27  * You should have received a copy of the GNU Lesser General Public License
28  * along with OpenShot Library. If not, see <http://www.gnu.org/licenses/>.
29  */
30 
31 #include "../include/Settings.h"
32 
33 using namespace std;
34 using namespace openshot;
35 
36 
37 // Global reference to logger
38 Settings *Settings::m_pInstance = NULL;
39 
40 // Create or Get an instance of the logger singleton
41 Settings *Settings::Instance()
42 {
43  if (!m_pInstance) {
44  // Create the actual instance of logger only once
45  m_pInstance = new Settings;
46  m_pInstance->HARDWARE_DECODER = 0;
47  m_pInstance->HIGH_QUALITY_SCALING = false;
48  m_pInstance->MAX_WIDTH = 0;
49  m_pInstance->MAX_HEIGHT = 0;
50  m_pInstance->WAIT_FOR_VIDEO_PROCESSING_TASK = false;
51  m_pInstance->OMP_THREADS = 12;
52  m_pInstance->FF_THREADS = 8;
53  m_pInstance->DE_LIMIT_HEIGHT_MAX = 1100;
54  m_pInstance->DE_LIMIT_WIDTH_MAX = 1950;
55  m_pInstance->HW_DE_DEVICE_SET = 0;
56  m_pInstance->HW_EN_DEVICE_SET = 0;
57  m_pInstance->PLAYBACK_AUDIO_DEVICE_NAME = "";
58  }
59 
60  return m_pInstance;
61 }
This class is contains settings used by libopenshot (and can be safely toggled at any point) ...
Definition: Settings.h:56
STL namespace.
int HARDWARE_DECODER
Use video codec for faster video decoding (if supported)
Definition: Settings.h:92
This namespace is the default namespace for all code in the openshot library.