diff options
author | Jedidiah Barber <contact@jedbarber.id.au> | 2023-07-17 21:03:46 +1200 |
---|---|---|
committer | Jedidiah Barber <contact@jedbarber.id.au> | 2023-07-17 21:03:46 +1200 |
commit | 8463ca926a038bab28772c56bf5b32b0a7403853 (patch) | |
tree | 7f1edea7571bb5e5b67b5f2b15e9a3140148a676 /src/portaudio-streams.ads | |
parent | 17ed86acaee20590b3ef4d1eea10f2fd27bd3350 (diff) |
Sine wave blocking example added, fixed Buffer wrapping bug
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; |