Hosted by
|
with Readers; use Readers;
with Token_Readers; use Token_Readers;
package body Notations.Articulations.MusicXML is
function Read_Articulation
(XML : access XML_Reader)
return Notation_Access
is
Articulation : Articulation_Enum;
Placement : Placement_Enum := Default;
begin
Articulation := To_Articulation_Enum(Get_Context(XML));
while not End_Of_Tag(XML) loop
Read_Attribute_Name(XML);
if Found(XML, "placement") then
Read_Attribute_Value(XML);
Placement := To_Placement_Enum(Get_Token(XML));
else
XML_Expect_Error(XML, "", "placement");
end if;
end loop;
Exit_Tag(XML);
return Notation_Access(Create(Articulation, Placement));
end Read_Articulation;
procedure Write_Articulation
(XML : access XML_Writer;
This : access Articulation)
is
begin
Write_Element(XML, To_XML(Get_Name(This)'Img),
"placement", To_XML(Get_Placement(This)'Img));
end Write_Articulation;
end Notations.Articulations.MusicXML;
|