Ejemplo n.º 1
0
static HRESULT WINAPI IDirectMusicPerformance8Impl_PChannelInfo (LPDIRECTMUSICPERFORMANCE8 iface, DWORD dwPChannel, IDirectMusicPort** ppPort, DWORD* pdwGroup, DWORD* pdwMChannel) {
	IDirectMusicPerformance8Impl *This = (IDirectMusicPerformance8Impl *)iface;
	DMUS_PORTPARAMS8 dmusportparams;
	GUID def;

	FIXME("(%p, %d, %p, %p, %p): stub\n", This, dwPChannel, ppPort, pdwGroup, pdwMChannel);

	dmusportparams.dwSize = sizeof(DMUS_PORTPARAMS8);
	dmusportparams.dwValidParams = 0;
	IDirectMusic8_GetDefaultPort(This->pDirectMusic, &def);
	IDirectMusic8_CreatePort(This->pDirectMusic, &def, &dmusportparams, ppPort, NULL);

	return S_OK;
}
Ejemplo n.º 2
0
static HRESULT WINAPI IDirectMusicPerformance8Impl_PChannelInfo(IDirectMusicPerformance8 *iface,
        DWORD PChannel, IDirectMusicPort **port, DWORD *group, DWORD *MChannel)
{
    IDirectMusicPerformance8Impl *This = impl_from_IDirectMusicPerformance8(iface);
    DMUS_PORTPARAMS8 port_params;
    GUID default_port;

    FIXME("(%p)->(%d, %p, %p, %p): stub\n", This, PChannel, port, group, MChannel);

    port_params.dwSize = sizeof(DMUS_PORTPARAMS8);
    port_params.dwValidParams = 0;
    IDirectMusic8_GetDefaultPort(This->pDirectMusic, &default_port);
    IDirectMusic8_CreatePort(This->pDirectMusic, &default_port, &port_params, port, NULL);

    return S_OK;
}
Ejemplo n.º 3
0
static HRESULT WINAPI IDirectMusicPerformance8Impl_AddPort(IDirectMusicPerformance8 *iface,
        IDirectMusicPort *pPort)
{
        IDirectMusicPerformance8Impl *This = impl_from_IDirectMusicPerformance8(iface);
	HRESULT hr = E_FAIL;

	FIXME("(%p, %p): stub\n", This, pPort);
	if (!This->pDirectMusic || !This->pDirectSound) return DMUS_E_NOT_INIT;
	if (NULL == pPort) {
	  GUID port_guid;
	  IDirectMusicPort* pDefaultPort = NULL;
	  DMUS_PORTPARAMS params;
	  int i, j;
	  hr = IDirectMusic8_GetDefaultPort(This->pDirectMusic, &port_guid);
	  if (FAILED(hr)) return hr;
	  ZeroMemory(&params, sizeof(params)); 
	  params.dwSize = sizeof(params);
	  params.dwValidParams = DMUS_PORTPARAMS_CHANNELGROUPS | DMUS_PORTPARAMS_SHARE;
	  params.dwChannelGroups = 1;
	  params.fShare = TRUE;
	  hr = IDirectMusic8_CreatePort(This->pDirectMusic, &port_guid, &params, &pDefaultPort, NULL);
	  if (FAILED(hr)) return hr;
	  hr = IDirectMusicPort_Activate(pDefaultPort, TRUE);
	  if (FAILED(hr)) { IDirectMusicPort_Release(pDefaultPort); return hr; }
	  j = 0;
	  for (i = 0; i < 16; ++i) {
	    if (NULL == This->PChannel[i].port) {
	      This->PChannel[i].port = pPort; 
	      This->PChannel[i].group = 0; 
	      This->PChannel[i].channel = j; /* FIXME: should this be assigned? */
	      j++;
	    }
	  }
	} else {
	  IDirectMusicPort_AddRef(pPort);	  
	}
	/**
	 * We should remember added Ports (for example using a list)
	 * and control if Port is registered for each api who use ports
	 */
	return S_OK;
}