#ifndef _CHORDMAPPER_HPP_ #define _CHORDMAPPER_HPP_ #ifndef _COMMON_BLOCK_HPP_ #include #endif #ifndef _GUITAR_FRETTEDNOTE_HPP_ #include #endif #ifndef _GUITAR_FRETBOARD_HPP_ #include #endif #ifndef _MUSIC_CHORD_HPP_ #include #endif class ChordMapper { public: ChordMapper(); virtual ~ChordMapper(); bool map(const Music::Chord &chord,Block &frettedNotes); private: enum {MaxFretDistance=4}; // Maximum distance for note spanning across frets bool getAt(const Note ¬e,FrettedNote &frettedNote,Block &containedNotes); bool getAt(int startingString,int direction,const Note ¬e,FrettedNote &frettedNote,Block &containedNotes); int distance(const FrettedNote &frettedNote,Block &frettedNotes); int distance(const FrettedNote &firstNote,const FrettedNote &secondNote); bool getFillerNotes(int fret,const Music::Chord &chord,Block &frettedNotes); bool contains(const FrettedNote &frettedNote,Block &frettedNotes); bool isIn(const FrettedNote &frettedNote,const Music::Chord &chord); void getNearestNote(const FrettedNote &frettedNote,const Note &srchNote,FrettedNote &foundNote); bool getNearestNoteInRange(const FrettedNote &frettedNote,const Note &srchNote,FrettedNote &foundNote,int stringOffset,int fretOffset); Fretboard mFretboard; }; inline ChordMapper::ChordMapper() { } inline ChordMapper::~ChordMapper() { } #endif