From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,b57f84f15b8a93fb X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2000-12-13 18:35:11 PST Path: supernews.google.com!sn-xit-02!supernews.com!nntp-relay.ihug.net!ihug.co.nz!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newshub2.home.com!news.home.com!news1.rdc2.on.home.com.POSTED!not-for-mail Message-ID: <3A383164.27001C5E@home.com> From: "Warren W. Gay VE3WWG" X-Mailer: Mozilla 4.75 [en] (Windows NT 5.0; U) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Streams Quandry in Ada95 (SOLVED) References: <3A37B3C3.86CFCF66@home.com> <3A37D5BC.982E3BDF@home.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Thu, 14 Dec 2000 02:35:09 GMT NNTP-Posting-Host: 24.141.193.52 X-Complaints-To: abuse@home.net X-Trace: news1.rdc2.on.home.com 976761309 24.141.193.52 (Wed, 13 Dec 2000 18:35:09 PST) NNTP-Posting-Date: Wed, 13 Dec 2000 18:35:09 PST Organization: Excite@Home - The Leader in Broadband http://home.com/faster Xref: supernews.google.com comp.lang.ada:3113 Date: 2000-12-14T02:35:09+00:00 List-Id: "Warren W. Gay VE3WWG" wrote: > I just got an email from Sergey Koshcheyev who I think > has solved this riddle (to be confirmed tonight). He says: "it looks that the problem > is you're using Audio_Stream as both the package name and the type name, so the > compiler is getting confused..." I think he may be right. He was right. When I renamed the package to Audio_Streams (plural), this removed the confusion with the type: type Audio_Stream is access all Audio_Stream_Type'Class; With the original name conflict in place, the things I thought were legal to do, were not. Being relatively new to Ada, I assumed that I was doing something that I shouldn't be able to do. Once I renamed the package, as per Sergey's advice, I was then able to do the things I thought you could do. I defined : procedure Pump(In_Str, Out_Str: Audio_Stream) as required. To access derived primitives on Au_Stream, all I now need to do is: Chans := Channels(In_Str.All); -- Determine the # of input audio channels To set the # of channels on the Out_Str, (for DSP_Stream) then: Set_Channels(Out_Str.All,Chans); -- Configure DSP to use n channel output The Read/Write on the stream now works as expected: Audio_I32'Read(In_Str,I); -- Read 32 bit int Life is good! Thanks everybody. Sergey wins the prize ;-) This is the 2nd time I was burnt by the package name. This time, I'll remember the lesson. -- Warren W. Gay VE3WWG http://members.home.net/ve3wwg