CAClef Class Reference

#include <clef.h>

Inheritance diagram for CAClef:

Inheritance graph
[legend]

List of all members.

Public Types

enum  CAPredefinedClefType {
  Undefined = -1, Treble, Bass, French,
  Soprano, Mezzosoprano, Alto, Tenor,
  Baritone, Varbaritone, Subbass, Percussion,
  Tablature
}
enum  CAClefType {
  F, G, C, PercussionHigh,
  PercussionLow, Tab
}

Public Member Functions

 CAClef (CAPredefinedClefType type, CAStaff *staff, int time, int offsetInterval=0)
 CAClef (CAClefType type, int c1, CAStaff *staff, int time, int offset=0)
CAClefclone ()
void setPredefinedType (CAPredefinedClefType type)
CAClefType clefType ()
const int c1 ()
const int centerPitch ()
int compare (CAMusElement *elt)
void setClefType (CAClefType type)
void setOffset (int offset)
int offset ()

Static Public Member Functions

static const QString clefTypeToString (CAClefType)
static CAClefType clefTypeFromString (const QString)
static const int offsetFromReadable (const int offsetInterval)
static const int offsetToReadable (const int offset)

Private Attributes

CAClefType _clefType
int _c1
int _centerPitch
int _offset


Detailed Description

Copyright (c) 2006-2007, Matevž Jekovec, Canorus development team All Rights Reserved. See AUTHORS for a complete list of authors.

Licensed under the GNU GENERAL PUBLIC LICENSE. See LICENSE.GPL for details.

Represents a clef in the score

This class represents every clef in the score. It directly inherits the base class CAMusElement. Element is not playable (_timeLength=0).

Definition at line 17 of file clef.h.


Member Enumeration Documentation

enum CAClef::CAPredefinedClefType

Enumerator:
Undefined 
Treble 
Bass 
French 
Soprano 
Mezzosoprano 
Alto 
Tenor 
Baritone 
Varbaritone 
Subbass 
Percussion 
Tablature 

Definition at line 19 of file clef.h.

enum CAClef::CAClefType

Enumerator:
F 
G 
C 
PercussionHigh 
PercussionLow 
Tab 

Definition at line 35 of file clef.h.


Constructor & Destructor Documentation

CAClef::CAClef ( CAPredefinedClefType  type,
CAStaff staff,
int  time,
int  offsetInterval = 0 
)

Creates a new predefined clef with type type, parent staff and start time time. _timeLength is set to 0. offsetInterval can be custom -1,0,1 no offset, +8 or -8 etc. mean the 8 written above or below the clef which raises or lowers the clef for one octave or whichever interval. Offset is the musical interval, not the internal offset.

See also:
CAPredefinedClefType, CAMusElement

Definition at line 28 of file clef.cpp.

References CAMusElement::_musElementType, _offset, CAMusElement::Clef, offsetFromReadable(), and setPredefinedType().

Referenced by clone().

Here is the call graph for this function:

Here is the caller graph for this function:

CAClef::CAClef ( CAClefType  type,
int  c1,
CAStaff staff,
int  time,
int  offset = 0 
)

Creates a new clef with type type, location of middle C c1, time start time and parent staff. offset is the internal clef offset 0, +7, -7 etc. It does not affect c1.

See also:
CAPredefinedClefType, CAMusElement

Definition at line 41 of file clef.cpp.

References _c1, CAMusElement::_musElementType, _offset, CAMusElement::Clef, and setClefType().

Here is the call graph for this function:


Member Function Documentation

CAClef * CAClef::clone (  )  [virtual]

Clones a music element with exact properties including the context.

Implements CAMusElement.

Definition at line 111 of file clef.cpp.

References _c1, _clefType, CAMusElement::_context, _offset, CAMusElement::_timeStart, CAMusElement::addMark(), CAClef(), CAMusElement::markList(), and CAMark::setAssociatedElement().

Here is the call graph for this function:

void CAClef::setPredefinedType ( CAPredefinedClefType  type  ) 

Definition at line 49 of file clef.cpp.

References _c1, Alto, Baritone, Bass, C, F, French, G, Mezzosoprano, offset(), setClefType(), Soprano, Subbass, Tenor, Treble, and Varbaritone.

Referenced by CAClef().

Here is the call graph for this function:

Here is the caller graph for this function:

CAClefType CAClef::clefType (  )  [inline]

Definition at line 49 of file clef.h.

References _clefType.

Referenced by CALilyPondExport::exportVoiceImpl(), and CACanorusMLExport::exportVoiceImpl().

Here is the caller graph for this function:

