maiacore 1.10.1
Music analisys library
Barline Class Reference

Represents a barline in a musical score, including style, direction, and location. More...

#include <barline.h>

Public Member Functions

 Barline ()
 Constructs a new Barline object with default values.
 
void clean ()
 Clears all barline properties, resetting to default state.
 
std::string getBarStyle () const
 Returns the barline style as a string. More...
 
void setBarStyle (const std::string &barStyle)
 Sets the barline style. More...
 
std::string getDirection () const
 Returns the repeat direction as a string. More...
 
void setDirection (const std::string &direction)
 Sets the repeat direction. More...
 
std::string getLocation () const
 Returns the barline location as a string. More...
 
void setLocation (const std::string &location)
 Sets the barline location. More...
 
void setRepeatStart ()
 Sets the barline as a repeat start (heavy-light, forward).
 
void setRepeatEnd ()
 Sets the barline as a repeat end (light-heavy, backward).
 
std::string toXML (const int identSize=2) const
 Serializes the barline to MusicXML format. More...
 

Detailed Description

Represents a barline in a musical score, including style, direction, and location.

The Barline class provides methods for setting and querying the barline style (e.g., single, double, repeat), direction (forward, backward), and location (left, right, middle). It supports MusicXML serialization and is designed for music analysis, computational musicology, and MusicXML processing.

Member Function Documentation

◆ getBarStyle()

std::string Barline::getBarStyle ( ) const

Returns the barline style as a string.

Returns
Barline style string.

◆ getDirection()

std::string Barline::getDirection ( ) const

Returns the repeat direction as a string.

Returns
Direction string ("forward", "backward", or empty).

◆ getLocation()

std::string Barline::getLocation ( ) const

Returns the barline location as a string.

Returns
Location string ("left", "right", "middle", or empty).

◆ setBarStyle()

void Barline::setBarStyle ( const std::string &  barStyle)

Sets the barline style.

Parameters
barStyleBarline style string (e.g., "light-heavy").

◆ setDirection()

void Barline::setDirection ( const std::string &  direction)

Sets the repeat direction.

Parameters
directionDirection string ("forward" or "backward").

◆ setLocation()

void Barline::setLocation ( const std::string &  location)

Sets the barline location.

Parameters
locationLocation string ("left", "right", "middle").

◆ toXML()

std::string Barline::toXML ( const int  identSize = 2) const

Serializes the barline to MusicXML format.

Parameters
identSizeIndentation size (default: 2).
Returns
MusicXML string for the barline.

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