Hosted by
|
with Ada.Tags; use Ada.Tags;
with Glyphs; use Glyphs;
with Font_Loaders; use Font_Loaders;
with Printers; use Printers;
with Music.Notes; use Music.Notes;
package Boxes.Note_Heads is
type Stem_Side_Enum is (None, Left, Right);
subtype Dot_Range is Positive range 1 .. 3;
type Dot_Array is array(Dot_Range) of Glyph_Access;
type Note_Head_Box is new Box with private;
Note_Head_Box_Tag : constant String;
type Note_Head_Box_Access is access all Note_Head_Box;
function Create
(Note_Head : in Note_Head_Enum;
Filled : in Boolean;
Position : in Integer)
return Note_Head_Box_Access;
function Get_Note_Head
(This : access Note_Head_Box)
return Note_Head_Enum;
function Get_Filled
(This : access Note_Head_Box)
return Boolean;
function Get_Position
(This : access Note_Head_Box)
return Integer;
procedure Set_Stem_Side
(This : access Note_Head_Box;
Stem_Side : in Stem_Side_Enum);
function Get_Stem_Side
(This : access Note_Head_Box)
return Stem_Side_Enum;
function Get_Name
(This : access Note_Head_Box)
return String;
procedure Layout
(This : access Note_Head_Box;
Font : access Font_Loader);
procedure Add_Dots
(This : access Note_Head_Box;
Font : access Font_Loader;
Dots : in Positive;
Offset : in Vector);
procedure Print
(This : access Note_Head_Box;
To : access Printer'Class;
Center : in Vector);
private
type Note_Head_Box is
new Box with
record
Note_Head : Note_Head_Enum;
Filled : Boolean;
Position : Integer;
Stem_Side : Stem_Side_Enum;
Glyph : Glyph_Access;
Dots : Dot_Array;
Dot_Offset : Vector;
end record;
Note_Head_Box_Tag : constant String := "boxes.note_heads.note_head_box";
end Boxes.Note_Heads;
|