const int CAClef::c1 (  )  [inline]

Definition at line 50 of file clef.h.

References _c1.

Referenced by CADrawableKeySignature::CADrawableKeySignature(), CADrawableStaff::calculateCenterYCoord(), CANote::calculateNotePosition(), CADrawableStaff::calculatePitch(), CALilyPondExport::exportVoiceImpl(), CACanorusMLExport::exportVoiceImpl(), and CAScoreViewPort::updateHelpers().

Here is the caller graph for this function:

const int CAClef::centerPitch (  )  [inline]

Definition at line 51 of file clef.h.

References _centerPitch.

int CAClef::compare ( CAMusElement elt  )  [virtual]

Compares the music element with the given elt and returns number of differences in their properties. Returns 0, if the music elements are exact; -1 if the music element type differs; otherwise number greater than 0.

This method is usually used when opening a score document where music elements are written in various voices (eg. barlines), but are eventually merged and written only once per staff.

Implements CAMusElement.

Definition at line 123 of file clef.cpp.

References _c1, _clefType, _offset, CAMusElement::Clef, and CAMusElement::musElementType().

Here is the call graph for this function:

void CAClef::setClefType ( CAClefType  type  ) 

Sets the clef type to type and update _c1 and _centerPitch.

See also:
CAClefType, _clefType

Definition at line 99 of file clef.cpp.

References _centerPitch, _clefType, C, F, G, and offset().

Referenced by CAClef(), and setPredefinedType().

Here is the call graph for this function:

Here is the caller graph for this function:

void CAClef::setOffset ( int  offset  )  [inline]

Definition at line 56 of file clef.h.

References _c1, and _offset.

Referenced by CAMainWin::on_uiClefOffset_valueChanged().

int CAClef::offset (  )  [inline]

Definition at line 57 of file clef.h.

References _offset.

Referenced by CALilyPondExport::exportVoiceImpl(), CACanorusMLExport::exportVoiceImpl(), setClefType(), setPredefinedType(), and CAMainWin::updateClefToolBar().

Here is the caller graph for this function:

const QString CAClef::clefTypeToString ( CAClefType  type  )  [static]

Converts clef type to QString.

See also:
CAClefType, clefTypeFromString()

Definition at line 140 of file clef.cpp.

References C, F, G, PercussionHigh, PercussionLow, and Tab.

Referenced by CACanorusMLExport::exportVoiceImpl().

Here is the caller graph for this function:

CAClef::CAClefType CAClef::clefTypeFromString ( const   QString  )  [static]

Converts QString type to clef type.

See also:
CAClefType, clefTypeToString()

Definition at line 157 of file clef.cpp.

References C, F, G, PercussionHigh, PercussionLow, and Tab.

Referenced by CACanorusMLImport::startElement().

Here is the caller graph for this function:

const int CAClef::offsetFromReadable ( const int  offset  )  [static]

Converts the musical interval offset to Canorus internal offset. This method is usually called where user inputs the offset interval and it needs to be stored.

See also:
offsetToReadable()

Definition at line 191 of file clef.cpp.

Referenced by CAClef(), and CAMainWin::on_uiClefOffset_valueChanged().

Here is the caller graph for this function:

const int CAClef::offsetToReadable ( const int  offsetInterval  )  [static]

Converts the internal clef offset to the musical interval. eg. offset +1 means +2 (supper second), +7 means +8 (supper octave), -7 means -8 (sub octave), 0 is an exception and stays 0 (instead of prime)

This method is usually called when displaying the offset of the key (eg. when rendering it).

See also:
offsetFromReadable()

Definition at line 178 of file clef.cpp.

Referenced by CAMainWin::updateClefToolBar().

Here is the caller graph for this function:


Member Data Documentation

CAClefType CAClef::_clefType [private]

Definition at line 66 of file clef.h.

Referenced by clefType(), clone(), compare(), and setClefType().

CAClef::_c1 [private]

Location of the middle C:

See also:
c1(), _centerPitch

Definition at line 67 of file clef.h.

Referenced by c1(), CAClef(), clone(), compare(), setOffset(), and setPredefinedType().

CAClef::_centerPitch [private]

Location of the clefs physical center:

See also:
centerPitch(), _c1

Definition at line 68 of file clef.h.

Referenced by centerPitch(), and setClefType().

int CAClef::_offset [private]

Definition at line 69 of file clef.h.

Referenced by CAClef(), clone(), compare(), offset(), and setOffset().


The documentation for this class was generated from the following files:
Generated on Sat Feb 9 13:11:53 2008 for Canorus by  doxygen 1.5.3