Songbook-Client  0.7
This application is a manager of customguitar songbooks
 All Classes Files Functions Variables Enumerations Enumerator Pages
Public Types | Public Member Functions
CChord Class Reference

CChord is an object representing a guitar/ukulele chord. More...

#include <chord.hh>

List of all members.

Public Types

enum  StringCount { GuitarStringCount = 6, UkuleleStringCount = 4 }
enum  Instrument { Guitar, Ukulele }

Public Member Functions

 CChord (const QString &chord="\\gtab{}{0:}", QObject *parent=0)
 Constructor.
 ~CChord ()
 Destructor.
bool isValid () const
QString toString ()
void fromString (const QString &gtab)
QPixmap * toPixmap ()
QString name () const
void setName (const QString &name)
QString fret () const
void setFret (const QString &fret)
QString strings () const
void setStrings (const QString &strings)
Instrument instrument () const
void setInstrument (const Instrument &instrument)
bool isImportant () const
void setImportant (bool value)
QColor color ()
void setDrawBorder (bool value)

Detailed Description

CChord is an object representing a guitar/ukulele chord.

A chord has a text and a graphical representation.

The text representation follows the syntax introduced by the Songs LaTeX Package (http://songs.sourceforge.net):

\gtab{<name>}{<fret>:<strings>}

Regarding its graphical representation, a chord is a grid (diagram) where vertical lines correspond to strings and horizontal lines to frets:

chord.png

Member Enumeration Documentation

This enum type lists supported instruments.

Enumerator:
Guitar 

guitar.

Ukulele 

ukulele.

This enum type indicates the number of strings of an instrumuent.

Enumerator:
GuitarStringCount 

guitar: 6

UkuleleStringCount 

ukulele: 4


Member Function Documentation

QColor CChord::color ( )

Returns the chord color. The color is based on the instrument (guitar: blue; ukulele: purple) and whether or not it is important (yes: dark; no: light).

See also:
setType, setImportant
QString CChord::fret ( ) const

Returns the fret number. For example, given a E-flat minor chord

\gtab{E&m}{5:X02210}

returns 5.

See also:
setFret
void CChord::fromString ( const QString &  gtab)

Builds a chord from a string.

See also:
toString
CChord::Instrument CChord::instrument ( ) const

Returns the instrument of the chord. For example, given a E-flat minor chord

\gtab{E&m}{5:X02210}

returns Instrument::Guitar.

See also:
setType
bool CChord::isImportant ( ) const

Returns true if the chord is important; false otherwise. Non important chords are well-known fingering for usual chords such as

\gtab{C}{X32010}
See also:
setImportant
bool CChord::isValid ( ) const

Returns true if the chord is valid; false otherwise. A valid chord has a non-empty chord name and a number of strings that matches its instrument.

QString CChord::name ( ) const

Returns the chord name. For example, given a E-flat minor chord

\\gtab{E&m}{5:X02210}

returns E&m.

See also:
setChord
void CChord::setDrawBorder ( bool  value)

Draws a rounded path around the whole diagram if value is true. Default is false. The rounded path takes the color of the chord.

See also:
color
void CChord::setFret ( const QString &  fret)

Sets the fret number fret.

See also:
fret
void CChord::setImportant ( bool  value)

Marks a chord as important; default is false.

See also:
isImportant
void CChord::setInstrument ( const Instrument instrument)

Sets the instrument instrument.

See also:
type
void CChord::setName ( const QString &  name)

Sets the chord name name.

See also:
chord
void CChord::setStrings ( const QString &  strings)

Sets the strings strings.

See also:
strings
QString CChord::strings ( ) const

Returns the chord strings. For example, given a E-flat minor chord

\gtab{E&m}{5:X02210}

returns X02210.

See also:
setStrings
QPixmap * CChord::toPixmap ( )

Returns the graphical representation (diagram) of the chord.

See also:
toString
QString CChord::toString ( )

Returns the string representation of the chord.

See also:
fromString

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