47 Barre() { startString = endString = -1; }
48 Barre(
int s,
int e) : startString(s), endString(e) {}
49 bool exists()
const {
return startString > -1; }
59 bool exists()
const {
return fret > 0; }
92 typedef std::map<int, FretItem::Barre>
BarreMap;
94 typedef std::map<int, std::vector<FretItem::Dot>>
DotMap;
107 void updateDiagram();
125 int _fretOffset { 0 };
126 int _maxFrets { 24 };
127 bool _showNut {
true };
145 qreal _userMag { 1.0 };
148 void removeDot(
int s,
int f = 0);
149 void removeBarre(
int f);
150 void removeBarres(
int string,
int fret = 0);
151 void removeMarker(
int s);
152 void removeDotsMarkers(
int ss,
int es,
int fret);
158 virtual void draw(QPainter*)
const override;
166 virtual void layout()
override;
167 virtual void write(
XmlWriter& xml)
const override;
172 virtual QLineF dragAnchor()
const override;
173 virtual QPointF pagePos()
const override;
177 void writeMusicXML(
XmlWriter& xml)
const;
180 int frets()
const {
return _frets; }
181 void setStrings(
int n);
185 void setBarre(
int startString,
int endString,
int fret);
186 void setBarre(
int string,
int fret,
bool add =
false);
192 void undoSetFretBarre(
int _string,
int _fret,
bool _add =
false);
193 void undoFretClear();
201 QString
harmonyText()
const {
return _harmony ? _harmony->plainText() : QString(); }
202 qreal centerX()
const;
203 void setHarmony(QString harmonyText);
205 std::vector<FretItem::Dot> dot(
int s,
int f = 0)
const;
208 #if 0 // NOTE:JT possible future feature 209 int fingering(
int s)
const {
return _fingering ? _fingering[s] : 0; }
212 BarreMap
barres()
const {
return _barres; }
213 DotMap
dots()
const {
return _dots; }
214 MarkerMap
markers()
const {
return _markers; }
220 virtual void add(
Element*)
override;
221 virtual void remove(
Element*)
override;
223 virtual bool acceptDrop(
EditData&)
const override;
226 void endEditDrag(
EditData& editData)
override;
227 virtual void scanElements(
void* data,
void (*func)(
void*,
Element*),
bool all=
true)
override;
230 virtual bool setProperty(
Pid propertyId,
const QVariant&)
override;
231 virtual QVariant propertyDefault(
Pid)
const override;
MarkerMap markers() const
Definition: fret.h:214
bool showNut() const
Definition: fret.h:198
int fretOffset() const
Definition: fret.h:194
Pid
Definition: property.h:62
Fretboard diagram.
Definition: fret.h:122
QFont font
Definition: fret.h:144
Barre(int s, int e)
Definition: fret.h:48
int _numPos
Definition: fret.h:146
bool exists() const
Definition: fret.h:59
const char * name
Definition: fret.h:77
void setUserMag(qreal m)
Definition: fret.h:234
qreal fretDist
Definition: fret.h:143
int startString
Definition: fret.h:44
Base class of score layout elements.
Definition: element.h:158
Segment * segment()
Definition: fret.h:161
const char * name
Definition: fret.h:72
FretDotType dtype
Definition: fret.h:76
FretUndoData()
Definition: fret.h:104
MarkerMap _markers
Definition: fret.h:136
void setFretOffset(int val)
Definition: fret.h:195
Definition: stringdata.h:35
Barre()
Definition: fret.h:47
FretMarkerType mtype
Definition: fret.h:63
std::map< int, std::vector< FretItem::Dot > > DotMap
Definition: fret.h:94
BarreMap _barres
Definition: fret.h:99
qreal userMag() const
Definition: fret.h:233
Harmony * harmony() const
Definition: fret.h:216
BarreMap barres() const
Definition: fret.h:212
int fingering
Definition: fret.h:55
FretMarkerType
Definition: fret.h:34
DotMap dots() const
Definition: fret.h:213
qreal stringLw
Definition: fret.h:140
bool exists() const
Definition: fret.h:49
int strings() const
Definition: fret.h:179
int frets() const
Definition: fret.h:180
void setShowNut(bool val)
Definition: fret.h:199
Definition: aeolus.cpp:26
int maxFrets() const
Definition: fret.h:196
Marker()
Definition: fret.h:65
BarreMap _barres
Definition: fret.h:130
std::map< int, FretItem::Barre > BarreMap
Definition: fret.h:92
static const std::vector< FretItem::DotTypeNameItem > dotTypeNameMap
Definition: fret.h:81
void setMaxFrets(int val)
Definition: fret.h:197
Graphic representation of a chord.
Definition: chord.h:55
MarkerMap _markers
Definition: fret.h:100
DotMap _dots
Definition: fret.h:101
void setFrets(int n)
Definition: fret.h:182
Definition: element.h:111
bool exists() const
Definition: fret.h:67
std::map< int, FretItem::Marker > MarkerMap
Definition: fret.h:93
virtual ElementType type() const override
Definition: fret.h:165
Dot()
Definition: fret.h:57
DotMap _dots
Definition: fret.h:133
FretMarkerType mtype
Definition: fret.h:71
FretDotType
Definition: fret.h:26
qreal stringDist
Definition: fret.h:142
ElementType
Definition: types.h:34
qreal nutLw
Definition: fret.h:141
QString harmonyText() const
Definition: fret.h:201
virtual FretDiagram * clone() const override
Definition: fret.h:159
Marker(FretMarkerType t)
Definition: fret.h:66
Dot(int f, FretDotType t=FretDotType::NORMAL)
Definition: fret.h:58
int endString
Definition: fret.h:45
static const std::vector< FretItem::MarkerTypeNameItem > markerTypeNameMap
Definition: fret.h:80
Pid propertyId(const QStringRef &s)
Definition: property.cpp:347