Skip to content

Commit

Permalink
Fixing the PAE clef and renaming barLine
Browse files Browse the repository at this point in the history
  • Loading branch information
lpugin committed Aug 26, 2014
1 parent c86d03c commit e130d8f
Show file tree
Hide file tree
Showing 20 changed files with 102 additions and 102 deletions.
8 changes: 4 additions & 4 deletions include/vrv/barline.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ namespace vrv {
//----------------------------------------------------------------------------

/**
* This class models the MEI <barline> element.
* This class models the MEI <barLine> element.
*/
class Barline: public LayerElement, public AttBarLineLog
{
Expand Down Expand Up @@ -50,7 +50,7 @@ class Barline: public LayerElement, public AttBarLineLog
void SetAlignment( Alignment *alignment ) { m_alignment = alignment; };

/*
* Return true if the barline type requires repetition dots to be drawn.
* Return true if the barLine type requires repetition dots to be drawn.
*/
bool HasRepetitionDots( );

Expand All @@ -62,9 +62,9 @@ class Barline: public LayerElement, public AttBarLineLog
private:

public:
/** Indicates a partial barline (inbetween the staves) - no MEI equivalent */
/** Indicates a partial barLine (inbetween the staves) - no MEI equivalent */
bool m_partialBarline;
/** Indicates a barline displayed only on the staff - no MEI equivalent */
/** Indicates a barLine displayed only on the staff - no MEI equivalent */
bool m_onStaffOnly;

private:
Expand Down
4 changes: 2 additions & 2 deletions include/vrv/iomei.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class MeiOutput: public FileOutputStream
* Write a Barline.
* Callded from WriteLayerElement.
*/
void WriteMeiBarline( pugi::xml_node meiBarline, Barline *barline );
void WriteMeiBarline( pugi::xml_node meiBarline, Barline *barLine );

/**
* Write a Beam.
Expand Down Expand Up @@ -233,7 +233,7 @@ class MeiInput: public FileInputStream
bool ReadMeiStaff( pugi::xml_node staff );
bool ReadMeiLayer( pugi::xml_node layer );
bool ReadMeiLayerElement( pugi::xml_node XmlElement );
LayerElement *ReadMeiBarline( pugi::xml_node barline );
LayerElement *ReadMeiBarline( pugi::xml_node barLine );
LayerElement *ReadMeiBeam( pugi::xml_node beam );
LayerElement *ReadMeiClef( pugi::xml_node clef );
LayerElement *ReadMeiMensur( pugi::xml_node mensur );
Expand Down
8 changes: 4 additions & 4 deletions include/vrv/iopae.h
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ class MeasureObject {
durations = d.durations;
dots = d.dots;
durations_offset = d.durations_offset;
barline = d.barline;
barLine = d.barLine;
abbreviation_offset = d.abbreviation_offset;
wholerest = d.wholerest;
}
Expand All @@ -164,7 +164,7 @@ class MeasureObject {
durations = d.durations;
dots = d.dots;
durations_offset = d.durations_offset;
barline = d.barline;
barLine = d.barLine;
abbreviation_offset = d.abbreviation_offset;
wholerest = d.wholerest;
return *this;
Expand All @@ -182,7 +182,7 @@ class MeasureObject {
meter = NULL;
key = NULL;
notes.clear();
barline = BARRENDITION_NONE;
barLine = BARRENDITION_NONE;
wholerest = 0;
abbreviation_offset = -1;
};
Expand All @@ -195,7 +195,7 @@ class MeasureObject {
std::vector<int> durations;
std::vector<int> dots; // use the same offset as durations, they are used in parallel
unsigned int durations_offset;
data_BARRENDITION barline;
data_BARRENDITION barLine;
int abbreviation_offset;
int wholerest; // number of whole rests to process
};
Expand Down
8 changes: 4 additions & 4 deletions include/vrv/measure.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class Measure: public DocObject, public AttCommon, public AttMeasureLog
int GetMeasureIdx() const { return Object::GetIdx(); };

/**
* @name Set and get the left and right barline types
* @name Set and get the left and right barLine types
* This somehow conflicts with AttMeasureLog, which are transfered from and to the
* Barline object when reading and writing MEI. See MeiInput::ReadMeiMeasure and
* MeiOutput::ReadMeiMeasure
Expand Down Expand Up @@ -91,12 +91,12 @@ class Measure: public DocObject, public AttCommon, public AttMeasureLog
int GetXRel( );

/**
* Return the X rel position of the right barline (without its width)
* Return the X rel position of the right barLine (without its width)
*/
int GetRightBarlineX( );

/**
* Return the width of the measure, including the barline width
* Return the width of the measure, including the barLine width
*/
int GetWidth( );

Expand Down Expand Up @@ -130,7 +130,7 @@ class Measure: public DocObject, public AttCommon, public AttMeasureLog

/**
* Align the measures by adjusting the m_drawingXRel position looking at the MeasureAligner.
* This method also moves the end position of the measure according to the barline width.
* This method also moves the end position of the measure according to the barLine width.
*/
virtual int AlignMeasures( ArrayPtrVoid params );

Expand Down
8 changes: 4 additions & 4 deletions include/vrv/view.h
Original file line number Diff line number Diff line change
Expand Up @@ -125,13 +125,13 @@ class View
*/
///@{
void DrawSystem( DeviceContext *dc, System *system );
void DrawScoreDef( DeviceContext *dc, ScoreDef *scoreDef, Measure *measure, int x, Barline *barline = NULL );
void DrawScoreDef( DeviceContext *dc, ScoreDef *scoreDef, Measure *measure, int x, Barline *barLine = NULL );
void DrawStaffGrp( DeviceContext *dc, Measure *measure, StaffGrp *staffGrp, int x );
void DrawBracket ( DeviceContext *dc, int x, int y1, int y2, int staffSize);
void DrawBrace ( DeviceContext *dc, int x, int y1, int y2, int staffSize);
void DrawBarlines( DeviceContext *dc, Measure *measure, StaffGrp *staffGrp, Barline *barline );
void DrawBarline( DeviceContext *dc, int y_top, int y_bottom, Barline *barline );
void DrawBarlineDots ( DeviceContext *dc, StaffDef *staffDef, Staff *staff, Barline *barline );
void DrawBarlines( DeviceContext *dc, Measure *measure, StaffGrp *staffGrp, Barline *barLine );
void DrawBarline( DeviceContext *dc, int y_top, int y_bottom, Barline *barLine );
void DrawBarlineDots ( DeviceContext *dc, StaffDef *staffDef, Staff *staff, Barline *barLine );
void DrawPartialBarline ( DeviceContext *dc, System *system, int x, Staff *pportee);
void DrawMeasure( DeviceContext *dc, Measure *measure, System *system );
void DrawStaff( DeviceContext *dc, Staff *staff, Measure *measure, System *system );
Expand Down
2 changes: 1 addition & 1 deletion include/vrv/vrv.h
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ class DefaultEnv
unsigned char m_staffLineWidth;
/** The stem width */
unsigned char m_stemWidth;
/** The barline width */
/** The barLine width */
unsigned char m_barlineWidth;
/** The maximum beam slope */
unsigned char m_beamMaxSlope;
Expand Down
2 changes: 1 addition & 1 deletion include/vrv/vrvdef.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ namespace vrv {

#define VERSION_MAJOR 0
#define VERSION_MINOR 9
#define VERSION_REVISION 0
#define VERSION_REVISION 2

#define is_in(x,a,b) (((x) >= std::min((a),(b))) && ((x) <= std::max((a),(b))))

Expand Down
6 changes: 3 additions & 3 deletions libmei/atts_mensural.h
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,8 @@ class AttMensurDefaultLog: public Att
bool HasMensurSign( );

//
void SetMensurSlash(unsigned char mensurSlash_) { m_mensurSlash = mensurSlash_; };
unsigned char GetMensurSlash() const { return m_mensurSlash; };
void SetMensurSlash(char mensurSlash_) { m_mensurSlash = mensurSlash_; };
char GetMensurSlash() const { return m_mensurSlash; };
bool HasMensurSlash( );

///@}
Expand All @@ -164,7 +164,7 @@ class AttMensurDefaultLog: public Att
* Indicates the number lines added to the mensuration sign.
* For example, one slash is added for what we now call 'alla breve'.
**/
unsigned char m_mensurSlash;
char m_mensurSlash;

/* include <attmensur.slash> */
};
Expand Down
20 changes: 10 additions & 10 deletions libmei/atts_shared.h
Original file line number Diff line number Diff line change
Expand Up @@ -723,8 +723,8 @@ class AttCleffingLog: public Att
bool HasClefShape( );

//
void SetClefLine(unsigned char clefLine_) { m_clefLine = clefLine_; };
unsigned char GetClefLine() const { return m_clefLine; };
void SetClefLine(char clefLine_) { m_clefLine = clefLine_; };
char GetClefLine() const { return m_clefLine; };
bool HasClefLine( );

//
Expand All @@ -747,7 +747,7 @@ class AttCleffingLog: public Att
* The value must be in the range between 1 and the number of lines on the staff.
* The numbering of lines starts with the lowest line of the staff.
**/
unsigned char m_clefLine;
char m_clefLine;
/** Records the amount of octave displacement to be applied to the clef. **/
data_OCTAVE_DIS m_clefDis;
/** Records the direction of octave displacement to be applied to the clef. **/
Expand Down Expand Up @@ -2274,8 +2274,8 @@ class AttLineloc: public Att
* to the default value)
**/
///@{
void SetLine(unsigned char line_) { m_line = line_; };
unsigned char GetLine() const { return m_line; };
void SetLine(char line_) { m_line = line_; };
char GetLine() const { return m_line; };
bool HasLine( );

///@}
Expand All @@ -2286,7 +2286,7 @@ class AttLineloc: public Att
* The value must be in the range between 1 and the number of lines on the staff.
* The numbering of lines starts with the lowest line of the staff.
**/
unsigned char m_line;
char m_line;

/* include <attline> */
};
Expand Down Expand Up @@ -2996,7 +2996,7 @@ class AttMeterconformanceBar: public Att
* point of alignment across all the parts.
* Bar lines within a score are usually controlling; that is, they "line up". Bar
* lines within parts may or may not be controlling. When applied to <measure>,
* this attribute indicates the nature of the right barline but not the left.
* this attribute indicates the nature of the right barLine but not the left.
**/
std::string m_control;

