Hosted by
|
package body Music.Notes is
function Create
return Note_Access
is
Result : Note_Access := new Note;
begin
Result.Notations := Notation_Lists.Create;
return Result;
end Create;
procedure Set_Note_Head
(This : access Note;
Note_Head : in Note_Head_Enum := Normal) is
begin
This.Note_Head := Note_Head;
end Set_Note_Head;
function Get_Note_Head
(This : access Note)
return Note_Head_Enum is
begin
return This.Note_Head;
end Get_Note_Head;
procedure Set_Filled
(This : access Note;
Filled : in Filled_Enum := Auto) is
begin
This.Filled := Filled;
end Set_Filled;
procedure Set_Grace
(This : access Note;
Grace : in Boolean := False) is
begin
This.Grace := Grace;
end Set_Grace;
function Get_Grace
(This : access Note)
return Boolean is
begin
return This.Grace;
end Get_Grace;
procedure Set_Chord
(This : access Note;
Chord : in Boolean := False) is
begin
This.Chord := Chord;
end Set_Chord;
function Get_Chord
(This : access Note)
return Boolean is
begin
return This.Chord;
end Get_Chord;
procedure Set_Pitch
(This : access Note;
Pitch : in Pitch_Access) is
begin
This.Pitch := Pitch;
end Set_Pitch;
function Get_Pitch
(This : access Note)
return Pitch_Access is
begin
return This.Pitch;
end Get_Pitch;
procedure Set_Duration
(This : access Note;
Duration : in Positive := 1) is
begin
This.Duration := Duration;
end Set_Duration;
function Get_Duration
(This : access Note)
return Positive is
begin
return This.Duration;
end Get_Duration;
procedure Set_Voice
(This : access Note;
Voice : in Natural := 0) is
begin
This.Voice := Voice;
end Set_Voice;
function Get_Voice
(This : access Note)
return Natural is
begin
return This.Voice;
end Get_Voice;
procedure Set_Note_Type
(This : access Note;
Note_Type : in Note_Type_Enum := Whole) is
begin
This.Note_Type := Note_Type;
end Set_Note_Type;
function Get_Note_Type
(This : access Note)
return Note_Type_Enum is
begin
return This.Note_Type;
end Get_Note_Type;
function Get_Dots
(This : access Note)
return Natural is
begin
return This.Dots;
end Get_Dots;
procedure Set_Stem
(This : access Note;
Stem : in Stem_Enum := Auto) is
begin
This.Stem := Stem;
end Set_Stem;
function Get_Stem
(This : access Note)
return Stem_Enum is
begin
return This.Stem;
end Get_Stem;
procedure Set_Staff
(This : access Note;
Staff : in Natural := 0) is
begin
This.Staff := Staff;
end Set_Staff;
function Get_Staff
(This : access Note)
return Natural is
begin
return This.Staff;
end Get_Staff;
function Get_Beams
(This : access Note)
return Beam_Array is
begin
return This.Beams;
end Get_Beams;
function Get_Notations
(This : access Note)
return Notation_List_Access is
begin
return This.Notations;
end Get_Notations;
procedure Set_Lyric
(This : access Note;
Lyric : in Lyric_Access) is
begin
This.Lyric := Lyric;
end Set_Lyric;
function Get_Lyric
(This : access Note)
return Lyric_Access is
begin
return This.Lyric;
end Get_Lyric;
function Get_Filled
(This : access Note)
return Boolean is
begin
case This.Filled is
when Yes => return True;
when No => return False;
when Auto =>
case This.Note_Type is
when Whole | Half => return False;
when others => return True;
end case;
end case;
end Get_Filled;
procedure Add_Dot
(This : access Note) is
begin
This.Dots := This.Dots + 1;
end Add_Dot;
procedure Set_Beam_State
(This : access Note;
Index : in Beam_Range;
State : in Beam_State_Enum) is
begin
This.Beams(Index) := State;
end Set_Beam_State;
function Get_Beam_State
(This : access Note;
Index : in Beam_Range)
return Beam_State_Enum is
begin
return This.Beams(Index);
end Get_Beam_State;
procedure Add_Notation
(This : access Note;
Add : access Notations.Notation'Class) is
begin
Notation_Lists.Push(This.Notations, Notations.Notation_Access(Add));
end Add_Notation;
function Get_Position
(This : access Note)
return Integer is
begin
return Get_Position(This.Pitch);
end Get_Position;
end Music.Notes;
|