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 ChordConstrains.h
22
@brief Header file for Chord exercises
29
#ifndef __CHORDCONSTRAINS_H__ //to avoid nested includes
30
#define __CHORDCONSTRAINS_H__
32
// For compilers that support precompilation, includes "wx/wx.h".
33
#include "wx/wxprec.h"
43
#include "Generators.h"
44
#include "Constrains.h"
55
ect_LastTriad = ect_Suspended_2nd,
65
ect_MinorMajorSeventh,
66
ect_LastSeventh = ect_MinorMajorSeventh,
72
ect_LastSixth = ect_AugSixth,
74
//last element, to signal End Of Table
83
//last element, to signal End Of Table
88
class lmChordConstrains
91
lmChordConstrains(wxString sSection);
92
~lmChordConstrains() {}
94
EChordType GetRandomChordType();
97
bool AreInversionsAllowed() { return m_fAllowInversions; }
98
void SetInversionsAllowed(bool fValue) { m_fAllowInversions = fValue; }
100
bool IsChordValid(EChordType nType) { return m_fValidChords[nType]; }
101
void SetChordValid(EChordType nType, bool fValid) { m_fValidChords[nType] = fValid; }
102
bool* GetValidChords() { return m_fValidChords; }
104
bool IsValidGroup(EChordGroup nGroup);
106
bool IsModeAllowed(int nMode) { return m_fAllowedModes[nMode]; }
107
void SetModeAllowed(int nMode, bool fValue) {
108
m_fAllowedModes[nMode] = fValue;
111
void SetDisplayKey(bool fValue) { m_fDisplayKey = fValue; }
112
bool DisplayKey() { return m_fDisplayKey; }
114
void SetSettingsLink(bool fValue) { m_fSettingsLink = fValue; }
115
bool IncludeSettingsLink() { return m_fSettingsLink; }
116
void SetSection(wxString sSection) {
117
m_sSection = sSection;
123
void SetTheoryMode(bool fValue) { m_fTheoryMode = fValue; }
124
bool IsTheoryMode() { return m_fTheoryMode; }
126
lmKeyConstrains* GetKeyConstrains() { return &m_oValidKeys; }
132
wxString m_sSection; //to save settings
133
bool m_fSettingsLink; //include settings link
134
bool m_fAllowInversions;
135
bool m_fValidChords[ect_Max];
136
lmKeyConstrains m_oValidKeys; //allowed key signatures
138
bool m_fAllowedModes[3]; // 0-harmonic
139
// 1-melodic ascending
140
// 2-melodic descending
141
wxString m_sLowerRoot; //valid range for root notes
142
wxString m_sUpperRoot;
144
//lmIdfyChordCtrol is used both for ear training exercises and for theory exercises.
145
//Following variables are used for configuration
152
#endif // __CHORDCONSTRAINS_H__