-- $Date: 2004/03/08 10:48:49 $
-- $Revision: 1.5 $
-- $Author: jcrocholl $

with Ada.Tags; use Ada.Tags;

with Messages; use Messages;
with Tag_Strings; use Tag_Strings;
with Music.Notes.Output; use Music.Notes.Output; use Music.Notes;
with Music.Barlines.Output; use Music.Barlines.Output; use Music.Barlines;

package body Music.Output is

   procedure Add
     (To   : access Collector'Class;
      This : access Music_Data'Class)
   is
      use type Ada.Tags.Tag;
      Tag : String := To_String(This.all'Tag);
   begin
      -- Debug("adding music " & Tag);
      if Tag = Note_Tag then Music.Notes.Output.Add(To, Note_Access(This));
      elsif Tag = Barline_Tag then Music.Barlines.Output.Add(To, Barline_Access(This));
      else
         Error("unsupported element: " & Tag);
      end if;
   end Add;

end Music.Output;