Public Member Functions | Static Public Member Functions
MusicNoteLib::Chords Class Reference

Maniuplates Chord definitions for Western Music More...

#include <Chords.h>

List of all members.

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)

Detailed Description

Maniuplates Chord definitions for Western Music


Constructor & Destructor Documentation

MusicNoteLib::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.

Parameters:
pChordsArray of Chord definitions.
nSizeSize of the pChords Array

References LoadDefinitions().


Member Function Documentation

void MusicNoteLib::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.

Parameters:
pChordsArray of Chord definitions.
nSizeSize of the pChords Array
unsigned int MusicNoteLib::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.

Parameters:
szTokenthe string that has any Chord name at its start
retValthe ChordDef object that has a Chord with its name present in the szToken
Returns:
the number of characters correctly matched. Zero, if no match found

Referenced by GetDefaultMatchingChord().

unsigned int MusicNoteLib::Chords::GetDefaultMatchingChord ( const TCHAR *  szToken,
ChordDef retVal 
) [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.

Parameters:
szTokenthe string that has any Chord name at its start
retValthe ChordDef object that has a Chord with its name present in the szToken
Returns:
the number of characters correctly matched. Zero, if no match found

References ExtractMatchingChord().

void MusicNoteLib::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.

Parameters:
pChordsArray of Chord definitions. Use NULL to load the default values
nSizeSize of the pChords Array

Referenced by Chords().


The documentation for this class was generated from the following files:

CFugue, the C++ Music Programming Library © Copyright 2009 CineFx Digital Media Pvt Ltd. Gopalakrishna Palem