ReactOS 0.4.17-dev-934-g091855f
audiopath.c
Go to the documentation of this file.
1/* IDirectMusicAudioPath Implementation
2 *
3 * Copyright (C) 2003-2004 Rok Mandeljc
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
18 */
19
20#include "dmime_private.h"
21
23
25 IDirectMusicAudioPath IDirectMusicAudioPath_iface;
27 IDirectMusicPerformance8* pPerf;
28 IDirectMusicGraph* pToolGraph;
29 IDirectSoundBuffer* pDSBuffer;
30 IDirectSoundBuffer* pPrimary;
31
33};
34
36{
37 struct list entry;
40};
41
42#ifdef __REACTOS__
44#else
46#endif
47
49{
50 struct list entry;
53
55};
56
58{
62
64};
65
66static inline struct IDirectMusicAudioPathImpl *impl_from_IDirectMusicAudioPath(IDirectMusicAudioPath *iface)
67{
69}
70
72{
73 return CONTAINING_RECORD(iface, struct audio_path_config, dmobj.IPersistStream_iface);
74}
75
76void set_audiopath_perf_pointer(IDirectMusicAudioPath *iface, IDirectMusicPerformance8 *performance)
77{
79 This->pPerf = performance;
80}
81
82void set_audiopath_dsound_buffer(IDirectMusicAudioPath *iface, IDirectSoundBuffer *buffer)
83{
85 This->pDSBuffer = buffer;
86}
87
88void set_audiopath_primary_dsound_buffer(IDirectMusicAudioPath *iface, IDirectSoundBuffer *buffer)
89{
91 This->pPrimary = buffer;
92}
93
94/*****************************************************************************
95 * IDirectMusicAudioPathImpl implementation
96 */
97static HRESULT WINAPI IDirectMusicAudioPathImpl_QueryInterface (IDirectMusicAudioPath *iface, REFIID riid, void **ppobj)
98{
100
101 TRACE("(%p, %s, %p)\n", This, debugstr_dmguid(riid), ppobj);
102
103 *ppobj = NULL;
104
105 if (IsEqualIID (riid, &IID_IDirectMusicAudioPath) || IsEqualIID (riid, &IID_IUnknown))
106 *ppobj = &This->IDirectMusicAudioPath_iface;
107
108 if (*ppobj) {
109 IUnknown_AddRef((IUnknown*)*ppobj);
110 return S_OK;
111 }
112
113 WARN("(%p, %s, %p): not found\n", This, debugstr_dmguid(riid), ppobj);
114 return E_NOINTERFACE;
115}
116
117static ULONG WINAPI IDirectMusicAudioPathImpl_AddRef (IDirectMusicAudioPath *iface)
118{
121
122 TRACE("(%p): ref=%ld\n", This, ref);
123
124 return ref;
125}
126
127static ULONG WINAPI IDirectMusicAudioPathImpl_Release (IDirectMusicAudioPath *iface)
128{
131
132 TRACE("(%p): ref=%ld\n", This, ref);
133
134 if (ref == 0) {
135 if (This->pPrimary)
137 if (This->pDSBuffer)
139 This->pPerf = NULL;
140 free(This);
141 }
142
143 return ref;
144}
145
146static HRESULT WINAPI IDirectMusicAudioPathImpl_GetObjectInPath (IDirectMusicAudioPath *iface, DWORD dwPChannel, DWORD dwStage, DWORD dwBuffer,
147 REFGUID guidObject, DWORD dwIndex, REFGUID iidInterface, void** ppObject)
148{
150 HRESULT hr;
151
152 FIXME("(%p, %ld, %ld, %ld, %s, %ld, %s, %p): stub\n", This, dwPChannel, dwStage, dwBuffer, debugstr_dmguid(guidObject),
153 dwIndex, debugstr_dmguid(iidInterface), ppObject);
154
155 switch (dwStage) {
156 case DMUS_PATH_BUFFER:
157 if (This->pDSBuffer)
158 {
159 if (IsEqualIID (iidInterface, &IID_IUnknown) ||
160 IsEqualIID (iidInterface, &IID_IDirectSoundBuffer) ||
161 IsEqualIID (iidInterface, &IID_IDirectSoundBuffer8) ||
162 IsEqualIID (iidInterface, &IID_IDirectSound3DBuffer)) {
163 return IDirectSoundBuffer_QueryInterface(This->pDSBuffer, iidInterface, ppObject);
164 }
165
166 WARN("Unsupported interface %s\n", debugstr_dmguid(iidInterface));
167 *ppObject = NULL;
168 return E_NOINTERFACE;
169 }
170 break;
171
173 if (IsEqualIID (iidInterface, &IID_IDirectSound3DListener)) {
174 IDirectSoundBuffer_QueryInterface(This->pPrimary, &IID_IDirectSound3DListener, ppObject);
175 return S_OK;
176 } else {
177 FIXME("bad iid...\n");
178 }
179 }
180 break;
181
183 {
184 if (IsEqualIID (iidInterface, &IID_IDirectMusicGraph)) {
185 if (NULL == This->pToolGraph) {
186 IDirectMusicGraph* pGraph;
187 hr = create_dmgraph(&IID_IDirectMusicGraph, (void**)&pGraph);
188 if (FAILED(hr))
189 return hr;
190 This->pToolGraph = pGraph;
191 }
192 *ppObject = This->pToolGraph;
194 return S_OK;
195 }
196 }
197 break;
198
200 {
201 /* TODO */
202 }
203 break;
204
206 {
207 /* TODO check wanted GUID */
208 *ppObject = This->pPerf;
209 IUnknown_AddRef((LPUNKNOWN) *ppObject);
210 return S_OK;
211 }
212 break;
213
215 {
216 IDirectMusicGraph* pPerfoGraph = NULL;
217 IDirectMusicPerformance8_GetGraph(This->pPerf, &pPerfoGraph);
218 if (NULL == pPerfoGraph) {
219 IDirectMusicGraph* pGraph = NULL;
220 hr = create_dmgraph(&IID_IDirectMusicGraph, (void**)&pGraph);
221 if (FAILED(hr))
222 return hr;
224 pPerfoGraph = pGraph;
225 }
226 *ppObject = pPerfoGraph;
227 return S_OK;
228 }
229 break;
230
232 default:
233 break;
234 }
235
236 *ppObject = NULL;
237 return E_INVALIDARG;
238}
239
240static HRESULT WINAPI IDirectMusicAudioPathImpl_Activate(IDirectMusicAudioPath *iface, BOOL activate)
241{
243
244 FIXME("(%p, %d): semi-stub\n", This, activate);
245
246 if (!!activate == This->fActive)
247 return S_FALSE;
248
249 if (!activate && This->pDSBuffer) {
250 /* Path is being deactivated */
251 IDirectSoundBuffer_Stop(This->pDSBuffer);
252 }
253
254 This->fActive = !!activate;
255
256 return S_OK;
257}
258
259static HRESULT WINAPI IDirectMusicAudioPathImpl_SetVolume (IDirectMusicAudioPath *iface, LONG lVolume, DWORD dwDuration)
260{
262 FIXME("(%p, %li, %ld): stub\n", This, lVolume, dwDuration);
263 return S_OK;
264}
265
266static HRESULT WINAPI IDirectMusicAudioPathImpl_ConvertPChannel (IDirectMusicAudioPath *iface, DWORD dwPChannelIn, DWORD* pdwPChannelOut)
267{
269 FIXME("(%p, %ld, %p): stub\n", This, dwPChannelIn, pdwPChannelOut);
270 return S_OK;
271}
272
273static const IDirectMusicAudioPathVtbl DirectMusicAudioPathVtbl = {
281};
282
283/* IDirectMusicObject */
286{
287 struct chunk_entry riff = {0};
288 HRESULT hr;
289
290 TRACE("(%p, %p, %p)\n", iface, stream, desc);
291
292 if (!stream)
293 return E_POINTER;
294 if (!desc || desc->dwSize != sizeof(*desc))
295 return E_INVALIDARG;
296
297 if ((hr = stream_get_chunk(stream, &riff)) != S_OK)
298 return hr;
299 if (riff.id != FOURCC_RIFF || riff.type != DMUS_FOURCC_AUDIOPATH_FORM) {
300 TRACE("loading failed: unexpected %s\n", debugstr_chunk(&riff));
303 }
304
307 if (FAILED(hr))
308 return hr;
309
310 desc->guidClass = CLSID_DirectMusicAudioPathConfig;
311 desc->dwValidData |= DMUS_OBJ_CLASS;
312
314 return S_OK;
315}
316
317static const IDirectMusicObjectVtbl dmobject_vtbl = {
324};
325
327{
328 struct chunk_entry chunk = { .parent = pchl };
329 struct audio_path_pchannel_to_buffer *pchannel_to_buffer = NULL;
332 ULONG i;
333 HRESULT hr;
334
335 while ((hr = stream_next_chunk(stream, &chunk)) == S_OK)
336 {
337 switch (chunk.id)
338 {
340 hr = stream_read(stream, &header, sizeof(header));
341 if (FAILED(hr))
342 break;
343
344 TRACE("Got PChannelToBuffer header:\n");
345 TRACE("\tdwPChannelCount: %lu\n", header.dwPChannelCount);
346 TRACE("\tdwPChannelBase: %lu\n", header.dwPChannelBase);
347 TRACE("\tdwBufferCount: %lu\n", header.dwBufferCount);
348 TRACE("\tdwFlags: %lx\n", header.dwFlags);
349
350 bytes = chunk.size - sizeof(header);
351
352 if (bytes != sizeof(GUID) * header.dwBufferCount)
353 {
354 WARN("Invalid size of GUIDs array\n");
355 hr = E_FAIL;
356 break;
357 }
358
359 pchannel_to_buffer = calloc(1, sizeof(*pchannel_to_buffer) + bytes);
360 if (!pchannel_to_buffer)
361 {
363 break;
364 }
365
366 pchannel_to_buffer->header = header;
367 TRACE("number of GUIDs: %lu\n", pchannel_to_buffer->header.dwBufferCount);
368
369 hr = stream_read(stream, pchannel_to_buffer->guids, bytes);
370 if (FAILED(hr))
371 break;
372
373 for (i = 0; i < pchannel_to_buffer->header.dwBufferCount; i++)
374 TRACE("\tguids[%lu]: %s\n", i, debugstr_dmguid(&pchannel_to_buffer->guids[i]));
375
376 list_add_tail(&This->pchannel_to_buffer_entries, &pchannel_to_buffer->entry);
377 pchannel_to_buffer = NULL;
378 break;
379 case FOURCC_LIST:
380 if (chunk.type == DMUS_FOURCC_UNFO_LIST)
381 TRACE("Unfo list in PChannelToBuffer is ignored\n");
382 else
383 WARN("Unknown %s\n", debugstr_chunk(&chunk));
384 break;
385 case MAKEFOURCC('p','b','g','d'):
386 FIXME("Undocumented %s\n", debugstr_chunk(&chunk));
387 break;
388 default:
389 WARN("Unknown %s\n", debugstr_chunk(&chunk));
390 break;
391 }
392
393 if (FAILED(hr))
394 break;
395 }
396
397 if (FAILED(hr) && pchannel_to_buffer)
398 free(pchannel_to_buffer);
399 return hr;
400}
401
402static void port_config_destroy(struct audio_path_port_config *port_config)
403{
404 struct audio_path_pchannel_to_buffer *pchannel_to_buffer, *next_pchannel_to_buffer;
405 LIST_FOR_EACH_ENTRY_SAFE(pchannel_to_buffer, next_pchannel_to_buffer, &port_config->pchannel_to_buffer_entries,
407 {
408 list_remove(&pchannel_to_buffer->entry);
409 free(pchannel_to_buffer);
410 }
411 free(port_config);
412}
413
415{
416 struct chunk_entry chunk = { .parent = pcfl };
417 struct audio_path_port_config *port_config = calloc(1, sizeof(*port_config));
418 HRESULT hr;
419
420 if (!port_config)
421 return E_OUTOFMEMORY;
422
424
425 while ((hr = stream_next_chunk(stream, &chunk)) == S_OK)
426 {
427 switch (chunk.id)
428 {
430 hr = stream_chunk_get_data(stream, &chunk, &port_config->header, sizeof(port_config->header));
431 if (FAILED(hr))
432 break;
433 TRACE("Got PortConfig header:\n");
434 TRACE("\tdwPChannelBase: %lu\n", port_config->header.dwPChannelBase);
435 TRACE("\tdwPChannelCount: %lu\n", port_config->header.dwPChannelCount);
436 TRACE("\tdwFlags: %lx\n", port_config->header.dwFlags);
437 TRACE("\tguidPort: %s\n", debugstr_dmguid(&port_config->header.guidPort));
438 break;
440 hr = stream_chunk_get_data(stream, &chunk, &port_config->params, sizeof(port_config->params));
441 if (FAILED(hr))
442 break;
443 TRACE("Got PortConfig params:\n");
444 TRACE("\tdwSize: %lu\n", port_config->params.dwSize);
445 TRACE("\tdwValidParams: %lx\n", port_config->params.dwValidParams);
447 TRACE("\tvoices: %lu\n", port_config->params.dwVoices);
449 TRACE("\tchannel groups: %lu\n", port_config->params.dwChannelGroups);
451 TRACE("\taudio channels: %lu\n", port_config->params.dwAudioChannels);
453 TRACE("\tsample rate: %lu\n", port_config->params.dwSampleRate);
455 TRACE("\teffects: %lx\n", port_config->params.dwEffectFlags);
456 if (port_config->params.dwValidParams & DMUS_PORTPARAMS_SHARE)
457 TRACE("\tshare: %d\n", port_config->params.fShare);
459 TRACE("\tfeatures: %lx\n", port_config->params.dwFeatures);
460 break;
461 case FOURCC_LIST:
463 FIXME("DirectSound buffer descriptors is not supported\n");
464 else if (chunk.type == DMUS_FOURCC_PCHANNELS_LIST)
466 else if (chunk.type == DMUS_FOURCC_UNFO_LIST)
467 TRACE("Unfo list in PortConfig is ignored\n");
468 else
469 WARN("Unknown %s\n", debugstr_chunk(&chunk));
470 break;
471 default:
472 WARN("Unknown %s\n", debugstr_chunk(&chunk));
473 }
474
475 if (FAILED(hr))
476 break;
477 }
478
479 if (FAILED(hr))
480 port_config_destroy(port_config);
481 else
482 list_add_tail(&This->port_config_entries, &port_config->entry);
483 return hr;
484}
485
487{
488 struct chunk_entry chunk = { .parent = pcsl };
489 HRESULT hr;
490
491 while ((hr = stream_next_chunk(stream, &chunk)) == S_OK)
492 {
493 switch (MAKE_IDTYPE(chunk.id, chunk.type))
494 {
497 if (FAILED(hr))
498 return hr;
499 break;
500 default:
501 WARN("Unknown %s\n", debugstr_chunk(&chunk));
502 break;
503 }
504 }
505 return SUCCEEDED(hr) ? S_OK : hr;
506}
507
508/* IPersistStream */
510{
512 struct chunk_entry riff = {0}, chunk = {0};
513 HRESULT hr = S_OK;
514
515 FIXME("(%p, %p): Loading\n", This, stream);
516
517 if (!stream)
518 return E_POINTER;
519
520 hr = stream_get_chunk(stream, &riff);
521 if (FAILED(hr))
522 {
523 WARN("Failed to get chunk %#lx.\n", hr);
524 return hr;
525 }
526
528 {
529 WARN("loading failed: unexpected %s\n", debugstr_chunk(&riff));
530 return E_UNEXPECTED;
531 }
532
533 if (FAILED(hr = dmobj_parsedescriptor(stream, &riff, &This->dmobj.desc,
536 {
537 WARN("Failed to parse descriptor %#lx.\n", hr);
538 return hr;
539 }
540 This->dmobj.desc.guidClass = CLSID_DirectMusicAudioPathConfig;
541 This->dmobj.desc.dwValidData |= DMUS_OBJ_CLASS;
542
543 chunk.parent = &riff;
544 while ((hr = stream_next_chunk(stream, &chunk)) == S_OK)
545 {
546 switch (MAKE_IDTYPE(chunk.id, chunk.type))
547 {
550 if (FAILED(hr))
551 return hr;
553 FIXME("buffer attributes are not supported\n");
554 break;
555 case MAKE_IDTYPE(FOURCC_LIST, MAKEFOURCC('p','a','p','d')):
556 FIXME("Undocumented %s\n", debugstr_chunk(&chunk));
557 break;
559 WARN("Unknown %s\n", debugstr_chunk(&chunk));
560 break;
563 /* Already parsed in dmobj_parsedescriptor. */
564 break;
565 default:
566 WARN("Unknown %s\n", debugstr_chunk(&chunk));
567 break;
568 }
569 }
570 TRACE("Finished parsing %#lx\n", hr);
571 return SUCCEEDED(hr) ? S_OK : hr;
572}
573
574static const IPersistStreamVtbl persiststream_vtbl = {
583};
584
585static inline struct audio_path_config *impl_from_IUnknown(IUnknown *iface)
586{
588}
589
591{
593
594 TRACE("(%p, %s, %p)\n", This, debugstr_dmguid(riid), ppobj);
595
596 *ppobj = NULL;
597
599 *ppobj = &This->IUnknown_iface;
600 else if (IsEqualIID (riid, &IID_IDirectMusicObject))
601 *ppobj = &This->dmobj.IDirectMusicObject_iface;
603 *ppobj = &This->dmobj.IPersistStream_iface;
604
605 if (*ppobj)
606 {
607 IUnknown_AddRef((IUnknown*)*ppobj);
608 return S_OK;
609 }
610
611 WARN("(%p, %s, %p): not found\n", This, debugstr_dmguid(riid), ppobj);
612 return E_NOINTERFACE;
613}
614
616{
619
620 TRACE("(%p): ref=%ld\n", This, ref);
621
622 return ref;
623}
624
626{
629
630 TRACE("(%p): ref=%ld\n", This, ref);
631
632 if (!ref)
633 {
634 struct audio_path_port_config *config, *next_config;
635 LIST_FOR_EACH_ENTRY_SAFE(config, next_config, &This->port_config_entries, struct audio_path_port_config, entry)
636 {
637 list_remove(&config->entry);
639 }
640 free(This);
641 }
642 return ref;
643}
644
645static const IUnknownVtbl path_config_unk_vtbl =
646{
650};
651
653{
655 struct list *first_port_config, *first_pchannel_to_buffer;
656 struct audio_path_port_config *port_config;
657 struct audio_path_pchannel_to_buffer *pchannel_to_buffer;
658 GUID *guids;
659
660 first_port_config = list_head(&This->port_config_entries);
661 if (list_next(&This->port_config_entries, first_port_config))
662 FIXME("Only one port config supported. %p -> %p\n", first_port_config, list_next(&This->port_config_entries, first_port_config));
663 port_config = LIST_ENTRY(first_port_config, struct audio_path_port_config, entry);
664 first_pchannel_to_buffer = list_head(&port_config->pchannel_to_buffer_entries);
665 if (list_next(&port_config->pchannel_to_buffer_entries, first_pchannel_to_buffer))
666 FIXME("Only one pchannel to buffer entry supported.\n");
667 pchannel_to_buffer = LIST_ENTRY(first_pchannel_to_buffer, struct audio_path_pchannel_to_buffer, entry);
668
669 /* Secondary buffer description */
670 memset(format, 0, sizeof(*format));
671 format->wFormatTag = WAVE_FORMAT_PCM;
672 format->nChannels = 1;
673 format->nSamplesPerSec = 44000;
674 format->nAvgBytesPerSec = 44000 * 2;
675 format->nBlockAlign = 2;
676 format->wBitsPerSample = 16;
677 format->cbSize = 0;
678
679 memset(desc, 0, sizeof(*desc));
680 desc->dwSize = sizeof(*desc);
682 desc->dwBufferBytes = DSBSIZE_MIN;
683 desc->dwReserved = 0;
684 desc->lpwfxFormat = format;
685 desc->guid3DAlgorithm = GUID_NULL;
686
687 guids = pchannel_to_buffer->guids;
688 if (pchannel_to_buffer->header.dwBufferCount == 2)
689 {
690 if ((!IsEqualGUID(&guids[0], &GUID_Buffer_Reverb) && !IsEqualGUID(&guids[0], &GUID_Buffer_Stereo)) ||
691 (!IsEqualGUID(&guids[1], &GUID_Buffer_Reverb) && !IsEqualGUID(&guids[1], &GUID_Buffer_Stereo)) ||
692 IsEqualGUID(&guids[0], &guids[1]))
693 FIXME("Only a stereo plus reverb buffer is supported\n");
694 else
695 {
697 format->nChannels = 2;
698 format->nBlockAlign *= 2;
699 format->nAvgBytesPerSec *= 2;
700 }
701 }
702 else if (pchannel_to_buffer->header.dwBufferCount == 1)
703 {
704 if (IsEqualGUID(guids, &GUID_Buffer_Stereo))
705 {
707 format->nChannels = 2;
708 format->nBlockAlign *= 2;
709 format->nAvgBytesPerSec *= 2;
710 }
711 else if (IsEqualGUID(guids, &GUID_Buffer_3D_Dry))
713 else if (IsEqualGUID(guids, &GUID_Buffer_Mono))
715 else
716 FIXME("Unsupported buffer guid %s\n", debugstr_dmguid(guids));
717 }
718 else
719 FIXME("Multiple buffers not supported\n");
720
721 *params = port_config->params;
722 if (!(params->dwValidParams & DMUS_PORTPARAMS_CHANNELGROUPS))
723 {
725 params->dwChannelGroups = (port_config->header.dwPChannelCount + 15) / 16;
726 }
727 if (!(params->dwValidParams & DMUS_PORTPARAMS_AUDIOCHANNELS))
728 {
729 params->dwValidParams |= DMUS_PORTPARAMS_AUDIOCHANNELS;
730 params->dwAudioChannels = format->nChannels;
731 }
732 return S_OK;
733}
734
735/* for ClassFactory */
737{
739 HRESULT hr;
740
741 *ppobj = NULL;
742 if (!(obj = calloc(1, sizeof(*obj)))) return E_OUTOFMEMORY;
743 obj->IDirectMusicAudioPath_iface.lpVtbl = &DirectMusicAudioPathVtbl;
744 obj->ref = 1;
745
746 hr = IDirectMusicAudioPath_QueryInterface(&obj->IDirectMusicAudioPath_iface, riid, ppobj);
747 IDirectMusicAudioPath_Release(&obj->IDirectMusicAudioPath_iface);
748 return hr;
749}
750
752{
753 struct audio_path_config *obj;
754 HRESULT hr;
755
756 *ppobj = NULL;
757 if (!(obj = calloc(1, sizeof(*obj)))) return E_OUTOFMEMORY;
758 dmobject_init(&obj->dmobj, &CLSID_DirectMusicAudioPathConfig, &obj->IUnknown_iface);
759 obj->IUnknown_iface.lpVtbl = &path_config_unk_vtbl;
760 obj->dmobj.IDirectMusicObject_iface.lpVtbl = &dmobject_vtbl;
761 obj->dmobj.IPersistStream_iface.lpVtbl = &persiststream_vtbl;
762 obj->ref = 1;
763
764 list_init(&obj->port_config_entries);
765
766 hr = IUnknown_QueryInterface(&obj->IUnknown_iface, riid, ppobj);
767 IUnknown_Release(&obj->IUnknown_iface);
768 return hr;
769}
static unsigned char bytes[4]
Definition: adnsresfilter.c:74
#define InterlockedIncrement
Definition: armddk.h:53
#define InterlockedDecrement
Definition: armddk.h:52
static ULONG WINAPI path_config_IUnknown_Release(IUnknown *unk)
Definition: audiopath.c:625
static struct audio_path_config * impl_from_IPersistStream(IPersistStream *iface)
Definition: audiopath.c:71
static struct audio_path_config * impl_from_IUnknown(IUnknown *iface)
Definition: audiopath.c:585
HRESULT create_dmaudiopath(REFIID riid, void **ppobj)
Definition: audiopath.c:736
static const IDirectMusicAudioPathVtbl DirectMusicAudioPathVtbl
Definition: audiopath.c:273
static struct IDirectMusicAudioPathImpl * impl_from_IDirectMusicAudioPath(IDirectMusicAudioPath *iface)
Definition: audiopath.c:66
void set_audiopath_primary_dsound_buffer(IDirectMusicAudioPath *iface, IDirectSoundBuffer *buffer)
Definition: audiopath.c:88
static ULONG WINAPI IDirectMusicAudioPathImpl_Release(IDirectMusicAudioPath *iface)
Definition: audiopath.c:127
static const IDirectMusicObjectVtbl dmobject_vtbl
Definition: audiopath.c:317
static void port_config_destroy(struct audio_path_port_config *port_config)
Definition: audiopath.c:402
static HRESULT WINAPI path_config_IPersistStream_Load(IPersistStream *iface, IStream *stream)
Definition: audiopath.c:509
void set_audiopath_dsound_buffer(IDirectMusicAudioPath *iface, IDirectSoundBuffer *buffer)
Definition: audiopath.c:82
static const IPersistStreamVtbl persiststream_vtbl
Definition: audiopath.c:574
static HRESULT WINAPI path_config_IUnknown_QueryInterface(IUnknown *iface, REFIID riid, void **ppobj)
Definition: audiopath.c:590
static HRESULT WINAPI IDirectMusicAudioPathImpl_QueryInterface(IDirectMusicAudioPath *iface, REFIID riid, void **ppobj)
Definition: audiopath.c:97
static HRESULT parse_port_configs_list(struct audio_path_config *This, IStream *stream, const struct chunk_entry *pcsl)
Definition: audiopath.c:486
static HRESULT parse_port_config_list(struct audio_path_config *This, IStream *stream, const struct chunk_entry *pcfl)
Definition: audiopath.c:414
static HRESULT WINAPI IDirectMusicAudioPathImpl_GetObjectInPath(IDirectMusicAudioPath *iface, DWORD dwPChannel, DWORD dwStage, DWORD dwBuffer, REFGUID guidObject, DWORD dwIndex, REFGUID iidInterface, void **ppObject)
Definition: audiopath.c:146
HRESULT path_config_get_audio_path_params(IUnknown *iface, WAVEFORMATEX *format, DSBUFFERDESC *desc, DMUS_PORTPARAMS *params)
Definition: audiopath.c:652
static ULONG WINAPI IDirectMusicAudioPathImpl_AddRef(IDirectMusicAudioPath *iface)
Definition: audiopath.c:117
static HRESULT WINAPI IDirectMusicAudioPathImpl_Activate(IDirectMusicAudioPath *iface, BOOL activate)
Definition: audiopath.c:240
static const IUnknownVtbl path_config_unk_vtbl
Definition: audiopath.c:645
static ULONG WINAPI path_config_IUnknown_AddRef(IUnknown *unk)
Definition: audiopath.c:615
static HRESULT WINAPI path_config_IDirectMusicObject_ParseDescriptor(IDirectMusicObject *iface, IStream *stream, DMUS_OBJECTDESC *desc)
Definition: audiopath.c:284
static HRESULT parse_pchannel_to_buffers_list(struct audio_path_port_config *This, IStream *stream, const struct chunk_entry *pchl)
Definition: audiopath.c:326
static HRESULT WINAPI IDirectMusicAudioPathImpl_SetVolume(IDirectMusicAudioPath *iface, LONG lVolume, DWORD dwDuration)
Definition: audiopath.c:259
HRESULT create_dmaudiopath_config(REFIID riid, void **ppobj)
Definition: audiopath.c:751
void set_audiopath_perf_pointer(IDirectMusicAudioPath *iface, IDirectMusicPerformance8 *performance)
Definition: audiopath.c:76
static HRESULT WINAPI IDirectMusicAudioPathImpl_ConvertPChannel(IDirectMusicAudioPath *iface, DWORD dwPChannelIn, DWORD *pdwPChannelOut)
Definition: audiopath.c:266
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
#define WAVE_FORMAT_PCM
Definition: constants.h:425
static void list_remove(struct list_entry *entry)
Definition: list.h:90
static void list_add_tail(struct list_entry *head, struct list_entry *entry)
Definition: list.h:83
static void list_init(struct list_entry *head)
Definition: list.h:51
#define FIXME(fmt,...)
Definition: precomp.h:53
#define WARN(fmt,...)
Definition: precomp.h:61
const GUID IID_IUnknown
Definition: list.h:39
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define E_INVALIDARG
Definition: ddrawi.h:101
#define E_FAIL
Definition: ddrawi.h:102
#define free
Definition: debug_ros.c:5
struct config_s config
HRESULT hr
Definition: delayimp.cpp:582
static LPVOID LPUNKNOWN
Definition: dinput.c:53
#define NULL
Definition: types.h:112
const struct sortguid * guids
Definition: locale.c:422
#define MAKEFOURCC(ch0, ch1, ch2, ch3)
Definition: ddsformat.c:45
#define DMUS_E_CHUNKNOTFOUND
Definition: dmerror.h:66
HRESULT create_dmgraph(REFIID riid, void **ret_iface)
Definition: graph.c:301
HRESULT WINAPI dmobj_IDirectMusicObject_GetDescriptor(IDirectMusicObject *iface, DMUS_OBJECTDESC *desc)
Definition: dmobject.c:503
void dmobject_init(struct dmobject *dmobj, const GUID *class, IUnknown *outer_unk)
Definition: dmobject.c:749
HRESULT stream_chunk_get_data(IStream *stream, const struct chunk_entry *chunk, void *data, ULONG size)
Definition: dmobject.c:417
HRESULT stream_next_chunk(IStream *stream, struct chunk_entry *chunk)
Definition: dmobject.c:360
ULONG WINAPI dmobj_IPersistStream_Release(IPersistStream *iface)
Definition: dmobject.c:702
ULONG WINAPI dmobj_IDirectMusicObject_Release(IDirectMusicObject *iface)
Definition: dmobject.c:497
HRESULT dmobj_parsedescriptor(IStream *stream, const struct chunk_entry *riff, DMUS_OBJECTDESC *desc, DWORD supported)
Definition: dmobject.c:591
HRESULT WINAPI dmobj_IDirectMusicObject_QueryInterface(IDirectMusicObject *iface, REFIID riid, void **ret_iface)
Definition: dmobject.c:484
HRESULT WINAPI unimpl_IPersistStream_GetSizeMax(IPersistStream *iface, ULARGE_INTEGER *size)
Definition: dmobject.c:742
HRESULT WINAPI dmobj_IDirectMusicObject_SetDescriptor(IDirectMusicObject *iface, DMUS_OBJECTDESC *desc)
Definition: dmobject.c:518
void dump_DMUS_OBJECTDESC(DMUS_OBJECTDESC *desc)
Definition: dmobject.c:222
const char * debugstr_chunk(const struct chunk_entry *chunk)
Definition: dmobject.c:279
HRESULT WINAPI dmobj_IPersistStream_GetClassID(IPersistStream *iface, CLSID *class)
Definition: dmobject.c:708
ULONG WINAPI dmobj_IPersistStream_AddRef(IPersistStream *iface)
Definition: dmobject.c:696
const char * debugstr_dmguid(const GUID *id)
Definition: dmobject.c:36
HRESULT WINAPI dmobj_IPersistStream_QueryInterface(IPersistStream *iface, REFIID riid, void **ret_iface)
Definition: dmobject.c:689
ULONG WINAPI dmobj_IDirectMusicObject_AddRef(IDirectMusicObject *iface)
Definition: dmobject.c:491
HRESULT stream_skip_chunk(IStream *stream, const struct chunk_entry *chunk)
Definition: dmobject.c:351
HRESULT stream_get_chunk(IStream *stream, struct chunk_entry *chunk)
Definition: dmobject.c:307
HRESULT WINAPI unimpl_IPersistStream_IsDirty(IPersistStream *iface)
Definition: dmobject.c:729
HRESULT WINAPI unimpl_IPersistStream_Save(IPersistStream *iface, IStream *stream, BOOL clear_dirty)
Definition: dmobject.c:735
static HRESULT stream_reset_chunk_data(IStream *stream, const struct chunk_entry *chunk)
Definition: dmobject.h:50
#define MAKE_IDTYPE(id, type)
Definition: dmobject.h:33
struct IDirectMusicGraph * LPDIRECTMUSICGRAPH
Definition: dmplugin.h:87
#define DMUS_PORTPARAMS_CHANNELGROUPS
Definition: dmusicc.h:206
#define DMUS_PORTPARAMS_SAMPLERATE
Definition: dmusicc.h:208
#define DMUS_PORTPARAMS_AUDIOCHANNELS
Definition: dmusicc.h:207
#define DMUS_PORTPARAMS_SHARE
Definition: dmusicc.h:210
#define DMUS_PORTPARAMS_FEATURES
Definition: dmusicc.h:211
#define DMUS_PORTPARAMS_VOICES
Definition: dmusicc.h:205
#define DMUS_PORTPARAMS_EFFECTS
Definition: dmusicc.h:209
#define DMUS_FOURCC_DSBUFFER_LIST
Definition: dmusicf.h:58
#define DMUS_FOURCC_PCHANNELS_ITEM
Definition: dmusicf.h:61
#define DMUS_FOURCC_GUID_CHUNK
Definition: dmusicf.h:42
#define DMUS_FOURCC_PORTCONFIGS_LIST
Definition: dmusicf.h:54
#define DMUS_FOURCC_VERSION_CHUNK
Definition: dmusicf.h:51
#define DMUS_FOURCC_AUDIOPATH_FORM
Definition: dmusicf.h:53
#define DMUS_FOURCC_PORTPARAMS_ITEM
Definition: dmusicf.h:57
#define DMUS_FOURCC_PCHANNELS_LIST
Definition: dmusicf.h:60
#define DMUS_FOURCC_PORTCONFIG_LIST
Definition: dmusicf.h:55
#define DMUS_FOURCC_UNFO_LIST
Definition: dmusicf.h:44
#define DMUS_FOURCC_PORTCONFIG_ITEM
Definition: dmusicf.h:56
#define IDirectMusicPerformance8_SetGraph(p, a)
Definition: dmusici.h:1412
#define IDirectMusicPerformance8_GetGraph(p, a)
Definition: dmusici.h:1411
#define DMUS_PATH_AUDIOPATH_TOOL
Definition: dmusici.h:284
#define DMUS_OBJ_NAME
Definition: dmusici.h:267
#define IDirectMusicAudioPath_QueryInterface(p, a, b)
Definition: dmusici.h:1209
#define DMUS_PATH_PERFORMANCE_GRAPH
Definition: dmusici.h:286
#define DMUS_PATH_AUDIOPATH_GRAPH
Definition: dmusici.h:283
#define DMUS_OBJ_CLASS
Definition: dmusici.h:266
#define DMUS_PATH_PERFORMANCE_TOOL
Definition: dmusici.h:287
#define DMUS_PATH_PRIMARY_BUFFER
Definition: dmusici.h:293
#define DMUS_OBJ_VERSION
Definition: dmusici.h:272
#define DMUS_PATH_BUFFER
Definition: dmusici.h:289
#define IDirectMusicAudioPath_Release(p)
Definition: dmusici.h:1211
#define DMUS_PATH_PERFORMANCE
Definition: dmusici.h:285
#define IDirectMusicGraph_AddRef(p)
Definition: dmusici.h:1471
#define DMUS_OBJ_CATEGORY
Definition: dmusici.h:268
#define DMUS_OBJ_OBJECT
Definition: dmusici.h:265
#define DSBCAPS_GLOBALFOCUS
Definition: dsound.h:219
#define DSBCAPS_CTRLVOLUME
Definition: dsound.h:213
#define DSBCAPS_MUTE3DATMAXDISTANCE
Definition: dsound.h:221
#define DSBCAPS_CTRLPAN
Definition: dsound.h:212
#define IDirectSoundBuffer_Stop(p)
Definition: dsound.h:591
#define DSBCAPS_CTRLFX
Definition: dsound.h:216
#define DSBSIZE_MIN
Definition: dsound.h:224
#define DSBCAPS_CTRLFREQUENCY
Definition: dsound.h:211
#define DSBCAPS_CTRL3D
Definition: dsound.h:210
#define IDirectSoundBuffer_QueryInterface(p, a, b)
Definition: dsound.h:572
#define IDirectSoundBuffer_Release(p)
Definition: dsound.h:574
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
GLuint buffer
Definition: glext.h:5915
GLenum const GLfloat * params
Definition: glext.h:5645
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
REFIID riid
Definition: atlbase.h:39
#define S_OK
Definition: intsafe.h:52
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define FAILED(hr)
Definition: intsafe.h:51
#define C_ASSERT(e)
Definition: intsafe.h:73
uint32_t entry
Definition: isohybrid.c:63
#define GUID_NULL
Definition: ks.h:106
#define FOURCC_RIFF
Definition: mmsystem.h:564
#define FOURCC_LIST
Definition: mmsystem.h:565
D3D11_SHADER_VARIABLE_DESC desc
Definition: reflection.c:1683
static int stream_read
Definition: htmldoc.c:205
long LONG
Definition: pedump.c:60
const GUID IID_IPersistStream
Definition: proxy.cpp:13
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95
#define REFIID
Definition: guiddef.h:118
#define calloc
Definition: rosglue.h:14
#define offsetof(TYPE, MEMBER)
#define LIST_FOR_EACH_ENTRY_SAFE(cursor, cursor2, list, type, field)
Definition: list.h:242
__WINE_SERVER_LIST_INLINE struct list * list_next(const struct list *list, const struct list *elem)
Definition: list.h:117
#define memset(x, y, z)
Definition: compat.h:39
#define TRACE(s)
Definition: solgame.cpp:4
IDirectSoundBuffer * pPrimary
Definition: audiopath.c:30
IDirectSoundBuffer * pDSBuffer
Definition: audiopath.c:29
IDirectMusicPerformance8 * pPerf
Definition: audiopath.c:27
IDirectMusicGraph * pToolGraph
Definition: audiopath.c:28
IDirectMusicAudioPath IDirectMusicAudioPath_iface
Definition: audiopath.c:25
DWORD dwSampleRate
Definition: dmusicc.h:320
DWORD dwEffectFlags
Definition: dmusicc.h:321
DWORD dwValidParams
Definition: dmusicc.h:316
DWORD dwAudioChannels
Definition: dmusicc.h:319
DWORD dwChannelGroups
Definition: dmusicc.h:318
DWORD dwFeatures
Definition: dmusicc.h:323
Definition: scsiwmi.h:51
IUnknown IUnknown_iface
Definition: audiopath.c:59
struct list port_config_entries
Definition: audiopath.c:63
struct dmobject dmobj
Definition: audiopath.c:60
DMUS_IO_PCHANNELTOBUFFER_HEADER header
Definition: audiopath.c:38
DMUS_IO_PORTCONFIG_HEADER header
Definition: audiopath.c:51
DMUS_PORTPARAMS8 params
Definition: audiopath.c:52
struct list entry
Definition: audiopath.c:50
struct list pchannel_to_buffer_entries
Definition: audiopath.c:54
Definition: dmobject.h:26
FOURCC id
Definition: dmobject.h:27
FOURCC type
Definition: dmobject.h:29
uint16_t size
Definition: btrfs_drv.h:563
Definition: list.h:15
Definition: send.c:48
Definition: parse.h:23
#define LIST_ENTRY(type)
Definition: queue.h:175
ULONG_PTR SIZE_T
Definition: typedefs.h:80
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
uint32_t ULONG
Definition: typedefs.h:59
#define WINAPI
Definition: msvc.h:6
#define S_FALSE
Definition: winerror.h:3451
#define E_NOINTERFACE
Definition: winerror.h:3479
#define E_UNEXPECTED
Definition: winerror.h:3528
#define E_POINTER
Definition: winerror.h:3480