Expand Down Expand Up @@ -4190,15 +4190,15 @@ class AttSlashcount: public Att
* to the default value)
**/
///@{
void SetSlash(unsigned char slash_) { m_slash = slash_; };
unsigned char GetSlash() const { return m_slash; };
void SetSlash(char slash_) { m_slash = slash_; };
char GetSlash() const { return m_slash; };
bool HasSlash( );

///@}

protected:
/** Indicates the number of slashes present. **/
unsigned char m_slash;
char m_slash;

/* include <attslash> */
};
Expand Down
2 changes: 1 addition & 1 deletion src/bboxdevicecontext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ void BBoxDeviceContext::DrawRoundedRectangle(int x, int y, int width, int height

void BBoxDeviceContext::DrawText(const std::string& text, int x, int y)
{
//DrawMusicText( text, x, y);
DrawMusicText( text, x, y);
}


Expand Down
2 changes: 1 addition & 1 deletion src/doc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ void Doc::SetCurrentScoreDef( bool force )
for (staves = tree.child.begin(); staves != tree.child.end(); ++staves) {
for (layers = staves->second.child.begin(); layers != staves->second.child.end(); ++layers) {
for (verses= layers->second.child.begin(); verses != layers->second.child.end(); ++verses) {
std::cout << staves->first << " => " << layers->first << " => " << verses->first << '\n';
//std::cout << staves->first << " => " << layers->first << " => " << verses->first << '\n';
MapOfTypeN map;
map[ &typeid(Staff) ] = staves->first;
map[ &typeid(Layer) ] = layers->first;
Expand Down
14 changes: 7 additions & 7 deletions src/iomei.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ bool MeiOutput::WriteMeasure( Measure *measure )

measure->WriteCommon(m_measure);

// here we transfer the barline object values to @left and @right
// here we transfer the barLine object values to @left and @right
measure->SetLeft( measure->GetLeftBarlineType() );
measure->SetRight( measure->GetRightBarlineType() );
measure->WriteMeasureLog(m_measure);
Expand Down Expand Up @@ -302,7 +302,7 @@ bool MeiOutput::WriteLayerElement( LayerElement *element )

pugi::xml_node xmlElement;
if (dynamic_cast<Barline*>(element)) {
xmlElement = currentParent.append_child( "barline" );
xmlElement = currentParent.append_child( "barLine" );
WriteMeiBarline( xmlElement, dynamic_cast<Barline*>(element) );
}
else if (dynamic_cast<Beam*>(element)) {
Expand Down Expand Up @@ -358,9 +358,9 @@ bool MeiOutput::WriteLayerElement( LayerElement *element )
}
}

void MeiOutput::WriteMeiBarline( pugi::xml_node meiBarline, Barline *barline )
void MeiOutput::WriteMeiBarline( pugi::xml_node meiBarline, Barline *barLine )
{
barline->WriteBarLineLog(meiBarline);
barLine->WriteBarLineLog(meiBarline);
return;
}

Expand Down Expand Up @@ -1025,7 +1025,7 @@ bool MeiInput::ReadMeiMeasure( pugi::xml_node measure )
m_measure->ReadCommon(measure);
m_measure->ReadMeasureLog(measure);

// here we transfer the @left and @right values to the barline objects
// here we transfer the @left and @right values to the barLine objects
m_measure->SetLeftBarlineType( m_measure->GetLeft() );
m_measure->SetRightBarlineType( m_measure->GetRight() );

Expand Down Expand Up @@ -1172,10 +1172,10 @@ bool MeiInput::ReadMeiLayerElement( pugi::xml_node xmlElement )
return true;
}

LayerElement *MeiInput::ReadMeiBarline( pugi::xml_node barline )
LayerElement *MeiInput::ReadMeiBarline( pugi::xml_node barLine )
{
Barline *vrvBarline = new Barline();
vrvBarline->ReadBarLineLog(barline);
vrvBarline->ReadBarLineLog(barLine);
return vrvBarline;
}

Expand Down
24 changes: 12 additions & 12 deletions src/iopae.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -270,9 +270,9 @@ void PaeInput::parsePlainAndEasy(std::istream &infile) {
current_measure.notes[0].tie = 0;
}

//barline
//barLine
else if ((incipit[i] == ':') || (incipit[i] == '/')) {
i += getBarline(incipit, &current_measure.barline, i);
i += getBarline(incipit, &current_measure.barLine, i);
current_measure.abbreviation_offset = 0; // just in case...
staff.push_back( current_measure );
current_measure.reset();
Expand Down Expand Up @@ -337,9 +337,9 @@ void PaeInput::parsePlainAndEasy(std::istream &infile) {
i++;
}

// we need to add the last measure if it has no barline at the end
// we need to add the last measure if it has no barLine at the end
if (current_measure.notes.size() != 0) {
//current_measure.barline = "=-";
//current_measure.barLine = "=-";
staff.push_back( current_measure );
current_measure.notes.clear();
}
Expand Down Expand Up @@ -801,18 +801,18 @@ int PaeInput::getClefInfo( const char *incipit, Clef *mclef, int index ) {

if (clef == 'C' || clef == 'c') {
mclef->SetShape(CLEFSHAPE_C);
mclef->SetLine(line);
mclef->SetLine(line - 48);
} else if (clef == 'G') {
mclef->SetShape(CLEFSHAPE_G);
mclef->SetLine(line);
mclef->SetLine(line - 48);
} else if (clef == 'g') {
mclef->SetShape(CLEFSHAPE_G);
mclef->SetLine(line);
mclef->SetLine(line - 48);
mclef->SetDis(OCTAVE_DIS_8);
mclef->SetDisPlace(PLACE_above);
} else if (clef == 'F' || clef == 'f') {
mclef->SetShape(CLEFSHAPE_F);
mclef->SetLine(line);
mclef->SetLine(line - 48);
} else {
// what the...
LogDebug("Clef %c is Undefined", clef);
Expand Down Expand Up @@ -850,7 +850,7 @@ int PaeInput::getWholeRest( const char *incipit, int *wholerest, int index ) {

/**********************************
*
* getBarline -- read the barline.
* getBarline -- read the barLine.
* Translation from PAE to verovio representaion:
*
BARRENDITION_single /
Expand Down Expand Up @@ -1092,10 +1092,10 @@ void PaeInput::convertMeasure(MeasureObject *measure ) {
parseNote(note);
}

// Set barline
// FIXME use flags for proper barline identification
// Set barLine
// FIXME use flags for proper barLine identification
Barline *bline = m_measure->GetRightBarline();
bline->SetRend( measure->barline );
bline->SetRend( measure->barLine );

}

Expand Down
4 changes: 2 additions & 2 deletions src/measure.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ void Measure::Clear()
m_xAbs = VRV_UNSET;
m_drawingXRel = 0;
m_drawingX = 0;
// by default, we have a single barline on the right (none on the left)
// by default, we have a single barLine on the right (none on the left)
m_rightBarline.SetRend( this->GetRight() );
m_leftBarline.SetRend( this->GetLeft() );
}
Expand Down Expand Up @@ -225,7 +225,7 @@ int Measure::AlignMeasures( ArrayPtrVoid params )

(*shift) += m_measureAligner.GetRightAlignment()->GetXRel();

// We also need to take into account the measure end (right) barline with here
// We also need to take into account the measure end (right) barLine with here
if (GetRightBarlineType() != BARRENDITION_NONE) {
// shift the next measure of the total with
(*shift) += GetRightBarline()->GetAlignment()->GetMaxWidth();
Expand Down
Loading

0 comments on commit e130d8f

Please sign in to comment.