~ubuntu-branches/ubuntu/gutsy/audacity/gutsy-backports

« back to all changes in this revision

Viewing changes to lib-src/portaudio-v19/src/hostapi/coreaudio/pa_mac_core.c

  • Committer: Bazaar Package Importer
  • Author(s): John Dong
  • Date: 2008-02-18 21:58:19 UTC
  • mfrom: (13.1.2 hardy)
  • Revision ID: james.westby@ubuntu.com-20080218215819-tmbcf1rx238r8gdv
Tags: 1.3.4-1.1ubuntu1~gutsy1
Automated backport upload; no source changes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
70
70
#include "pa_mac_core_utilities.h"
71
71
#include "pa_mac_core_blocking.h"
72
72
 
 
73
 
 
74
#ifdef __cplusplus
 
75
extern "C"
 
76
{
 
77
#endif /* __cplusplus */
 
78
 
73
79
/* prototypes for functions declared in this file */
74
80
 
75
 
#ifdef __cplusplus
76
 
extern "C"
77
 
{
78
 
#endif /* __cplusplus */
79
 
 
80
81
PaError PaMacCore_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex index );
81
82
 
 
83
/*
 
84
 * Function declared in pa_mac_core.h. Sets up a PaMacCoreStreamInfoStruct
 
85
 * with the requested flags and initializes channel map.
 
86
 */
 
87
void PaMacCore_SetupStreamInfo(  PaMacCoreStreamInfo *data, const unsigned long flags )
 
88
{
 
89
   bzero( data, sizeof( PaMacCoreStreamInfo ) );
 
90
   data->size = sizeof( PaMacCoreStreamInfo );
 
91
   data->hostApiType = paCoreAudio;
 
92
   data->version = 0x01;
 
93
   data->flags = flags;
 
94
   data->channelMap = NULL;
 
95
   data->channelMapSize = 0;
 
96
}
 
97
 
 
98
/*
 
99
 * Function declared in pa_mac_core.h. Adds channel mapping to a PaMacCoreStreamInfoStruct
 
100
 */
 
101
void PaMacCore_SetupChannelMap( PaMacCoreStreamInfo *data, const SInt32 * const channelMap, const unsigned long channelMapSize )
 
102
{
 
103
   data->channelMap = channelMap;
 
104
   data->channelMapSize = channelMapSize;
 
105
}
 
106
static char *channelName = NULL;
 
107
static int channelNameSize = 0;
 
108
static bool ensureChannelNameSize( int size )
 
109
{
 
110
   if( size >= channelNameSize ) {
 
111
      free( channelName );
 
112
      channelName = (char *) malloc( ( channelNameSize = size ) + 1 );
 
113
      if( !channelName ) {
 
114
         channelNameSize = 0;
 
115
         return false;
 
116
      }
 
117
   }
 
118
   return true;
 
119
}
 
120
/*
 
121
 * Function declared in pa_mac_core.h. retrives channel names.
 
122
 */
 
123
const char *PaMacCore_GetChannelName( int device, int channelIndex, bool input )
 
124
{
 
125
   struct PaUtilHostApiRepresentation *hostApi;
 
126
   PaError err;
 
127
   OSStatus error;
 
128
   err = PaUtil_GetHostApiRepresentation( &hostApi, paCoreAudio );
 
129
   assert(err == paNoError);
 
130
   PaMacAUHAL *macCoreHostApi = (PaMacAUHAL*)hostApi;
 
131
   AudioDeviceID hostApiDevice = macCoreHostApi->devIds[device];
 
132
 
 
133
   UInt32 size = 0;
 
134
 
 
135
   error = AudioDeviceGetPropertyInfo( hostApiDevice,
 
136
                                       channelIndex + 1,
 
137
                                       input,
 
138
                                       kAudioDevicePropertyChannelName,
 
139
                                       &size,
 
140
                                       NULL );
 
141
   if( error ) {
 
142
      //try the CFString
 
143
      CFStringRef name;
 
144
      bool isDeviceName = false;
 
145
      size = sizeof( name );
 
146
      error = AudioDeviceGetProperty( hostApiDevice,
 
147
                                      channelIndex + 1,
 
148
                                      input,
 
149
                                      kAudioDevicePropertyChannelNameCFString,
 
150
                                      &size,
 
151
                                      &name );
 
152
      if( error ) { //as a last-ditch effort, get the device name. Later we'll append the channel number.
 
153
         size = sizeof( name );
 
154
         error = AudioDeviceGetProperty( hostApiDevice,
 
155
                                      channelIndex + 1,
 
156
                                      input,
 
157
                                      kAudioDevicePropertyDeviceNameCFString,
 
158
                                      &size,
 
159
                                      &name );
 
160
         if( error )
 
161
            return NULL;
 
162
         isDeviceName = true;
 
163
      }
 
164
      if( isDeviceName ) {
 
165
         name = CFStringCreateWithFormat( NULL, NULL, CFSTR( "%@: %d"), name, channelIndex + 1 );
 
166
      }
 
167
 
 
168
      CFIndex length = CFStringGetLength(name);
 
169
      while( ensureChannelNameSize( length * sizeof(UniChar) + 1 ) ) {
 
170
         if( CFStringGetCString( name, channelName, channelNameSize, kCFStringEncodingUTF8 ) ) {
 
171
            if( isDeviceName )
 
172
               CFRelease( name );
 
173
            return channelName;
 
174
         }
 
175
         if( length == 0 )
 
176
            ++length;
 
177
         length *= 2;
 
178
      }
 
179
      if( isDeviceName )
 
180
         CFRelease( name );
 
181
      return NULL;
 
182
   }
 
183
 
 
184
   //continue with C string:
 
185
   if( !ensureChannelNameSize( size ) )
 
186
      return NULL;
 
187
 
 
188
   error = AudioDeviceGetProperty( hostApiDevice,
 
189
                                   channelIndex + 1,
 
190
                                   input,
 
191
                                   kAudioDevicePropertyChannelName,
 
192
                                   &size,
 
193
                                   channelName );
 
194
 
 
195
   if( error ) {
 
196
      ERR( error );
 
197
      return NULL;
 
198
   }
 
199
   return channelName;
 
200
}
 
201
 
 
202
 
 
203
 
 
204
 
 
205
 
 
206
AudioDeviceID PaMacCore_GetStreamInputDevice( PaStream* s )
 
207
{
 
208
    PaMacCoreStream *stream = (PaMacCoreStream*)s;
 
209
    VVDBUG(("PaMacCore_GetStreamInputHandle()\n"));
 
210
 
 
211
    return ( stream->inputDevice );
 
212
}
 
213
 
 
214
AudioDeviceID PaMacCore_GetStreamOutputDevice( PaStream* s )
 
215
{
 
216
    PaMacCoreStream *stream = (PaMacCoreStream*)s;
 
217
    VVDBUG(("PaMacCore_GetStreamOutputHandle()\n"));
 
218
 
 
219
    return ( stream->outputDevice );
 
220
}
 
221
 
82
222
#ifdef __cplusplus
83
223
}
84
224
#endif /* __cplusplus */
137
277
#define PA_AUHAL_SET_LAST_HOST_ERROR( errorCode, errorText ) \
138
278
    PaUtil_SetLastHostErrorInfo( paInDevelopment, errorCode, errorText )
