Hosted by
|
with Integer_Strings; use Integer_Strings;
package body Music.Forwards.MusicXML is
function Read_Forward
(XML : access XML_Reader)
return Forward_Access
is
Duration : Positive;
Voice : Positive;
Staff : Positive;
begin
Exit_Tag(XML);
Duration := To_Number(Read_Element_Data(XML, "duration"));
Voice := To_Number(Read_Element_Data(XML, "voice"));
Staff := To_Number(Read_Element_Data(XML, "staff"));
Assert_Tag(XML, "/forward");
return Create(Duration, Voice, Staff);
end Read_Forward;
procedure Write_Forward
(XML : access XML_Writer;
This : access Forward)
is
begin
Start_Element(XML, "forward");
Write_Element(XML, "duration", To_String(Get_Duration(This)));
Write_Element(XML, "voice", To_String(Get_Voice(This)));
Write_Element(XML, "staff", To_String(Get_Staff(This)));
Close_Element(XML, "forward");
end Write_Forward;
end Music.Forwards.MusicXML;
|