Commit 33c8d7b8 authored by Shaun Ren's avatar Shaun Ren Committed by Alexandre Julliard

sapi: Add SpMMAudioOut stub.

parent 7acaf251
......@@ -4,6 +4,7 @@ IMPORTS = uuid ole32 user32 advapi32
C_SRCS = \
automation.c \
main.c \
mmaudio.c \
resource.c \
stream.c \
token.c \
......
......@@ -105,6 +105,7 @@ static const struct IClassFactoryVtbl class_factory_vtbl =
static struct class_factory data_key_cf = { { &class_factory_vtbl }, data_key_create };
static struct class_factory file_stream_cf = { { &class_factory_vtbl }, file_stream_create };
static struct class_factory mmaudio_out_cf = { { &class_factory_vtbl }, mmaudio_out_create };
static struct class_factory resource_mgr_cf = { { &class_factory_vtbl }, resource_manager_create };
static struct class_factory speech_stream_cf = { { &class_factory_vtbl }, speech_stream_create };
static struct class_factory speech_voice_cf = { { &class_factory_vtbl }, speech_voice_create };
......@@ -125,6 +126,8 @@ HRESULT WINAPI DllGetClassObject( REFCLSID clsid, REFIID iid, void **obj )
cf = &data_key_cf.IClassFactory_iface;
else if (IsEqualCLSID( clsid, &CLSID_SpFileStream ))
cf = &file_stream_cf.IClassFactory_iface;
else if (IsEqualCLSID( clsid, &CLSID_SpMMAudioOut ))
cf = &mmaudio_out_cf.IClassFactory_iface;
else if (IsEqualCLSID( clsid, &CLSID_SpObjectTokenCategory ))
cf = &token_category_cf.IClassFactory_iface;
else if (IsEqualCLSID( clsid, &CLSID_SpObjectTokenEnum ))
......
......@@ -103,3 +103,18 @@ coclass SpFileStream
interface ISpStream;
[default] interface ISpeechFileStream;
}
[
uuid(a8c680eb-3d32-11d2-9ee7-00c04f797396),
helpstring("SpMMAudioOut"),
progid("SAPI.SpMMAudioOut.1"),
vi_progid("SAPI.SpMMAudioOut"),
threading(both)
]
coclass SpMMAudioOut
{
interface ISpEventSource;
interface ISpEventSink;
interface ISpObjectWithToken;
interface ISpMMSysAudio;
}
......@@ -25,6 +25,7 @@ HRESULT file_stream_create( IUnknown *outer, REFIID iid, void **obj ) DECLSPEC_H
HRESULT resource_manager_create( IUnknown *outer, REFIID iid, void **obj ) DECLSPEC_HIDDEN;
HRESULT speech_stream_create( IUnknown *outer, REFIID iid, void **obj ) DECLSPEC_HIDDEN;
HRESULT speech_voice_create( IUnknown *outer, REFIID iid, void **obj ) DECLSPEC_HIDDEN;
HRESULT mmaudio_out_create( IUnknown *outer, REFIID iid, void **obj ) DECLSPEC_HIDDEN;
HRESULT token_category_create( IUnknown *outer, REFIID iid, void **obj ) DECLSPEC_HIDDEN;
HRESULT token_enum_create( IUnknown *outer, REFIID iid, void **obj ) DECLSPEC_HIDDEN;
HRESULT token_create( IUnknown *outer, REFIID iid, void **obj ) DECLSPEC_HIDDEN;
......@@ -3,6 +3,7 @@ IMPORTS = ole32 user32 advapi32
C_SRCS = \
automation.c \
mmaudio.c \
resource.c \
stream.c \
token.c \
......
/*
* Speech API (SAPI) winmm audio tests.
*
* Copyright 2023 Shaun Ren for CodeWeavers
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#define COBJMACROS
#include "sapiddk.h"
#include "sperror.h"
#include "wine/test.h"
static void test_interfaces(void)
{
ISpMMSysAudio *mmaudio;
IUnknown *unk;
ISpEventSource *source;
ISpEventSink *sink;
ISpObjectWithToken *obj_with_token;
HRESULT hr;
hr = CoCreateInstance(&CLSID_SpMMAudioOut, NULL, CLSCTX_INPROC_SERVER,
&IID_ISpMMSysAudio, (void **)&mmaudio);
ok(hr == S_OK, "Failed to create ISpMMSysAudio interface: %#lx.\n", hr);
ISpMMSysAudio_Release(mmaudio);
hr = CoCreateInstance(&CLSID_SpMMAudioOut, NULL, CLSCTX_INPROC_SERVER,
&IID_IUnknown, (void **)&unk);
ok(hr == S_OK, "Failed to create IUnknown interface: %#lx.\n", hr);
IUnknown_Release(unk);
hr = CoCreateInstance(&CLSID_SpMMAudioOut, NULL, CLSCTX_INPROC_SERVER,
&IID_ISpEventSource, (void **)&source);
ok(hr == S_OK, "Failed to create ISpEventSource interface: %#lx.\n", hr);
ISpEventSource_Release(source);
hr = CoCreateInstance(&CLSID_SpMMAudioOut, NULL, CLSCTX_INPROC_SERVER,
&IID_ISpEventSink, (void **)&sink);
ok(hr == S_OK, "Failed to create ISpEventSink interface: %#lx.\n", hr);
ISpEventSink_Release(sink);
hr = CoCreateInstance(&CLSID_SpMMAudioOut, NULL, CLSCTX_INPROC_SERVER,
&IID_ISpObjectWithToken, (void **)&obj_with_token);
ok(hr == S_OK, "Failed to create ISpObjectWithToken interface: %#lx.\n", hr);
ISpObjectWithToken_Release(obj_with_token);
}
START_TEST(mmaudio)
{
CoInitialize(NULL);
test_interfaces();
CoUninitialize();
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment