conhost: Fix handling selection boundaries in copy_selection.
[wine/zf.git] / dlls / dmime / segmentstate.c
blobedd7ed70f05f87b575250c7796fdc6dfd3a4200e
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"
21 #include "dmobject.h"
23 WINE_DEFAULT_DEBUG_CHANNEL(dmime);
25 typedef struct IDirectMusicSegmentState8Impl {
26 IDirectMusicSegmentState8 IDirectMusicSegmentState8_iface;
27 LONG ref;
28 } IDirectMusicSegmentState8Impl;
30 static inline IDirectMusicSegmentState8Impl *impl_from_IDirectMusicSegmentState8(IDirectMusicSegmentState8 *iface)
32 return CONTAINING_RECORD(iface, IDirectMusicSegmentState8Impl, IDirectMusicSegmentState8_iface);
35 static HRESULT WINAPI DirectMusicSegmentState8_QueryInterface(IDirectMusicSegmentState8 *iface, REFIID riid, void **ppobj)
37 IDirectMusicSegmentState8Impl *This = impl_from_IDirectMusicSegmentState8(iface);
39 TRACE("(%p, %s, %p)\n", This, debugstr_dmguid(riid), ppobj);
41 if (!ppobj)
42 return E_POINTER;
44 *ppobj = NULL;
46 if (IsEqualIID(riid, &IID_IUnknown) ||
47 IsEqualIID(riid, &IID_IDirectMusicSegmentState) ||
48 IsEqualIID(riid, &IID_IDirectMusicSegmentState8))
50 IDirectMusicSegmentState8_AddRef(iface);
51 *ppobj = &This->IDirectMusicSegmentState8_iface;
52 return S_OK;
55 WARN("(%p, %s, %p): not found\n", This, debugstr_dmguid(riid), ppobj);
56 return E_NOINTERFACE;
59 static ULONG WINAPI DirectMusicSegmentState8_AddRef(IDirectMusicSegmentState8 *iface)
61 IDirectMusicSegmentState8Impl *This = impl_from_IDirectMusicSegmentState8(iface);
62 ULONG ref = InterlockedIncrement(&This->ref);
64 TRACE("(%p): %d\n", This, ref);
66 DMIME_LockModule();
68 return ref;
71 static ULONG WINAPI DirectMusicSegmentState8_Release(IDirectMusicSegmentState8 *iface)
73 IDirectMusicSegmentState8Impl *This = impl_from_IDirectMusicSegmentState8(iface);
74 ULONG ref = InterlockedDecrement(&This->ref);
76 TRACE("(%p): %d\n", This, ref);
78 if (ref == 0)
79 HeapFree(GetProcessHeap(), 0, This);
81 DMIME_UnlockModule();
83 return ref;
86 static HRESULT WINAPI DirectMusicSegmentState8_GetRepeats(IDirectMusicSegmentState8 *iface, DWORD* pdwRepeats)
88 IDirectMusicSegmentState8Impl *This = impl_from_IDirectMusicSegmentState8(iface);
89 FIXME("(%p, %p): stub\n", This, pdwRepeats);
90 return S_OK;
93 static HRESULT WINAPI DirectMusicSegmentState8_GetSegment(IDirectMusicSegmentState8 *iface, IDirectMusicSegment** ppSegment)
95 IDirectMusicSegmentState8Impl *This = impl_from_IDirectMusicSegmentState8(iface);
96 FIXME("(%p, %p): stub\n", This, ppSegment);
97 return S_OK;
100 static HRESULT WINAPI DirectMusicSegmentState8_GetStartTime(IDirectMusicSegmentState8 *iface, MUSIC_TIME* pmtStart)
102 IDirectMusicSegmentState8Impl *This = impl_from_IDirectMusicSegmentState8(iface);
103 FIXME("(%p, %p): stub\n", This, pmtStart);
104 return S_OK;
107 static HRESULT WINAPI DirectMusicSegmentState8_GetSeek(IDirectMusicSegmentState8 *iface, MUSIC_TIME* pmtSeek)
109 IDirectMusicSegmentState8Impl *This = impl_from_IDirectMusicSegmentState8(iface);
110 FIXME("(%p, %p): stub\n", This, pmtSeek);
111 return S_OK;
114 static HRESULT WINAPI DirectMusicSegmentState8_GetStartPoint(IDirectMusicSegmentState8 *iface, MUSIC_TIME* pmtStart)
116 IDirectMusicSegmentState8Impl *This = impl_from_IDirectMusicSegmentState8(iface);
117 FIXME("(%p, %p): stub\n", This, pmtStart);
118 return S_OK;
121 static HRESULT WINAPI DirectMusicSegmentState8_SetTrackConfig(IDirectMusicSegmentState8 *iface, REFGUID rguidTrackClassID, DWORD dwGroupBits, DWORD dwIndex, DWORD dwFlagsOn, DWORD dwFlagsOff) {
122 IDirectMusicSegmentState8Impl *This = impl_from_IDirectMusicSegmentState8(iface);
123 FIXME("(%p, %s, %d, %d, %d, %d): stub\n", This, debugstr_dmguid(rguidTrackClassID), dwGroupBits, dwIndex, dwFlagsOn, dwFlagsOff);
124 return S_OK;
127 static HRESULT WINAPI DirectMusicSegmentState8_GetObjectInPath(IDirectMusicSegmentState8 *iface, DWORD dwPChannel, DWORD dwStage, DWORD dwBuffer, REFGUID guidObject, DWORD dwIndex, REFGUID iidInterface, void** ppObject) {
128 IDirectMusicSegmentState8Impl *This = impl_from_IDirectMusicSegmentState8(iface);
129 FIXME("(%p, %d, %d, %d, %s, %d, %s, %p): stub\n", This, dwPChannel, dwStage, dwBuffer, debugstr_dmguid(guidObject), dwIndex, debugstr_dmguid(iidInterface), ppObject);
130 return S_OK;
133 static const IDirectMusicSegmentState8Vtbl DirectMusicSegmentState8Vtbl = {
134 DirectMusicSegmentState8_QueryInterface,
135 DirectMusicSegmentState8_AddRef,
136 DirectMusicSegmentState8_Release,
137 DirectMusicSegmentState8_GetRepeats,
138 DirectMusicSegmentState8_GetSegment,
139 DirectMusicSegmentState8_GetStartTime,
140 DirectMusicSegmentState8_GetSeek,
141 DirectMusicSegmentState8_GetStartPoint,
142 DirectMusicSegmentState8_SetTrackConfig,
143 DirectMusicSegmentState8_GetObjectInPath
146 /* for ClassFactory */
147 HRESULT WINAPI create_dmsegmentstate(REFIID riid, void **ret_iface)
149 IDirectMusicSegmentState8Impl* obj;
150 HRESULT hr;
152 *ret_iface = NULL;
154 obj = HeapAlloc (GetProcessHeap(), 0, sizeof(IDirectMusicSegmentState8Impl));
155 if (!obj)
156 return E_OUTOFMEMORY;
158 obj->IDirectMusicSegmentState8_iface.lpVtbl = &DirectMusicSegmentState8Vtbl;
159 obj->ref = 1;
161 hr = IDirectMusicSegmentState8_QueryInterface(&obj->IDirectMusicSegmentState8_iface, riid, ret_iface);
162 IDirectMusicSegmentState8_Release(&obj->IDirectMusicSegmentState8_iface);
163 return hr;