2017-03-30 20:11:37 +02:00
|
|
|
/****************************************************************************
|
|
|
|
* Copyright (C) 2015 Dimok
|
|
|
|
* Modified by Maschell, 2016,2017 for HID to VPAD
|
|
|
|
*
|
|
|
|
* 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
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (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/>.
|
|
|
|
****************************************************************************/
|
|
|
|
#ifndef _APPLICATION_H
|
|
|
|
#define _APPLICATION_H
|
|
|
|
|
|
|
|
#include "menu/MainWindow.h"
|
|
|
|
#include "video/CVideo.h"
|
|
|
|
#include "system/CThread.h"
|
|
|
|
|
|
|
|
#define APPLICATION_CLOSE_APPLY 1
|
|
|
|
#define APPLICATION_CLOSE_MIIMAKER 2
|
|
|
|
|
|
|
|
class Application : public CThread
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
static Application * instance() {
|
|
|
|
if(!applicationInstance)
|
|
|
|
applicationInstance = new Application();
|
|
|
|
return applicationInstance;
|
|
|
|
}
|
|
|
|
static void destroyInstance() {
|
|
|
|
if(applicationInstance) {
|
|
|
|
delete applicationInstance;
|
|
|
|
applicationInstance = NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
CVideo *getVideo(void) const {
|
|
|
|
return video;
|
|
|
|
}
|
|
|
|
MainWindow *getMainWindow(void) const {
|
|
|
|
return mainWindow;
|
|
|
|
}
|
|
|
|
|
|
|
|
GuiSound *getBgMusic(void) const {
|
|
|
|
return bgMusic;
|
|
|
|
}
|
|
|
|
|
2017-04-10 11:07:50 +02:00
|
|
|
s32 exec(void);
|
2017-03-30 20:11:37 +02:00
|
|
|
void fadeOut(void);
|
|
|
|
|
2017-05-07 14:52:18 +02:00
|
|
|
void reloadUI(void);
|
|
|
|
|
2017-04-10 11:07:50 +02:00
|
|
|
void quit(s32 code) {
|
2017-03-30 20:11:37 +02:00
|
|
|
exitCode = code;
|
|
|
|
exitApplication = true;
|
|
|
|
}
|
|
|
|
private:
|
|
|
|
Application();
|
2017-05-06 19:53:36 +02:00
|
|
|
|
2017-03-30 20:11:37 +02:00
|
|
|
virtual ~Application();
|
|
|
|
|
|
|
|
static Application *applicationInstance;
|
|
|
|
static bool exitApplication;
|
|
|
|
|
|
|
|
void executeThread(void);
|
|
|
|
|
2017-05-06 19:53:36 +02:00
|
|
|
void loadLanguageFromConfig();
|
|
|
|
|
2017-05-07 14:52:18 +02:00
|
|
|
bool reloadUIflag = false;
|
|
|
|
|
2017-03-30 20:11:37 +02:00
|
|
|
GuiSound *bgMusic;
|
|
|
|
CVideo *video;
|
|
|
|
MainWindow *mainWindow;
|
|
|
|
GuiController *controller[5];
|
2017-04-10 11:07:50 +02:00
|
|
|
s32 exitCode;
|
2017-03-30 20:11:37 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif //_APPLICATION_H
|