OBS源碼解析(3)OBSApp類介紹

來源:互聯網
上載者:User

標籤:--   public   std   sap   push   tput   return   string   main   

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類介紹

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.