File: MainController.h

package info (click to toggle)
exadrums 0.7.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 5,728 kB
  • sloc: cpp: 2,880; xml: 165; makefile: 76
file content (84 lines) | stat: -rw-r--r-- 1,642 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
/*
 * Controller.h
 *
 *  Created on: 16 Apr 2016
 *      Author: jeremy
 */

#ifndef SOURCE_CONTROLLERS_MAINCONTROLLER_H_
#define SOURCE_CONTROLLERS_MAINCONTROLLER_H_


#include "MetronomeController.h"
#include "KitController.h"
#include "ConfigController.h"
#include "CoachController.h"

#include <libexadrums/Api/eXaDrums.hpp>

#include <gtkmm/builder.h>
#include <gtkmm/button.h>
#include <gtkmm/checkbutton.h>
#include <gtkmm/aboutdialog.h>
#include <gtkmm/window.h>

#include <string>
#include <memory>
#include <functional>

#include <cstdlib>


namespace Controllers
{

	class MainController
	{

	public:

		MainController();
		virtual ~MainController();

		void Create(Glib::RefPtr<Gtk::Builder>& builder, const std::string& mf, const std::function<void()>& quit, bool isRoot);
		bool ReebootRequired() const 
		{
			if(configController != nullptr)
				return configController->IsImportConfig(); 
			
			return false;
		}

	private:

		// Signals methods
		// Dialogs
		void ShowAboutDialog();
		void HideAboutDialog(int responseId);

		bool isCreated = false;

		std::shared_ptr<eXaDrumsApi::eXaDrums> drumKit;
		Glib::RefPtr<Gtk::Builder> builder;

		// Controllers
		std::unique_ptr<MetronomeController> metronomeController;
		std::unique_ptr<CoachController> coachController;
		std::unique_ptr<KitController> kitController;
		std::unique_ptr<ConfigController> configController;

		// Buttons
		Gtk::Button* aboutButton = nullptr;
		Gtk::Button* rhythmCoachPrefButton = nullptr;

		// Dialogs
		Gtk::AboutDialog* aboutDialog = nullptr;

		// Windows


	};

} /* namespace Gui */

#endif /* SOURCE_CONTROLLERS_MAINCONTROLLER_H_ */