MCPcopy Create free account
hub / github.com/OpenShot/libopenshot / Instance

Method Instance

src/Settings.cpp:43–61  ·  view source on GitHub ↗

Create or Get an instance of the settings singleton

Source from the content-addressed store, hash-verified

41
42// Create or Get an instance of the settings singleton
43Settings *Settings::Instance()
44{
45 if (!m_pInstance) {
46 // Create the actual instance of Settings only once
47 m_pInstance = new Settings;
48 const int machine_threads = std::max(2, omp_get_num_procs());
49 m_pInstance->default_omp_threads = machine_threads;
50 m_pInstance->default_ff_threads = machine_threads;
51 m_pInstance->OMP_THREADS = machine_threads;
52 m_pInstance->FF_THREADS = machine_threads;
53 auto env_debug = std::getenv("LIBOPENSHOT_DEBUG");
54 if (env_debug != nullptr)
55 m_pInstance->DEBUG_TO_STDERR = true;
56 }
57
58 m_pInstance->ApplyOpenMPSettings();
59
60 return m_pInstance;
61}

Callers

nothing calls this directly

Calls 1

ApplyOpenMPSettingsMethod · 0.80

Tested by

no test coverage detected