-- $Date: 2004/03/08 11:05:10 $
-- $Revision: 1.15 $
-- $Author: jcrocholl $
-- $Hash: 4fc448c46b65a8414fd3fd7ded387929 $

-- This file was automatically created with ado.php.
-- Manual changes will be lost when it is updated.

with Keys; use Keys;
with Times; use Times;
with Lists;
with Music; use Music;
with Clefs; use Clefs;
with Music.Notes; use Music.Notes;
with Music.Directions; use Music.Directions;
with Music.Barlines; use Music.Barlines;

package Measures is

   package Clef_Lists is new Lists(Clef_Access);
   subtype Clef_List is Clef_Lists.List;
   subtype Clef_List_Access is Clef_Lists.List_Access;

   package Time_Lists is new Lists(Time_Access);
   subtype Time_List is Time_Lists.List;
   subtype Time_List_Access is Time_Lists.List_Access;

   package Music_Lists is new Lists(Music_Data_Access);
   subtype Music_List is Music_Lists.List;
   subtype Music_List_Access is Music_Lists.List_Access;

   -- Public representation.
   type Measure is limited private;

   -- Pointer to representation data.
   type Measure_Access is access all Measure;

   -- Constructor for instances.
   function Create
     (Number : in Natural := 0) -- The initial number.
     return Measure_Access;     -- The newly created measure.

   -- Accessor to read the number of a measure.
   function Get_Number
     (This : access Measure-- The measure to read from.
     return Natural;         -- The number of that measure.

   -- Mutator to update the divisions of a measure.
   procedure Set_Divisions
     (This      : access Measure;    -- The measure to be updated.
      Divisions : in Positive := 1); -- The new divisions of that measure.

   -- Accessor to read the divisions of a measure.
   function Get_Divisions
     (This : access Measure-- The measure to read from.
     return Positive;        -- The divisions of that measure.

   -- Mutator to update the key of a measure.
   procedure Set_Key
     (This : access Measure-- The measure to be updated.
      Key  : in Key_Access); -- The new key of that measure.

   -- Accessor to read the key of a measure.
   function Get_Key
     (This : access Measure-- The measure to read from.
     return Key_Access;      -- The key of that measure.

   -- Mutator to update the staves of a measure.
   procedure Set_Staves
     (This   : access Measure;   -- The measure to be updated.
      Staves : in Natural := 0); -- The new staves of that measure.

   -- Accessor to read the staves of a measure.
   function Get_Staves
     (This : access Measure-- The measure to read from.
     return Natural;         -- The staves of that measure.

   -- Accessor to read the clefs of a measure.
   function Get_Clefs
     (This : access Measure)  -- The measure to read from.
     return Clef_List_Access-- The clefs of that measure.

   -- Accessor to read the times of a measure.
   function Get_Times
     (This : access Measure)  -- The measure to read from.
     return Time_List_Access-- The times of that measure.

   -- Accessor to read the musics of a measure.
   function Get_Musics
     (This : access Measure)   -- The measure to read from.
     return Music_List_Access-- The musics of that measure.

   -- Add a clef to the measure.
   procedure Add_Clef
     (This : access Measure-- The measure object instance.
      Add  : access Clef);   -- Add this clef.

   -- Add a time to the measure.
   procedure Add_Time
     (This : access Measure-- The measure object instance.
      Add  : access Time);   -- Add this time.

   -- Add some music to the end of the measure.
   procedure Add_Music
     (This : access Measure;                -- The measure object instance.
      Add  : access Music_Data'Class); -- Add this music.

private

   -- Private representation.
   type Measure is limited record
      Number    : Natural := 0;
      Divisions : Positive := 1;
      Key       : Key_Access;
      Staves    : Natural := 0;
      Clefs     : Clef_List_Access;
      Times     : Time_List_Access;
      Musics    : Music_List_Access;
   end record;

end Measures;