Skip to content

Commit

Permalink
Minimal drawing code for generic layer elements
Browse files Browse the repository at this point in the history
  • Loading branch information
lpugin committed Sep 19, 2024
1 parent 6e6afc5 commit a47f7a7
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
2 changes: 2 additions & 0 deletions include/vrv/view.h
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,8 @@ class View {
void DrawDots(DeviceContext *dc, LayerElement *element, Layer *layer, Staff *staff, Measure *measure);
void DrawDurationElement(DeviceContext *dc, LayerElement *element, Layer *layer, Staff *staff, Measure *measure);
void DrawFlag(DeviceContext *dc, LayerElement *element, Layer *layer, Staff *staff, Measure *measure);
void DrawGenericLayerElement(
DeviceContext *dc, LayerElement *element, Layer *layer, Staff *staff, Measure *measure);
void DrawGraceGrp(DeviceContext *dc, LayerElement *element, Layer *layer, Staff *staff, Measure *measure);
void DrawHalfmRpt(DeviceContext *dc, LayerElement *element, Layer *layer, Staff *staff, Measure *measure);
void DrawKeySig(DeviceContext *dc, LayerElement *element, Layer *layer, Staff *staff, Measure *measure);
Expand Down
17 changes: 17 additions & 0 deletions src/view_element.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,9 @@ void View::DrawLayerElement(DeviceContext *dc, LayerElement *element, Layer *lay
else if (element->Is(FLAG)) {
this->DrawFlag(dc, element, layer, staff, measure);
}
else if (element->Is(GENERIC_ELEMENT)) {
this->DrawGenericLayerElement(dc, element, layer, staff, measure);
}
else if (element->Is(GRACEGRP)) {
this->DrawGraceGrp(dc, element, layer, staff, measure);
}
Expand Down Expand Up @@ -890,6 +893,20 @@ void View::DrawFlag(DeviceContext *dc, LayerElement *element, Layer *layer, Staf
dc->EndGraphic(element, this);
}

void View::DrawGenericLayerElement(
DeviceContext *dc, LayerElement *element, Layer *layer, Staff *staff, Measure *measure)
{
assert(dc);
assert(element);
assert(layer);
assert(staff);
assert(measure);

dc->StartGraphic(element, "", element->GetID());

dc->EndGraphic(element, this);
}

void View::DrawGraceGrp(DeviceContext *dc, LayerElement *element, Layer *layer, Staff *staff, Measure *measure)
{
assert(dc);
Expand Down

0 comments on commit a47f7a7

Please sign in to comment.