1
//--------------------------------------------------------------------------------------
2
// LenMus Phonascus: The teacher of music
3
// Copyright (c) 2002-2007 Cecilio Salmeron
5
// This program is free software; you can redistribute it and/or modify it under the
6
// terms of the GNU General Public License as published by the Free Software Foundation;
7
// either version 2 of the License, or (at your option) any later version.
9
// This program is distributed in the hope that it will be useful, but WITHOUT ANY
10
// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
11
// PARTICULAR PURPOSE. See the GNU General Public License for more details.
13
// You should have received a copy of the GNU General Public License along with this
14
// program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street,
15
// Fifth Floor, Boston, MA 02110-1301, USA.
17
// For any comment, suggestion or feature request, please contact the manager of
18
// the project at cecilios@users.sourceforge.net
20
//-------------------------------------------------------------------------------------
21
/*! @file IdfyChordCtrol.h
22
@brief Header file for class lmIdfyChordCtrol
23
@ingroup html_controls
26
#ifndef __IDFYCHORDCTROL_H__ //to avoid nested includes
27
#define __IDFYCHORDCTROL_H__
29
// For compilers that support precompilation, includes "wx/wx.h".
30
#include "wx/wxprec.h"
40
#include "ChordConstrains.h"
41
#include "../score/Score.h"
42
#include "ScoreAuxCtrol.h"
43
#include "UrlAuxCtrol.h"
44
#include "CountersCtrol.h"
48
class lmIdfyChordCtrol : public wxWindow
50
DECLARE_DYNAMIC_CLASS(lmIdfyChordCtrol)
54
// constructor and destructor
55
lmIdfyChordCtrol(wxWindow* parent, wxWindowID id,
56
lmChordConstrains* pConstrains,
57
const wxPoint& pos = wxDefaultPosition,
58
const wxSize& size = wxDefaultSize, int style = 0);
63
void OnSize(wxSizeEvent& event);
64
void OnRespButton(wxCommandEvent& event);
65
void OnPlay(wxCommandEvent& event);
66
void OnNewProblem(wxCommandEvent& event);
67
void OnResetCounters(wxCommandEvent& event);
68
void OnDisplaySolution(wxCommandEvent& event);
69
void OnSettingsButton(wxCommandEvent& event);
71
// event handlers related to debugging
72
void OnDebugShowSourceScore(wxCommandEvent& event);
73
void OnDebugDumpScore(wxCommandEvent& event);
74
void OnDebugShowMidiEvents(wxCommandEvent& event);
78
void EnableButtons(bool fEnable);
81
void DisplaySolution();
84
wxString PrepareScore(EClefType nClef, EChordType nType, lmScore** pScore);
88
lmScore* m_pChordScore; //solution score with the chord
89
lmScore* m_pAuxScore; //score to play user selected chords
90
lmScoreAuxCtrol* m_pScoreCtrol;
91
lmCountersCtrol* m_pCounters;
92
wxFlexGridSizer* m_pKeyboardSizer;
94
lmChordConstrains* m_pConstrains; //constraints for the exercise
95
bool m_fQuestionAsked; //question asked but not yet answered
98
EKeySignatures m_nKey;
104
wxStaticText* m_pRowLabel[5];
105
wxButton* m_pAnswerButton[ect_Max]; //buttons for the answers
106
int m_nRealChord[ect_Max]; // chord that corresponds
107
// to each valid button
108
int m_nRespIndex; //index to the button with the right answer
109
wxString m_sAnswer; //The names of each interval
111
lmUrlAuxCtrol* m_pPlayButton; // "play" button
112
lmUrlAuxCtrol* m_pShowSolution; // "show solution" button
114
//lmIdfyChordCtrol is used both for ear training exercises and for theory exercises.
115
//Following variables are used for configuration
118
DECLARE_EVENT_TABLE()
123
#endif // __IDFYCHORDCTROL_H__