139
279
 
140
 
 
141
280
/*currently, this is only used in initialization, but it might be modified
142
281
  to be used when the list of devices changes.*/
143
282
static PaError gatherDeviceInfo(PaMacAUHAL *auhalHostApi)
621
760
    AURenderCallbackStruct rcbs;
622
761
    unsigned long macInputStreamFlags  = paMacCorePlayNice;
623
762
    unsigned long macOutputStreamFlags = paMacCorePlayNice;
 
763
    SInt32 const *inChannelMap = NULL;
 
764
    SInt32 const *outChannelMap = NULL;
 
765
    unsigned long inChannelMapSize = 0;
 
766
    unsigned long outChannelMapSize = 0;
624
767
 
625
768
    VVDBUG(("OpenAndSetupOneAudioUnit(): in chan=%d, in fmt=%ld, out chan=%d, out fmt=%ld, requestedFramesPerBuffer=%ld\n",
626
769
                inStreamParams  ? inStreamParams->channelCount  : -1,
638
781
 
639
782
    /* -- get the user's api specific info, if they set any -- */
640
783
    if( inStreamParams && inStreamParams->hostApiSpecificStreamInfo )
 
784
    {
641
785
       macInputStreamFlags=
642
 
            ((paMacCoreStreamInfo*)inStreamParams->hostApiSpecificStreamInfo)
 
786
            ((PaMacCoreStreamInfo*)inStreamParams->hostApiSpecificStreamInfo)
643
787
                  ->flags;
 
788
       inChannelMap = ((PaMacCoreStreamInfo*)inStreamParams->hostApiSpecificStreamInfo)
 
789
                  ->channelMap;
 
790
       inChannelMapSize = ((PaMacCoreStreamInfo*)inStreamParams->hostApiSpecificStreamInfo)
 
791
                  ->channelMapSize;
 
792
    }
644
793
    if( outStreamParams && outStreamParams->hostApiSpecificStreamInfo )
 
794
    {
645
795
       macOutputStreamFlags=
646
 
            ((paMacCoreStreamInfo*)outStreamParams->hostApiSpecificStreamInfo)
 
796
            ((PaMacCoreStreamInfo*)outStreamParams->hostApiSpecificStreamInfo)
647
797
                  ->flags;
 
798
       outChannelMap = ((PaMacCoreStreamInfo*)outStreamParams->hostApiSpecificStreamInfo)
 
799
                  ->channelMap;
 
800
       outChannelMapSize = ((PaMacCoreStreamInfo*)outStreamParams->hostApiSpecificStreamInfo)
 
801
                  ->channelMapSize; 
 
802
    }
648
803
    /* Override user's flags here, if desired for testing. */
649
804
 
650
805
    /*
689
844
    /* -- if there is input, we have to explicitly enable input -- */
690
845
    if( inStreamParams )
691
846
    {
692
 
       UInt32 enableIO;
693
 
       enableIO = 1;
 
847
       UInt32 enableIO = 1;
694
848
       ERR_WRAP( AudioUnitSetProperty( *audioUnit,
695
849
                 kAudioOutputUnitProperty_EnableIO,
696
850
                 kAudioUnitScope_Input,
701
855
    /* -- if there is no output, we must explicitly disable output -- */
702
856
    if( !outStreamParams )
703
857
    {
704
 
       UInt32 enableIO;
705
 
       enableIO = 0;
 
858
       UInt32 enableIO = 0;
706
859
       ERR_WRAP( AudioUnitSetProperty( *audioUnit,
707
860
                 kAudioOutputUnitProperty_EnableIO,
708
861
                 kAudioUnitScope_Output,
710
863
                 &enableIO,
711
864
                 sizeof(enableIO) ) );
712
865
    }
 
866
 
713
867
    /* -- set the devices -- */
714
868
    /* make sure input and output are the same device if we are doing input and
715
869
       output. */
716
870
    if( inStreamParams && outStreamParams )
 
871
    {
717
872
       assert( outStreamParams->device == inStreamParams->device );
 
873
    }
718
874
    if( inStreamParams )
719
875
    {
720
876
       *audioDevice = auhalHostApi->devIds[inStreamParams->device] ;
753
909
                                          requestedFramesPerBuffer,
754
910
                                          actualInputFramesPerBuffer );
755
911
       if( paResult ) goto error;
756
 
       if( macInputStreamFlags & paMacCore_ChangeDeviceParameters ) {
 
912
       if( macInputStreamFlags & paMacCoreChangeDeviceParameters ) {
757
913
          bool requireExact;
758
 
          requireExact=macInputStreamFlags&paMacCore_FailIfConversionRequired;
 
914
          requireExact=macInputStreamFlags & paMacCoreFailIfConversionRequired;
759
915
          paResult = setBestSampleRateForDevice( *audioDevice, FALSE,
760
916
                                                 requireExact, sampleRate );
761
917
          if( paResult ) goto error;
771
927
                                          requestedFramesPerBuffer,
772
928
                                          actualOutputFramesPerBuffer );
773
929
       if( paResult ) goto error;
774
 
       if( macOutputStreamFlags & paMacCore_ChangeDeviceParameters ) {
 
930
       if( macOutputStreamFlags & paMacCoreChangeDeviceParameters ) {
775
931
          bool requireExact;
776
 
          requireExact=macOutputStreamFlags&paMacCore_FailIfConversionRequired;
 
932
          requireExact=macOutputStreamFlags & paMacCoreFailIfConversionRequired;
777
933
          paResult = setBestSampleRateForDevice( *audioDevice, TRUE,
778
934
                                                 requireExact, sampleRate );
779
935
          if( paResult ) goto error;
963
1119
                               &rcbs,
964
1120
                               sizeof(rcbs)) );
965
1121
 
966
 
    /*IMPLEMENTME: may need to worry about channel mapping.*/
967
 
 
 
1122
    /* channel mapping. */
 
1123
    if(inChannelMap)
 
1124
    {
 
1125
        UInt32 mapSize = inChannelMapSize *sizeof(SInt32);
 
1126
 
 
1127
        //for each channel of desired input, map the channel from
 
1128
        //the device's output channel.
 
1129
        ERR_WRAP( AudioUnitSetProperty(*audioUnit,
 
1130
                                kAudioOutputUnitProperty_ChannelMap,
 
1131
                                kAudioUnitScope_Output,
 
1132
                                INPUT_ELEMENT,
 
1133
                                inChannelMap,
 
1134
                                mapSize));
 
1135
    }
 
1136
    if(outChannelMap)
 
1137
    {
 
1138
        UInt32 mapSize = outChannelMapSize *sizeof(SInt32);
 
1139
 
 
1140
        //for each channel of desired output, map the channel from
 
1141
        //the device's output channel.
 
1142
        ERR_WRAP(AudioUnitSetProperty(*audioUnit,
 
1143
                                kAudioOutputUnitProperty_ChannelMap,
 
1144
                                kAudioUnitScope_Output,
 
1145
                                OUTPUT_ELEMENT,
 
1146
                                outChannelMap,
 
1147
                                mapSize));
 
1148
    }
968
1149
    /* initialize the audio unit */
969
1150
    ERR_WRAP( AudioUnitInitialize(*audioUnit) );
970
1151
 
1106
1287
    {
1107
1288
        PaUtil_InitializeStreamRepresentation( &stream->streamRepresentation,
1108
1289
                                        &auhalHostApi->blockingStreamInterface,
1109
 
                                        BlioCallback, &stream->blio );
 
1290
                                        BlioCallback, &stream->blio );
1110
1291
    }
1111
1292
 
1112
1293
    PaUtil_InitializeCpuLoadMeasurer( &stream->cpuLoadMeasurer, sampleRate );
1275
1456
          }
1276
1457
 
1277
1458
          /* now we can initialize the ring buffer */
1278
 
          assert( 0 ==
1279
 
            RingBuffer_Init( &stream->inputRingBuffer,
1280
 
                             ringSize*szfl, data ) );
 
1459
          PaUtil_InitializeRingBuffer( &stream->inputRingBuffer,
 
1460
                                   ringSize*szfl, data ) ;
1281
1461
          /* advance the read point a little, so we are reading from the
1282
1462
             middle of the buffer */
1283
1463
          if( stream->outputUnit )
1284
 
             RingBuffer_AdvanceWriteIndex( &stream->inputRingBuffer, ringSize*szfl / RING_BUFFER_ADVANCE_DENOMINATOR );
 
1464
             PaUtil_AdvanceRingBufferWriteIndex( &stream->inputRingBuffer, ringSize*szfl / RING_BUFFER_ADVANCE_DENOMINATOR );
1285
1465
       }
1286
1466
    }
1287
1467
 
1448
1628
{
1449
1629
   void *dummyData;
1450
1630
   long dummySize;
1451
 
   RingBuffer *rb = (RingBuffer *) inUserData;
 
1631
   PaUtilRingBuffer *rb = (PaUtilRingBuffer *) inUserData;
1452
1632
 
1453
1633
   VVDBUG(("ringBufferIOProc()\n"));
1454
1634
 
1455
1635
   assert( sizeof( UInt32 ) == sizeof( long ) );
1456
 
   if( RingBuffer_GetReadAvailable( rb ) == 0 ) {
 
1636
   if( PaUtil_GetRingBufferReadAvailable( rb ) == 0 ) {
1457
1637
      *outData = NULL;
1458
1638
      *ioDataSize = 0;
1459
1639
      return RING_BUFFER_EMPTY;
1460
1640
   }
1461
 
   RingBuffer_GetReadRegions( rb, *ioDataSize,
1462
 
                              outData, (long *)ioDataSize, 
1463
 
                              &dummyData, &dummySize );
 
1641
   PaUtil_GetRingBufferReadRegions( rb, *ioDataSize,
 
1642
                                    outData, (long *)ioDataSize, 
 
1643
                                    &dummyData, &dummySize );
1464
1644
      
1465
1645
   assert( *ioDataSize );
1466
 
   RingBuffer_AdvanceReadIndex( rb, *ioDataSize );
 
1646
   PaUtil_AdvanceRingBufferReadIndex( rb, *ioDataSize );
1467
1647
 
1468
1648
   return noErr;
1469
1649
}
1671
1851
               AudioConverter would otherwise handle for us. */
1672
1852
            void *data1, *data2;
1673
1853
            long size1, size2;
1674
 
            RingBuffer_GetReadRegions( &stream->inputRingBuffer,
1675
 
                                       inChan*frames*flsz,
1676
 
                                       &data1, &size1,
1677
 
                                       &data2, &size2 );
 
1854
            PaUtil_GetRingBufferReadRegions( &stream->inputRingBuffer,
 
1855
                                             inChan*frames*flsz,
 
1856
                                             &data1, &size1,
 
1857
                                             &data2, &size2 );
1678
1858
            if( size1 / ( flsz * inChan ) == frames ) {
1679
1859
               /* simplest case: all in first buffer */
1680
1860
               PaUtil_SetInputFrameCount( &(stream->bufferProcessor), frames );
1685
1865
               framesProcessed =
1686
1866
                    PaUtil_EndBufferProcessing( &(stream->bufferProcessor),
1687
1867
                                                &callbackResult );
1688
 
               RingBuffer_AdvanceReadIndex(&stream->inputRingBuffer, size1 );
 
1868
               PaUtil_AdvanceRingBufferReadIndex(&stream->inputRingBuffer, size1 );
1689
1869
            } else if( ( size1 + size2 ) / ( flsz * inChan ) < frames ) {
1690
1870
               /*we underflowed. take what data we can, zero the rest.*/
1691
 
               float data[frames*inChan];
 
1871
               unsigned char data[frames*inChan*flsz];
1692
1872
               if( size1 )
1693
1873
                  memcpy( data, data1, size1 );
1694
1874
               if( size2 )
1703
1883
               framesProcessed =
1704
1884
                    PaUtil_EndBufferProcessing( &(stream->bufferProcessor),
1705
1885
                                                &callbackResult );
1706
 
               RingBuffer_AdvanceReadIndex( &stream->inputRingBuffer,
1707
 
                                            size1+size2 );
 
1886
               PaUtil_AdvanceRingBufferReadIndex( &stream->inputRingBuffer,
 
1887
                                                  size1+size2 );
1708
1888
               /* flag underflow */
1709
1889
               stream->xrunFlags |= paInputUnderflow;
1710
1890
            } else {
1724
1904
               framesProcessed =
1725
1905
                    PaUtil_EndBufferProcessing( &(stream->bufferProcessor),
1726
1906
                                                &callbackResult );
1727
 
               RingBuffer_AdvanceReadIndex(&stream->inputRingBuffer, size1+size2 );
 
1907
               PaUtil_AdvanceRingBufferReadIndex(&stream->inputRingBuffer, size1+size2 );
1728
1908
            }
1729
1909
         }
1730
1910
      } else {
1764
1944
            into the ring buffer. */
1765
1945
         long bytesIn, bytesOut;
1766
1946
         bytesIn = sizeof( float ) * inNumberFrames * chan;
1767
 
         bytesOut = RingBuffer_Write( &stream->inputRingBuffer,
1768
 
                                stream->inputAudioBufferList.mBuffers[0].mData,
1769
 
                                bytesIn );
 
1947
         bytesOut = PaUtil_WriteRingBuffer( &stream->inputRingBuffer,
 
1948
                                            stream->inputAudioBufferList.mBuffers[0].mData,
 
1949
                                            bytesIn );
1770
1950
         if( bytesIn != bytesOut )
1771
1951
            stream->xrunFlags |= paInputOverflow ;
1772
1952
      }
1940
2120
#undef ERR_WRAP
1941
2121
}
1942
2122
 
 
2123
// it's not clear from appl's docs that this really waits
 
