| 1 |
/* |
| 2 |
* CoachController.h |
| 3 |
* |
| 4 |
* Created on: 7 May 2017 |
| 5 |
* Author: jeremy |
| 6 |
*/ |
| 7 |
|
| 8 |
#ifndef SOURCE_CONTROLLERS_COACHCONTROLLER_H_ |
| 9 |
#define SOURCE_CONTROLLERS_COACHCONTROLLER_H_ |
| 10 |
|
| 11 |
#include <libexadrums/Api/eXaDrums.hpp> |
| 12 |
|
| 13 |
#include <gtkmm/builder.h> |
| 14 |
#include <gtkmm/window.h> |
| 15 |
#include <gtkmm/button.h> |
| 16 |
#include <gtkmm/scale.h> |
| 17 |
#include <gtkmm/levelbar.h> |
| 18 |
#include <gtkmm/label.h> |
| 19 |
|
| 20 |
#include <vector> |
| 21 |
|
| 22 |
|
| 23 |
namespace Controllers |
| 24 |
{ |
| 25 |
|
| 26 |
class CoachController |
| 27 |
{ |
| 28 |
|
| 29 |
public: |
| 30 |
|
| 31 |
CoachController(Glib::RefPtr<Gtk::Builder> builder, std::shared_ptr<eXaDrumsApi::eXaDrums> drumKit); |
| 32 |
virtual ~CoachController(); |
| 33 |
|
| 34 |
private: |
| 35 |
|
| 36 |
void OpenRhythmCoach(); |
| 37 |
void CloseRhythmCoach(); |
| 38 |
bool UpdateCoach(); |
| 39 |
|
| 40 |
Glib::RefPtr<Gtk::Builder> builder; |
| 41 |
std::shared_ptr<eXaDrumsApi::eXaDrums> drumKit; |
| 42 |
|
| 43 |
Gtk::Window* coachWindow; |
| 44 |
Gtk::Button* coachButton; |
| 45 |
Gtk::Button* coachCloseButton; |
| 46 |
Gtk::Scale* clickMeter; |
| 47 |
Gtk::Scale* jitterMeter; |
| 48 |
Gtk::LevelBar* hitMeterBar; |
| 49 |
Gtk::Label* scoreLabel; |
| 50 |
|
| 51 |
sigc::connection coachTimeout; |
| 52 |
|
| 53 |
std::vector<int> scores; |
| 54 |
size_t scoreIndex = 0; |
| 55 |
long long prevLastTrigTime = 0; |
| 56 |
|
| 57 |
}; |
| 58 |
|
| 59 |
} /* namespace Controllers */ |
| 60 |
|
| 61 |
#endif /* SOURCE_CONTROLLERS_COACHCONTROLLER_H_ */ |