2013-11-07 15:45:03 -08:00
|
|
|
/******************************************************************************
|
|
|
|
Copyright (C) 2013 by Hugh Bailey <obs.jim@gmail.com>
|
|
|
|
|
|
|
|
This program is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
2013-12-02 21:24:38 -08:00
|
|
|
the Free Software Foundation, either version 2 of the License, or
|
2013-11-07 15:45:03 -08:00
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
******************************************************************************/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <wx/app.h>
|
2013-12-22 22:40:07 -08:00
|
|
|
#include <wx/window.h>
|
2013-11-07 15:45:03 -08:00
|
|
|
|
2013-12-22 16:42:02 -08:00
|
|
|
#include <util/util.hpp>
|
2013-11-23 22:38:52 -08:00
|
|
|
|
2013-12-30 05:56:39 -08:00
|
|
|
#include <string>
|
|
|
|
|
2013-11-23 22:38:52 -08:00
|
|
|
class OBSAppBase : public wxApp {
|
|
|
|
public:
|
|
|
|
virtual ~OBSAppBase();
|
|
|
|
};
|
|
|
|
|
|
|
|
class OBSApp : public OBSAppBase {
|
2013-12-30 05:56:39 -08:00
|
|
|
std::string locale;
|
|
|
|
ConfigFile globalConfig;
|
|
|
|
TextLookup textLookup;
|
|
|
|
wxWindow *mainWindow;
|
2013-11-23 22:38:52 -08:00
|
|
|
|
|
|
|
bool InitGlobalConfig();
|
2013-12-15 23:07:08 -08:00
|
|
|
bool InitGlobalConfigDefaults();
|
2013-11-23 22:38:52 -08:00
|
|
|
bool InitConfigDefaults();
|
2013-12-07 09:22:56 -08:00
|
|
|
bool InitLocale();
|
2013-12-22 22:40:07 -08:00
|
|
|
bool InitOBSBasic();
|
|
|
|
|
|
|
|
void GetFPSCommon(uint32_t &num, uint32_t &den) const;
|
|
|
|
void GetFPSInteger(uint32_t &num, uint32_t &den) const;
|
|
|
|
void GetFPSFraction(uint32_t &num, uint32_t &den) const;
|
|
|
|
void GetFPSNanoseconds(uint32_t &num, uint32_t &den) const;
|
2013-11-23 22:38:52 -08:00
|
|
|
|
2013-11-07 15:45:03 -08:00
|
|
|
public:
|
|
|
|
virtual bool OnInit();
|
2013-11-23 22:38:52 -08:00
|
|
|
virtual int OnExit();
|
2013-12-07 09:22:56 -08:00
|
|
|
|
2013-12-22 22:40:07 -08:00
|
|
|
inline wxWindow *GetMainWindow() const {return mainWindow;}
|
|
|
|
|
|
|
|
inline config_t GlobalConfig() const {return globalConfig;}
|
2013-12-12 20:47:42 -08:00
|
|
|
|
2013-12-30 05:56:39 -08:00
|
|
|
inline const char *GetLocale() const
|
|
|
|
{
|
|
|
|
return locale.c_str();
|
|
|
|
}
|
|
|
|
|
2013-12-22 22:40:07 -08:00
|
|
|
inline const char *GetString(const char *lookupVal) const
|
2013-12-07 09:22:56 -08:00
|
|
|
{
|
|
|
|
return textLookup.GetString(lookupVal);
|
|
|
|
}
|
2013-12-22 22:40:07 -08:00
|
|
|
|
|
|
|
void GetConfigFPS(uint32_t &num, uint32_t &den) const;
|
|
|
|
const char *GetRenderModule() const;
|
2013-11-07 15:45:03 -08:00
|
|
|
};
|
2013-11-23 22:38:52 -08:00
|
|
|
|
|
|
|
wxDECLARE_APP(OBSApp);
|
2013-12-07 09:22:56 -08:00
|
|
|
|
2013-12-12 20:47:42 -08:00
|
|
|
inline config_t GetGlobalConfig() {return wxGetApp().GlobalConfig();}
|
|
|
|
|
2013-12-07 09:22:56 -08:00
|
|
|
#define Str(lookupVal) wxGetApp().GetString(lookupVal)
|
2013-12-13 22:11:23 -08:00
|
|
|
#define WXStr(lookupVal) wxString(Str(lookupVal), wxConvUTF8)
|