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_EARINTERVALSCONSTRAINS_H__ //to avoid nested includes
22
#define __LENMUS_EARINTERVALSCONSTRAINS_H__
25
#include "lenmus_standard_header.h"
26
#include "lenmus_constrains.h"
27
#include "lenmus_injectors.h"
30
#include "lomse_pitch.h"
31
using namespace lomse;
36
//---------------------------------------------------------------------------------------
37
// EarIntervalsConstrains: options for EarIntervalsCtrol control
38
class EarIntervalsConstrains : public ExerciseOptions
41
EarIntervalsConstrains(wxString sSection, ApplicationScope& appScope);
42
~EarIntervalsConstrains() {}
44
bool IsIntervalAllowed(int nInterval) { return m_fIntervalAllowed[nInterval]; }
45
void SetIntervalAllowed(int nInterval, bool fValue) {
46
m_fIntervalAllowed[nInterval] = fValue;
48
bool IsTypeAllowed(int nType) { return m_fTypeAllowed[nType]; }
49
void SetTypeAllowed(int nType, bool fValue) {
50
m_fTypeAllowed[nType] = fValue;
52
bool OnlyNatural() { return m_fOnlyNatural; }
53
void SetOnlyNatural(bool fValue) { m_fOnlyNatural = fValue; }
55
bool FirstNoteEqual() { return m_fFirstEqual; }
56
void SetFirstNoteEqual(bool fValue) { m_fFirstEqual = fValue; }
59
KeyConstrains* GetKeyConstrains() { return &m_oValidKeys; }
61
bool* AllowedIntervals() { return m_fIntervalAllowed; }
62
void SetMinNote(DiatonicPitch nPitch) { m_nMinPitch = nPitch; }
63
DiatonicPitch MinNote() { return m_nMinPitch; }
64
void SetMaxNote(DiatonicPitch nPitch) { m_nMaxPitch = nPitch; }
65
DiatonicPitch MaxNote() { return m_nMaxPitch; }
74
wxString m_sSection; // section name to save the constraints
76
bool m_fIntervalAllowed[lmNUM_INTVALS]; //interval n allowed (0..24)
77
int m_nMinPitch; // interval allowed range: min. diatonic pitch
78
int m_nMaxPitch; // max diatonic pitch
79
bool m_fTypeAllowed[3]; // intervals: allowed types:
81
// 1-melodic ascending
82
// 2-melodic descending
83
bool m_fOnlyNatural; //use only natural intervals of the scale
84
KeyConstrains m_oValidKeys; //allowed key signatures
86
//for interval comparison exercises
87
bool m_fFirstEqual; // first note equal in both intervals
95
#endif // __LENMUS_EARINTERVALSCONSTRAINS_H__