diff options
Diffstat (limited to 'src/portaudio-streams.ads')
-rw-r--r-- | src/portaudio-streams.ads | 54 |
1 files changed, 30 insertions, 24 deletions
diff --git a/src/portaudio-streams.ads b/src/portaudio-streams.ads index bdd6247..8acf758 100644 --- a/src/portaudio-streams.ads +++ b/src/portaudio-streams.ads @@ -57,6 +57,12 @@ package Portaudio.Streams is type Frame_Amount is new Interfaces.Unsigned_32; + -- Acts as a wrapper around the arrays given above. + -- This both avoids the use of void pointers, and also + -- allows for easier reference to arrays by frame/channel. + -- Since it is only a pointer wrapper, please ensure that + -- every Buffer lives at least as long as any array used + -- to make it. type Buffer is tagged private; function Kind @@ -156,46 +162,46 @@ package Portaudio.Streams is with Pre => Store.Kind = UInt_8_Format; function Wrap - (Store : access Float_32_Array; - Frames : in Frame_Amount; - Channels : in Natural) + (Store : in Float_32_Array; + Frames : in Frame_Amount; + Channels : in Natural) return Buffer - with Pre => Store.all'Length = Frames * Frame_Amount (Channels); + with Pre => Store'Length = Frames * Frame_Amount (Channels); function Wrap - (Store : access Int_32_Array; - Frames : in Frame_Amount; - Channels : in Natural) + (Store : in Int_32_Array; + Frames : in Frame_Amount; + Channels : in Natural) return Buffer - with Pre => Store.all'Length = Frames * Frame_Amount (Channels); + with Pre => Store'Length = Frames * Frame_Amount (Channels); function Wrap - (Store : access Int_24_Array; - Frames : in Frame_Amount; - Channels : in Natural) + (Store : in Int_24_Array; + Frames : in Frame_Amount; + Channels : in Natural) return Buffer - with Pre => Store.all'Length = Frames * Frame_Amount (Channels); + with Pre => Store'Length = Frames * Frame_Amount (Channels); function Wrap - (Store : access Int_16_Array; - Frames : in Frame_Amount; - Channels : in Natural) + (Store : in Int_16_Array; + Frames : in Frame_Amount; + Channels : in Natural) return Buffer - with Pre => Store.all'Length = Frames * Frame_Amount (Channels); + with Pre => Store'Length = Frames * Frame_Amount (Channels); function Wrap - (Store : access Int_8_Array; - Frames : in Frame_Amount; - Channels : in Natural) + (Store : in Int_8_Array; + Frames : in Frame_Amount; + Channels : in Natural) return Buffer - with Pre => Store.all'Length = Frames * Frame_Amount (Channels); + with Pre => Store'Length = Frames * Frame_Amount (Channels); function Wrap - (Store : access UInt_8_Array; - Frames : in Frame_Amount; - Channels : in Natural) + (Store : in UInt_8_Array; + Frames : in Frame_Amount; + Channels : in Natural) return Buffer - with Pre => Store.all'Length = Frames * Frame_Amount (Channels); + with Pre => Store'Length = Frames * Frame_Amount (Channels); type Parameters is private; |