wined3d: Replace wined3d_surface_update_desc() with wined3d_texture_update_desc().
[wine.git] / dlls / dmime / segmentstate.c
blobb1b176ca5caf3663b28d3da29aaa8b241985b22c
1 /* IDirectMusicSegmentState8 Implementation
3 * Copyright (C) 2003-2004 Rok Mandeljc
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (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 GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
20 #include "dmime_private.h"
22 WINE_DEFAULT_DEBUG_CHANNEL(dmime);
24 typedef struct IDirectMusicSegmentState8Impl {
25 IDirectMusicSegmentState8 IDirectMusicSegmentState8_iface;
26 LONG ref;
27 } IDirectMusicSegmentState8Impl;
29 static inline IDirectMusicSegmentState8Impl *impl_from_IDirectMusicSegmentState8(IDirectMusicSegmentState8 *iface)
31 return CONTAINING_RECORD(iface, IDirectMusicSegmentState8Impl, IDirectMusicSegmentState8_iface);
34 static HRESULT WINAPI DirectMusicSegmentState8_QueryInterface(IDirectMusicSegmentState8 *iface, REFIID riid, void **ppobj)
36 IDirectMusicSegmentState8Impl *This = impl_from_IDirectMusicSegmentState8(iface);
38 TRACE("(%p, %s, %p)\n", This, debugstr_dmguid(riid), ppobj);
40 if (!ppobj)
41 return E_POINTER;
43 *ppobj = NULL;
45 if (IsEqualIID(riid, &IID_IUnknown) ||
46 IsEqualIID(riid, &IID_IDirectMusicSegmentState) ||
47 IsEqualIID(riid, &IID_IDirectMusicSegmentState8))
49 IDirectMusicSegmentState8_AddRef(iface);
50 *ppobj = &This->IDirectMusicSegmentState8_iface;
51 return S_OK;
54 WARN("(%p, %s, %p): not found\n", This, debugstr_dmguid(riid), ppobj);
55 return E_NOINTERFACE;
58 static ULONG WINAPI DirectMusicSegmentState8_AddRef(IDirectMusicSegmentState8 *iface)
60 IDirectMusicSegmentState8Impl *This = impl_from_IDirectMusicSegmentState8(iface);
61 ULONG ref = InterlockedIncrement(&This->ref);
63 TRACE("(%p): %d\n", This, ref);
65 DMIME_LockModule();
67 return ref;
70 static ULONG WINAPI DirectMusicSegmentState8_Release(IDirectMusicSegmentState8 *iface)
72 IDirectMusicSegmentState8Impl *This = impl_from_IDirectMusicSegmentState8(iface);
73 ULONG ref = InterlockedDecrement(&This->ref);
75 TRACE("(%p): %d\n", This, ref);
77 if (ref == 0)
78 HeapFree(GetProcessHeap(), 0, This);
80 DMIME_UnlockModule();
82 return ref;
85 static HRESULT WINAPI DirectMusicSegmentState8_GetRepeats(IDirectMusicSegmentState8 *iface, DWORD* pdwRepeats)
87 IDirectMusicSegmentState8Impl *This = impl_from_IDirectMusicSegmentState8(iface);
88 FIXME("(%p, %p): stub\n", This, pdwRepeats);
89 return S_OK;
92 static HRESULT WINAPI DirectMusicSegmentState8_GetSegment(IDirectMusicSegmentState8 *iface, IDirectMusicSegment** ppSegment)
94 IDirectMusicSegmentState8Impl *This = impl_from_IDirectMusicSegmentState8(iface);
95 FIXME("(%p, %p): stub\n", This, ppSegment);
96 return S_OK;
99 static HRESULT WINAPI DirectMusicSegmentState8_GetStartTime(IDirectMusicSegmentState8 *iface, MUSIC_TIME* pmtStart)
101 IDirectMusicSegmentState8Impl *This = impl_from_IDirectMusicSegmentState8(iface);
102 FIXME("(%p, %p): stub\n", This, pmtStart);
103 return S_OK;
106 static HRESULT WINAPI DirectMusicSegmentState8_GetSeek(IDirectMusicSegmentState8 *iface, MUSIC_TIME* pmtSeek)
108 IDirectMusicSegmentState8Impl *This = impl_from_IDirectMusicSegmentState8(iface);
109 FIXME("(%p, %p): stub\n", This, pmtSeek);
110 return S_OK;
113 static HRESULT WINAPI DirectMusicSegmentState8_GetStartPoint(IDirectMusicSegmentState8 *iface, MUSIC_TIME* pmtStart)
115 IDirectMusicSegmentState8Impl *This = impl_from_IDirectMusicSegmentState8(iface);
116 FIXME("(%p, %p): stub\n", This, pmtStart);
117 return S_OK;
120 static HRESULT WINAPI DirectMusicSegmentState8_SetTrackConfig(IDirectMusicSegmentState8 *iface, REFGUID rguidTrackClassID, DWORD dwGroupBits, DWORD dwIndex, DWORD dwFlagsOn, DWORD dwFlagsOff) {
121 IDirectMusicSegmentState8Impl *This = impl_from_IDirectMusicSegmentState8(iface);
122 FIXME("(%p, %s, %d, %d, %d, %d): stub\n", This, debugstr_dmguid(rguidTrackClassID), dwGroupBits, dwIndex, dwFlagsOn, dwFlagsOff);
123 return S_OK;
126 static HRESULT WINAPI DirectMusicSegmentState8_GetObjectInPath(IDirectMusicSegmentState8 *iface, DWORD dwPChannel, DWORD dwStage, DWORD dwBuffer, REFGUID guidObject, DWORD dwIndex, REFGUID iidInterface, void** ppObject) {
127 IDirectMusicSegmentState8Impl *This = impl_from_IDirectMusicSegmentState8(iface);
128 FIXME("(%p, %d, %d, %d, %s, %d, %s, %p): stub\n", This, dwPChannel, dwStage, dwBuffer, debugstr_dmguid(guidObject), dwIndex, debugstr_dmguid(iidInterface), ppObject);
129 return S_OK;
132 static const IDirectMusicSegmentState8Vtbl DirectMusicSegmentState8Vtbl = {
133 DirectMusicSegmentState8_QueryInterface,
134 DirectMusicSegmentState8_AddRef,
135 DirectMusicSegmentState8_Release,
136 DirectMusicSegmentState8_GetRepeats,
137 DirectMusicSegmentState8_GetSegment,
138 DirectMusicSegmentState8_GetStartTime,
139 DirectMusicSegmentState8_GetSeek,
140 DirectMusicSegmentState8_GetStartPoint,
141 DirectMusicSegmentState8_SetTrackConfig,
142 DirectMusicSegmentState8_GetObjectInPath
145 /* for ClassFactory */
146 HRESULT WINAPI create_dmsegmentstate(REFIID riid, void **ret_iface)
148 IDirectMusicSegmentState8Impl* obj;
149 HRESULT hr;
151 *ret_iface = NULL;
153 obj = HeapAlloc (GetProcessHeap(), 0, sizeof(IDirectMusicSegmentState8Impl));
154 if (!obj)
155 return E_OUTOFMEMORY;
157 obj->IDirectMusicSegmentState8_iface.lpVtbl = &DirectMusicSegmentState8Vtbl;
158 obj->ref = 1;
160 hr = IDirectMusicSegmentState8_QueryInterface(&obj->IDirectMusicSegmentState8_iface, riid, ret_iface);
161 IDirectMusicSegmentState8_Release(&obj->IDirectMusicSegmentState8_iface);
162 return hr;