35 #define PIANO_EVENT_TIMER 73566
36 #define DEFERRED_KEY_CLICK_DOWN 1
37 #define DEFERRED_KEY_CLICK_UP 2
38 #define INFOWIN_TIMEOUT 3
41 WX_DECLARE_OBJARRAY(wxRect, RectArray);
47 PIANO_MODE_COMPOSITE = 0,
61 ChartTypeEnum chart_type;
62 ChartFamilyEnum chart_family;
63 std::vector<int> dbindex_list;
71 class Piano :
public wxEvtHandler {
76 void Paint(
int y, wxDC &dc, wxDC *shapeDC = NULL);
77 void Paint(
int y,
ocpnDC &dc, wxDC *shapeDC = NULL);
79 void FormatKeys(
void);
80 bool MouseEvent(wxMouseEvent &event);
81 void SetColorScheme(ColorScheme cs);
82 void SetKeyArray(std::vector<int> ¢er_array, std::vector<int> &full_array);
83 void SetActiveKey(
int iactive) { m_iactive = iactive; }
84 void SetActiveKeyArray(std::vector<int> array);
85 void SetNoshowIndexArray(std::vector<int> array);
86 void AddNoshowIndexArray(std::vector<int> array);
87 void SetEclipsedIndexArray(std::vector<int> array);
88 void SetSkewIndexArray(std::vector<int> array);
89 void SetTmercIndexArray(std::vector<int> array);
90 void SetPolyIndexArray(std::vector<int> array);
91 int GetPianoMode() {
return m_piano_mode;}
93 std::vector<int> GetActiveKeyArray() {
return m_active_index_array; }
95 void SetVizIcon(wxBitmap *picon_bmp) {
96 if (m_pVizIconBmp)
delete m_pVizIconBmp;
97 m_pVizIconBmp = picon_bmp;
99 void SetInVizIcon(wxBitmap *picon_bmp) {
100 if (m_pInVizIconBmp)
delete m_pInVizIconBmp;
101 m_pInVizIconBmp = picon_bmp;
103 void SetSkewIcon(wxBitmap *picon_bmp) {
104 if (m_pSkewIconBmp)
delete m_pSkewIconBmp;
105 m_pSkewIconBmp = picon_bmp;
107 void SetTMercIcon(wxBitmap *picon_bmp) {
108 if (m_pTmercIconBmp)
delete m_pTmercIconBmp;
109 m_pTmercIconBmp = picon_bmp;
111 void SetPolyIcon(wxBitmap *picon_bmp) {
112 if (m_pPolyIconBmp)
delete m_pPolyIconBmp;
113 m_pPolyIconBmp = picon_bmp;
115 void ShowBusy(
bool busy);
116 void onTimerEvent(wxTimerEvent &event);
118 wxPoint GetKeyOrigin(
int key_index);
119 void ResetRollover(
void);
120 void SetRoundedRectangles(
bool val) {
128 wxString &GenerateAndStoreNewHash();
129 wxString &GetStoredHash();
131 int GetnKeys() {
return m_nRegions; }
134 void SetPianoMode(
int new_mode) {m_piano_mode = new_mode;}
136 void DrawGLSL(
int y);
137 void BuildGLTexture();
138 bool InArray(std::vector<int> &array,
int key);
142 wxString GetStateHash();
148 std::vector<PianoKeyElement> m_composite_array;
152 int m_hover_icon_last;
157 wxBrush m_srBrush, m_rBrush;
158 wxBrush m_svBrush, m_vBrush;
159 wxBrush m_unavailableBrush;
160 wxBrush m_utileBrush, m_tileBrush;
165 std::vector<int> m_key_array;
166 std::vector<int> m_noshow_index_array;
167 std::vector<int> m_active_index_array;
168 std::vector<int> m_eclipsed_index_array;
169 std::vector<int> m_skew_index_array;
170 std::vector<int> m_tmerc_index_array;
171 std::vector<int> m_poly_index_array;
173 wxTimer m_eventTimer;
174 int m_click_sel_index;
177 std::vector<wxRect> KeyRect;
179 wxBitmap *m_pVizIconBmp;
180 wxBitmap *m_pInVizIconBmp;
181 wxBitmap *m_pTmercIconBmp;
182 wxBitmap *m_pSkewIconBmp;
183 wxBitmap *m_pPolyIconBmp;
189 unsigned int m_tex, m_texw, m_texh, m_tex_piano_height;
190 int m_ref, m_pad, m_radius, m_texPitch;
195 DECLARE_EVENT_TABLE()
205 void OnSize(wxSizeEvent &event);
206 void OnPaint(wxPaintEvent &event);
207 void MouseEvent(wxMouseEvent &event);
212 DECLARE_EVENT_TABLE()