- Timestamp:
- 10/24/02 00:25:20 (6 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
pa_proposals/trunk/016-UseStructsForOpenStreamParameters.html
r47 r54 18 18 <P><A href="index.html">Enhancement Proposals Index</A>, 19 19 <A href="http://www.portaudio.com/">PortAudio Home Page</A></P> 20 <P>Updated: October 18, 2002 </P>20 <P>Updated: October 24, 2002 </P> 21 21 22 22 <H4>Status</H4> … … 39 39 typedef struct PaStreamParameters{ 40 40 PaDeviceIndex device; 41 int num Channels;41 int numberOfChannels; 42 42 PaSampleFormat sampleFormat; 43 43 PaTime suggestedLatency; … … 91 91 <P> 92 92 Using structures to pack function parameters has the advantage of creating 93 more readable code, because clients will generallyassign values to94 these structures as follows :93 more readable code, because clients can assign values to 94 these structures as follows. Incedentally, the ability to write the following code in C was one of the reasons Bjarne Stroustrup gave for not adding named parameters to C++. 95 95 </P> 96 96 … … 98 98 PaStreamParameters inputParameters; 99 99 inputParameters.device = Pa_GetDefaultInputDevice(); 100 inputParameters.num Channels = 2;100 inputParameters.numberOfChannels = 2; 101 101 inputParameters.sampleFormat = paFloat32; 102 102 inputParameters.suggestedlatency = Pa_GetDefaultLowInputLatency( inputParameters.device ); … … 113 113 </P> 114 114 115 <P> 116 Originally the numberOfChannels field was called numChannels in line with the old Pa_OpenStream parameters of the same name. However it was discovered that this field was the only one in the whole api that used an abbreviation, so it was changed to numberOfChannels for consistency. Other abbreviations currently used are Info and Ptr, neither of these are field names. Further more, Info is a very common abbreviation (over 113 million appearances in google). There is an enumeration called PaErrorNum, but we are considering eliding this with PaError or renaming it PaErrorCode. 117 </P> 115 118 116 119 <H4>Impact Analysis</H4>
