dmusic: Move IDirectMusicThru and IDirectMusicPortDownload to DirectMusicPort object where they belong.

This commit is contained in:
Christian Costa 2008-12-18 21:24:58 +01:00 committed by Alexandre Julliard
parent 02e4c33611
commit cc53bd283c
5 changed files with 113 additions and 214 deletions

View File

@ -15,9 +15,7 @@ C_SRCS = \
downloadedinstrument.c \ downloadedinstrument.c \
instrument.c \ instrument.c \
port.c \ port.c \
portdownload.c \ regsvr.c
regsvr.c \
thru.c
RC_SRCS = version.rc RC_SRCS = version.rc

View File

@ -131,23 +131,14 @@ struct IDirectMusicDownloadImpl {
/* IDirectMusicDownloadImpl fields */ /* IDirectMusicDownloadImpl fields */
}; };
/*****************************************************************************
* IDirectMusicPortDownloadImpl implementation structure
*/
struct IDirectMusicPortDownloadImpl {
/* IUnknown fields */
const IDirectMusicPortDownloadVtbl *lpVtbl;
LONG ref;
/* IDirectMusicPortDownloadImpl fields */
};
/***************************************************************************** /*****************************************************************************
* IDirectMusicPortImpl implementation structure * IDirectMusicPortImpl implementation structure
*/ */
struct IDirectMusicPortImpl { struct IDirectMusicPortImpl {
/* IUnknown fields */ /* IUnknown fields */
const IDirectMusicPortVtbl *lpVtbl; const IDirectMusicPortVtbl *lpVtbl;
const IDirectMusicPortDownloadVtbl *lpDownloadVtbl;
const IDirectMusicThruVtbl *lpThruVtbl;
LONG ref; LONG ref;
/* IDirectMusicPortImpl fields */ /* IDirectMusicPortImpl fields */
@ -165,17 +156,6 @@ extern HRESULT WINAPI IDirectMusicPortImpl_Activate (LPDIRECTMUSICPORT iface, BO
/** Internal factory */ /** Internal factory */
extern HRESULT WINAPI DMUSIC_CreateDirectMusicPortImpl (LPCGUID lpcGUID, LPVOID *ppobj, LPUNKNOWN pUnkOuter, LPDMUS_PORTPARAMS pPortParams, LPDMUS_PORTCAPS pPortCaps); extern HRESULT WINAPI DMUSIC_CreateDirectMusicPortImpl (LPCGUID lpcGUID, LPVOID *ppobj, LPUNKNOWN pUnkOuter, LPDMUS_PORTPARAMS pPortParams, LPDMUS_PORTCAPS pPortCaps);
/*****************************************************************************
* IDirectMusicThruImpl implementation structure
*/
struct IDirectMusicThruImpl {
/* IUnknown fields */
const IDirectMusicThruVtbl *lpVtbl;
LONG ref;
/* IDirectMusicThruImpl fields */
};
/***************************************************************************** /*****************************************************************************
* IReferenceClockImpl implementation structure * IReferenceClockImpl implementation structure
*/ */

View File

@ -26,7 +26,13 @@ static HRESULT WINAPI IDirectMusicPortImpl_QueryInterface (LPDIRECTMUSICPORT ifa
IDirectMusicPortImpl *This = (IDirectMusicPortImpl *)iface; IDirectMusicPortImpl *This = (IDirectMusicPortImpl *)iface;
TRACE("(%p, %s, %p)\n", This, debugstr_dmguid(riid), ppobj); TRACE("(%p, %s, %p)\n", This, debugstr_dmguid(riid), ppobj);
if (IsEqualIID (riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IDirectMusicPort)) { if (IsEqualIID (riid, &IID_IUnknown) ||
IsEqualGUID(riid, &IID_IDirectMusicPort) ||
IsEqualGUID(riid, &IID_IDirectMusicPort8) ||
IsEqualGUID(riid, &IID_IDirectMusicPortDownload) ||
IsEqualGUID(riid, &IID_IDirectMusicPortDownload8) ||
IsEqualGUID(riid, &IID_IDirectMusicThru) ||
IsEqualGUID(riid, &IID_IDirectMusicThru8)) {
IUnknown_AddRef(iface); IUnknown_AddRef(iface);
*ppobj = This; *ppobj = This;
return S_OK; return S_OK;
@ -236,6 +242,107 @@ static const IDirectMusicPortVtbl DirectMusicPort_Vtbl = {
IDirectMusicPortImpl_GetFormat IDirectMusicPortImpl_GetFormat
}; };
/* IDirectMusicPortDownload IUnknown parts follow: */
static HRESULT WINAPI IDirectMusicPortDownloadImpl_QueryInterface (LPDIRECTMUSICPORTDOWNLOAD iface, REFIID riid, LPVOID *ppobj) {
ICOM_THIS_MULTI(IDirectMusicPortImpl, lpDownloadVtbl, iface);
TRACE("(%p/%p)->(%s, %p)\n", This, iface, debugstr_dmguid(riid), ppobj);
return IUnknown_QueryInterface((IUnknown *)&(This->lpVtbl), riid, ppobj);
}
static ULONG WINAPI IDirectMusicPortDownloadImpl_AddRef (LPDIRECTMUSICPORTDOWNLOAD iface) {
ICOM_THIS_MULTI(IDirectMusicPortImpl, lpDownloadVtbl, iface);
TRACE("(%p/%p)->()\n", This, iface);
return IUnknown_AddRef((IUnknown *)&(This->lpVtbl));
}
static ULONG WINAPI IDirectMusicPortDownloadImpl_Release (LPDIRECTMUSICPORTDOWNLOAD iface) {
ICOM_THIS_MULTI(IDirectMusicPortImpl, lpDownloadVtbl, iface);
TRACE("(%p/%p)->()\n", This, iface);
return IUnknown_Release((IUnknown *)&(This->lpVtbl));
}
/* IDirectMusicPortDownload Interface follow: */
static HRESULT WINAPI IDirectMusicPortDownloadImpl_GetBuffer (LPDIRECTMUSICPORTDOWNLOAD iface, DWORD dwDLId, IDirectMusicDownload** ppIDMDownload) {
ICOM_THIS_MULTI(IDirectMusicPortImpl, lpDownloadVtbl, iface);
FIXME("(%p/%p)->(%d, %p): stub\n", This, iface, dwDLId, ppIDMDownload);
return S_OK;
}
static HRESULT WINAPI IDirectMusicPortDownloadImpl_AllocateBuffer (LPDIRECTMUSICPORTDOWNLOAD iface, DWORD dwSize, IDirectMusicDownload** ppIDMDownload) {
ICOM_THIS_MULTI(IDirectMusicPortImpl, lpDownloadVtbl, iface);
FIXME("(%p/%p)->(%d, %p): stub\n", This, iface, dwSize, ppIDMDownload);
return S_OK;
}
static HRESULT WINAPI IDirectMusicPortDownloadImpl_GetDLId (LPDIRECTMUSICPORTDOWNLOAD iface, DWORD* pdwStartDLId, DWORD dwCount) {
ICOM_THIS_MULTI(IDirectMusicPortImpl, lpDownloadVtbl, iface);
FIXME("(%p/%p)->(%p, %d): stub\n", This, iface, pdwStartDLId, dwCount);
return S_OK;
}
static HRESULT WINAPI IDirectMusicPortDownloadImpl_GetAppend (LPDIRECTMUSICPORTDOWNLOAD iface, DWORD* pdwAppend) {
IDirectMusicPortImpl *This = (IDirectMusicPortImpl *)iface;
FIXME("(%p/%p)->(%p): stub\n", This, iface, pdwAppend);
return S_OK;
}
static HRESULT WINAPI IDirectMusicPortDownloadImpl_Download (LPDIRECTMUSICPORTDOWNLOAD iface, IDirectMusicDownload* pIDMDownload) {
IDirectMusicPortImpl *This = (IDirectMusicPortImpl *)iface;
FIXME("(%p/%p)->(%p): stub\n", This, iface, pIDMDownload);
return S_OK;
}
static HRESULT WINAPI IDirectMusicPortDownloadImpl_Unload (LPDIRECTMUSICPORTDOWNLOAD iface, IDirectMusicDownload* pIDMDownload) {
IDirectMusicPortImpl *This = (IDirectMusicPortImpl *)iface;
FIXME("(%p/%p)->(%p): stub\n", This, iface, pIDMDownload);
return S_OK;
}
static const IDirectMusicPortDownloadVtbl DirectMusicPortDownload_Vtbl = {
IDirectMusicPortDownloadImpl_QueryInterface,
IDirectMusicPortDownloadImpl_AddRef,
IDirectMusicPortDownloadImpl_Release,
IDirectMusicPortDownloadImpl_GetBuffer,
IDirectMusicPortDownloadImpl_AllocateBuffer,
IDirectMusicPortDownloadImpl_GetDLId,
IDirectMusicPortDownloadImpl_GetAppend,
IDirectMusicPortDownloadImpl_Download,
IDirectMusicPortDownloadImpl_Unload
};
/* IDirectMusicThru IUnknown parts follow: */
static HRESULT WINAPI IDirectMusicThruImpl_QueryInterface (LPDIRECTMUSICTHRU iface, REFIID riid, LPVOID *ppobj) {
ICOM_THIS_MULTI(IDirectMusicPortImpl, lpThruVtbl, iface);
TRACE("(%p/%p)->(%s, %p)\n", This, iface, debugstr_dmguid(riid), ppobj);
return IUnknown_QueryInterface((IUnknown *)&(This->lpVtbl), riid, ppobj);
}
static ULONG WINAPI IDirectMusicThruImpl_AddRef (LPDIRECTMUSICTHRU iface) {
ICOM_THIS_MULTI(IDirectMusicPortImpl, lpThruVtbl, iface);
TRACE("(%p/%p)->()\n", This, iface);
return IUnknown_AddRef((IUnknown *)&(This->lpVtbl));
}
static ULONG WINAPI IDirectMusicThruImpl_Release (LPDIRECTMUSICTHRU iface) {
ICOM_THIS_MULTI(IDirectMusicPortImpl, lpThruVtbl, iface);
TRACE("(%p/%p)->()\n", This, iface);
return IUnknown_Release((IUnknown *)&(This->lpVtbl));
}
/* IDirectMusicThru Interface follow: */
static HRESULT WINAPI IDirectMusicThruImpl_ThruChannel (LPDIRECTMUSICTHRU iface, DWORD dwSourceChannelGroup, DWORD dwSourceChannel, DWORD dwDestinationChannelGroup, DWORD dwDestinationChannel, LPDIRECTMUSICPORT pDestinationPort) {
ICOM_THIS_MULTI(IDirectMusicPortImpl, lpThruVtbl, iface);
FIXME("(%p/%p)->(%d, %d, %d, %d, %p): stub\n", This, iface, dwSourceChannelGroup, dwSourceChannel, dwDestinationChannelGroup, dwDestinationChannel, pDestinationPort);
return S_OK;
}
static const IDirectMusicThruVtbl DirectMusicThru_Vtbl = {
IDirectMusicThruImpl_QueryInterface,
IDirectMusicThruImpl_AddRef,
IDirectMusicThruImpl_Release,
IDirectMusicThruImpl_ThruChannel
};
HRESULT WINAPI DMUSIC_CreateDirectMusicPortImpl (LPCGUID lpcGUID, LPVOID *ppobj, LPUNKNOWN pUnkOuter, LPDMUS_PORTPARAMS pPortParams, LPDMUS_PORTCAPS pPortCaps) { HRESULT WINAPI DMUSIC_CreateDirectMusicPortImpl (LPCGUID lpcGUID, LPVOID *ppobj, LPUNKNOWN pUnkOuter, LPDMUS_PORTPARAMS pPortParams, LPDMUS_PORTCAPS pPortCaps) {
IDirectMusicPortImpl *obj; IDirectMusicPortImpl *obj;
HRESULT hr = E_FAIL; HRESULT hr = E_FAIL;
@ -248,6 +355,8 @@ HRESULT WINAPI DMUSIC_CreateDirectMusicPortImpl (LPCGUID lpcGUID, LPVOID *ppobj,
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
} }
obj->lpVtbl = &DirectMusicPort_Vtbl; obj->lpVtbl = &DirectMusicPort_Vtbl;
obj->lpDownloadVtbl = &DirectMusicPortDownload_Vtbl;
obj->lpThruVtbl = &DirectMusicThru_Vtbl;
obj->ref = 0; /* will be inited by QueryInterface */ obj->ref = 0; /* will be inited by QueryInterface */
obj->fActive = FALSE; obj->fActive = FALSE;
obj->params = *pPortParams; obj->params = *pPortParams;

View File

@ -1,111 +0,0 @@
/* IDirectMusicPortDownloadImpl Implementation
*
* Copyright (C) 2003-2004 Rok Mandeljc
*
* This program 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 program 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 program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "dmusic_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmusic);
/* IDirectMusicPortDownload IUnknown parts follow: */
static HRESULT WINAPI IDirectMusicPortDownloadImpl_QueryInterface (LPDIRECTMUSICPORTDOWNLOAD iface, REFIID riid, LPVOID *ppobj) {
IDirectMusicPortDownloadImpl *This = (IDirectMusicPortDownloadImpl *)iface;
TRACE("(%p, %s, %p)\n", This, debugstr_dmguid(riid), ppobj);
if (IsEqualIID (riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IDirectMusicPortDownload)) {
IUnknown_AddRef(iface);
*ppobj = This;
return S_OK;
}
WARN("(%p, %s, %p): not found\n", This, debugstr_dmguid(riid), ppobj);
return E_NOINTERFACE;
}
static ULONG WINAPI IDirectMusicPortDownloadImpl_AddRef (LPDIRECTMUSICPORTDOWNLOAD iface) {
IDirectMusicPortDownloadImpl *This = (IDirectMusicPortDownloadImpl *)iface;
ULONG refCount = InterlockedIncrement(&This->ref);
TRACE("(%p)->(ref before=%u)\n", This, refCount - 1);
DMUSIC_LockModule();
return refCount;
}
static ULONG WINAPI IDirectMusicPortDownloadImpl_Release (LPDIRECTMUSICPORTDOWNLOAD iface) {
IDirectMusicPortDownloadImpl *This = (IDirectMusicPortDownloadImpl *)iface;
ULONG refCount = InterlockedDecrement(&This->ref);
TRACE("(%p)->(ref before=%u)\n", This, refCount + 1);
if (!refCount) {
HeapFree(GetProcessHeap(), 0, This);
}
DMUSIC_UnlockModule();
return refCount;
}
/* IDirectMusicPortDownload Interface follow: */
static HRESULT WINAPI IDirectMusicPortDownloadImpl_GetBuffer (LPDIRECTMUSICPORTDOWNLOAD iface, DWORD dwDLId, IDirectMusicDownload** ppIDMDownload) {
IDirectMusicPortDownloadImpl *This = (IDirectMusicPortDownloadImpl *)iface;
FIXME("(%p, %d, %p): stub\n", This, dwDLId, ppIDMDownload);
return S_OK;
}
static HRESULT WINAPI IDirectMusicPortDownloadImpl_AllocateBuffer (LPDIRECTMUSICPORTDOWNLOAD iface, DWORD dwSize, IDirectMusicDownload** ppIDMDownload) {
IDirectMusicPortDownloadImpl *This = (IDirectMusicPortDownloadImpl *)iface;
FIXME("(%p, %d, %p): stub\n", This, dwSize, ppIDMDownload);
return S_OK;
}
static HRESULT WINAPI IDirectMusicPortDownloadImpl_GetDLId (LPDIRECTMUSICPORTDOWNLOAD iface, DWORD* pdwStartDLId, DWORD dwCount) {
IDirectMusicPortDownloadImpl *This = (IDirectMusicPortDownloadImpl *)iface;
FIXME("(%p, %p, %d): stub\n", This, pdwStartDLId, dwCount);
return S_OK;
}
static HRESULT WINAPI IDirectMusicPortDownloadImpl_GetAppend (LPDIRECTMUSICPORTDOWNLOAD iface, DWORD* pdwAppend) {
IDirectMusicPortDownloadImpl *This = (IDirectMusicPortDownloadImpl *)iface;
FIXME("(%p, %p): stub\n", This, pdwAppend);
return S_OK;
}
static HRESULT WINAPI IDirectMusicPortDownloadImpl_Download (LPDIRECTMUSICPORTDOWNLOAD iface, IDirectMusicDownload* pIDMDownload) {
IDirectMusicPortDownloadImpl *This = (IDirectMusicPortDownloadImpl *)iface;
FIXME("(%p, %p): stub\n", This, pIDMDownload);
return S_OK;
}
static HRESULT WINAPI IDirectMusicPortDownloadImpl_Unload (LPDIRECTMUSICPORTDOWNLOAD iface, IDirectMusicDownload* pIDMDownload) {
IDirectMusicPortDownloadImpl *This = (IDirectMusicPortDownloadImpl *)iface;
FIXME("(%p, %p): stub\n", This, pIDMDownload);
return S_OK;
}
static const IDirectMusicPortDownloadVtbl DirectMusicPortDownload_Vtbl = {
IDirectMusicPortDownloadImpl_QueryInterface,
IDirectMusicPortDownloadImpl_AddRef,
IDirectMusicPortDownloadImpl_Release,
IDirectMusicPortDownloadImpl_GetBuffer,
IDirectMusicPortDownloadImpl_AllocateBuffer,
IDirectMusicPortDownloadImpl_GetDLId,
IDirectMusicPortDownloadImpl_GetAppend,
IDirectMusicPortDownloadImpl_Download,
IDirectMusicPortDownloadImpl_Unload
};

View File

@ -1,77 +0,0 @@
/* IDirectMusicThru Implementation
*
* Copyright (C) 2003-2004 Rok Mandeljc
*
* This program 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 program 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 program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "dmusic_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmusic);
/* IDirectMusicThru IUnknown parts follow: */
static HRESULT WINAPI IDirectMusicThruImpl_QueryInterface (LPDIRECTMUSICTHRU iface, REFIID riid, LPVOID *ppobj) {
IDirectMusicThruImpl *This = (IDirectMusicThruImpl *)iface;
TRACE("(%p, %s, %p)\n", This, debugstr_dmguid(riid), ppobj);
if (IsEqualIID (riid, &IID_IUnknown) ||
IsEqualIID (riid, &IID_IDirectMusicThru)) {
IUnknown_AddRef(iface);
*ppobj = This;
return S_OK;
}
WARN("(%p, %s, %p): not found\n", This, debugstr_dmguid(riid), ppobj);
return E_NOINTERFACE;
}
static ULONG WINAPI IDirectMusicThruImpl_AddRef (LPDIRECTMUSICTHRU iface) {
IDirectMusicThruImpl *This = (IDirectMusicThruImpl *)iface;
ULONG refCount = InterlockedIncrement(&This->ref);
TRACE("(%p)->(ref before=%u)\n", This, refCount - 1);
DMUSIC_LockModule();
return refCount;
}
static ULONG WINAPI IDirectMusicThruImpl_Release (LPDIRECTMUSICTHRU iface) {
IDirectMusicThruImpl *This = (IDirectMusicThruImpl *)iface;
ULONG refCount = InterlockedDecrement(&This->ref);
TRACE("(%p)->(ref before=%u)\n", This, refCount + 1);
if (!refCount) {
HeapFree(GetProcessHeap(), 0, This);
}
DMUSIC_UnlockModule();
return refCount;
}
/* IDirectMusicThru Interface follow: */
static HRESULT WINAPI IDirectMusicThruImpl_ThruChannel (LPDIRECTMUSICTHRU iface, DWORD dwSourceChannelGroup, DWORD dwSourceChannel, DWORD dwDestinationChannelGroup, DWORD dwDestinationChannel, LPDIRECTMUSICPORT pDestinationPort) {
IDirectMusicThruImpl *This = (IDirectMusicThruImpl *)iface;
FIXME("(%p, %d, %d, %d, %d, %p): stub\n", This, dwSourceChannelGroup, dwSourceChannel, dwDestinationChannelGroup, dwDestinationChannel, pDestinationPort);
return S_OK;
}
static const IDirectMusicThruVtbl DirectMusicThru_Vtbl = {
IDirectMusicThruImpl_QueryInterface,
IDirectMusicThruImpl_AddRef,
IDirectMusicThruImpl_Release,
IDirectMusicThruImpl_ThruChannel
};