Loading...
Searching...
No Matches
Settings.cpp
Go to the documentation of this file.
// Copyright (c) 2008-2019 OpenShot Studios, LLC
//
// SPDX-License-Identifier: LGPL-3.0-or-later
#include <cstdlib>
#include <omp.h>
#include "Settings.h"
using namespace openshot;
// Global reference to Settings
Settings *Settings::m_pInstance = nullptr;
// Create or Get an instance of the settings singleton
Settings *Settings::Instance()
{
if (!m_pInstance) {
// Create the actual instance of Settings only once
m_pInstance = new Settings;
m_pInstance->OMP_THREADS = omp_get_num_procs();
m_pInstance->FF_THREADS = omp_get_num_procs();
auto env_debug = std::getenv("LIBOPENSHOT_DEBUG");
if (env_debug != nullptr)
m_pInstance->DEBUG_TO_STDERR = true;
}
return m_pInstance;
}
Settings.h
Header file for global Settings class.
openshot::Settings
This class is contains settings used by libopenshot (and can be safely toggled at any point).
Definition Settings.h:26
openshot::Settings::Instance
static Settings * Instance()
Create or get an instance of this logger singleton (invoke the class with this method).
Definition Settings.cpp:23
openshot
This namespace is the default namespace for all code in the openshot library.
Definition Compressor.h:29