2124
// until all data is flushed.
 
2125
static ComponentResult BlockWhileAudioUnitIsRunning( AudioUnit audioUnit, AudioUnitElement element )
 
2126
{
 
2127
    Boolean isRunning = 1;
 
2128
    while( isRunning ) {
 
2129
       UInt32 s = sizeof( isRunning );
 
2130
       ComponentResult err = AudioUnitGetProperty( audioUnit, kAudioOutputUnitProperty_IsRunning, kAudioUnitScope_Global, element,  &isRunning, &s );
 
2131
       if( err )
 
2132
          return err;
 
2133
       Pa_Sleep( 100 );
 
2134
    }
 
2135
    return noErr;
 
2136
}
1943
2137
 
1944
2138
static PaError StopStream( PaStream *s )
1945
2139
{
1960
2154
    if( stream->inputUnit == stream->outputUnit && stream->inputUnit )
1961
2155
    {
1962
2156
       ERR_WRAP( AudioOutputUnitStop(stream->inputUnit) );
 
2157
       ERR_WRAP( BlockWhileAudioUnitIsRunning(stream->inputUnit,0) );
 
2158
       ERR_WRAP( BlockWhileAudioUnitIsRunning(stream->inputUnit,1) );
1963
2159
       ERR_WRAP( AudioUnitReset(stream->inputUnit, kAudioUnitScope_Global, 1) );
1964
2160
       ERR_WRAP( AudioUnitReset(stream->inputUnit, kAudioUnitScope_Global, 0) );
1965
2161
    }
1968
2164
       if( stream->inputUnit )
1969
2165
       {
1970
2166
          ERR_WRAP(AudioOutputUnitStop(stream->inputUnit) );
 
2167
          ERR_WRAP( BlockWhileAudioUnitIsRunning(stream->inputUnit,1) );
1971
2168
          ERR_WRAP(AudioUnitReset(stream->inputUnit,kAudioUnitScope_Global,1));
1972
2169
       }
1973
2170
       if( stream->outputUnit )
1974
2171
       {
1975
2172
          ERR_WRAP(AudioOutputUnitStop(stream->outputUnit));
 
2173
          ERR_WRAP( BlockWhileAudioUnitIsRunning(stream->outputUnit,0) );
1976
2174
          ERR_WRAP(AudioUnitReset(stream->outputUnit,kAudioUnitScope_Global,0));
1977
2175
       }
1978
2176
    }
