1
//---------------------------------------------------------------------------------------
2
// LenMus Phonascus: The teacher of music
3
// Copyright (c) 2002-2012 LenMus project
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 3 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, see <http://www.gnu.org/licenses/>.
16
// For any comment, suggestion or feature request, please contact the manager of
17
// the project at cecilios@users.sourceforge.net
19
//---------------------------------------------------------------------------------------
21
#ifndef __LENMUS_CADENCESCONSTRAINS_H__ //to avoid nested includes
22
#define __LENMUS_CADENCESCONSTRAINS_H__
25
#include "lenmus_standard_header.h"
26
#include "lenmus_generators.h"
27
#include "lenmus_constrains.h"
28
#include "lenmus_cadence.h"
31
#include <wx/wxprec.h>
40
lm_eCadButtonTerminal = 0,
41
lm_eCadButtonTransient,
44
lm_eCadButtonImperfect,
45
lm_eCadButtonDeceptive,
52
class CadencesConstrains : public ExerciseOptions
55
CadencesConstrains(wxString sSection, ApplicationScope& appScope);
56
~CadencesConstrains() {}
58
ECadenceType GetRandomCadence();
60
bool IsCadenceValid(ECadenceType nType) { return m_fValidCadences[nType]; }
61
void SetCadenceValid(ECadenceType nType, bool fValid) { m_fValidCadences[nType] = fValid; }
62
bool* GetValidCadences() { return m_fValidCadences; }
64
bool IsValidButton(ECadenceButtons nB) { return m_fValidButtons[nB]; }
65
void SetValidButton(ECadenceButtons nB, bool fValue) { m_fValidButtons[nB] = fValue; }
66
bool* GetValidButtons() { return m_fValidButtons; }
68
int GetKeyDisplayMode() { return m_nKeyDisplayMode; }
69
void SetKeyDisplayMode(int nKeyDisplayMode) { m_nKeyDisplayMode = nKeyDisplayMode; }
71
void SetSection(wxString sSection) {
72
m_sSection = sSection;
78
KeyConstrains* GetKeyConstrains() { return &m_oValidKeys; }
84
bool m_fValidButtons[lm_eCadMaxButton];
85
bool m_fValidCadences[k_cadence_max];
86
KeyConstrains m_oValidKeys; //allowed key signatures
88
//params only for ear training exercises
89
int m_nKeyDisplayMode; // 0-play A4 note
97
#endif // __LENMUS_CADENCESCONSTRAINS_H__