1
// RCS-ID: $Id: TheoScalesCtrol.h,v 1.3 2006/02/23 19:19:53 cecilios Exp $
2
//--------------------------------------------------------------------------------------
3
// LenMus Phonascus: The teacher of music
4
// Copyright (c) 2002-2006 Cecilio Salmeron
6
// This program is free software; you can redistribute it and/or modify it under the
7
// terms of the GNU General Public License as published by the Free Software Foundation;
8
// either version 2 of the License, or (at your option) any later version.
10
// This program is distributed in the hope that it will be useful, but WITHOUT ANY
11
// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12
// PARTICULAR PURPOSE. See the GNU General Public License for more details.
14
// You should have received a copy of the GNU General Public License along with this
15
// program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street,
16
// Fifth Floor, Boston, MA 02110-1301, USA.
18
// For any comment, suggestion or feature request, please contact the manager of
19
// the project at cecilios@users.sourceforge.net
21
//-------------------------------------------------------------------------------------
22
/*! @file TheoScalesCtrol.h
23
@brief Header file for class lmTheoScalesCtrol
24
@ingroup html_controls
30
#ifndef __THEOSCALESCTROL_H__ //to avoid nested includes
31
#define __THEOSCALESCTROL_H__
33
// for (compilers that support precompilation, includes "wx/wx.h".
34
#include "wx/wxprec.h"
44
#include "wx/checkbox.h"
46
#include "Constrains.h"
47
#include "../score/score.h"
48
#include "ScoreAuxCtrol.h"
49
#include "UrlAuxCtrol.h"
50
#include "../sound/SoundEvents.h"
53
class lmTheoScalesCtrol : public wxWindow
55
DECLARE_DYNAMIC_CLASS(lmTheoScalesCtrol)
59
// constructor and destructor
60
lmTheoScalesCtrol(wxWindow* parent, wxWindowID id,
61
lmTheoScalesConstrains* pConstrains,
62
const wxPoint& pos = wxDefaultPosition,
63
const wxSize& size = wxDefaultSize, int style = 0);
68
void OnClose(wxCloseEvent& event);
69
void OnSize(wxSizeEvent& event);
70
void OnRespButton(wxCommandEvent& event);
71
void OnPlay(wxCommandEvent& event);
72
void OnNewProblem(wxCommandEvent& event);
73
void OnResetCounters(wxCommandEvent& event);
74
void OnDisplaySolution(wxCommandEvent& event);
76
// event handlers related to debugging
77
void OnDebugShowSourceScore(wxCommandEvent& event);
78
void OnDebugDumpScore(wxCommandEvent& event);
79
void OnDebugShowMidiEvents(wxCommandEvent& event);
81
// event handlers related with playing a score
82
void OnEndOfPlay(lmEndOfPlayEvent& WXUNUSED(event));
86
void EnableButtons(bool fEnable);
89
void DisplaySolution();
95
lmScore* m_pScore; // the score with the scale
96
lmScoreAuxCtrol* m_pScoreCtrol;
97
wxCheckBox* m_pChkKeySignature;
98
lmTheoScalesConstrains* m_pConstrains;
99
bool m_fProblemCreated; //there is a problem prepared
100
lmPitch m_ntMidi[8]; //the midi pitch of the two notes
101
lmPitch m_ntPitch[8]; //the pitch of the two notes
102
bool m_fPlayEnabled; //Play enabled
105
//buttons for the answers: 6 rows, 8 buttons per row
106
wxButton* m_pAnswerButton[48];
107
int m_nRespIndex; //index to the button with the right answer
108
bool m_fButtonsEnabled; //buttons enabled
110
wxString m_sAnswer; //scale name
111
lmUrlAuxCtrol* m_pPlayLink;
112
bool m_fPlaying; //playing
113
bool m_fClosing; // waiting for play stopped to close the window
115
DECLARE_EVENT_TABLE()
120
#endif // __THEOSCALESCTROL_H__