CFugue
|
Maniuplates Chord definitions for Western Music More...
#include <Chords.h>
Public Member Functions | |
Chords () | |
Initialize the Chords with default definitions. | |
Chords (const ChordDef *pChords, int nSize) | |
void | LoadDefinitions (const ChordDef *pChords=NULL, int nSize=0) |
void | AddDefinitions (const ChordDef *pChords, int nSize) |
unsigned int | ExtractMatchingChord (const TCHAR *szToken, ChordDef *retVal) const |
Static Public Member Functions | |
static unsigned int | GetDefaultMatchingChord (const TCHAR *szToken, ChordDef *retVal) |
CFugue::Chords::Chords | ( | const ChordDef * | pChords, |
int | nSize | ||
) |
Initialize the Chords with custom Chord definitions. If supplied array is empty, default values will be loaded. Only references to the ChordDef are stored in the Chords class. So ensure that the supplied pChords is not freed till this Chords object is released.
pChords | Array of Chord definitions. |
nSize | Size of the pChords Array |
Definition at line 140 of file Chords.cpp.
References LoadDefinitions().
void CFugue::Chords::AddDefinitions | ( | const ChordDef * | pChords, |
int | nSize | ||
) |
Adds the supplied definitions to the existing ones. Caller has to ensure that the new values do not add duplicates to existing ones. The input array should not be freed before this Chords object is freed.
pChords | Array of Chord definitions. |
nSize | Size of the pChords Array |
Definition at line 156 of file Chords.cpp.
unsigned int CFugue::Chords::ExtractMatchingChord | ( | const TCHAR * | szToken, |
ChordDef * | retVal | ||
) | const |
Retrieves the chord that suits the first part of the given string. If you have not added any custom definitions with AddDefinitions(), then you might find the static GetDefaultMatchingChord() method more convenient.
szToken | the string that has any Chord name at its start |
retVal | the ChordDef object that has a Chord with its name present in the szToken |
Definition at line 163 of file Chords.cpp.
Referenced by GetDefaultMatchingChord().
|
static |
Retrieves the chord that suits the first part of the given string. Same as ExtractMatchingChord, except that this method is static and uses only the in-built default chord definitions for the search. For custom chord definitions, you need to create a Chords object and use ExtractMatchingChord.
szToken | the string that has any Chord name at its start |
retVal | the ChordDef object that has a Chord with its name present in the szToken |
Definition at line 168 of file Chords.cpp.
References ExtractMatchingChord().
void CFugue::Chords::LoadDefinitions | ( | const ChordDef * | pChords = NULL , |
int | nSize = 0 |
||
) |
Overrides the existing definitions with the supplied values. If supplied array is empty, default values will be loaded. The supplied array should not be freed before this Chords object is freed.
pChords | Array of Chord definitions. Use NULL to load the default values |
nSize | Size of the pChords Array |
Definition at line 145 of file Chords.cpp.
Referenced by Chords().
CFugue, the C++ Music Programming Library | © Copyright 2009 Cenacle Research India Private Limited | Gopalakrishna Palem |