1979
2177
    if( stream->inputRingBuffer.buffer ) {
1980
 
       RingBuffer_Flush( &stream->inputRingBuffer );
 
2178
       PaUtil_FlushRingBuffer( &stream->inputRingBuffer );
1981
2179
       bzero( (void *)stream->inputRingBuffer.buffer,
1982
2180
              stream->inputRingBuffer.bufferSize );
1983
2181
       /* advance the write point a little, so we are reading from the
1984
2182
          middle of the buffer. We'll need extra at the end because
1985
2183
          testing has shown that this helps. */
1986
2184
       if( stream->outputUnit )
1987
 
          RingBuffer_AdvanceWriteIndex( &stream->inputRingBuffer,
1988
 
                                    stream->inputRingBuffer.bufferSize
1989
 
                                           / RING_BUFFER_ADVANCE_DENOMINATOR );
 
2185
          PaUtil_AdvanceRingBufferWriteIndex( &stream->inputRingBuffer,
 
2186
                                              stream->inputRingBuffer.bufferSize
 
2187
                                              / RING_BUFFER_ADVANCE_DENOMINATOR );
1990
2188
    }
1991
2189
 
1992
2190
    stream->xrunFlags = 0;
2038
2236
 
2039
2237
    return PaUtil_GetCpuLoad( &stream->cpuLoadMeasurer );
