OBS源码解析(3)OBSApp类介绍
OBSApp类有以下功能:
1.负责配置文件管理
2.版本信息管理
3.主界面OBSBasic对象管理
4.obs模块初始化
class OBSApp : public QApplication {
Q_OBJECT
private:
std::string locale;
std::string theme;
ConfigFile globalConfig;
TextLookup textLookup;
OBSContext obsContext;
QPointer<OBSMainWindow> mainWindow;
profiler_name_store_t *profilerNameStore = nullptr;
os_inhibit_t *sleepInhibitor = nullptr;
int sleepInhibitRefs = 0;
std::deque<obs_frontend_translate_ui_cb> translatorHooks;
bool InitGlobalConfig();
bool InitGlobalConfigDefaults();
bool InitLocale();
bool InitTheme();
public:
OBSApp(int &argc, char **argv, profiler_name_store_t *store);
~OBSApp();
void AppInit();
bool OBSInit();
inline QMainWindow *GetMainWindow() const {return mainWindow.data();}
inline config_t *GlobalConfig() const {return globalConfig;}
inline const char *GetLocale() const
{
return locale.c_str();
}
inline const char *GetTheme() const {return theme.c_str();}
bool SetTheme(std::string name, std::string path = "");
inline lookup_t *GetTextLookup() const {return textLookup;}
inline const char *GetString(const char *lookupVal) const
{
return textLookup.GetString(lookupVal);
}
bool TranslateString(const char *lookupVal, const char **out) const;
profiler_name_store_t *GetProfilerNameStore() const
{
return profilerNameStore;
}
const char *GetLastLog() const;
const char *GetCurrentLog() const;
std::string GetVersionString() const;
const char *InputAudioSource() const;
const char *OutputAudioSource() const;
const char *GetRenderModule() const;
inline void IncrementSleepInhibition()
{
if (!sleepInhibitor) return;
if (sleepInhibitRefs++ == 0)
os_inhibit_sleep_set_active(sleepInhibitor, true);
}
inline void DecrementSleepInhibition()
{
if (!sleepInhibitor) return;
if (sleepInhibitRefs == 0) return;
if (--sleepInhibitRefs == 0)
os_inhibit_sleep_set_active(sleepInhibitor, false);
}
inline void PushUITranslation(obs_frontend_translate_ui_cb cb)
{
translatorHooks.emplace_front(cb);
}
inline void PopUITranslation()
{
translatorHooks.pop_front();
}
};
OBS源码解析(3)OBSApp类介绍的更多相关文章
- AOP源码解析:AspectJAwareAdvisorAutoProxyCreator类的介绍
AspectJAwareAdvisorAutoProxyCreator 的类图 上图中一些 类/接口 的介绍: AspectJAwareAdvisorAutoProxyCreator : 公开了Asp ...
- Mybatis源码解析3——核心类SqlSessionFactory,看完我悟了
这是昨晚的武汉,晚上九点钟拍的,疫情又一次来袭,曾经熙熙攘攘的夜市也变得冷冷清清,但比前几周要好很多了.希望大家都能保护好自己,保护好身边的人,生活不可能像你想象的那么好,但也不会像你想象的那么糟. ...
- java源码解析之String类(二)
上一节主要介绍了String类的一些构造方法,主要分为四类 无参构造器:String(),创建一个空字符串"",区别于null字符串,""已经初始化,null并 ...
- Netty源码解析 -- 内存对齐类SizeClasses
在学习Netty内存池之前,我们先了解一下Netty的内存对齐类SizeClasses,它为Netty内存池中的内存块提供大小对齐,索引计算等服务方法. 源码分析基于Netty 4.1.52 Nett ...
- AOP源码解析:AspectJExpressionPointcutAdvisor类
先看看 AspectJExpressionPointcutAdvisor 的类图 再了解一下切点(Pointcut)表达式,它指定触发advice的方法,可以精确到返回参数,参数类型,方法名 1 pa ...
- java源码解析之Object类
一.Object类概述 Object类是java中类层次的根,是所有类的基类.在编译时会自动导入.Object中的方法如下: 二.方法详解 Object的方法可以分成两类,一类是被关键字fin ...
- Bulma 源码解析之 .columns 类
{说明} 这一部分的源码内容被我简化了,另外我还额外添加了一个辅助类 is-grow. .columns // 修饰类 &.is-centered justify-content: cente ...
- java源码解析之String类(一)
String是我们接触最多的类,无论是学习中还是工作中,基本每天都会和字符串打交道,从字符串本身的各种拼接.切片.变形,再到和其他基本数据类型的转换,几乎无时无刻都在使用它,今天就让我们揭开Strin ...
- Spring源码解析 – @Configuration配置类及注解Bean的解析
在分析Spring 容器创建过程时,我们知道容器默认会加载一些后置处理器PostPRocessor,以AnnotationConfigApplicationContext为例,在构造函数中初始化rea ...
随机推荐
- Coins(多重背包+二进制优化)
Problem Description Whuacmers use coins.They have coins of value A1,A2,A3...An Silverland dollar. On ...
- Is It A Tree?
Is It A Tree? Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total ...
- (11.06)Java小知识
最近由于课程变化,学习计划也跟着改动,留给我写博客的时间也越来越少.今天晚上没有课,抽空过来图书馆写一写,许久不写感觉都有点陌生了! 今天要和大季家分享的衔接了上一篇博客,是关于方法的嵌套调用与递归调 ...
- 【Win 10 应用开发】UI Composition 札记(三):与 XAML 集成
除了 DirectX 游戏开发,我们一般很少单独使用 UI Composition ,因此,与 XAML 互动并集成是必然结果.这样能够把两者的优势混合使用,让UI布局能够更灵活. 说到与 XAML ...
- Luogu P1541 乌龟棋(NOIP2010TG)
自己的第一篇博文 祭一下祭一下 题目背景 小明过生日的时候,爸爸送给他一副乌龟棋当作礼物. 题目描述 乌龟棋的棋盘是一行N个格子,每个格子上一个分数(非负整数).棋盘第1格是唯一的起点,第N格是终点, ...
- RE:考勤系统的复盘
一大早看了 <美团旅行前端技术体系的思考与实践> 这篇文,恰巧又在昨天完成了一个项目.确实让我忍不住码篇总结,为自己做一个复盘. 历时两个月,考勤系统 这个项目总算能够称得上完成了.项目 ...
- C# WinForm程序添加启动画面
如果程序在装载时需要进行较长时间的处理,最好使用启动画面,一方面美化程序,一方面可以不使用户面对着一片空白的程序界面. 我手头上一个小项目主界面启动时需要检查用户文件及运行环境是否有效,需要一段时间处 ...
- python基础-------模块与包(四)
configparser模块与 subprcess 利用configparser模块配置一个类似于 windows.ini格式的文件可以包含一个或多个节(section),每个节可以有多个参数(键=值 ...
- pt-show-grants
用法: pt-show-grants [OPTION ... ] [DSN] 例子: pt-show-grants pt-show-grants --separate --revoke | dif ...
- Linux系统查找文件目录的命令
查找目录名autobackup,并且列出路径:find -name 'autobackup'-type d find -name 'directoryname'-type d