Files
Work/guitar/backup/20040302/TabEntry.hpp
2024-08-07 09:16:27 -04:00

109 lines
2.1 KiB
C++

#ifndef _GUITAR_TABENTRY_HPP_
#define _GUITAR_TABENTRY_HPP_
#ifndef _COMMON_BLOCK_HPP_
#include <common/block.hpp>
#endif
#ifndef _GUITAR_FRETTEDNOTE_HPP_
#include <guitar/FrettedNote.hpp>
#endif
#ifndef _GUITAR_NOTETYPE_HPP_
#include <guitar/NoteType.hpp>
#endif
#ifndef _GUITAR_TIMING_HPP_
#include <guitar/timing.hpp>
#endif
#ifndef _MUSIC_CHORD_HPP_
#include <music/chord.hpp>
#endif
class MIDIOutputDevice;
class TabEntry;
typedef Block<TabEntry> TabEntries;
class TabEntry : public Block<FrettedNote>
{
public:
TabEntry();
TabEntry(const TabEntry &entry);
virtual ~TabEntry();
bool play(MIDIOutputDevice &midiDevice,bool useDelay=true)const;
bool operator==(const TabEntry &entry)const;
TabEntry &operator=(const TabEntry &entry);
const NoteType &getNoteType(void)const;
void setNoteType(const NoteType &noteType);
String toString(void)const;
bool fromString(String strText);
bool fromChord(const Music::Chord &chord);
bool contains(int string,int &entryIndex);
bool contains(int string);
bool remove(int string,int fret);
void remove(void);
bool addFrettedNote(int string,const FrettedNote &frettedNote);
bool setFrettedNote(int string,const FrettedNote &frettedNote);
const String &getComment(void)const;
void setComment(const String &comment);
bool hasSeparator(void)const;
void hasSeparator(bool hasSeparator);
private:
void delay(void)const;
NoteType mNoteType;
String mComment;
bool mHasSeparator;
};
inline
TabEntry::TabEntry()
: mHasSeparator(false)
{
}
inline
TabEntry::~TabEntry()
{
}
inline
const NoteType &TabEntry::getNoteType(void)const
{
return mNoteType;
}
inline
void TabEntry::setNoteType(const NoteType &noteType)
{
mNoteType=noteType;
}
inline
void TabEntry::remove(void)
{
Block<FrettedNote>::remove();
}
inline
const String &TabEntry::getComment(void)const
{
return mComment;
}
inline
void TabEntry::setComment(const String &comment)
{
mComment=comment;
}
inline
bool TabEntry::hasSeparator(void)const
{
return mHasSeparator;
}
inline
void TabEntry::hasSeparator(bool hasSeparator)
{
mHasSeparator=hasSeparator;
}
#endif