Lines Matching defs:oss

79     OSSVoiceOut *oss = (OSSVoiceOut *) hw;
92 err = waveOutGetPosition(oss->hStream, &mmtime, sizeof(mmtime));
97 if (mmtime.u.sample > 0 && mmtime.u.sample == oss->old_optr) {
103 samples = oss->default_bufsize >> hw->info.shift;
117 Assert(oss->lpwh[oss->idxBuffer].dwFlags & WHDR_PREPARED);
118 Assert( (oss->lpwh[oss->idxBuffer].dwFlags & WHDR_DONE) ||
119 !(oss->lpwh[oss->idxBuffer].dwFlags & WHDR_INQUEUE));
121 if (!(oss->lpwh[oss->idxBuffer].dwFlags & WHDR_DONE) && (oss->lpwh[oss->idxBuffer].dwFlags & WHDR_INQUEUE))
123 Log(("winmm: buffer overrun -> current buffer=%d!!\n", oss->idxBuffer));
128 dst = oss->lpwh[oss->idxBuffer].lpData;
130 Log(("winmm_run_out: buffer=%d dst=%08x src=%08x convert_samples %08X\n", oss->idxBuffer, dst, src, convert_samples));
136 oss->lpwh[oss->idxBuffer].dwBufferLength = convert_samples << hw->info.shift;
137 rc = waveOutWrite(oss->hStream, &oss->lpwh[oss->idxBuffer], sizeof(oss->lpwh[oss->idxBuffer]));
149 oss->idxBuffer++;
150 if (oss->idxBuffer >= oss->cBuffers)
151 oss->idxBuffer = 0;
156 oss->old_optr = mmtime.u.sample;
162 OSSVoiceOut *oss = (OSSVoiceOut *) hw;
165 waveOutReset(oss->hStream);
166 err = waveOutClose(oss->hStream);
170 oss->fd = -1;
172 if (oss->pcm_buf) {
173 RTMemFree(oss->pcm_buf);
174 oss->pcm_buf = NULL;
184 OSSVoiceOut *oss = (OSSVoiceOut *)dwInstance;
187 bufidx = (dwParam1 - (DWORD)oss->lpwh) / sizeof(WAVEHDR);
197 OSSVoiceOut *oss = (OSSVoiceOut *) hw;
227 rc = waveOutOpen(&oss->hStream, WAVE_MAPPER, &waveInfo, &winmmBufferDone, oss, CALLBACK_FUNCTION);
229 rc = waveOutOpen(&oss->hStream, WAVE_MAPPER, &waveInfo, 0, 0, CALLBACK_NULL);
240 oss->pcm_buf = RTMemAllocZ (hw->bufsize);
241 if (!oss->pcm_buf)
244 rc = waveOutClose (oss->hStream);
245 oss->hStream = (HWAVEOUT)-1;
249 Log(("PCM buffer %08X size %d\n", oss->pcm_buf, hw->bufsize));
250 oss->cBuffers = hw->bufsize / WINMM_BUFFER_SIZE;
251 oss->lpwh = RTMemAllocZ (oss->cBuffers * sizeof(*oss->lpwh));
252 if (!oss->lpwh)
254 RTMemFree(oss->pcm_buf);
256 rc = waveOutClose (oss->hStream);
257 oss->hStream = (HWAVEOUT)-1;
261 for (i=0;i<oss->cBuffers;i++)
263 oss->lpwh[i].lpData = (char *)oss->pcm_buf + i*WINMM_BUFFER_SIZE;
264 oss->lpwh[i].dwBufferLength = WINMM_BUFFER_SIZE;
266 rc = waveOutPrepareHeader(oss->hStream, &oss->lpwh[i], sizeof(oss->lpwh[i]));
274 oss->default_bufsize = WINMM_BUFFER_SIZE;
276 waveOutSetVolume(oss->hStream, 0xffffffff);
282 OSSVoiceOut *oss = (OSSVoiceOut *) hw;
299 if (buflen > oss->default_bufsize)
301 oss->default_bufsize = buflen;
302 oss->cBuffers = hw->bufsize / buflen;
304 for (i=0;i<oss->cBuffers;i++)
306 rc = waveOutUnprepareHeader(oss->hStream, &oss->lpwh[i], sizeof(oss->lpwh[i]));
314 for (i=0;i<oss->cBuffers;i++)
316 oss->lpwh[i].lpData = (char *)oss->pcm_buf + i*oss->default_bufsize;
317 oss->lpwh[i].dwBufferLength = oss->default_bufsize;
319 rc = waveOutPrepareHeader(oss->hStream, &oss->lpwh[i], sizeof(oss->lpwh[i]));
333 oss->old_optr = 0;
334 oss->idxBuffer = 0;
335 oss->fStart = 1;
336 pcm_info_clear (&hw->info, oss->pcm_buf, hw->samples);
342 rc = waveOutReset(oss->hStream);
355 OSSVoiceIn *oss = (OSSVoiceIn *) hw;
383 rc = waveInOpen(&oss->hStream, WAVE_MAPPER, &waveInfo, 0, 0, CALLBACK_NULL);
393 oss->pcm_buf = RTMemAllocZ (hw->bufsize);
394 if (!oss->pcm_buf) {
395 rc = waveInClose(oss->hStream);
396 oss->hStream = (HWAVEIN)-1;
406 OSSVoiceIn *oss = (OSSVoiceIn *) hw;
407 err = waveInClose(oss->hStream);
411 oss->fd = -1;
412 if (oss->pcm_buf) {
413 RTMemFree(oss->pcm_buf);
414 oss->pcm_buf = NULL;
421 OSSVoiceIn *oss = (OSSVoiceIn *) hw;
454 void *p = advance (oss->pcm_buf, bufs[i].add << hwshift);
455 nread = read (oss->fd, p, bufs[i].len);
530 err = waveOutGetVolume(oss->hStream, &dwVolume);
546 err = waveOutSetVolume(oss->hStream, dwVolume);