-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathXT7Main.h
101 lines (92 loc) · 3.28 KB
/
XT7Main.h
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
/*
* File: XT7Main.h
* Author: Saleem Edah-Tally - [email protected]
* Licence : LGPL 2.1
* Copyright Saleem Edah-Tally, M.D. - © 2014
*
* Created on 1 mars 2014, 15:00
*/
#ifndef XT7MAIN_H
#define XT7MAIN_H
#include "Resources/UI/t7main.h"
#include "PedalManager.h"
#include "KeyboardSimulation.h"
#include <wx/config.h>
#include <wx/listctrl.h>
#include <wx/dir.h>
class PedalEVH;
class KeyboardSimulation;
class XT7Main : public T7Main {
public:
friend class PedalEVH;
XT7Main();
XT7Main( wxWindow* parent, wxWindowID id = SYMBOL_T7MAIN_IDNAME, const wxString& caption = SYMBOL_T7MAIN_TITLE, const wxPoint& pos = SYMBOL_T7MAIN_POSITION, const wxSize& size = SYMBOL_T7MAIN_SIZE, long style = SYMBOL_T7MAIN_STYLE );
virtual ~XT7Main();
private:
wxConfig * config;
IPedalMonitor * pedMonitor;
PedalEVH * pedalEVH;
PedalCodeIdentifier * pedCodeIdentifier;
MediaProgress * mediaProgress;
wxListView * lvMediaList;
KeyboardSimulation * m_keyHandler;
bool streamError;
bool configError;
wxArrayString hidPaths;
wxString loadedMediaPath;
void CollapsiblePaneChanged(wxCollapsiblePaneEvent& evt);
void UpdateTitle();
void MessageBox(const wxString& msg, const bool notify = false);
bool ListenToPedal();
void Init();
void SavePedalDevice(wxCommandEvent& evt);
void SavePedalAction(wxCommandEvent& evt);
void SavePedalAutoRewind(wxCommandEvent& evt);
bool ArePedalActionsConsistent();
void StartPedalCodeIdentification(wxCommandEvent& evt);
void UpdatePedalCode(const unsigned short code);
bool AreAllPedalsIdentified();
bool ArePedalsFullyConfigured();
void SliderChanged(wxCommandEvent& evt); // OTHER EVENTS ARE wxScrollEvent
void UpdateMediaProgressPosition();
void UpdateMediaControlPosition(wxFileOffset position);
void LoadMedia(wxListEvent& evt);
void MediaRootChanged(wxFileDirPickerEvent& evt);
void ListMedia(wxCommandEvent& evt);
void SetStreamError();
void ShowAbout(wxCommandEvent& evt);
void OnIdle(wxIdleEvent& evt);
};
///////////////////////////////////////////////////////////////////////////////////////
/*
* Event handler of PedalEvent class.
*/
class PedalEVH : public PedalEvent {
public:
friend class KeyboardSimulation;
PedalEVH(XT7Main * parent, wxFileOffset newAutoRewindOnPause = 1000);
virtual ~PedalEVH();
void UpdateAutoRewind(wxFileOffset newAutoRewindOnPause);
void ResetFastMoveWorkers();
void PauseFastMoveWorkers();
private:
XT7Main * m_owner;
MediaFastMove * m_Forward;
MediaFastMove * m_Rewind;
wxFileOffset m_autoRewind;
void Left(PedalEvent::PedalStatus status);
void Middle(PedalEvent::PedalStatus status);
void Right(PedalEvent::PedalStatus status);
void OnPedalMonitorExit();
void OnFastMoveExit(MediaFastMove * active);
void Rewind(PedalEvent::PedalStatus status);
void FastForward(PedalEvent::PedalStatus status);
void Play(PedalEvent::PedalStatus status);
void OnPedalCaught(const unsigned short code);
void OnCodeIdentifierExit(PedalCodeIdentifier * active);
void OnMediaProgressExit(MediaProgress * active);
void OnMediaProgressPosition();
void OnMediaControlPosition(wxFileOffset position);
void OnStreamError();
};
#endif /* XT7MAIN_H */