Move the FPS computation from the D3D code to the common code.
[wine/multimedia.git] / dlls / dmime / patterntrack.c
blobb289de0adbe3a59f92ebd7aa3d28e2f74cbc4783
1 /* IDirectMusicPatternTrack Implementation
3 * Copyright (C) 2003-2004 Rok Mandeljc
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
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
13 * GNU Library General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 #include "dmime_private.h"
22 WINE_DEFAULT_DEBUG_CHANNEL(dmime);
24 /* IDirectMusicPatternTrack IUnknown parts follow: */
25 HRESULT WINAPI IDirectMusicPatternTrackImpl_QueryInterface (LPDIRECTMUSICPATTERNTRACK iface, REFIID riid, LPVOID *ppobj) {
26 ICOM_THIS(IDirectMusicPatternTrackImpl,iface);
27 TRACE("(%p, %s, %p)\n", This, debugstr_dmguid(riid), ppobj);
29 if (IsEqualIID (riid, &IID_IUnknown) ||
30 IsEqualIID (riid, &IID_IDirectMusicPatternTrack)) {
31 IDirectMusicPatternTrackImpl_AddRef(iface);
32 *ppobj = This;
33 return S_OK;
36 WARN("(%p, %s, %p): not found\n", This, debugstr_dmguid(riid), ppobj);
37 return E_NOINTERFACE;
40 ULONG WINAPI IDirectMusicPatternTrackImpl_AddRef (LPDIRECTMUSICPATTERNTRACK iface) {
41 ICOM_THIS(IDirectMusicPatternTrackImpl,iface);
42 TRACE("(%p): AddRef from %ld\n", This, This->ref);
43 return ++(This->ref);
46 ULONG WINAPI IDirectMusicPatternTrackImpl_Release (LPDIRECTMUSICPATTERNTRACK iface) {
47 ICOM_THIS(IDirectMusicPatternTrackImpl,iface);
48 ULONG ref = --This->ref;
49 TRACE("(%p): ReleaseRef to %ld\n", This, This->ref);
50 if (ref == 0) {
51 HeapFree(GetProcessHeap(), 0, This);
53 return ref;
56 /* IDirectMusicPatternTrack Interface follow: */
57 HRESULT WINAPI IDirectMusicPatternTrackImpl_CreateSegment (LPDIRECTMUSICPATTERNTRACK iface, IDirectMusicStyle* pStyle, IDirectMusicSegment** ppSegment) {
58 ICOM_THIS(IDirectMusicPatternTrackImpl,iface);
59 FIXME("(%p, %p, %p): stub\n", This, pStyle, ppSegment);
60 return S_OK;
63 HRESULT WINAPI IDirectMusicPatternTrackImpl_SetVariation (LPDIRECTMUSICPATTERNTRACK iface, IDirectMusicSegmentState* pSegState, DWORD dwVariationFlags, DWORD dwPart) {
64 ICOM_THIS(IDirectMusicPatternTrackImpl,iface);
65 FIXME("(%p, %p, %ld, %ld): stub\n", This, pSegState, dwVariationFlags, dwPart);
66 return S_OK;
69 HRESULT WINAPI IDirectMusicPatternTrackImpl_SetPatternByName (LPDIRECTMUSICPATTERNTRACK iface, IDirectMusicSegmentState* pSegState, WCHAR* wszName, IDirectMusicStyle* pStyle, DWORD dwPatternType, DWORD* pdwLength) {
70 ICOM_THIS(IDirectMusicPatternTrackImpl,iface);
71 FIXME("(%p, %p, %p, %p, %ld, %p): stub\n", This, pSegState, wszName, pStyle, dwPatternType, pdwLength);
72 return S_OK;
75 ICOM_VTABLE(IDirectMusicPatternTrack) DirectMusicPatternTrack_Vtbl = {
76 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
77 IDirectMusicPatternTrackImpl_QueryInterface,
78 IDirectMusicPatternTrackImpl_AddRef,
79 IDirectMusicPatternTrackImpl_Release,
80 IDirectMusicPatternTrackImpl_CreateSegment,
81 IDirectMusicPatternTrackImpl_SetVariation,
82 IDirectMusicPatternTrackImpl_SetPatternByName
85 /* for ClassFactory */
86 HRESULT WINAPI DMUSIC_CreateDirectMusicPatternTrackImpl (LPCGUID lpcGUID, LPVOID *ppobj, LPUNKNOWN pUnkOuter) {
87 IDirectMusicPatternTrackImpl* track;
89 track = HeapAlloc (GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicPatternTrackImpl));
90 if (NULL == track) {
91 *ppobj = (LPVOID) NULL;
92 return E_OUTOFMEMORY;
94 track->lpVtbl = &DirectMusicPatternTrack_Vtbl;
95 track->ref = 0; /* will be inited by QueryInterface */
97 return IDirectMusicPatternTrackImpl_QueryInterface ((LPDIRECTMUSICPATTERNTRACK)track, lpcGUID, ppobj);