par l'anneau de l'ia word master | Bonjour,
Je sais pas si ça va être efficace mais ça tourne.
D'abord j'ai initialisé ma liste.
Code :
Right_Max : constant Bar_Access := new Bar_Type ' (1, (1, (others => (120.0, Laps_Type'Last))), Next => null); Left_Max : constant Bar_Access := new Bar_Type ' (1, (1, (others => (120.0, Laps_Time-1.0))), Next => Right_max); Left_Min : constant Bar_Access := new Bar_Type ' (1, (1, (others => (120.0, 0.0))), Next => Left_Max); type Buffered_Bar_Sequencer_record is record Bar_Sequencer : Bar_Sequencer_Record := (Left_Min, Left_Max, Right_Max); Current : Bar_Access := Left_Min; Left : Bar_Access := Left_Min; Right : Bar_Access := Left_Min; In_Loop : Boolean := False; end record; procedure Initialize(Bufferd_Bar_Sequencer : out Buffered_Bar_Sequencer_Record; In_Loop : in Boolean := False) is begin Bufferd_Bar_Sequencer.current := Bufferd_Bar_Sequencer.Bar_Sequencer.Left_Min; Bufferd_Bar_Sequencer.Left := Bufferd_Bar_Sequencer.Bar_Sequencer.Left_Min; Bufferd_Bar_Sequencer.Right := Bufferd_Bar_Sequencer.Bar_Sequencer.Left_Max; Bufferd_Bar_Sequencer.In_Loop := In_Loop; if In_Loop then if Bufferd_Bar_Sequencer.Left /= null then Bufferd_Bar_Sequencer.Right.Next := Bufferd_Bar_Sequencer.Left; end if; end if; end Initialize;
|
J'ai implémenté une fonction set_Next pour passer d'élément en élément.
Code :
function Set_Next (Buffered_Bar_Sequencer : in out Buffered_Bar_Sequencer_Record) return Boolean is begin if Buffered_Bar_Sequencer.Current.Next /= null then Buffered_Bar_Sequencer.Current := Buffered_Bar_Sequencer.Current.Next; if Buffered_Bar_Sequencer.Left.Next /= null then Buffered_Bar_Sequencer.Left := Buffered_Bar_Sequencer.Left.next; end if; if Buffered_Bar_Sequencer.Right.Next /= null then Buffered_Bar_Sequencer.Right := Buffered_Bar_Sequencer.Right.next; end if; return True; else return False; end if; end Set_Next;
|
J'ai initialisé un timeout :
Code :
procedure Play (Widget : access Gtk_Widget_Record'class; Main_Window : in Ultrason_Access) is begin Main_Window.Transport_Play := Ultrason_G_Source.Timeout_Add(1, Set_Next'Access, Main_Window); end Play;
|
Et écris une fonction interface :
Code :
function Set_Next (Ultrason : Ultrason_Access) return Boolean is Verax : Boolean := My_Computing.Set_Next(Ultrason.Buffered_Bar_Sequencer); begin if Verax then Set_Text(Ultrason.Position, Formatting.Image(Ultrason.Buffered_Bar_Sequencer.Current.Steps.Set(1).Hours, true)); Set_Text(Ultrason.Cursor_Left, Formatting.Image(Ultrason.Buffered_Bar_Sequencer.Left.Steps.Set(1).Hours, true)); Set_Text(Ultrason.Cursor_Right, Formatting.Image(Ultrason.Buffered_Bar_Sequencer.right.Steps.Set(1).Hours, true)); end if; return Verax; end Set_Next;
|
---------------
Toute expression prend un sens spirituel qui nous influence dans notre quête de l'Homme.
|