summaryrefslogtreecommitdiff
path: root/example
diff options
context:
space:
mode:
authorJedidiah Barber <contact@jedbarber.id.au>2023-07-26 16:43:15 +1200
committerJedidiah Barber <contact@jedbarber.id.au>2023-07-26 16:43:15 +1200
commit79c1381d198f5b4ae1b75210971a8ccea1049bad (patch)
tree05d9565ce5ec6327520de6e8d37470aa7b982fd2 /example
parenta0ff8c910377207db64d4c7d5eaa76130f41f5f5 (diff)
File_Info now a tagged type for ease of use
Diffstat (limited to 'example')
-rw-r--r--example/file_info_example.adb20
-rw-r--r--example/read_example.adb2
-rw-r--r--example/virtual_io_example.adb20
3 files changed, 17 insertions, 25 deletions
diff --git a/example/file_info_example.adb b/example/file_info_example.adb
index 3971163..a147de6 100644
--- a/example/file_info_example.adb
+++ b/example/file_info_example.adb
@@ -47,18 +47,14 @@ begin
My_Sound_File.Open (ACom.Argument (1), Libsndfile.Read_Only, My_Info);
TIO.New_Line;
- TIO.Put_Line ("Open frame count:" &
- Libsndfile.Count_Type'Image (Libsndfile.Frames (My_Info)));
- TIO.Put_Line ("Open sample rate:" & Natural'Image (Libsndfile.Rate (My_Info)));
- TIO.Put_Line ("Open channel count:" & Natural'Image (Libsndfile.Channels (My_Info)));
- TIO.Put_Line ("Open major format: " &
- Libsndfile.Major_Format'Image (Libsndfile.Major (My_Info)));
- TIO.Put_Line ("Open minor format: " &
- Libsndfile.Minor_Format'Image (Libsndfile.Minor (My_Info)));
- TIO.Put_Line ("Open endianness: " &
- Libsndfile.Endianness'Image (Libsndfile.Endian (My_Info)));
- TIO.Put_Line ("Open section count:" & Natural'Image (Libsndfile.Sections (My_Info)));
- TIO.Put_Line ("Open seekable: " & Boolean'Image (Libsndfile.Seekable (My_Info)));
+ TIO.Put_Line ("Open frame count:" & Libsndfile.Count_Type'Image (My_Info.Frames));
+ TIO.Put_Line ("Open sample rate:" & Natural'Image (My_Info.Rate));
+ TIO.Put_Line ("Open channel count:" & Natural'Image (My_Info.Channels));
+ TIO.Put_Line ("Open major format: " & Libsndfile.Major_Format'Image (My_Info.Major));
+ TIO.Put_Line ("Open minor format: " & Libsndfile.Minor_Format'Image (My_Info.Minor));
+ TIO.Put_Line ("Open endianness: " & Libsndfile.Endianness'Image (My_Info.Endian));
+ TIO.Put_Line ("Open section count:" & Natural'Image (My_Info.Sections));
+ TIO.Put_Line ("Open seekable: " & Boolean'Image (My_Info.Seekable));
TIO.New_Line;
My_Sound_File.Close;
diff --git a/example/read_example.adb b/example/read_example.adb
index 33b2d7a..719e7ec 100644
--- a/example/read_example.adb
+++ b/example/read_example.adb
@@ -52,7 +52,7 @@ begin
TIO.New_Line;
declare
- Channel_Count : Natural := Libsndfile.Channels (My_Info);
+ Channel_Count : Natural := My_Info.Channels;
Test_Frames : Libsndfile.Count_Type := 5;
My_Shorts : Libsndfile.Short_Data (1 .. Natural (Test_Frames) * Channel_Count);
diff --git a/example/virtual_io_example.adb b/example/virtual_io_example.adb
index 0561655..3812354 100644
--- a/example/virtual_io_example.adb
+++ b/example/virtual_io_example.adb
@@ -134,18 +134,14 @@ begin
My_Tell'Unrestricted_Access);
TIO.New_Line;
- TIO.Put_Line ("Open frame count:" &
- Libsndfile.Count_Type'Image (Libsndfile.Frames (My_Info)));
- TIO.Put_Line ("Open sample rate:" & Natural'Image (Libsndfile.Rate (My_Info)));
- TIO.Put_Line ("Open channel count:" & Natural'Image (Libsndfile.Channels (My_Info)));
- TIO.Put_Line ("Open major format: " &
- Libsndfile.Major_Format'Image (Libsndfile.Major (My_Info)));
- TIO.Put_Line ("Open minor format: " &
- Libsndfile.Minor_Format'Image (Libsndfile.Minor (My_Info)));
- TIO.Put_Line ("Open endianness: " &
- Libsndfile.Endianness'Image (Libsndfile.Endian (My_Info)));
- TIO.Put_Line ("Open section count:" & Natural'Image (Libsndfile.Sections (My_Info)));
- TIO.Put_Line ("Open seekable: " & Boolean'Image (Libsndfile.Seekable (My_Info)));
+ TIO.Put_Line ("Open frame count:" & Libsndfile.Count_Type'Image (My_Info.Frames));
+ TIO.Put_Line ("Open sample rate:" & Natural'Image (My_Info.Rate));
+ TIO.Put_Line ("Open channel count:" & Natural'Image (My_Info.Channels));
+ TIO.Put_Line ("Open major format: " & Libsndfile.Major_Format'Image (My_Info.Major));
+ TIO.Put_Line ("Open minor format: " & Libsndfile.Minor_Format'Image (My_Info.Minor));
+ TIO.Put_Line ("Open endianness: " & Libsndfile.Endianness'Image (My_Info.Endian));
+ TIO.Put_Line ("Open section count:" & Natural'Image (My_Info.Sections));
+ TIO.Put_Line ("Open seekable: " & Boolean'Image (My_Info.Seekable));
TIO.New_Line;
Test_File.Close;