Show
Ignore:
Timestamp:
10/24/02 00:25:20 (6 years ago)
Author:
rossbencina
Message:

x- renamed PaStreamParameters::numChannels to numberOfChannels for consistency (it was the only symbol in portaudio.h which didn't use full words, except for Info and Ptr)

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • pa_proposals/trunk/016-UseStructsForOpenStreamParameters.html

    r47 r54  
    1818<P><A href="index.html">Enhancement Proposals Index</A>, 
    1919<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> 
    2121 
    2222<H4>Status</H4> 
     
    3939typedef struct PaStreamParameters{ 
    4040     PaDeviceIndex device; 
    41      int numChannels; 
     41     int numberOfChannels; 
    4242     PaSampleFormat sampleFormat; 
    4343     PaTime suggestedLatency; 
     
    9191<P> 
    9292Using structures to pack function parameters has the advantage of creating  
    93 more readable code, because clients will generally assign values to 
    94 these structures as follows: 
     93more readable code, because clients can assign values to 
     94these 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++. 
    9595</P> 
    9696 
     
    9898PaStreamParameters inputParameters; 
    9999inputParameters.device = Pa_GetDefaultInputDevice(); 
    100 inputParameters.numChannels = 2; 
     100inputParameters.numberOfChannels = 2; 
    101101inputParameters.sampleFormat = paFloat32; 
    102102inputParameters.suggestedlatency = Pa_GetDefaultLowInputLatency( inputParameters.device ); 
     
    113113</P> 
    114114 
     115<P> 
     116Originally 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> 
    115118 
    116119<H4>Impact Analysis</H4>