Verovio
Source code documentation
vrv::PitchInterface Class Reference

This class is an interface for elements with pitch, such as notes and neumes. More...

#include <pitchinterface.h>

Inheritance diagram for vrv::PitchInterface:
vrv::Interface vrv::Custos vrv::KeyAccid vrv::Liquescent vrv::Nc vrv::Note vrv::Oriscus vrv::Quilisma

Public Member Functions

bool HasIdenticalPitchInterface (const PitchInterface *otherPitchInterface) const
 Interface comparison operator. More...
 
void AdjustPitchByOffset (int pitchOffset)
 Shift pname and octave by a certain number of steps.
 
int PitchDifferenceTo (const PitchInterface *pi) const
 Get steps between calling object and parameter. More...
 
void AdjustPitchForNewClef (const Clef *oldClef, const Clef *newClef)
 adjust the pitch value so that it stays in the same x,y position given it's new and old clefs
 
Constructors, destructors, reset methods

Reset method resets all attribute classes

 PitchInterface ()
 
virtual ~PitchInterface ()
 
void Reset () override
 Virtual reset method. More...
 
InterfaceId IsInterface () const override
 Virtual method returning the InterfaceId of the interface. More...
 
Set and get the default octave
void SetOctDefault (data_OCTAVE oct)
 
data_OCTAVE GetOctDefault () const
 
bool HasOctDefault () const
 
- Public Member Functions inherited from vrv::Interface
void RegisterInterfaceAttClass (AttClassId attClassId)
 Method for registering an MEI att classes in the interface.
 
std::vector< AttClassId > * GetAttClasses ()
 Method for obtaining a pointer to the attribute class vector of the interface.
 
 Interface ()
 
virtual ~Interface ()
 

Static Public Member Functions

static void AdjustPname (int &pname, int &oct)
 Adjust the pname and the octave for values outside the range. More...
 
static int CalcLoc (const LayerElement *element, const Layer *layer, const LayerElement *crossStaffElement, bool topChordNote=true)
 Calculate the loc for a note, rest or chord considering its position in the layer. More...
 
static int CalcLoc (data_PITCHNAME pname, int oct, int clefLocOffset)
 Calculate the loc for a pitch and octave and considerting the clef loc offset. More...
 

Detailed Description

This class is an interface for elements with pitch, such as notes and neumes.

It is not an abstract class but should not be instanciated directly.

Member Function Documentation

◆ AdjustPname()

static void vrv::PitchInterface::AdjustPname ( int &  pname,
int &  oct 
)
static

Adjust the pname and the octave for values outside the range.

To be tested

◆ CalcLoc() [1/2]

static int vrv::PitchInterface::CalcLoc ( const LayerElement element,
const Layer layer,
const LayerElement crossStaffElement,
bool  topChordNote = true 
)
static

Calculate the loc for a note, rest or chord considering its position in the layer.

By default for chord takes the top note, but the bottom note otherwise. E.g., return 0 for and C4 with clef C1, -2 with clef G2.

◆ CalcLoc() [2/2]

static int vrv::PitchInterface::CalcLoc ( data_PITCHNAME  pname,
int  oct,
int  clefLocOffset 
)
static

Calculate the loc for a pitch and octave and considerting the clef loc offset.

E.g., return 0 for and C4 with clef C1, -2 with clef G2.

◆ HasIdenticalPitchInterface()

bool vrv::PitchInterface::HasIdenticalPitchInterface ( const PitchInterface otherPitchInterface) const

Interface comparison operator.

Checks if the LayerElement has a PitchInterface and compares attributes

◆ IsInterface()

InterfaceId vrv::PitchInterface::IsInterface ( ) const
inlineoverridevirtual

Virtual method returning the InterfaceId of the interface.

Needs to be overridden in child classes.

Reimplemented from vrv::Interface.

◆ PitchDifferenceTo()

int vrv::PitchInterface::PitchDifferenceTo ( const PitchInterface pi) const

Get steps between calling object and parameter.

Returns calling pitch minus parameter pitch.

◆ Reset()

void vrv::PitchInterface::Reset ( )
overridevirtual

Virtual reset method.

Needs to be overridden in child classes.

Reimplemented from vrv::Interface.

Reimplemented in vrv::Quilisma.


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