| 1 |
/* |
| 2 |
* Controller.h |
| 3 |
* |
| 4 |
* Created on: 16 Apr 2016 |
| 5 |
* Author: jeremy |
| 6 |
*/ |
| 7 |
|
| 8 |
#ifndef SOURCE_CONTROLLERS_MAINCONTROLLER_H_ |
| 9 |
#define SOURCE_CONTROLLERS_MAINCONTROLLER_H_ |
| 10 |
|
| 11 |
|
| 12 |
#include "MetronomeController.h" |
| 13 |
#include "KitController.h" |
| 14 |
#include "ConfigController.h" |
| 15 |
#include "CoachController.h" |
| 16 |
|
| 17 |
#include <libexadrums/Api/eXaDrums.hpp> |
| 18 |
|
| 19 |
#include <gtkmm/builder.h> |
| 20 |
#include <gtkmm/button.h> |
| 21 |
#include <gtkmm/checkbutton.h> |
| 22 |
#include <gtkmm/aboutdialog.h> |
| 23 |
#include <gtkmm/window.h> |
| 24 |
|
| 25 |
#include <string> |
| 26 |
#include <memory> |
| 27 |
#include <functional> |
| 28 |
|
| 29 |
#include <cstdlib> |
| 30 |
|
| 31 |
|
| 32 |
namespace Controllers |
| 33 |
{ |
| 34 |
|
| 35 |
class MainController |
| 36 |
{ |
| 37 |
|
| 38 |
public: |
| 39 |
|
| 40 |
MainController(); |
| 41 |
virtual ~MainController(); |
| 42 |
|
| 43 |
void Create(Glib::RefPtr<Gtk::Builder>& builder, const std::string& mf, const std::function<void()>& quit, bool isRoot); |
| 44 |
bool ReebootRequired() const |
| 45 |
{ |
| 46 |
if(configController != nullptr) |
| 47 |
return configController->IsImportConfig(); |
| 48 |
|
| 49 |
return false; |
| 50 |
} |
| 51 |
|
| 52 |
private: |
| 53 |
|
| 54 |
// Signals methods |
| 55 |
// Dialogs |
| 56 |
void ShowAboutDialog(); |
| 57 |
void HideAboutDialog(int responseId); |
| 58 |
|
| 59 |
bool isCreated = false; |
| 60 |
|
| 61 |
std::shared_ptr<eXaDrumsApi::eXaDrums> drumKit; |
| 62 |
Glib::RefPtr<Gtk::Builder> builder; |
| 63 |
|
| 64 |
// Controllers |
| 65 |
std::unique_ptr<MetronomeController> metronomeController; |
| 66 |
std::unique_ptr<CoachController> coachController; |
| 67 |
std::unique_ptr<KitController> kitController; |
| 68 |
std::unique_ptr<ConfigController> configController; |
| 69 |
|
| 70 |
// Buttons |
| 71 |
Gtk::Button* aboutButton = nullptr; |
| 72 |
Gtk::Button* rhythmCoachPrefButton = nullptr; |
| 73 |
|
| 74 |
// Dialogs |
| 75 |
Gtk::AboutDialog* aboutDialog = nullptr; |
| 76 |
|
| 77 |
// Windows |
| 78 |
|
| 79 |
|
| 80 |
}; |
| 81 |
|
| 82 |
} /* namespace Gui */ |
| 83 |
|
| 84 |
#endif /* SOURCE_CONTROLLERS_MAINCONTROLLER_H_ */ |