summaryrefslogtreecommitdiff
path: root/src/libsndfile.ads
diff options
context:
space:
mode:
Diffstat (limited to 'src/libsndfile.ads')
-rw-r--r--src/libsndfile.ads22
1 files changed, 7 insertions, 15 deletions
diff --git a/src/libsndfile.ads b/src/libsndfile.ads
index d88c06d..ad82d0c 100644
--- a/src/libsndfile.ads
+++ b/src/libsndfile.ads
@@ -51,7 +51,7 @@ package Libsndfile is
Track_Number_String,
Genre_String);
- type File_Info is private;
+ type File_Info is tagged private;
type Major_Format is
(Format_Unknown,
@@ -222,7 +222,7 @@ package Libsndfile is
(File : in out Sound_File;
Name : in String;
Mode : in File_Mode;
- Info : in out File_Info)
+ Info : in out File_Info'Class)
with Pre => not Is_Open (File),
Post => Is_Open (File);
@@ -352,8 +352,6 @@ private
pragma Inline (Version_String);
-
-
type Sound_File is tagged limited record
Ptr : System.Address := System.Null_Address;
FMode : File_Mode := Read_Only;
@@ -368,7 +366,7 @@ private
-- This cannot correspond to the C-side SF_INFO since sf_count_t can vary
- type File_Info is record
+ type C_File_Info is record
My_Frames : Interfaces.Integer_64;
My_Sample_Rate : Interfaces.C.int;
My_Channels : Interfaces.C.int;
@@ -379,10 +377,12 @@ private
My_Seekable : Interfaces.C.int;
end record with Convention => C;
-
- Blank_Info : constant File_Info := (My_Frames => 0, others => 0);
+ type File_Info is tagged record
+ Data : C_File_Info;
+ end record;
+ Blank_Info : constant File_Info := (Data => (My_Frames => 0, others => 0));
procedure Raise_Error
@@ -413,8 +413,6 @@ private
return Interfaces.C.int;
-
-
sf_false : constant Interfaces.C.int;
pragma Import (C, sf_false, "sf_false");
@@ -422,8 +420,6 @@ private
pragma Import (C, sf_true, "sf_true");
-
-
sfm_read : constant Interfaces.C.int;
pragma Import (C, sfm_read, "sfm_read");
@@ -434,8 +430,6 @@ private
pragma Import (C, sfm_rdwr, "sfm_rdwr");
-
-
sf_seek_set : constant Interfaces.C.int;
pragma Import (C, sf_seek_set, "sf_seek_set");
@@ -446,8 +440,6 @@ private
pragma Import (C, sf_seek_end, "sf_seek_end");
-
-
function sf_error
(File : in System.Address)
return Interfaces.C.int;