2003-04-08 21:42:00 +00:00
|
|
|
/* IDirectMusicPerformance Implementation
|
|
|
|
*
|
|
|
|
* Copyright (C) 2003 Rok Mandeljc
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 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 Library General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
2003-09-05 23:08:26 +00:00
|
|
|
#include <stdarg.h>
|
|
|
|
|
2003-04-08 21:42:00 +00:00
|
|
|
#include "windef.h"
|
|
|
|
#include "winbase.h"
|
|
|
|
#include "winuser.h"
|
|
|
|
#include "wingdi.h"
|
|
|
|
#include "wine/debug.h"
|
|
|
|
|
2003-07-21 22:10:14 +00:00
|
|
|
#include "dmime_private.h"
|
2003-04-08 21:42:00 +00:00
|
|
|
|
2003-08-22 23:53:27 +00:00
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(dmime);
|
2003-04-08 21:42:00 +00:00
|
|
|
|
2003-08-22 23:53:27 +00:00
|
|
|
/* IDirectMusicPerformance8 IUnknown part: */
|
2003-04-08 21:42:00 +00:00
|
|
|
HRESULT WINAPI IDirectMusicPerformance8Impl_QueryInterface (LPDIRECTMUSICPERFORMANCE8 iface, REFIID riid, LPVOID *ppobj)
|
|
|
|
{
|
|
|
|
ICOM_THIS(IDirectMusicPerformance8Impl,iface);
|
|
|
|
|
2003-08-22 23:53:27 +00:00
|
|
|
if (IsEqualIID (riid, &IID_IUnknown) ||
|
|
|
|
IsEqualIID (riid, &IID_IDirectMusicPerformance) ||
|
|
|
|
IsEqualIID (riid, &IID_IDirectMusicPerformance8)) {
|
2003-04-08 21:42:00 +00:00
|
|
|
IDirectMusicPerformance8Impl_AddRef(iface);
|
|
|
|
*ppobj = This;
|
2003-06-07 00:39:18 +00:00
|
|
|
return S_OK;
|
2003-04-08 21:42:00 +00:00
|
|
|
}
|
2003-08-22 23:53:27 +00:00
|
|
|
|
2003-06-27 19:43:13 +00:00
|
|
|
WARN("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppobj);
|
2003-04-08 21:42:00 +00:00
|
|
|
return E_NOINTERFACE;
|
|
|
|
}
|
|
|
|
|
|
|
|
ULONG WINAPI IDirectMusicPerformance8Impl_AddRef (LPDIRECTMUSICPERFORMANCE8 iface)
|
|
|
|
{
|
|
|
|
ICOM_THIS(IDirectMusicPerformance8Impl,iface);
|
|
|
|
TRACE("(%p) : AddRef from %ld\n", This, This->ref);
|
|
|
|
return ++(This->ref);
|
|
|
|
}
|
|
|
|
|
|
|
|
ULONG WINAPI IDirectMusicPerformance8Impl_Release (LPDIRECTMUSICPERFORMANCE8 iface)
|
|
|
|
{
|
|
|
|
ICOM_THIS(IDirectMusicPerformance8Impl,iface);
|
|
|
|
ULONG ref = --This->ref;
|
|
|
|
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
|
2003-08-22 23:53:27 +00:00
|
|
|
if (ref == 0) {
|
2003-04-08 21:42:00 +00:00
|
|
|
HeapFree(GetProcessHeap(), 0, This);
|
|
|
|
}
|
|
|
|
return ref;
|
|
|
|
}
|
|
|
|
|
2003-08-22 23:53:27 +00:00
|
|
|
/* IDirectMusicPerformance8 IDirectMusicPerformance Interface part: */
|
2003-04-08 21:42:00 +00:00
|
|
|
HRESULT WINAPI IDirectMusicPerformance8Impl_Init (LPDIRECTMUSICPERFORMANCE8 iface, IDirectMusic** ppDirectMusic, LPDIRECTSOUND pDirectSound, HWND hWnd)
|
|
|
|
{
|
2003-06-07 00:39:18 +00:00
|
|
|
ICOM_THIS(IDirectMusicPerformance8Impl,iface);
|
2003-06-13 18:59:51 +00:00
|
|
|
|
2003-06-30 18:28:52 +00:00
|
|
|
FIXME("(iface = %p, dmusic = %p, dsound = %p, hwnd = %p)\n", This, ppDirectMusic, pDirectSound, hWnd);
|
2003-08-22 23:53:27 +00:00
|
|
|
if (This->pDirectMusic || This->pDirectSound)
|
2003-06-16 20:26:50 +00:00
|
|
|
return DMUS_E_ALREADY_INITED;
|
|
|
|
|
2003-07-02 04:30:27 +00:00
|
|
|
if (NULL != pDirectSound) {
|
2003-07-21 22:10:14 +00:00
|
|
|
This->pDirectSound = (IDirectSound*) pDirectSound;
|
|
|
|
IDirectSound_AddRef((LPDIRECTSOUND) This->pDirectSound);
|
2003-07-02 04:30:27 +00:00
|
|
|
} else {
|
2003-07-21 22:10:14 +00:00
|
|
|
DirectSoundCreate8(&IID_IDirectSound8, (LPDIRECTSOUND8*) &This->pDirectSound, NULL);
|
|
|
|
if (!This->pDirectSound)
|
2003-07-02 04:30:27 +00:00
|
|
|
return DSERR_NODRIVER;
|
|
|
|
}
|
|
|
|
|
2003-06-16 20:26:50 +00:00
|
|
|
if (NULL != ppDirectMusic && NULL != *ppDirectMusic) {
|
2003-06-13 18:59:51 +00:00
|
|
|
/* app creates it's own dmusic object and gives it to performance */
|
2003-07-21 22:10:14 +00:00
|
|
|
This->pDirectMusic = (IDirectMusic8*) *ppDirectMusic;
|
|
|
|
IDirectMusic8_AddRef((LPDIRECTMUSIC8) This->pDirectMusic);
|
2003-06-16 20:26:50 +00:00
|
|
|
} else {
|
|
|
|
/* app allows the performance to initialise itfself and needs a pointer to object*/
|
2003-07-21 22:10:14 +00:00
|
|
|
CoCreateInstance (&CLSID_DirectMusic, NULL, CLSCTX_INPROC_SERVER, &IID_IDirectMusic8, (void**)&This->pDirectMusic);
|
2003-06-16 20:26:50 +00:00
|
|
|
if (ppDirectMusic) {
|
2003-07-21 22:10:14 +00:00
|
|
|
*ppDirectMusic = (LPDIRECTMUSIC) This->pDirectMusic;
|
|
|
|
IDirectMusic8_AddRef((LPDIRECTMUSIC8) *ppDirectMusic);
|
2003-06-13 18:59:51 +00:00
|
|
|
}
|
2003-06-07 00:39:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return S_OK;
|
2003-04-08 21:42:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
HRESULT WINAPI IDirectMusicPerformance8Impl_PlaySegment (LPDIRECTMUSICPERFORMANCE8 iface, IDirectMusicSegment* pSegment, DWORD dwFlags, __int64 i64StartTime, IDirectMusicSegmentState** ppSegmentState)
|
|
|
|
{
|
2003-06-07 00:39:18 +00:00
|
|
|
ICOM_THIS(IDirectMusicPerformance8Impl,iface);
|
|
|
|
|
2003-07-21 22:10:14 +00:00
|
|
|
FIXME("(%p, %p, %ld, %lli, %p): stub\n", This, pSegment, dwFlags, i64StartTime, ppSegmentState);
|
2003-06-07 00:39:18 +00:00
|
|
|
|
|
|
|
return S_OK;
|
2003-04-08 21:42:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
HRESULT WINAPI IDirectMusicPerformance8Impl_Stop (LPDIRECTMUSICPERFORMANCE8 iface, IDirectMusicSegment* pSegment, IDirectMusicSegmentState* pSegmentState, MUSIC_TIME mtTime, DWORD dwFlags)
|
|
|
|
{
|
2003-06-07 00:39:18 +00:00
|
|
|
ICOM_THIS(IDirectMusicPerformance8Impl,iface);
|
|
|
|
|
|
|
|
FIXME("(%p, %p, %p, %ld, %ld): stub\n", This, pSegment, pSegmentState, mtTime, dwFlags);
|
|
|
|
|
|
|
|
return S_OK;
|
2003-04-08 21:42:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
HRESULT WINAPI IDirectMusicPerformance8Impl_GetSegmentState (LPDIRECTMUSICPERFORMANCE8 iface, IDirectMusicSegmentState** ppSegmentState, MUSIC_TIME mtTime)
|
|
|
|
{
|
2003-06-07 00:39:18 +00:00
|
|
|
ICOM_THIS(IDirectMusicPerformance8Impl,iface);
|
|
|
|
|
|
|
|
FIXME("(%p,%p, %ld): stub\n", This, ppSegmentState, mtTime);
|
|
|
|
|
|
|
|
return S_OK;
|
2003-04-08 21:42:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
HRESULT WINAPI IDirectMusicPerformance8Impl_SetPrepareTime (LPDIRECTMUSICPERFORMANCE8 iface, DWORD dwMilliSeconds)
|
|
|
|
{
|
2003-06-07 00:39:18 +00:00
|
|
|
ICOM_THIS(IDirectMusicPerformance8Impl,iface);
|
|
|
|
|
|
|
|
FIXME("(%p, %ld): stub\n", This, dwMilliSeconds);
|
|
|
|
|
|
|
|
return S_OK;
|
2003-04-08 21:42:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
HRESULT WINAPI IDirectMusicPerformance8Impl_GetPrepareTime (LPDIRECTMUSICPERFORMANCE8 iface, DWORD* pdwMilliSeconds)
|
|
|
|
{
|
2003-06-07 00:39:18 +00:00
|
|
|
ICOM_THIS(IDirectMusicPerformance8Impl,iface);
|
|
|
|
|
|
|
|
FIXME("(%p, %p): stub\n", This, pdwMilliSeconds);
|
|
|
|
|
|
|
|
return S_OK;
|
2003-04-08 21:42:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
HRESULT WINAPI IDirectMusicPerformance8Impl_SetBumperLength (LPDIRECTMUSICPERFORMANCE8 iface, DWORD dwMilliSeconds)
|
|
|
|
{
|
2003-06-07 00:39:18 +00:00
|
|
|
ICOM_THIS(IDirectMusicPerformance8Impl,iface);
|
|
|
|
|
|
|
|
FIXME("(%p, %ld): stub\n", This, dwMilliSeconds);
|
|
|
|
|
|
|
|
return S_OK;
|
2003-04-08 21:42:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
HRESULT WINAPI IDirectMusicPerformance8Impl_GetBumperLength (LPDIRECTMUSICPERFORMANCE8 iface, DWORD* pdwMilliSeconds)
|
|
|
|
{
|
2003-06-07 00:39:18 +00:00
|
|
|
ICOM_THIS(IDirectMusicPerformance8Impl,iface);
|
|
|
|
|
|
|
|
FIXME("(%p, %p): stub\n", This, pdwMilliSeconds);
|
|
|
|
|
|
|
|
return S_OK;
|
2003-04-08 21:42:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
HRESULT WINAPI IDirectMusicPerformance8Impl_SendPMsg (LPDIRECTMUSICPERFORMANCE8 iface, DMUS_PMSG* pPMSG)
|
|
|
|
{
|
2003-06-07 00:39:18 +00:00
|
|
|
ICOM_THIS(IDirectMusicPerformance8Impl,iface);
|
|
|
|
|
|
|
|
FIXME("(%p, %p): stub\n", This, pPMSG);
|
|
|
|
|
|
|
|
return S_OK;
|
2003-04-08 21:42:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
HRESULT WINAPI IDirectMusicPerformance8Impl_MusicToReferenceTime (LPDIRECTMUSICPERFORMANCE8 iface, MUSIC_TIME mtTime, REFERENCE_TIME* prtTime)
|
|
|
|
{
|
2003-06-07 00:39:18 +00:00
|
|
|
ICOM_THIS(IDirectMusicPerformance8Impl,iface);
|
|
|
|
|
2003-07-21 22:10:14 +00:00
|
|
|
FIXME("(%p, %ld, %p): stub\n", This, mtTime, prtTime);
|
2003-06-07 00:39:18 +00:00
|
|
|
|
|
|
|
return S_OK;
|
2003-04-08 21:42:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
HRESULT WINAPI IDirectMusicPerformance8Impl_ReferenceToMusicTime (LPDIRECTMUSICPERFORMANCE8 iface, REFERENCE_TIME rtTime, MUSIC_TIME* pmtTime)
|
|
|
|
{
|
2003-06-07 00:39:18 +00:00
|
|
|
ICOM_THIS(IDirectMusicPerformance8Impl,iface);
|
|
|
|
|
2003-07-21 22:10:14 +00:00
|
|
|
FIXME("(%p, %lli, %p): stub\n", This, rtTime, pmtTime);
|
2003-06-07 00:39:18 +00:00
|
|
|
|
|
|
|
return S_OK;
|
2003-04-08 21:42:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
HRESULT WINAPI IDirectMusicPerformance8Impl_IsPlaying (LPDIRECTMUSICPERFORMANCE8 iface, IDirectMusicSegment* pSegment, IDirectMusicSegmentState* pSegState)
|
|
|
|
{
|
2003-06-07 00:39:18 +00:00
|
|
|
ICOM_THIS(IDirectMusicPerformance8Impl,iface);
|
|
|
|
|
|
|
|
FIXME("(%p, %p, %p): stub\n", This, pSegment, pSegState);
|
|
|
|
|
|
|
|
return S_OK;
|
2003-04-08 21:42:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
HRESULT WINAPI IDirectMusicPerformance8Impl_GetTime (LPDIRECTMUSICPERFORMANCE8 iface, REFERENCE_TIME* prtNow, MUSIC_TIME* pmtNow)
|
|
|
|
{
|
2003-06-07 00:39:18 +00:00
|
|
|
ICOM_THIS(IDirectMusicPerformance8Impl,iface);
|
|
|
|
|
2003-07-21 22:10:14 +00:00
|
|
|
FIXME("(%p, %p, %p): stub\n", This, prtNow, pmtNow);
|
2003-06-07 00:39:18 +00:00
|
|
|
|
|
|
|
return S_OK;
|
2003-04-08 21:42:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
HRESULT WINAPI IDirectMusicPerformance8Impl_AllocPMsg (LPDIRECTMUSICPERFORMANCE8 iface, ULONG cb, DMUS_PMSG** ppPMSG)
|
|
|
|
{
|
2003-06-07 00:39:18 +00:00
|
|
|
ICOM_THIS(IDirectMusicPerformance8Impl,iface);
|
|
|
|
|
|
|
|
FIXME("(%p, %ld, %p): stub\n", This, cb, ppPMSG);
|
|
|
|
|
|
|
|
return S_OK;
|
2003-04-08 21:42:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
HRESULT WINAPI IDirectMusicPerformance8Impl_FreePMsg (LPDIRECTMUSICPERFORMANCE8 iface, DMUS_PMSG* pPMSG)
|
|
|
|
{
|
2003-06-07 00:39:18 +00:00
|
|
|
ICOM_THIS(IDirectMusicPerformance8Impl,iface);
|
|
|
|
|
|
|
|
FIXME("(%p, %p): stub\n", This, pPMSG);
|
|
|
|
|
|
|
|
return S_OK;
|
2003-04-08 21:42:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
HRESULT WINAPI IDirectMusicPerformance8Impl_GetGraph (LPDIRECTMUSICPERFORMANCE8 iface, IDirectMusicGraph** ppGraph)
|
|
|
|
{
|
2003-06-27 19:43:13 +00:00
|
|
|
ICOM_THIS(IDirectMusicPerformance8Impl,iface);
|
2003-06-07 00:39:18 +00:00
|
|
|
|
2003-06-13 18:59:51 +00:00
|
|
|
FIXME("(%p, %p): to check\n", This, ppGraph);
|
2003-06-07 00:39:18 +00:00
|
|
|
|
2003-07-21 22:10:14 +00:00
|
|
|
if (NULL != This->pToolGraph) {
|
|
|
|
*ppGraph = (LPDIRECTMUSICGRAPH) This->pToolGraph;
|
2003-06-13 18:59:51 +00:00
|
|
|
IDirectMusicGraphImpl_AddRef((LPDIRECTMUSICGRAPH) *ppGraph);
|
|
|
|
}
|
2003-07-21 22:10:14 +00:00
|
|
|
return S_OK;
|
2003-04-08 21:42:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
HRESULT WINAPI IDirectMusicPerformance8Impl_SetGraph (LPDIRECTMUSICPERFORMANCE8 iface, IDirectMusicGraph* pGraph)
|
|
|
|
{
|
2003-06-27 19:43:13 +00:00
|
|
|
ICOM_THIS(IDirectMusicPerformance8Impl,iface);
|
2003-06-07 00:39:18 +00:00
|
|
|
|
2003-06-13 18:59:51 +00:00
|
|
|
FIXME("(%p, %p): to check\n", This, pGraph);
|
2003-06-07 00:39:18 +00:00
|
|
|
|
2003-07-21 22:10:14 +00:00
|
|
|
if (NULL != This->pToolGraph) {
|
2003-06-13 18:59:51 +00:00
|
|
|
/* Todo clean buffers and tools before */
|
2003-07-21 22:10:14 +00:00
|
|
|
IDirectMusicGraphImpl_Release((LPDIRECTMUSICGRAPH) This->pToolGraph);
|
2003-06-13 18:59:51 +00:00
|
|
|
}
|
2003-07-21 22:10:14 +00:00
|
|
|
This->pToolGraph = pGraph;
|
|
|
|
if (NULL != This->pToolGraph) {
|
|
|
|
IDirectMusicGraphImpl_AddRef((LPDIRECTMUSICGRAPH) This->pToolGraph);
|
2003-06-13 18:59:51 +00:00
|
|
|
}
|
2003-07-21 22:10:14 +00:00
|
|
|
return S_OK;
|
2003-04-08 21:42:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
HRESULT WINAPI IDirectMusicPerformance8Impl_SetNotificationHandle (LPDIRECTMUSICPERFORMANCE8 iface, HANDLE hNotification, REFERENCE_TIME rtMinimum)
|
|
|
|
{
|
2003-06-07 00:39:18 +00:00
|
|
|
ICOM_THIS(IDirectMusicPerformance8Impl,iface);
|
|
|
|
|
2003-07-21 22:10:14 +00:00
|
|
|
FIXME("(%p, %p, %lli): stub\n", This, hNotification, rtMinimum);
|
2003-06-07 00:39:18 +00:00
|
|
|
|
|
|
|
return S_OK;
|
2003-04-08 21:42:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
HRESULT WINAPI IDirectMusicPerformance8Impl_GetNotificationPMsg (LPDIRECTMUSICPERFORMANCE8 iface, DMUS_NOTIFICATION_PMSG** ppNotificationPMsg)
|
|
|
|
{
|
2003-06-07 00:39:18 +00:00
|
|
|
ICOM_THIS(IDirectMusicPerformance8Impl,iface);
|
|
|
|
|
|
|
|
FIXME("(%p, %p): stub\n", This, ppNotificationPMsg);
|
|
|
|
|
|
|
|
return S_OK;
|
2003-04-08 21:42:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
HRESULT WINAPI IDirectMusicPerformance8Impl_AddNotificationType (LPDIRECTMUSICPERFORMANCE8 iface, REFGUID rguidNotificationType)
|
|
|
|
{
|
2003-06-07 00:39:18 +00:00
|
|
|
ICOM_THIS(IDirectMusicPerformance8Impl,iface);
|
|
|
|
|
|
|
|
FIXME("(%p, %s): stub\n", This, debugstr_guid(rguidNotificationType));
|
|
|
|
|
|
|
|
return S_OK;
|
2003-04-08 21:42:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
HRESULT WINAPI IDirectMusicPerformance8Impl_RemoveNotificationType (LPDIRECTMUSICPERFORMANCE8 iface, REFGUID rguidNotificationType)
|
|
|
|
{
|
2003-06-07 00:39:18 +00:00
|
|
|
ICOM_THIS(IDirectMusicPerformance8Impl,iface);
|
|
|
|
|
|
|
|
FIXME("(%p, %s): stub\n", This, debugstr_guid(rguidNotificationType));
|
|
|
|
|
|
|
|
return S_OK;
|
2003-04-08 21:42:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
HRESULT WINAPI IDirectMusicPerformance8Impl_AddPort (LPDIRECTMUSICPERFORMANCE8 iface, IDirectMusicPort* pPort)
|
|
|
|
{
|
2003-06-07 00:39:18 +00:00
|
|
|
ICOM_THIS(IDirectMusicPerformance8Impl,iface);
|
|
|
|
|
|
|
|
FIXME("(%p, %p): stub\n", This, pPort);
|
2003-07-21 22:10:14 +00:00
|
|
|
IDirectMusicPort_AddRef (pPort);
|
|
|
|
|
2003-06-07 00:39:18 +00:00
|
|
|
return S_OK;
|
2003-04-08 21:42:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
HRESULT WINAPI IDirectMusicPerformance8Impl_RemovePort (LPDIRECTMUSICPERFORMANCE8 iface, IDirectMusicPort* pPort)
|
|
|
|
{
|
2003-06-07 00:39:18 +00:00
|
|
|
ICOM_THIS(IDirectMusicPerformance8Impl,iface);
|
|
|
|
|
|
|
|
FIXME("(%p, %p): stub\n", This, pPort);
|
2003-07-21 22:10:14 +00:00
|
|
|
IDirectMusicPort_Release (pPort);
|
2003-06-07 00:39:18 +00:00
|
|
|
|
|
|
|
return S_OK;
|
2003-04-08 21:42:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
HRESULT WINAPI IDirectMusicPerformance8Impl_AssignPChannelBlock (LPDIRECTMUSICPERFORMANCE8 iface, DWORD dwBlockNum, IDirectMusicPort* pPort, DWORD dwGroup)
|
|
|
|
{
|
2003-06-30 18:28:52 +00:00
|
|
|
int i, j, range /* min value in range */;
|
2003-06-07 00:39:18 +00:00
|
|
|
ICOM_THIS(IDirectMusicPerformance8Impl,iface);
|
|
|
|
|
2003-06-13 18:59:51 +00:00
|
|
|
FIXME("(%p, %ld, %p, %ld): semi-stub\n", This, dwBlockNum, pPort, dwGroup-1);
|
2003-08-22 23:53:27 +00:00
|
|
|
range = 16 * dwBlockNum;
|
|
|
|
j = 0;
|
2003-06-13 18:59:51 +00:00
|
|
|
|
2003-08-22 23:53:27 +00:00
|
|
|
for (i = range; i < range+16; i++) {
|
|
|
|
/*TRACE("Setting PChannel[%i] to port %p, group %ld, MIDI port %i\n", i, pPort, dwGroup-1, j); */
|
|
|
|
This->PChannel[i].port = pPort;
|
|
|
|
This->PChannel[i].group = dwGroup - 1; /* first index is always zero */
|
|
|
|
This->PChannel[i].channel = j; /* FIXME: should this be assigned? */
|
|
|
|
j++;
|
|
|
|
}
|
|
|
|
|
|
|
|
return S_OK;
|
2003-04-08 21:42:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
HRESULT WINAPI IDirectMusicPerformance8Impl_AssignPChannel (LPDIRECTMUSICPERFORMANCE8 iface, DWORD dwPChannel, IDirectMusicPort* pPort, DWORD dwGroup, DWORD dwMChannel)
|
|
|
|
{
|
2003-06-07 00:39:18 +00:00
|
|
|
ICOM_THIS(IDirectMusicPerformance8Impl,iface);
|
|
|
|
|
2003-06-13 18:59:51 +00:00
|
|
|
TRACE("(%p, %ld, %p, %ld, %ld)\n", This, dwPChannel, pPort, dwGroup, dwMChannel);
|
|
|
|
This->PChannel[dwPChannel].port = pPort;
|
|
|
|
This->PChannel[dwPChannel].group = dwGroup;
|
|
|
|
This->PChannel[dwPChannel].channel = dwMChannel;
|
2003-06-07 00:39:18 +00:00
|
|
|
|
|
|
|
return S_OK;
|
2003-04-08 21:42:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
HRESULT WINAPI IDirectMusicPerformance8Impl_PChannelInfo (LPDIRECTMUSICPERFORMANCE8 iface, DWORD dwPChannel, IDirectMusicPort** ppPort, DWORD* pdwGroup, DWORD* pdwMChannel)
|
|
|
|
{
|
2003-06-07 00:39:18 +00:00
|
|
|
ICOM_THIS(IDirectMusicPerformance8Impl,iface);
|
|
|
|
|
|
|
|
FIXME("(%p, %ld, %p, %p, %p): stub\n", This, dwPChannel, ppPort, pdwGroup, pdwMChannel);
|
|
|
|
|
|
|
|
return S_OK;
|
2003-04-08 21:42:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
HRESULT WINAPI IDirectMusicPerformance8Impl_DownloadInstrument (LPDIRECTMUSICPERFORMANCE8 iface, IDirectMusicInstrument* pInst, DWORD dwPChannel, IDirectMusicDownloadedInstrument** ppDownInst, DMUS_NOTERANGE* pNoteRanges, DWORD dwNumNoteRanges, IDirectMusicPort** ppPort, DWORD* pdwGroup, DWORD* pdwMChannel)
|
|
|
|
{
|
2003-06-07 00:39:18 +00:00
|
|
|
ICOM_THIS(IDirectMusicPerformance8Impl,iface);
|
|
|
|
|
|
|
|
FIXME("(%p, %p, %ld, %p, %p, %ld, %p, %p, %p): stub\n", This, pInst, dwPChannel, ppDownInst, pNoteRanges, dwNumNoteRanges, ppPort, pdwGroup, pdwMChannel);
|
|
|
|
|
|
|
|
return S_OK;
|
2003-04-08 21:42:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
HRESULT WINAPI IDirectMusicPerformance8Impl_Invalidate (LPDIRECTMUSICPERFORMANCE8 iface, MUSIC_TIME mtTime, DWORD dwFlags)
|
|
|
|
{
|
2003-06-07 00:39:18 +00:00
|
|
|
ICOM_THIS(IDirectMusicPerformance8Impl,iface);
|
|
|
|
|
|
|
|
FIXME("(%p, %ld, %ld): stub\n", This, mtTime, dwFlags);
|
|
|
|
|
|
|
|
return S_OK;
|
2003-04-08 21:42:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
HRESULT WINAPI IDirectMusicPerformance8Impl_GetParam (LPDIRECTMUSICPERFORMANCE8 iface, REFGUID rguidType, DWORD dwGroupBits, DWORD dwIndex, MUSIC_TIME mtTime, MUSIC_TIME* pmtNext, void* pParam)
|
|
|
|
{
|
2003-06-07 00:39:18 +00:00
|
|
|
ICOM_THIS(IDirectMusicPerformance8Impl,iface);
|
|
|
|
|
|
|
|
FIXME("(%p, %s, %ld, %ld, %ld, %p, %p): stub\n", This, debugstr_guid(rguidType), dwGroupBits, dwIndex, mtTime, pmtNext, pParam);
|
|
|
|
|
|
|
|
return S_OK;
|
2003-04-08 21:42:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
HRESULT WINAPI IDirectMusicPerformance8Impl_SetParam (LPDIRECTMUSICPERFORMANCE8 iface, REFGUID rguidType, DWORD dwGroupBits, DWORD dwIndex, MUSIC_TIME mtTime, void* pParam)
|
|
|
|
{
|
2003-06-07 00:39:18 +00:00
|
|
|
ICOM_THIS(IDirectMusicPerformance8Impl,iface);
|
|
|
|
|
|
|
|
FIXME("(%p, %s, %ld, %ld, %ld, %p): stub\n", This, debugstr_guid(rguidType), dwGroupBits, dwIndex, mtTime, pParam);
|
|
|
|
|
|
|
|
return S_OK;
|
2003-04-08 21:42:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
HRESULT WINAPI IDirectMusicPerformance8Impl_GetGlobalParam (LPDIRECTMUSICPERFORMANCE8 iface, REFGUID rguidType, void* pParam, DWORD dwSize)
|
|
|
|
{
|
2003-06-07 00:39:18 +00:00
|
|
|
ICOM_THIS(IDirectMusicPerformance8Impl,iface);
|
|
|
|
|
2003-06-13 18:59:51 +00:00
|
|
|
TRACE("(%p, %s, %p, %ld): stub\n", This, debugstr_guid(rguidType), pParam, dwSize);
|
|
|
|
|
2003-08-22 23:53:27 +00:00
|
|
|
if (IsEqualGUID (rguidType, &GUID_PerfAutoDownload))
|
2003-07-21 22:10:14 +00:00
|
|
|
memcpy(pParam, &This->fAutoDownload, sizeof(&This->fAutoDownload));
|
2003-08-22 23:53:27 +00:00
|
|
|
if (IsEqualGUID (rguidType, &GUID_PerfMasterGrooveLevel))
|
2003-07-21 22:10:14 +00:00
|
|
|
memcpy(pParam, &This->cMasterGrooveLevel, sizeof(&This->cMasterGrooveLevel));
|
2003-08-22 23:53:27 +00:00
|
|
|
if (IsEqualGUID (rguidType, &GUID_PerfMasterTempo))
|
2003-07-21 22:10:14 +00:00
|
|
|
memcpy(pParam, &This->fMasterTempo, sizeof(&This->fMasterTempo));
|
2003-08-22 23:53:27 +00:00
|
|
|
if (IsEqualGUID (rguidType, &GUID_PerfMasterVolume))
|
2003-07-21 22:10:14 +00:00
|
|
|
memcpy(pParam, &This->lMasterVolume, sizeof(&This->lMasterVolume));
|
2003-06-07 00:39:18 +00:00
|
|
|
|
|
|
|
return S_OK;
|
2003-04-08 21:42:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
HRESULT WINAPI IDirectMusicPerformance8Impl_SetGlobalParam (LPDIRECTMUSICPERFORMANCE8 iface, REFGUID rguidType, void* pParam, DWORD dwSize)
|
|
|
|
{
|
2003-06-07 00:39:18 +00:00
|
|
|
ICOM_THIS(IDirectMusicPerformance8Impl,iface);
|
|
|
|
|
2003-06-13 18:59:51 +00:00
|
|
|
TRACE("(%p, %s, %p, %ld)\n", This, debugstr_guid(rguidType), pParam, dwSize);
|
|
|
|
|
2003-08-22 23:53:27 +00:00
|
|
|
if (IsEqualGUID (rguidType, &GUID_PerfAutoDownload)) {
|
2003-07-21 22:10:14 +00:00
|
|
|
memcpy(&This->fAutoDownload, pParam, dwSize);
|
|
|
|
TRACE("=> AutoDownload set to %d\n", This->fAutoDownload);
|
2003-06-13 18:59:51 +00:00
|
|
|
}
|
2003-08-22 23:53:27 +00:00
|
|
|
if (IsEqualGUID (rguidType, &GUID_PerfMasterGrooveLevel)) {
|
2003-07-21 22:10:14 +00:00
|
|
|
memcpy(&This->cMasterGrooveLevel, pParam, dwSize);
|
|
|
|
TRACE("=> MasterGrooveLevel set to %i\n", This->cMasterGrooveLevel);
|
2003-06-13 18:59:51 +00:00
|
|
|
}
|
2003-08-22 23:53:27 +00:00
|
|
|
if (IsEqualGUID (rguidType, &GUID_PerfMasterTempo)) {
|
2003-07-21 22:10:14 +00:00
|
|
|
memcpy(&This->fMasterTempo, pParam, dwSize);
|
|
|
|
TRACE("=> MasterTempo set to %f\n", This->fMasterTempo);
|
2003-06-13 18:59:51 +00:00
|
|
|
}
|
2003-08-22 23:53:27 +00:00
|
|
|
if (IsEqualGUID (rguidType, &GUID_PerfMasterVolume)) {
|
2003-07-21 22:10:14 +00:00
|
|
|
memcpy(&This->lMasterVolume, pParam, dwSize);
|
|
|
|
TRACE("=> MasterVolume set to %li\n", This->lMasterVolume);
|
2003-06-13 18:59:51 +00:00
|
|
|
}
|
2003-06-07 00:39:18 +00:00
|
|
|
|
|
|
|
return S_OK;
|
2003-04-08 21:42:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
HRESULT WINAPI IDirectMusicPerformance8Impl_GetLatencyTime (LPDIRECTMUSICPERFORMANCE8 iface, REFERENCE_TIME* prtTime)
|
|
|
|
{
|
2003-06-07 00:39:18 +00:00
|
|
|
ICOM_THIS(IDirectMusicPerformance8Impl,iface);
|
|
|
|
|
|
|
|
FIXME("(%p, %p): stub\n", This, prtTime);
|
|
|
|
|
|
|
|
return S_OK;
|
2003-04-08 21:42:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
HRESULT WINAPI IDirectMusicPerformance8Impl_GetQueueTime (LPDIRECTMUSICPERFORMANCE8 iface, REFERENCE_TIME* prtTime)
|
|
|
|
{
|
2003-06-07 00:39:18 +00:00
|
|
|
ICOM_THIS(IDirectMusicPerformance8Impl,iface);
|
|
|
|
|
|
|
|
FIXME("(%p, %p): stub\n", This, prtTime);
|
|
|
|
|
|
|
|
return S_OK;
|
2003-04-08 21:42:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
HRESULT WINAPI IDirectMusicPerformance8Impl_AdjustTime (LPDIRECTMUSICPERFORMANCE8 iface, REFERENCE_TIME rtAmount)
|
|
|
|
{
|
2003-06-07 00:39:18 +00:00
|
|
|
ICOM_THIS(IDirectMusicPerformance8Impl,iface);
|
|
|
|
|
2003-07-21 22:10:14 +00:00
|
|
|
FIXME("(%p, %lli): stub\n", This, rtAmount);
|
2003-06-07 00:39:18 +00:00
|
|
|
|
|
|
|
return S_OK;
|
2003-04-08 21:42:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
HRESULT WINAPI IDirectMusicPerformance8Impl_CloseDown (LPDIRECTMUSICPERFORMANCE8 iface)
|
|
|
|
{
|
2003-06-07 00:39:18 +00:00
|
|
|
ICOM_THIS(IDirectMusicPerformance8Impl,iface);
|
|
|
|
|
|
|
|
FIXME("(%p): stub\n", This);
|
|
|
|
|
|
|
|
return S_OK;
|
2003-04-08 21:42:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
HRESULT WINAPI IDirectMusicPerformance8Impl_GetResolvedTime (LPDIRECTMUSICPERFORMANCE8 iface, REFERENCE_TIME rtTime, REFERENCE_TIME* prtResolved, DWORD dwTimeResolveFlags)
|
|
|
|
{
|
2003-06-07 00:39:18 +00:00
|
|
|
ICOM_THIS(IDirectMusicPerformance8Impl,iface);
|
|
|
|
|
2003-07-21 22:10:14 +00:00
|
|
|
FIXME("(%p, %lli, %p, %ld): stub\n", This, rtTime, prtResolved, dwTimeResolveFlags);
|
2003-06-07 00:39:18 +00:00
|
|
|
|
|
|
|
return S_OK;
|
2003-04-08 21:42:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
HRESULT WINAPI IDirectMusicPerformance8Impl_MIDIToMusic (LPDIRECTMUSICPERFORMANCE8 iface, BYTE bMIDIValue, DMUS_CHORD_KEY* pChord, BYTE bPlayMode, BYTE bChordLevel, WORD* pwMusicValue)
|
|
|
|
{
|
2003-06-07 00:39:18 +00:00
|
|
|
ICOM_THIS(IDirectMusicPerformance8Impl,iface);
|
|
|
|
|
|
|
|
FIXME("(%p, %d, %p, %d, %d, %p): stub\n", This, bMIDIValue, pChord, bPlayMode, bChordLevel, pwMusicValue);
|
|
|
|
|
|
|
|
return S_OK;
|
2003-04-08 21:42:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
HRESULT WINAPI IDirectMusicPerformance8Impl_MusicToMIDI (LPDIRECTMUSICPERFORMANCE8 iface, WORD wMusicValue, DMUS_CHORD_KEY* pChord, BYTE bPlayMode, BYTE bChordLevel, BYTE* pbMIDIValue)
|
|
|
|
{
|
2003-06-07 00:39:18 +00:00
|
|
|
ICOM_THIS(IDirectMusicPerformance8Impl,iface);
|
|
|
|
|
|
|
|
FIXME("(%p, %d, %p, %d, %d, %p): stub\n", This, wMusicValue, pChord, bPlayMode, bChordLevel, pbMIDIValue);
|
|
|
|
|
|
|
|
return S_OK;
|
2003-04-08 21:42:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
HRESULT WINAPI IDirectMusicPerformance8Impl_TimeToRhythm (LPDIRECTMUSICPERFORMANCE8 iface, MUSIC_TIME mtTime, DMUS_TIMESIGNATURE* pTimeSig, WORD* pwMeasure, BYTE* pbBeat, BYTE* pbGrid, short* pnOffset)
|
|
|
|
{
|
2003-06-07 00:39:18 +00:00
|
|
|
ICOM_THIS(IDirectMusicPerformance8Impl,iface);
|
|
|
|
|
|
|
|
FIXME("(%p, %ld, %p, %p, %p, %p, %p): stub\n", This, mtTime, pTimeSig, pwMeasure, pbBeat, pbGrid, pnOffset);
|
|
|
|
|
|
|
|
return S_OK;
|
2003-04-08 21:42:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
HRESULT WINAPI IDirectMusicPerformance8Impl_RhythmToTime (LPDIRECTMUSICPERFORMANCE8 iface, WORD wMeasure, BYTE bBeat, BYTE bGrid, short nOffset, DMUS_TIMESIGNATURE* pTimeSig, MUSIC_TIME* pmtTime)
|
|
|
|
{
|
2003-06-07 00:39:18 +00:00
|
|
|
ICOM_THIS(IDirectMusicPerformance8Impl,iface);
|
|
|
|
|
|
|
|
FIXME("(%p, %d, %d, %d, %i, %p, %p): stub\n", This, wMeasure, bBeat, bGrid, nOffset, pTimeSig, pmtTime);
|
|
|
|
|
|
|
|
return S_OK;
|
2003-04-08 21:42:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* IDirectMusicPerformance8 Interface part follow: */
|
2003-06-13 18:59:51 +00:00
|
|
|
HRESULT WINAPI IDirectMusicPerformance8ImplInitAudio (LPDIRECTMUSICPERFORMANCE8 iface,
|
|
|
|
IDirectMusic** ppDirectMusic,
|
|
|
|
IDirectSound** ppDirectSound,
|
|
|
|
HWND hWnd,
|
|
|
|
DWORD dwDefaultPathType,
|
|
|
|
DWORD dwPChannelCount,
|
|
|
|
DWORD dwFlags,
|
|
|
|
DMUS_AUDIOPARAMS* pParams)
|
|
|
|
{
|
2003-07-02 04:30:27 +00:00
|
|
|
IDirectSound* dsound;
|
|
|
|
|
2003-08-22 23:53:27 +00:00
|
|
|
ICOM_THIS(IDirectMusicPerformance8Impl,iface);
|
2003-06-13 18:59:51 +00:00
|
|
|
FIXME("(%p, %p, %p, %p, %lx, %lu, %lx, %p): to check\n", This, ppDirectMusic, ppDirectSound, hWnd, dwDefaultPathType, dwPChannelCount, dwFlags, pParams);
|
|
|
|
|
2003-07-21 22:10:14 +00:00
|
|
|
if (This->pDirectMusic || This->pDirectSound)
|
2003-06-16 20:26:50 +00:00
|
|
|
return DMUS_E_ALREADY_INITED;
|
|
|
|
|
2003-06-13 18:59:51 +00:00
|
|
|
if (NULL != ppDirectSound && NULL != *ppDirectSound) {
|
2003-07-02 04:30:27 +00:00
|
|
|
dsound = *ppDirectSound;
|
2003-06-13 18:59:51 +00:00
|
|
|
} else {
|
2003-08-22 23:53:27 +00:00
|
|
|
DirectSoundCreate8 (&IID_IDirectSound8, (LPDIRECTSOUND8*) &dsound, NULL);
|
2003-07-02 04:30:27 +00:00
|
|
|
if (!dsound)
|
|
|
|
return DSERR_NODRIVER;
|
2003-06-16 20:26:50 +00:00
|
|
|
if (ppDirectSound)
|
2003-07-02 04:30:27 +00:00
|
|
|
*ppDirectSound = dsound;
|
2003-06-13 18:59:51 +00:00
|
|
|
}
|
2003-06-16 20:26:50 +00:00
|
|
|
|
2003-07-02 04:30:27 +00:00
|
|
|
IDirectMusicPerformance8Impl_Init(iface, ppDirectMusic, dsound, hWnd);
|
2003-06-16 20:26:50 +00:00
|
|
|
|
|
|
|
/* Init increases the ref count of the dsound object. Decremente it if the app don't want a pointer to the object. */
|
2003-06-27 19:43:13 +00:00
|
|
|
if (!ppDirectSound)
|
2003-07-21 22:10:14 +00:00
|
|
|
IDirectSound_Release(This->pDirectSound);
|
2003-06-16 20:26:50 +00:00
|
|
|
|
2003-06-13 18:59:51 +00:00
|
|
|
/* as seen in msdn we need params init before audio path creation */
|
|
|
|
if (NULL != pParams) {
|
2003-07-21 22:10:14 +00:00
|
|
|
memcpy(&This->pParams, pParams, sizeof(DMUS_AUDIOPARAMS));
|
2003-06-13 18:59:51 +00:00
|
|
|
} else {
|
|
|
|
/* TODO, how can i fill the struct */
|
|
|
|
}
|
2003-07-21 22:10:14 +00:00
|
|
|
IDirectMusicPerformance8ImplCreateStandardAudioPath(iface, dwDefaultPathType, dwPChannelCount, FALSE, (IDirectMusicAudioPath**) &This->pDefaultPath);
|
2003-06-07 00:39:18 +00:00
|
|
|
|
2003-07-21 22:10:14 +00:00
|
|
|
return S_OK;
|
2003-04-08 21:42:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
HRESULT WINAPI IDirectMusicPerformance8ImplPlaySegmentEx (LPDIRECTMUSICPERFORMANCE8 iface, IUnknown* pSource, WCHAR* pwzSegmentName, IUnknown* pTransition, DWORD dwFlags, __int64 i64StartTime, IDirectMusicSegmentState** ppSegmentState, IUnknown* pFrom, IUnknown* pAudioPath)
|
|
|
|
{
|
2003-06-07 00:39:18 +00:00
|
|
|
ICOM_THIS(IDirectMusicPerformance8Impl,iface);
|
|
|
|
|
2003-07-21 22:10:14 +00:00
|
|
|
FIXME("(%p, %p, %p, %p, %ld, %lli, %p, %p, %p): stub\n", This, pSource, pwzSegmentName, pTransition, dwFlags, i64StartTime, ppSegmentState, pFrom, pAudioPath);
|
2003-06-07 00:39:18 +00:00
|
|
|
|
|
|
|
return S_OK;
|
2003-04-08 21:42:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
HRESULT WINAPI IDirectMusicPerformance8ImplStopEx (LPDIRECTMUSICPERFORMANCE8 iface, IUnknown* pObjectToStop, __int64 i64StopTime, DWORD dwFlags)
|
|
|
|
{
|
2003-06-07 00:39:18 +00:00
|
|
|
ICOM_THIS(IDirectMusicPerformance8Impl,iface);
|
|
|
|
|
2003-07-21 22:10:14 +00:00
|
|
|
FIXME("(%p, %p, %lli, %ld): stub\n", This, pObjectToStop, i64StopTime, dwFlags);
|
2003-06-07 00:39:18 +00:00
|
|
|
|
|
|
|
return S_OK;
|
2003-04-08 21:42:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
HRESULT WINAPI IDirectMusicPerformance8ImplClonePMsg (LPDIRECTMUSICPERFORMANCE8 iface, DMUS_PMSG* pSourcePMSG, DMUS_PMSG** ppCopyPMSG)
|
|
|
|
{
|
2003-06-07 00:39:18 +00:00
|
|
|
ICOM_THIS(IDirectMusicPerformance8Impl,iface);
|
|
|
|
|
|
|
|
FIXME("(%p, %p, %p): stub\n", This, pSourcePMSG, ppCopyPMSG);
|
|
|
|
|
|
|
|
return S_OK;
|
2003-04-08 21:42:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
HRESULT WINAPI IDirectMusicPerformance8ImplCreateAudioPath (LPDIRECTMUSICPERFORMANCE8 iface, IUnknown* pSourceConfig, BOOL fActivate, IDirectMusicAudioPath** ppNewPath)
|
|
|
|
{
|
2003-06-07 00:39:18 +00:00
|
|
|
ICOM_THIS(IDirectMusicPerformance8Impl,iface);
|
|
|
|
|
|
|
|
FIXME("(%p, %p, %d, %p): stub\n", This, pSourceConfig, fActivate, ppNewPath);
|
|
|
|
|
|
|
|
return S_OK;
|
2003-04-08 21:42:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
HRESULT WINAPI IDirectMusicPerformance8ImplCreateStandardAudioPath (LPDIRECTMUSICPERFORMANCE8 iface, DWORD dwType, DWORD dwPChannelCount, BOOL fActivate, IDirectMusicAudioPath** ppNewPath)
|
|
|
|
{
|
2003-06-16 20:26:50 +00:00
|
|
|
IDirectMusicAudioPathImpl *default_path;
|
|
|
|
DSBUFFERDESC desc;
|
|
|
|
WAVEFORMATEX format;
|
|
|
|
LPDIRECTSOUNDBUFFER8 buffer;
|
2003-06-07 00:39:18 +00:00
|
|
|
|
2003-06-16 20:26:50 +00:00
|
|
|
ICOM_THIS(IDirectMusicPerformance8Impl,iface);
|
|
|
|
|
|
|
|
FIXME("(%p)->(%ld, %ld, %d, %p): semi-stub\n", This, dwType, dwPChannelCount, fActivate, ppNewPath);
|
2003-06-07 00:39:18 +00:00
|
|
|
|
2003-06-16 20:26:50 +00:00
|
|
|
default_path = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicAudioPathImpl));
|
2003-06-27 19:43:13 +00:00
|
|
|
if (NULL == default_path) {
|
|
|
|
*ppNewPath = (LPDIRECTMUSICAUDIOPATH) NULL;
|
2003-06-16 20:26:50 +00:00
|
|
|
return E_OUTOFMEMORY;
|
|
|
|
}
|
|
|
|
default_path->lpVtbl = &DirectMusicAudioPath_Vtbl;
|
|
|
|
default_path->ref = 1;
|
2003-07-21 22:10:14 +00:00
|
|
|
default_path->pPerf = (IDirectMusicPerformance8*) This;
|
2003-06-16 20:26:50 +00:00
|
|
|
|
|
|
|
/* Secondary buffer description */
|
|
|
|
format.wFormatTag = WAVE_FORMAT_PCM;
|
|
|
|
format.nChannels = 1;
|
|
|
|
format.nSamplesPerSec = 44000;
|
|
|
|
format.nAvgBytesPerSec = 44000*2;
|
|
|
|
format.nBlockAlign = 2;
|
|
|
|
format.wBitsPerSample = 16;
|
|
|
|
format.cbSize = 0;
|
|
|
|
|
|
|
|
desc.dwSize = sizeof(desc);
|
|
|
|
desc.dwFlags = 0;
|
|
|
|
desc.dwBufferBytes = DSBSIZE_MIN;
|
|
|
|
desc.dwReserved = 0;
|
|
|
|
desc.lpwfxFormat = &format;
|
|
|
|
desc.guid3DAlgorithm = GUID_NULL;
|
|
|
|
|
|
|
|
switch(dwType) {
|
2003-06-13 18:59:51 +00:00
|
|
|
case DMUS_APATH_DYNAMIC_3D:
|
2003-06-16 20:26:50 +00:00
|
|
|
desc.dwFlags |= DSBCAPS_CTRL3D;
|
|
|
|
break;
|
2003-06-13 18:59:51 +00:00
|
|
|
case DMUS_APATH_DYNAMIC_MONO:
|
2003-06-16 20:26:50 +00:00
|
|
|
break;
|
|
|
|
case DMUS_APATH_SHARED_STEREOPLUSREVERB:
|
2003-06-13 18:59:51 +00:00
|
|
|
case DMUS_APATH_DYNAMIC_STEREO:
|
2003-06-16 20:26:50 +00:00
|
|
|
format.nChannels = 2;
|
|
|
|
format.nBlockAlign *= 2;
|
|
|
|
format.nAvgBytesPerSec *=2;
|
|
|
|
break;
|
2003-06-13 18:59:51 +00:00
|
|
|
default:
|
2003-06-16 20:26:50 +00:00
|
|
|
break;
|
2003-06-13 18:59:51 +00:00
|
|
|
}
|
2003-06-18 03:18:23 +00:00
|
|
|
|
2003-06-16 20:26:50 +00:00
|
|
|
/* FIXME: Should we create one secondary buffer for each PChannel? */
|
2003-08-22 23:53:27 +00:00
|
|
|
IDirectSound8_CreateSoundBuffer ((LPDIRECTSOUND8) This->pDirectSound, &desc, &buffer, NULL);
|
2003-07-21 22:10:14 +00:00
|
|
|
default_path->pDSBuffer = (IDirectSoundBuffer*) buffer;
|
2003-06-13 18:59:51 +00:00
|
|
|
|
2003-06-16 20:26:50 +00:00
|
|
|
/* Update description for creating primary buffer */
|
|
|
|
desc.dwFlags |= DSBCAPS_PRIMARYBUFFER;
|
|
|
|
desc.dwBufferBytes = 0;
|
|
|
|
desc.lpwfxFormat = NULL;
|
|
|
|
|
2003-08-22 23:53:27 +00:00
|
|
|
IDirectSound8_CreateSoundBuffer ((LPDIRECTSOUND8) This->pDirectSound, &desc, &buffer, NULL);
|
2003-06-16 20:26:50 +00:00
|
|
|
|
2003-07-21 22:10:14 +00:00
|
|
|
default_path->pPrimary = (IDirectSoundBuffer*) buffer;
|
2003-06-16 20:26:50 +00:00
|
|
|
|
|
|
|
*ppNewPath = (LPDIRECTMUSICAUDIOPATH) default_path;
|
|
|
|
|
|
|
|
TRACE(" returning IDirectMusicPerformance interface at %p.\n", *ppNewPath);
|
2003-06-13 18:59:51 +00:00
|
|
|
|
2003-07-21 22:10:14 +00:00
|
|
|
return S_OK;
|
2003-04-08 21:42:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
HRESULT WINAPI IDirectMusicPerformance8ImplSetDefaultAudioPath (LPDIRECTMUSICPERFORMANCE8 iface, IDirectMusicAudioPath* pAudioPath)
|
|
|
|
{
|
2003-08-22 23:53:27 +00:00
|
|
|
ICOM_THIS(IDirectMusicPerformance8Impl,iface);
|
2003-06-07 00:39:18 +00:00
|
|
|
|
2003-08-22 23:53:27 +00:00
|
|
|
FIXME("(%p, %p): semi-stub\n", This, pAudioPath);
|
|
|
|
if (NULL != This->pDefaultPath) {
|
|
|
|
IDirectMusicAudioPathImpl_Release((LPDIRECTMUSICAUDIOPATH) This->pDefaultPath);
|
|
|
|
((IDirectMusicAudioPathImpl*) This->pDefaultPath)->pPerf = NULL;
|
|
|
|
This->pDefaultPath = NULL;
|
|
|
|
}
|
|
|
|
This->pDefaultPath = pAudioPath;
|
|
|
|
if (NULL != This->pDefaultPath) {
|
|
|
|
IDirectMusicAudioPathImpl_AddRef((LPDIRECTMUSICAUDIOPATH) This->pDefaultPath);
|
|
|
|
((IDirectMusicAudioPathImpl*) This->pDefaultPath)->pPerf = (IDirectMusicPerformance8*) This;
|
|
|
|
}
|
|
|
|
|
|
|
|
return S_OK;
|
2003-04-08 21:42:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
HRESULT WINAPI IDirectMusicPerformance8ImplGetDefaultAudioPath (LPDIRECTMUSICPERFORMANCE8 iface, IDirectMusicAudioPath** ppAudioPath)
|
|
|
|
{
|
2003-07-21 22:10:14 +00:00
|
|
|
ICOM_THIS(IDirectMusicPerformance8Impl,iface);
|
2003-06-07 00:39:18 +00:00
|
|
|
|
2003-06-13 18:59:51 +00:00
|
|
|
FIXME("(%p, %p): semi-stub\n", This, ppAudioPath);
|
2003-06-07 00:39:18 +00:00
|
|
|
|
2003-07-21 22:10:14 +00:00
|
|
|
if (NULL != This->pDefaultPath) {
|
|
|
|
*ppAudioPath = (LPDIRECTMUSICAUDIOPATH) This->pDefaultPath;
|
2003-06-13 18:59:51 +00:00
|
|
|
IDirectMusicAudioPathImpl_AddRef(*ppAudioPath);
|
|
|
|
} else {
|
|
|
|
*ppAudioPath = NULL;
|
|
|
|
}
|
2003-07-21 22:10:14 +00:00
|
|
|
return S_OK;
|
2003-04-08 21:42:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
HRESULT WINAPI IDirectMusicPerformance8ImplGetParamEx (LPDIRECTMUSICPERFORMANCE8 iface, REFGUID rguidType, DWORD dwTrackID, DWORD dwGroupBits, DWORD dwIndex, MUSIC_TIME mtTime, MUSIC_TIME* pmtNext, void* pParam)
|
|
|
|
{
|
2003-06-07 00:39:18 +00:00
|
|
|
ICOM_THIS(IDirectMusicPerformance8Impl,iface);
|
|
|
|
|
|
|
|
FIXME("(%p, %s, %ld, %ld, %ld, %ld, %p, %p): stub\n", This, debugstr_guid(rguidType), dwTrackID, dwGroupBits, dwIndex, mtTime, pmtNext, pParam);
|
|
|
|
|
|
|
|
return S_OK;
|
2003-04-08 21:42:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
ICOM_VTABLE(IDirectMusicPerformance8) DirectMusicPerformance8_Vtbl =
|
|
|
|
{
|
|
|
|
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
|
|
|
|
IDirectMusicPerformance8Impl_QueryInterface,
|
|
|
|
IDirectMusicPerformance8Impl_AddRef,
|
|
|
|
IDirectMusicPerformance8Impl_Release,
|
|
|
|
IDirectMusicPerformance8Impl_Init,
|
|
|
|
IDirectMusicPerformance8Impl_PlaySegment,
|
|
|
|
IDirectMusicPerformance8Impl_Stop,
|
|
|
|
IDirectMusicPerformance8Impl_GetSegmentState,
|
|
|
|
IDirectMusicPerformance8Impl_SetPrepareTime,
|
|
|
|
IDirectMusicPerformance8Impl_GetPrepareTime,
|
|
|
|
IDirectMusicPerformance8Impl_SetBumperLength,
|
|
|
|
IDirectMusicPerformance8Impl_GetBumperLength,
|
|
|
|
IDirectMusicPerformance8Impl_SendPMsg,
|
|
|
|
IDirectMusicPerformance8Impl_MusicToReferenceTime,
|
|
|
|
IDirectMusicPerformance8Impl_ReferenceToMusicTime,
|
|
|
|
IDirectMusicPerformance8Impl_IsPlaying,
|
|
|
|
IDirectMusicPerformance8Impl_GetTime,
|
|
|
|
IDirectMusicPerformance8Impl_AllocPMsg,
|
|
|
|
IDirectMusicPerformance8Impl_FreePMsg,
|
|
|
|
IDirectMusicPerformance8Impl_GetGraph,
|
|
|
|
IDirectMusicPerformance8Impl_SetGraph,
|
|
|
|
IDirectMusicPerformance8Impl_SetNotificationHandle,
|
|
|
|
IDirectMusicPerformance8Impl_GetNotificationPMsg,
|
|
|
|
IDirectMusicPerformance8Impl_AddNotificationType,
|
|
|
|
IDirectMusicPerformance8Impl_RemoveNotificationType,
|
|
|
|
IDirectMusicPerformance8Impl_AddPort,
|
|
|
|
IDirectMusicPerformance8Impl_RemovePort,
|
|
|
|
IDirectMusicPerformance8Impl_AssignPChannelBlock,
|
|
|
|
IDirectMusicPerformance8Impl_AssignPChannel,
|
|
|
|
IDirectMusicPerformance8Impl_PChannelInfo,
|
|
|
|
IDirectMusicPerformance8Impl_DownloadInstrument,
|
|
|
|
IDirectMusicPerformance8Impl_Invalidate,
|
|
|
|
IDirectMusicPerformance8Impl_GetParam,
|
|
|
|
IDirectMusicPerformance8Impl_SetParam,
|
|
|
|
IDirectMusicPerformance8Impl_GetGlobalParam,
|
|
|
|
IDirectMusicPerformance8Impl_SetGlobalParam,
|
|
|
|
IDirectMusicPerformance8Impl_GetLatencyTime,
|
|
|
|
IDirectMusicPerformance8Impl_GetQueueTime,
|
|
|
|
IDirectMusicPerformance8Impl_AdjustTime,
|
|
|
|
IDirectMusicPerformance8Impl_CloseDown,
|
|
|
|
IDirectMusicPerformance8Impl_GetResolvedTime,
|
|
|
|
IDirectMusicPerformance8Impl_MIDIToMusic,
|
|
|
|
IDirectMusicPerformance8Impl_MusicToMIDI,
|
|
|
|
IDirectMusicPerformance8Impl_TimeToRhythm,
|
|
|
|
IDirectMusicPerformance8Impl_RhythmToTime,
|
|
|
|
IDirectMusicPerformance8ImplInitAudio,
|
|
|
|
IDirectMusicPerformance8ImplPlaySegmentEx,
|
|
|
|
IDirectMusicPerformance8ImplStopEx,
|
|
|
|
IDirectMusicPerformance8ImplClonePMsg,
|
|
|
|
IDirectMusicPerformance8ImplCreateAudioPath,
|
|
|
|
IDirectMusicPerformance8ImplCreateStandardAudioPath,
|
|
|
|
IDirectMusicPerformance8ImplSetDefaultAudioPath,
|
|
|
|
IDirectMusicPerformance8ImplGetDefaultAudioPath,
|
|
|
|
IDirectMusicPerformance8ImplGetParamEx
|
|
|
|
};
|
2003-05-04 02:26:03 +00:00
|
|
|
|
|
|
|
/* for ClassFactory */
|
2003-07-21 22:10:14 +00:00
|
|
|
HRESULT WINAPI DMUSIC_CreateDirectMusicPerformance (LPCGUID lpcGUID, LPDIRECTMUSICPERFORMANCE8 *ppDMPerf, LPUNKNOWN pUnkOuter)
|
2003-05-04 02:26:03 +00:00
|
|
|
{
|
2003-07-21 22:10:14 +00:00
|
|
|
IDirectMusicPerformance8Impl *pPerf;
|
2003-05-04 02:26:03 +00:00
|
|
|
|
2003-07-21 22:10:14 +00:00
|
|
|
TRACE("(%p,%p,%p)\n",lpcGUID, ppDMPerf, pUnkOuter);
|
2003-08-22 23:53:27 +00:00
|
|
|
if (IsEqualIID (lpcGUID, &IID_IDirectMusicPerformance) ||
|
|
|
|
IsEqualIID (lpcGUID, &IID_IDirectMusicPerformance8)) {
|
2003-07-21 22:10:14 +00:00
|
|
|
pPerf = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicPerformance8Impl));
|
|
|
|
if (NULL == pPerf)
|
2003-05-04 02:26:03 +00:00
|
|
|
{
|
2003-07-21 22:10:14 +00:00
|
|
|
*ppDMPerf = (LPDIRECTMUSICPERFORMANCE8)NULL;
|
2003-05-04 02:26:03 +00:00
|
|
|
return E_OUTOFMEMORY;
|
|
|
|
}
|
2003-07-21 22:10:14 +00:00
|
|
|
pPerf->lpVtbl = &DirectMusicPerformance8_Vtbl;
|
|
|
|
pPerf->ref = 1;
|
|
|
|
pPerf->pDirectMusic = NULL;
|
|
|
|
pPerf->pDirectSound = NULL;
|
|
|
|
pPerf->pDefaultPath = NULL;
|
2003-06-13 18:59:51 +00:00
|
|
|
|
2003-07-21 22:10:14 +00:00
|
|
|
*ppDMPerf = (LPDIRECTMUSICPERFORMANCE8) pPerf;
|
2003-05-04 02:26:03 +00:00
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
WARN("No interface found\n");
|
|
|
|
|
|
|
|
return E_NOINTERFACE;
|
|
|
|
}
|