#ifndef _GUITAR_FRETTEDNOTE_HPP_ #define _GUITAR_FRETTEDNOTE_HPP_ #ifndef _COMMON_STDIO_HPP_ #include #endif #ifndef _COMMON_ARRAY_HPP_ #include #endif #ifndef _MUSIC_NOTE_HPP_ #include #endif #ifndef _GUITAR_ACTION_HPP_ #include #endif class FrettedNote; typedef Array FrettedNotes; class FrettedNote : public Note { public: FrettedNote(); FrettedNote(const FrettedNote &frettedNote); FrettedNote(const Note ¬e,int string,int fret,const Action &action=Action(Action::Pick)); virtual ~FrettedNote(); FrettedNote &operator=(const FrettedNote &frettedNote); bool operator==(const FrettedNote &frettedNote)const; bool operator>(const FrettedNote &frettedNote)const; bool operator<(const FrettedNote &frettedNote)const; int getString(void)const; void setString(int string); int getFret(void)const; void setFret(int fret); void setNote(const Note ¬e); const Note &getNote(void)const; const Action &getAction(void)const; void setAction(const Action &action); String toString(void)const; private: int mString; int mFret; Action mAction; }; inline FrettedNote::FrettedNote(const FrettedNote &frettedNote) { *this=frettedNote; } inline FrettedNote::FrettedNote() : Note(Note::E,4), mString(0), mFret(0) { } inline FrettedNote::FrettedNote(const Note ¬e,int string,int fret,const Action &action) : Note(note), mString(string), mFret(fret), mAction(action) { } inline FrettedNote::~FrettedNote() { } inline FrettedNote &FrettedNote::operator=(const FrettedNote &frettedNote) { setString(frettedNote.getString()); setFret(frettedNote.getFret()); (Note&)*this=(Note&)frettedNote; setAction(frettedNote.getAction()); return *this; } inline bool FrettedNote::operator==(const FrettedNote &frettedNote)const { if(getString()==frettedNote.getString()&&getFret()==frettedNote.getFret()) return (Note&)*this==(Note&)frettedNote; return false; } inline bool FrettedNote::operator>(const FrettedNote &frettedNote)const { if(getString()>frettedNote.getString())return true; if(getFret()>frettedNote.getFret())return true; return (Note&)*this>(Note&)frettedNote; } inline bool FrettedNote::operator<(const FrettedNote &frettedNote)const { if(getString()