Removed some uses of the non-standard ICOM_THIS macro.
[wine/multimedia.git] / dlls / dmime / patterntrack.c
blob4287ca88e161755e094a2a13ad5cf161cd59d385
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 IDirectMusicPatternTrackImpl *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 IDirectMusicPatternTrackImpl *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 IDirectMusicPatternTrackImpl *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 IDirectMusicPatternTrackImpl *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 IDirectMusicPatternTrackImpl *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 IDirectMusicPatternTrackImpl *This = (IDirectMusicPatternTrackImpl *)iface;
71 FIXME("(%p, %p, %p, %p, %ld, %p): stub\n", This, pSegState, wszName, pStyle, dwPatternType, pdwLength);
72 return S_OK;
75 IDirectMusicPatternTrackVtbl DirectMusicPatternTrack_Vtbl = {
76 IDirectMusicPatternTrackImpl_QueryInterface,
77 IDirectMusicPatternTrackImpl_AddRef,
78 IDirectMusicPatternTrackImpl_Release,
79 IDirectMusicPatternTrackImpl_CreateSegment,
80 IDirectMusicPatternTrackImpl_SetVariation,
81 IDirectMusicPatternTrackImpl_SetPatternByName
84 /* for ClassFactory */
85 HRESULT WINAPI DMUSIC_CreateDirectMusicPatternTrackImpl (LPCGUID lpcGUID, LPVOID *ppobj, LPUNKNOWN pUnkOuter) {
86 IDirectMusicPatternTrackImpl* track;
88 track = HeapAlloc (GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicPatternTrackImpl));
89 if (NULL == track) {
90 *ppobj = (LPVOID) NULL;
91 return E_OUTOFMEMORY;
93 track->lpVtbl = &DirectMusicPatternTrack_Vtbl;
94 track->ref = 0; /* will be inited by QueryInterface */
96 return IDirectMusicPatternTrackImpl_QueryInterface ((LPDIRECTMUSICPATTERNTRACK)track, lpcGUID, ppobj);