Hosted by
|
package body Measures is
function Create
(Number : in Natural := 0)
return Measure_Access
is
Result : Measure_Access := new Measure;
begin
Result.Number := Number;
Result.Clefs := Clef_Lists.Create;
Result.Times := Time_Lists.Create;
Result.Musics := Music_Lists.Create;
return Result;
end Create;
function Get_Number
(This : access Measure)
return Natural is
begin
return This.Number;
end Get_Number;
procedure Set_Divisions
(This : access Measure;
Divisions : in Positive := 1) is
begin
This.Divisions := Divisions;
end Set_Divisions;
function Get_Divisions
(This : access Measure)
return Positive is
begin
return This.Divisions;
end Get_Divisions;
procedure Set_Key
(This : access Measure;
Key : in Key_Access) is
begin
This.Key := Key;
end Set_Key;
function Get_Key
(This : access Measure)
return Key_Access is
begin
return This.Key;
end Get_Key;
procedure Set_Staves
(This : access Measure;
Staves : in Natural := 0) is
begin
This.Staves := Staves;
end Set_Staves;
function Get_Staves
(This : access Measure)
return Natural is
begin
return This.Staves;
end Get_Staves;
function Get_Clefs
(This : access Measure)
return Clef_List_Access is
begin
return This.Clefs;
end Get_Clefs;
function Get_Times
(This : access Measure)
return Time_List_Access is
begin
return This.Times;
end Get_Times;
function Get_Musics
(This : access Measure)
return Music_List_Access is
begin
return This.Musics;
end Get_Musics;
procedure Add_Clef
(This : access Measure;
Add : access Clef) is
begin
Clef_Lists.Push(This.Clefs, Clef_Access(Add));
end Add_Clef;
procedure Add_Time
(This : access Measure;
Add : access Time) is
begin
Time_Lists.Push(This.Times, Time_Access(Add));
end Add_Time;
procedure Add_Music
(This : access Measure;
Add : access Music_Data'Class) is
begin
Music_Lists.Push(This.Musics, Music_Data_Access(Add));
end Add_Music;
end Measures;
|