Lines Matching refs:this

151     while (this->hidden->buf_free < this->hidden->mixlen) {  in NAS_WaitDevice()
153 NAS_AuNextEvent(this->hidden->aud, AuTrue, &ev); in NAS_WaitDevice()
154 NAS_AuDispatchEvent(this->hidden->aud, &ev); in NAS_WaitDevice()
161 while (this->hidden->mixlen > this->hidden->buf_free) { in NAS_PlayDevice()
168 NAS_AuNextEvent(this->hidden->aud, AuTrue, &ev); in NAS_PlayDevice()
169 NAS_AuDispatchEvent(this->hidden->aud, &ev); in NAS_PlayDevice()
171 this->hidden->buf_free -= this->hidden->mixlen; in NAS_PlayDevice()
174 NAS_AuWriteElement(this->hidden->aud, this->hidden->flow, 0, in NAS_PlayDevice()
175 this->hidden->mixlen, this->hidden->mixbuf, AuFalse, in NAS_PlayDevice()
178 this->hidden->written += this->hidden->mixlen; in NAS_PlayDevice()
181 fprintf(stderr, "Wrote %d bytes of audio data\n", this->hidden->mixlen); in NAS_PlayDevice()
188 return (this->hidden->mixbuf); in NAS_GetDeviceBuf()
194 struct SDL_PrivateAudioData *h = this->hidden; in NAS_CaptureFromDevice()
216 struct SDL_PrivateAudioData *h = this->hidden; in NAS_FlushCapture()
227 } while ((br == sizeof (buf)) && (total < this->spec.size)); in NAS_FlushCapture()
233 if (this->hidden->aud) { in NAS_CloseDevice()
234 NAS_AuCloseServer(this->hidden->aud); in NAS_CloseDevice()
236 SDL_free(this->hidden->mixbuf); in NAS_CloseDevice()
237 SDL_free(this->hidden); in NAS_CloseDevice()
263 SDL_AudioDevice *this = (SDL_AudioDevice *) hnd->data; in event_handler() local
264 struct SDL_PrivateAudioData *h = this->hidden; in event_handler()
265 if (this->iscapture) { in event_handler()
308 struct SDL_PrivateAudioData *h = this->hidden; in find_device()
309 …const unsigned int devicekind = this->iscapture ? AuComponentKindPhysicalInput : AuComponentKindPh… in find_device()
311 const int nch = this->spec.channels; in find_device()
326 this->spec.channels = AuDeviceNumTracks(dev); in find_device()
341 this->hidden = (struct SDL_PrivateAudioData *) in NAS_OpenDevice()
342 SDL_malloc((sizeof *this->hidden)); in NAS_OpenDevice()
343 if (this->hidden == NULL) { in NAS_OpenDevice()
346 SDL_zerop(this->hidden); in NAS_OpenDevice()
350 for (test_format = SDL_FirstAudioFormat(this->spec.format); in NAS_OpenDevice()
360 this->spec.format = test_format; in NAS_OpenDevice()
362 this->hidden->aud = NAS_AuOpenServer("", 0, NULL, 0, NULL, NULL); in NAS_OpenDevice()
363 if (this->hidden->aud == 0) { in NAS_OpenDevice()
367 this->hidden->dev = find_device(this); in NAS_OpenDevice()
368 if ((this->hidden->dev == AuNone) in NAS_OpenDevice()
369 || (!(this->hidden->flow = NAS_AuCreateFlow(this->hidden->aud, 0)))) { in NAS_OpenDevice()
373 buffer_size = this->spec.freq; in NAS_OpenDevice()
381 SDL_CalculateAudioSpec(&this->spec); in NAS_OpenDevice()
384 AuMakeElementImportDevice(elms, this->spec.freq, this->hidden->dev, in NAS_OpenDevice()
386 AuMakeElementExportClient(elms + 1, 0, this->spec.freq, format, in NAS_OpenDevice()
387 this->spec.channels, AuTrue, buffer_size, in NAS_OpenDevice()
390 AuMakeElementImportClient(elms, this->spec.freq, format, in NAS_OpenDevice()
391 this->spec.channels, AuTrue, buffer_size, in NAS_OpenDevice()
393 AuMakeElementExportDevice(elms + 1, 0, this->hidden->dev, this->spec.freq, in NAS_OpenDevice()
397 NAS_AuSetElements(this->hidden->aud, this->hidden->flow, AuTrue, in NAS_OpenDevice()
400 NAS_AuRegisterEventHandler(this->hidden->aud, AuEventHandlerIDMask, 0, in NAS_OpenDevice()
401 this->hidden->flow, event_handler, in NAS_OpenDevice()
402 (AuPointer) this); in NAS_OpenDevice()
404 NAS_AuStartFlow(this->hidden->aud, this->hidden->flow, NULL); in NAS_OpenDevice()
408 this->hidden->mixlen = this->spec.size; in NAS_OpenDevice()
409 this->hidden->mixbuf = (Uint8 *) SDL_malloc(this->hidden->mixlen); in NAS_OpenDevice()
410 if (this->hidden->mixbuf == NULL) { in NAS_OpenDevice()
413 SDL_memset(this->hidden->mixbuf, this->spec.silence, this->spec.size); in NAS_OpenDevice()