OBS Source Code Analysis (3) Obsapp class Introduction

Source: Internet
Author: User

The Obsapp class has the following features:

1. Responsible for profile management

2. Version information management

3. Main interface Obsbasic Object management

4.obs Module Initialization

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::d eque<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 Source Code Analysis (3) Obsapp class Introduction

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.