| 26 | | Although this proposal has been implemented in v19-devel, it still requires further discussion. |
| 27 | | We need to decide whether the host-specific |
| 28 | | data associated with PaHostApiSpecificStreamInfo should immediately follow the PaHostApiSpecificStreamInfo or whether PaHostApiSpecificStreamInfo should contain a pointer to the host specific data. We should also consider whether it is worth defining a special constant paNullStreamInfo to be passed to the streamInfo parameters to Pa_OpenStream() when no stream info is being used. |
| 29 | | </P> |
| 30 | | |
| | 26 | This proposal is sufficiently well defined to be implemented. It has been partially implemented |
| | 27 | in v19-devel, however the current proposal no longer utilises the PaHostApiSpecificStreamInfo |
| | 28 | structure currently used in v19-devel. |
| | 29 | </P> |
| 49 | | The following structure could be defined as a common header for all data structures passed to the inputDriverInfo and outputDriverInfo parameters of Pa_OpenStream: |
| 50 | | </P> |
| 51 | | |
| | 48 | The inputDriverInfo and outputDriverInfo to Pa_OpenStream() will be renamed inputStreamInfo and outputStreamInfo. |
| | 49 | </P> |
| | 50 | |
| | 51 | <P> |
| | 52 | A special constant paNullStreamInfo will be defined, which can be used in the inputStreamInfo |
| | 53 | and outputStreamInfo parameters. |
| | 54 | </P |
| | 55 | |
| | 56 | <PRE> |
| | 57 | #define paNullStreamInfo ((void*)0) |
| | 58 | </P> |
| | 59 | |
| | 60 | <P> |
| | 61 | All data structures defined by implementations to be passed |
| | 62 | to the inputStreamInfo and outputStreamInfo parameters of Pa_OpenStream |
| | 63 | must begin with the following fields: |
| | 64 | </P> |
| | 65 | |
| | 66 | <PRE> |
| | 67 | unsigned long size; /* size of whole structure including this header */ |
| | 68 | PaHostApiTypeId hostApiType; /* host API for which this data is intended */ |
| | 69 | unsigned long version; /* structure version */ |
| | 70 | </PRE> |
| | 71 | |
| | 72 | <P> |
| | 73 | The common infrastructure will expect these fields to be present, and to contain valid information. |
| | 74 | </P> |
| | 75 | |
| | 76 | |
| | 77 | <P> |
| | 78 | The following host API specific extensions will be placed in separate header files rather than being placed in portaudio.h |
| | 79 | </P> |
| | 80 | |
| | 81 | <P>___</P> |
| | 82 | |
| | 83 | <P>The following structure is proposed for passing device names to the OSS implementation:</P> |
| 55 | | PaHostApiTypeId hostApiType; /* host API for which this data is intended */ |
| 56 | | unsigned long version; /* structure version */ |
| 57 | | }PaHostApiSpecificStreamInfo; |
| 58 | | </PRE> |
| 59 | | |
| 60 | | <P> |
| 61 | | The inputDriverInfo and outputDriverInfo to Pa_OpenStream() will be renamed inputStreamInfo and outputStreamInfo and will have their types changed from void* to PaHostApiSpecificStreamInfo*. |
| 62 | | </P> |
| 63 | | |
| 64 | | |
| 65 | | <P> |
| 66 | | The following host API specific extensions will be placed in separate header files rather than being placed in portaudio.h |
| 67 | | </P> |
| 68 | | |
| 69 | | <P>___</P> |
| 70 | | |
| 71 | | <P>The following structure is proposed for passing device names to the OSS implementation:</P> |
| 72 | | <PRE> |
| 73 | | struct{ |
| 74 | | PaHostApiSpecificStreamInfo header; |
| | 87 | PaHostApiTypeId hostApiType; /* host API for which this data is intended */ |
| | 88 | unsigned long version; /* structure version */ |
| | 89 | |
| 149 | | Some objections were raised regarding changing the type of inputDriverInfo and outputDriverInfo from void* to PaHostAPISpecificInfo*, as this may require clients to explicitly cast to PaHostAPISpecificInfo* when passing NULL. However the added semantic and type safety advantages were considered more valuable. |
| | 166 | Originally this proposal involved declaring a common header structure which would |
| | 167 | be embedded at the head of each host-api specific stream info structure: |
| | 168 | </P> |
| | 169 | <PRE> |
| | 170 | struct{ |
| | 171 | unsigned long size; /* size of whole structure including this header */ |
| | 172 | PaHostApiTypeId hostApiType; /* host API for which this data is intended */ |
| | 173 | unsigned long version; /* structure version */ |
| | 174 | }PaHostApiSpecificStreamInfo; |
| | 175 | </PRE> |
| | 176 | |
| | 177 | <P> |
| | 178 | However, the unidiomatic type casts required to make the use of this structure transparent |
| | 179 | lead us to the current approach, where the presence of the header structure is |
| | 180 | implicit. |
| | 181 | </P> |
| | 182 | |
| | 183 | <P> |
| | 184 | When PaHostApiSpecificStreamInfo was still declared, we intended to change the type of the |
| | 185 | streamInfor parameters from void* to PaHostApiSpecificStreamInfo*. Some objections were raised |
| | 186 | to this, as it may have required clients to explicitly cast to PaHostAPISpecificInfo* when passing NULL. However the added semantic and type safety advantages were considered more valuable. The current |
| | 187 | proposal leaves these parameters as NULL. |