Skip to content

Commit

Permalink
Rename methods to avoid ambiguities [skip-ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
lpugin committed Sep 3, 2024
1 parent 6f0b050 commit db67b8c
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions include/vrv/barline.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@ class BarLine : public LayerElement,
* @return First entry is true if the attribute was found, second entry contains the value
*/
///@{
std::pair<bool, double> GetLength(const StaffDef *staffDef) const;
std::pair<bool, data_BARMETHOD> GetMethod(const StaffDef *staffDef) const;
std::pair<bool, int> GetPlace(const StaffDef *staffDef) const;
std::pair<bool, double> GetLengthFromContext(const StaffDef *staffDef) const;
std::pair<bool, data_BARMETHOD> GetMethodFromContext(const StaffDef *staffDef) const;
std::pair<bool, int> GetPlaceFromContext(const StaffDef *staffDef) const;
///@}

//----------//
Expand Down
6 changes: 3 additions & 3 deletions src/barline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ bool BarLine::IsDrawnThrough(const StaffGrp *staffGrp) const
return false;
}

std::pair<bool, double> BarLine::GetLength(const StaffDef *staffDef) const
std::pair<bool, double> BarLine::GetLengthFromContext(const StaffDef *staffDef) const
{
// First check the parent measure
const Measure *measure = dynamic_cast<const Measure *>(this->GetParent());
Expand All @@ -120,7 +120,7 @@ std::pair<bool, double> BarLine::GetLength(const StaffDef *staffDef) const
return { false, 0.0 };
}

std::pair<bool, data_BARMETHOD> BarLine::GetMethod(const StaffDef *staffDef) const
std::pair<bool, data_BARMETHOD> BarLine::GetMethodFromContext(const StaffDef *staffDef) const
{
// First check the parent measure
const Measure *measure = dynamic_cast<const Measure *>(this->GetParent());
Expand All @@ -145,7 +145,7 @@ std::pair<bool, data_BARMETHOD> BarLine::GetMethod(const StaffDef *staffDef) con
return { false, BARMETHOD_NONE };
}

std::pair<bool, int> BarLine::GetPlace(const StaffDef *staffDef) const
std::pair<bool, int> BarLine::GetPlaceFromContext(const StaffDef *staffDef) const
{
// First check the parent measure
const Measure *measure = dynamic_cast<const Measure *>(this->GetParent());
Expand Down
4 changes: 2 additions & 2 deletions src/view_element.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -423,9 +423,9 @@ void View::DrawBarLine(DeviceContext *dc, LayerElement *element, Layer *layer, S
StaffDef *drawingStaffDef = staff->m_drawingStaffDef;
// Determine the method
assert(drawingStaffDef);
auto [hasMethod, method] = barLine->GetMethod(drawingStaffDef);
auto [hasMethod, method] = barLine->GetMethodFromContext(drawingStaffDef);
if (barLine->HasMethod()) {
method = barLine->AttBarLineVis::GetMethod();
method = barLine->GetMethod();
}

dc->StartGraphic(element, "", element->GetID());
Expand Down
6 changes: 3 additions & 3 deletions src/view_page.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -772,7 +772,7 @@ void View::DrawBarLines(DeviceContext *dc, Measure *measure, StaffGrp *staffGrp,
}

// Determine the method
const auto [hasMethod, method] = barLine->GetMethod(staffDef);
const auto [hasMethod, method] = barLine->GetMethodFromContext(staffDef);
const bool methodMensur = hasMethod && (method == BARMETHOD_mensur);
const bool methodTakt = hasMethod && (method == BARMETHOD_takt);

Expand All @@ -798,7 +798,7 @@ void View::DrawBarLines(DeviceContext *dc, Measure *measure, StaffGrp *staffGrp,

// Adjust start and length
if (!methodMensur && !methodTakt) {
const auto [hasPlace, place] = barLine->GetPlace(staffDef);
const auto [hasPlace, place] = barLine->GetPlaceFromContext(staffDef);
if (hasPlace) {
// bar.place counts upwards (note order).
yBottom += place * unit;
Expand All @@ -808,7 +808,7 @@ void View::DrawBarLines(DeviceContext *dc, Measure *measure, StaffGrp *staffGrp,
yBottom -= 2 * unit;
}

const auto [hasLength, length] = barLine->GetLength(staffDef);
const auto [hasLength, length] = barLine->GetLengthFromContext(staffDef);
if (hasLength) {
yLength = length * unit;
}
Expand Down

0 comments on commit db67b8c

Please sign in to comment.