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"
23 WINE_DEFAULT_DEBUG_CHANNEL(dmime
);
25 typedef struct IDirectMusicSegmentState8Impl
{
26 IDirectMusicSegmentState8 IDirectMusicSegmentState8_iface
;
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
);
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
;
55 WARN("(%p, %s, %p): not found\n", This
, debugstr_dmguid(riid
), ppobj
);
59 static ULONG WINAPI
DirectMusicSegmentState8_AddRef(IDirectMusicSegmentState8
*iface
)
61 IDirectMusicSegmentState8Impl
*This
= impl_from_IDirectMusicSegmentState8(iface
);
62 ULONG ref
= InterlockedIncrement(&This
->ref
);
64 TRACE("(%p): %ld\n", This
, 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): %ld\n", This
, ref
);
79 HeapFree(GetProcessHeap(), 0, This
);
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
);
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
);
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
);
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
);
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
);
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, %ld, %ld, %ld, %ld): stub\n", This
, debugstr_dmguid(rguidTrackClassID
), dwGroupBits
, dwIndex
, dwFlagsOn
, dwFlagsOff
);
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, %ld, %ld, %ld, %s, %ld, %s, %p): stub\n", This
, dwPChannel
, dwStage
, dwBuffer
, debugstr_dmguid(guidObject
), dwIndex
, debugstr_dmguid(iidInterface
), ppObject
);
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
;
154 obj
= HeapAlloc (GetProcessHeap(), 0, sizeof(IDirectMusicSegmentState8Impl
));
156 return E_OUTOFMEMORY
;
158 obj
->IDirectMusicSegmentState8_iface
.lpVtbl
= &DirectMusicSegmentState8Vtbl
;
161 hr
= IDirectMusicSegmentState8_QueryInterface(&obj
->IDirectMusicSegmentState8_iface
, riid
, ret_iface
);
162 IDirectMusicSegmentState8_Release(&obj
->IDirectMusicSegmentState8_iface
);