1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
|
procedure Initialize(Surface : in Interface_Access;
As_Drums : in boolean) is
begin
Text_Io.Put_Line("Initialize surface...");
Text_Io.Put_Line("TOTO 2.1");
Gtk.Check_Button.Gtk_New(Surface.Check_Is_Drums, "Set as drums");
if As_Drums then
Surface.Is_Drums := True;
Surface.surface := new drums_Type;
Gtk_New(Surface.Surface.Main_Frame, "Drums");
Set_Active(Surface.Check_Is_Drums, True);
else
Surface.Is_Drums := False;
Surface.surface := new Synthetizer_Type;
Gtk_New(Surface.Surface.Main_Frame, "Synth");
Set_Active(Surface.Check_Is_Drums, False);
end if;
Gtk.Box.Gtk_New_Vbox(Surface.Main_Vbox);
Gtk.Box.Gtk_New_Hbox(Surface.Hbox);
Gtk.Box.Gtk_New_Vbox(Surface.Surface_Box);
Text_Io.Put_Line("TOTO 2.3");
Gtk_New_Text(Surface.Channel_Combo_box);
for I in 1..16 loop
insert_Text(Surface.Channel_Combo_box, Glib.Gint(I-1), "Channel" & Positive'Image(I));
end loop;
Set_Active(Surface.Channel_Combo_box, Glib.Gint(Surface.Channel));
Text_Io.Put_Line("TOTO 2.4");
Gtk.Box.Pack_Start(Surface.Surface_box, Surface.Surface.Main_Frame, False, False, 0);
Gtk.Box.Pack_Start(Surface.Hbox, Surface.Check_Is_Drums, False, False, 0);
Gtk.Box.Pack_Start(Surface.Hbox, Surface.Channel_Combo_box, False, False, 0);
Gtk.Box.Pack_Start(Surface.Main_Vbox, Surface.Hbox, False, False, 0);
Gtk.Box.Pack_Start(Surface.Main_Vbox, Surface.Surface_box, False, False, 0);
Text_Io.Put_Line("Init Timbre...");
Text_Io.Put_Line("TOTO 2.5");
Interfaces_Handlers.Connect(Surface.Check_Is_Drums,
"toggled",
Interfaces_handlers.To_Marshaller(Set_To_Active'access),
Surface);
Text_Io.Put_Line("TOTO 2.6");
Interfaces_Handlers.Connect(Surface.Channel_Combo_Box,
"changed",
Interfaces_handlers.To_Marshaller(Set_Timbre_Channel'access),
surface);
Text_Io.Put_Line("TOTO 2.7");
Gtk_New(Surface.Main_Frame);
Add(Surface.Main_Frame, Surface.Main_Vbox);
Text_Io.Put_Line("TOTO 2.8");
Show_All(Surface.Main_Frame);
Text_Io.Put_Line("TOTO 2.9");
end Initialize; |