Changeset 59 for pa_proposals/trunk

Show
Ignore:
Timestamp:
12/02/02 22:14:08 (6 years ago)
Author:
rossbencina
Message:

- replaced Pa_GetStreamInputLatency() and Pa_GetStreamOutputLatency() with a new PaStreamInfo? and Pa_GetStreamInfo() functions.
- added sampleRate to PaStreamInfo?
- marked PaStreamInfo::sampleRate as implemented

Location:
pa_proposals/trunk
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • pa_proposals/trunk/003-ImproveLatencySpecificationInterface.html

    r38 r59  
    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 19, 2002 </P> 
     20<P>Updated: December 3, 2002 </P> 
    2121 
    2222<H4>Status</H4> 
     
    7575 
    7676<P> 
    77 The following two functions are proposed to retrieve the input and output latency of a stream. Both return the latency in seconds. 
     77A method will be provided to retrieve the actual input and output latency of a stream. The following is proposed: A new PaStreamInfo structure will be defined along with a Pa_GetStreamInfo() function as follows: 
    7878</P> 
    7979 
    8080<PRE> 
    81 /* the following would operate directly on streams */ 
    82 PaTime Pa_GetStreamInputLatency( PaStream *stream ); 
    83 PaTime Pa_GetStreamOutputLatency( PaStream *stream ); 
     81/** A structure containing unchanging information about an open stream. 
     82 @see Pa_GetStreamInfo 
     83*/ 
     84 
     85typedef struct PaStreamInfo 
     86{ 
     87    /** this is struct version 1 */ 
     88    int structVersion; 
     89 
     90    /** The input latency of the stream in seconds. This value provides the most 
     91     accurate estimate of input latency available to the implementation. It may 
     92     differ significantly from the suggestedLatency value passed to Pa_OpenStream(). 
     93     The value of this field will be zero (0.) for output-only streams. 
     94     @see PaTime 
     95    */ 
     96    PaTime inputLatency; 
     97 
     98    /** The output latency of the stream in seconds. This value provides the most 
     99     accurate estimate of output latency available to the implementation. It may 
     100     differ significantly from the suggestedLatency value passed to Pa_OpenStream(). 
     101     The value of this field will be zero (0.) for input-only streams. 
     102     @see PaTime 
     103    */ 
     104    PaTime outputLatency; 
     105 
     106        ... (other fields) ... 
     107     
     108} PaStreamInfo; 
     109 
     110 
     111/** Retrieve a pointer to a PaStreamInfo structure containing information 
     112 about the specified stream. 
     113 @return A pointer to an immutable PaStreamInfo structure. If the stream 
     114 parameter invalid, or an error is encountered, the function returns NULL. 
     115 
     116 @param stream A pointer to an open stream previously created with Pa_OpenStream. 
     117 
     118 @note PortAudio manages the memory referenced by the returned pointer, 
     119 the client must not manipulate or free the memory. The pointer is only 
     120 guaranteed to be valid until the specified stream is closed. 
     121 
     122 @see PaStreamInfo 
     123*/ 
     124const PaStreamInfo* Pa_GetStreamInfo( PaStream *stream ); 
    84125</PRE> 
    85126 
     
    124165</P> 
    125166 
     167 
     168 
     169<P> 
     170Initially the following two functions were proposed to retrieve the actual input and output latency of a stream. However, the potential need to retrieve additional information about a stream was identified, and so the PaStreamInfo structure was introduced instead. 
     171</P> 
     172 
     173<PRE> 
     174/* the following would operate directly on streams */ 
     175PaTime Pa_GetStreamInputLatency( PaStream *stream ); 
     176PaTime Pa_GetStreamOutputLatency( PaStream *stream ); 
     177</PRE> 
     178 
     179 
    126180<H4>Impact Analysis</H4> 
    127181 
  • pa_proposals/trunk/017-MethodForRetrievingActualStreamSampleRate.html

    r53 r59  
    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 22, 2002 </P> 
     20<P>Updated: December 3, 2002 </P> 
    2121 
    2222<H4>Status</H4> 
    2323 
    24 <P>This proposals is open for discussion.</P> 
     24<P>This proposal is sufficiently well defined to be implemented. It is implemented in the v19-devel branch. </P> 
    2525 
    2626<H4>Background</H4> 
     
    3333 
    3434<P> 
    35 Add a function to retrieve the actual sample rate of the stream: 
     35Provide a method to to retrieve the actual sample rate of the stream. This will be achieved by 
     36adding a sample rate field to the new PaStreamInfo structure defined in <A HREF="003-ImproveLatencySpecificationInterface.html">003 - Improve Latency Specification Interface</A> 
     37</P> 
     38 
     39<PRE> 
     40/** A structure containing unchanging information about an open stream. 
     41 @see Pa_GetStreamInfo 
     42*/ 
     43 
     44typedef struct PaStreamInfo{ 
     45        ... 
     46 
     47    /** The sample rate of the stream in Hertz (samples per second). In cases 
     48     where the hardware sample rate is inaccurate and PortAudio is aware of it, 
     49     the value of this field may be different from the sampleRate parameter 
     50     passed to Pa_OpenStream(). If information about the actual hardware sample 
     51     rate is not available, this field will have the same value as the sampleRate 
     52     parameter passed to Pa_OpenStream(). 
     53    */ 
     54    double sampleRate; 
     55 
     56        ... 
     57} PaStreamInfo; 
     58</PRE> 
     59 
     60 
     61<H4>Discussion</H4> 
     62 
     63<P> Initially the following function was proposed, however it was decided that it was better to 
     64place actual latency and sample rate information in a common structure to simplify the  
     65API for casual users. 
    3666</P> 
    3767 
     
    5181</PRE> 
    5282 
    53  
    54 <H4>Discussion</H4> 
    55  
    56  
    57  
    5883<H4>Impact Analysis</H4> 
    5984 
     
    6590</BODY> 
    6691</HTML> 
     92 
  • pa_proposals/trunk/index.html

    r53 r59  
    1616 
    1717<P><A href="http://www.portaudio.com/">PortAudio Home Page</A></P> 
    18 <P>Updated: October 22, 2002 </P> 
     18<P>Updated: December 3, 2002 </P> 
    1919 
    2020<H2>Introduction</H2> 
     
    176176                <TD>implemented</TD> 
    177177        </TR> 
    178         <TR BGCOLOR="#FFCCFF"> 
     178        <TR> 
    179179                <TD><A HREF="017-MethodForRetrievingActualStreamSampleRate.html">017 - Method for Retrieving Actual Stream Sample Rate</A></TD> 
    180                 <TD>open for discussion</TD> 
    181                 <TD>not implemented</TD> 
    182                 <TD>not implemented</TD> 
    183                 <TD>not implemented</TD> 
    184                 <TD>not implemented</TD> 
     180                <TD>complete</TD> 
     181                <TD>implemented</TD> 
     182                <TD BGCOLOR="#FFCCCC">partial</TD> 
     183                <TD BGCOLOR="#FFCCCC">partial</TD> 
     184                <TD BGCOLOR="#FFCCCC">partial</TD> 
    185185        </TR> 
    186186        <TR>