2040
2238
}
2041
 
 
2042
 
/* Use this function to initialize a paMacCoreStreamInfo struct
2043
 
   using the requested flags. */
2044
 
void paSetupMacCoreStreamInfo( paMacCoreStreamInfo *data, unsigned long flags )
2045
 
{
2046
 
   bzero( data, sizeof( paMacCoreStreamInfo ) );
2047
 
   data->size = sizeof( paMacCoreStreamInfo );
2048
 
   data->hostApiType = paCoreAudio;
2049
 
   data->version = 0x01;
2050
 
   data->flags = flags;
2051
 
}
2052
 
 
2053
 
AudioDeviceID PaMacCore_GetStreamInputDevice( PaStream* s )
2054
 
{
2055
 
    PaMacCoreStream *stream = (PaMacCoreStream*)s;
2056
 
    VVDBUG(("PaMacCore_GetStreamInputHandle()\n"));
2057
 
 
2058
 
    return ( stream->inputDevice );
2059
 
}
2060
 
 
2061
 
AudioDeviceID PaMacCore_GetStreamOutputDevice( PaStream* s )
2062
 
{
2063
 
    PaMacCoreStream *stream = (PaMacCoreStream*)s;
2064
 
    VVDBUG(("PaMacCore_GetStreamOutputHandle()\n"));
2065
 
 
2066
 
    return ( stream->outputDevice );
2067
 
}