summaryrefslogtreecommitdiff
path: root/src/portaudio-streams.ads
diff options
context:
space:
mode:
authorJedidiah Barber <contact@jedbarber.id.au>2023-07-26 19:51:33 +1200
committerJedidiah Barber <contact@jedbarber.id.au>2023-07-26 19:51:33 +1200
commit6a4fd86a07ebe97c8067e0e732efc2f708a2c6a8 (patch)
tree67e44274d89448305c3b54c204789a3e0aae0382 /src/portaudio-streams.ads
parenta9eb2fc7099b78287faf5765e6b9721ce4e93fc1 (diff)
Changed data buffer types for easier interop with other libraries
Diffstat (limited to 'src/portaudio-streams.ads')
-rw-r--r--src/portaudio-streams.ads51
1 files changed, 21 insertions, 30 deletions
diff --git a/src/portaudio-streams.ads b/src/portaudio-streams.ads
index 8acf758..6eb22bd 100644
--- a/src/portaudio-streams.ads
+++ b/src/portaudio-streams.ads
@@ -33,25 +33,16 @@ package Portaudio.Streams is
UInt_8_Format);
- type Float_32 is new Float;
- for Float_32'Size use 32;
- type Float_32_Array is array (Positive range <>) of Float_32;
+ -- This type isn't usually available in Interfaces
+ type Integer_24 is range -2 ** 23 .. 2 ** 23 - 1;
+ for Integer_24'Size use 24;
- type Int_32 is new Interfaces.Integer_32;
- type Int_32_Array is array (Positive range <>) of Int_32;
-
- type Int_24 is range -2 ** 23 .. 2 ** 23 - 1;
- for Int_24'Size use 24;
- type Int_24_Array is array (Positive range <>) of Int_24;
-
- type Int_16 is new Interfaces.Integer_16;
- type Int_16_Array is array (Positive range <>) of Int_16;
-
- type Int_8 is new Interfaces.Integer_8;
- type Int_8_Array is array (Positive range <>) of Int_8;
-
- type UInt_8 is new Interfaces.Unsigned_8;
- type UInt_8_Array is array (Positive range <>) of UInt_8;
+ type Float_32_Array is array (Positive range <>) of Interfaces.IEEE_Float_32;
+ type Int_32_Array is array (Positive range <>) of Interfaces.Integer_32;
+ type Int_24_Array is array (Positive range <>) of Integer_24;
+ type Int_16_Array is array (Positive range <>) of Interfaces.Integer_16;
+ type Int_8_Array is array (Positive range <>) of Interfaces.Integer_8;
+ type UInt_8_Array is array (Positive range <>) of Interfaces.Unsigned_8;
type Frame_Amount is new Interfaces.Unsigned_32;
@@ -81,84 +72,84 @@ package Portaudio.Streams is
(Store : in Buffer;
Frame : in Frame_Amount;
Channel : in Positive)
- return Float_32
+ return Interfaces.IEEE_Float_32
with Pre => Store.Kind = Float_32_Format;
function Get
(Store : in Buffer;
Frame : in Frame_Amount;
Channel : in Positive)
- return Int_32
+ return Interfaces.Integer_32
with Pre => Store.Kind = Int_32_Format;
function Get
(Store : in Buffer;
Frame : in Frame_Amount;
Channel : in Positive)
- return Int_24
+ return Integer_24
with Pre => Store.Kind = Int_24_Format;
function Get
(Store : in Buffer;
Frame : in Frame_Amount;
Channel : in Positive)
- return Int_16
+ return Interfaces.Integer_16
with Pre => Store.Kind = Int_16_Format;
function Get
(Store : in Buffer;
Frame : in Frame_Amount;
Channel : in Positive)
- return Int_8
+ return Interfaces.Integer_8
with Pre => Store.Kind = Int_8_Format;
function Get
(Store : in Buffer;
Frame : in Frame_Amount;
Channel : in Positive)
- return UInt_8
+ return Interfaces.Unsigned_8
with Pre => Store.Kind = UInt_8_Format;
procedure Put
(Store : in Buffer;
Frame : in Frame_Amount;
Channel : in Positive;
- Value : in Float_32)
+ Value : in Interfaces.IEEE_Float_32)
with Pre => Store.Kind = Float_32_Format;
procedure Put
(Store : in Buffer;
Frame : in Frame_Amount;
Channel : in Positive;
- Value : in Int_32)
+ Value : in Interfaces.Integer_32)
with Pre => Store.Kind = Int_32_Format;
procedure Put
(Store : in Buffer;
Frame : in Frame_Amount;
Channel : in Positive;
- Value : in Int_24)
+ Value : in Integer_24)
with Pre => Store.Kind = Int_24_Format;
procedure Put
(Store : in Buffer;
Frame : in Frame_Amount;
Channel : in Positive;
- Value : in Int_16)
+ Value : in Interfaces.Integer_16)
with Pre => Store.Kind = Int_16_Format;
procedure Put
(Store : in Buffer;
Frame : in Frame_Amount;
Channel : in Positive;
- Value : in Int_8)
+ Value : in Interfaces.Integer_8)
with Pre => Store.Kind = Int_8_Format;
procedure Put
(Store : in Buffer;
Frame : in Frame_Amount;
Channel : in Positive;
- Value : in UInt_8)
+ Value : in Interfaces.Unsigned_8)
with Pre => Store.Kind = UInt_8_Format;
function Wrap