summaryrefslogtreecommitdiff
path: root/src/libao.adb
diff options
context:
space:
mode:
Diffstat (limited to 'src/libao.adb')
-rw-r--r--src/libao.adb70
1 files changed, 38 insertions, 32 deletions
diff --git a/src/libao.adb b/src/libao.adb
index c1491c2..e10582d 100644
--- a/src/libao.adb
+++ b/src/libao.adb
@@ -19,6 +19,10 @@ use type
package body Libao is
+ ------------------------
+ -- Functions From C --
+ ------------------------
+
procedure ao_initialize;
pragma Import (C, ao_initialize, "ao_initialize");
pragma Inline (ao_initialize);
@@ -28,8 +32,6 @@ package body Libao is
pragma Inline (ao_shutdown);
-
-
function ao_append_option
(Options : in out System.Address;
Key : in Interfaces.C.char_array;
@@ -83,8 +85,6 @@ package body Libao is
pragma Inline (ao_close);
-
-
function ao_driver_id
(Short_Name : in Interfaces.C.char_array)
return Interfaces.C.int;
@@ -115,8 +115,6 @@ package body Libao is
pragma Inline (ao_file_extension);
-
-
function ao_is_big_endian
return Interfaces.C.int;
pragma Import (C, ao_is_big_endian, "ao_is_big_endian");
@@ -295,6 +293,10 @@ package body Libao is
+ -----------------------------------
+ -- Controlled Type Subprograms --
+ -----------------------------------
+
procedure Adjust
(This : in out Option_List)
is
@@ -329,9 +331,22 @@ package body Libao is
Interfaces.C.Strings.Free (This.C_Struct.Matrix);
end Finalize;
+ procedure Finalize
+ (This : in out Final_Controller) is
+ begin
+ for Addy of Device_List loop
+ Do_Close (Addy);
+ end loop;
+ ao_shutdown;
+ end Finalize;
+
+ ---------------------------------
+ -- Data Types and Structures --
+ ---------------------------------
+
function Kind
(Attributes : in Info)
return Output_Kind
@@ -409,8 +424,6 @@ package body Libao is
end Option_Key;
-
-
function Image_Length
(Channel : in Channel_Mnemonic)
return Positive is
@@ -477,30 +490,9 @@ package body Libao is
- function Is_Alive
- return Boolean is
- begin
- return Alive_Status;
- end Is_Alive;
-
- procedure Startup is
- begin
- ao_initialize;
- Device_List.Clear;
- Alive_Status := True;
- end Startup;
-
- procedure Shutdown is
- begin
- for Addy of Device_List loop
- Do_Close (Addy);
- end loop;
- ao_shutdown;
- Alive_Status := False;
- end Shutdown;
-
-
-
+ --------------------------------------
+ -- Device Setup/Playback/Teardown --
+ --------------------------------------
procedure Do_Append
(Ptr : in out System.Address;
@@ -657,6 +649,10 @@ package body Libao is
+ --------------------------
+ -- Driver Information --
+ --------------------------
+
function Driver_ID
(Short_Name : in String)
return Driver_ID_Number
@@ -730,6 +726,10 @@ package body Libao is
+ ---------------------
+ -- Miscellaneous --
+ ---------------------
+
function Is_Big_Endian
return Boolean is
begin
@@ -741,6 +741,12 @@ package body Libao is
end Is_Big_Endian;
+
+
+begin
+
+ ao_initialize;
+
end Libao;