mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-03-05 07:06:13 -05:00
UI: Profile initialization
This commit is contained in:
@@ -27,6 +27,7 @@
|
||||
#include <util/dstr.h>
|
||||
#include <util/util.hpp>
|
||||
#include <util/platform.h>
|
||||
#include <util/profiler.hpp>
|
||||
#include <graphics/math-defs.h>
|
||||
|
||||
#include "obs-app.hpp"
|
||||
@@ -577,6 +578,8 @@ bool OBSBasic::LoadService()
|
||||
|
||||
bool OBSBasic::InitService()
|
||||
{
|
||||
ProfileScope("OBSBasic::InitService");
|
||||
|
||||
if (LoadService())
|
||||
return true;
|
||||
|
||||
@@ -728,6 +731,8 @@ bool OBSBasic::InitBasicConfigDefaults()
|
||||
|
||||
bool OBSBasic::InitBasicConfig()
|
||||
{
|
||||
ProfileScope("OBSBasic::InitBasicConfig");
|
||||
|
||||
char configPath[512];
|
||||
|
||||
int ret = GetProfilePath(configPath, sizeof(configPath), "");
|
||||
@@ -766,6 +771,8 @@ bool OBSBasic::InitBasicConfig()
|
||||
|
||||
void OBSBasic::InitOBSCallbacks()
|
||||
{
|
||||
ProfileScope("OBSBasic::InitOBSCallbacks");
|
||||
|
||||
signalHandlers.reserve(signalHandlers.size() + 6);
|
||||
signalHandlers.emplace_back(obs_get_signal_handler(), "source_add",
|
||||
OBSBasic::SourceAdded, this);
|
||||
@@ -783,6 +790,8 @@ void OBSBasic::InitOBSCallbacks()
|
||||
|
||||
void OBSBasic::InitPrimitives()
|
||||
{
|
||||
ProfileScope("OBSBasic::InitPrimitives");
|
||||
|
||||
obs_enter_graphics();
|
||||
|
||||
gs_render_start(true);
|
||||
@@ -805,6 +814,8 @@ void OBSBasic::InitPrimitives()
|
||||
|
||||
void OBSBasic::ResetOutputs()
|
||||
{
|
||||
ProfileScope("OBSBasic::ResetOutputs");
|
||||
|
||||
const char *mode = config_get_string(basicConfig, "Output", "Mode");
|
||||
bool advOut = astrcmpi(mode, "Advanced") == 0;
|
||||
|
||||
@@ -823,6 +834,8 @@ void OBSBasic::ResetOutputs()
|
||||
|
||||
void OBSBasic::OBSInit()
|
||||
{
|
||||
ProfileScope("OBSBasic::OBSInit");
|
||||
|
||||
const char *sceneCollection = config_get_string(App()->GlobalConfig(),
|
||||
"Basic", "SceneCollectionFile");
|
||||
char savePath[512];
|
||||
@@ -878,9 +891,12 @@ void OBSBasic::OBSInit()
|
||||
|
||||
InitPrimitives();
|
||||
|
||||
disableSaving--;
|
||||
Load(savePath);
|
||||
disableSaving++;
|
||||
{
|
||||
ProfileScope("OBSBasic::Load");
|
||||
disableSaving--;
|
||||
Load(savePath);
|
||||
disableSaving++;
|
||||
}
|
||||
|
||||
TimedCheckForUpdates();
|
||||
loaded = true;
|
||||
@@ -921,6 +937,8 @@ void OBSBasic::OBSInit()
|
||||
|
||||
void OBSBasic::InitHotkeys()
|
||||
{
|
||||
ProfileScope("OBSBasic::InitHotkeys");
|
||||
|
||||
struct obs_hotkeys_translations t = {};
|
||||
t.insert = Str("Hotkeys.Insert");
|
||||
t.del = Str("Hotkeys.Delete");
|
||||
@@ -986,6 +1004,8 @@ void OBSBasic::HotkeyTriggered(void *data, obs_hotkey_id id, bool pressed)
|
||||
|
||||
void OBSBasic::CreateHotkeys()
|
||||
{
|
||||
ProfileScope("OBSBasic::CreateHotkeys");
|
||||
|
||||
auto LoadHotkeyData = [&](const char *name) -> OBSData
|
||||
{
|
||||
const char *info = config_get_string(basicConfig,
|
||||
@@ -2001,6 +2021,8 @@ static inline enum video_format GetVideoFormatFromName(const char *name)
|
||||
|
||||
int OBSBasic::ResetVideo()
|
||||
{
|
||||
ProfileScope("OBSBasic::ResetVideo");
|
||||
|
||||
struct obs_video_info ovi;
|
||||
int ret;
|
||||
|
||||
@@ -2052,6 +2074,8 @@ int OBSBasic::ResetVideo()
|
||||
|
||||
bool OBSBasic::ResetAudio()
|
||||
{
|
||||
ProfileScope("OBSBasic::ResetAudio");
|
||||
|
||||
struct obs_audio_info ai;
|
||||
ai.samples_per_sec = config_get_uint(basicConfig, "Audio",
|
||||
"SampleRate");
|
||||
|
||||
Reference in New Issue
Block a user