Enable the display of a true type bitmap for true type fonts.
[wine] / dlls / dmsynth / synthsink.c
1 /* IDirectMusicSynthSink Implementation
2  *
3  * Copyright (C) 2003 Rok Mandeljc
4  *
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.
9  *
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.
14  *
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.
18  */
19
20 #include <stdarg.h>
21
22 #include "windef.h"
23 #include "winbase.h"
24 #include "winuser.h"
25 #include "wingdi.h"
26 #include "wine/debug.h"
27
28 #include "dmsynth_private.h"
29
30 WINE_DEFAULT_DEBUG_CHANNEL(dmsynth);
31
32 /* IDirectMusicSynthSink IUnknown part: */
33 HRESULT WINAPI IDirectMusicSynthSinkImpl_QueryInterface (LPDIRECTMUSICSYNTHSINK iface, REFIID riid, LPVOID *ppobj)
34 {
35         ICOM_THIS(IDirectMusicSynthSinkImpl,iface);
36
37         if (IsEqualIID (riid, &IID_IUnknown) || 
38             IsEqualIID (riid, &IID_IDirectMusicSynthSink)) {
39                 IDirectMusicSynthSinkImpl_AddRef(iface);
40                 *ppobj = This;
41                 return S_OK;
42         }
43
44         WARN("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppobj);
45         return E_NOINTERFACE;
46 }
47
48 ULONG WINAPI IDirectMusicSynthSinkImpl_AddRef (LPDIRECTMUSICSYNTHSINK iface)
49 {
50         ICOM_THIS(IDirectMusicSynthSinkImpl,iface);
51         TRACE("(%p) : AddRef from %ld\n", This, This->ref);
52         return ++(This->ref);
53 }
54
55 ULONG WINAPI IDirectMusicSynthSinkImpl_Release (LPDIRECTMUSICSYNTHSINK iface)
56 {
57         ICOM_THIS(IDirectMusicSynthSinkImpl,iface);
58         ULONG ref = --This->ref;
59         TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
60         if (ref == 0) {
61                 HeapFree(GetProcessHeap(), 0, This);
62         }
63         return ref;
64 }
65
66 /* IDirectMusicSynth IDirectMusicSynth part: */
67 HRESULT WINAPI IDirectMusicSynthSinkImpl_Init (LPDIRECTMUSICSYNTHSINK iface, IDirectMusicSynth* pSynth)
68 {
69         ICOM_THIS(IDirectMusicSynthSinkImpl,iface);
70
71         FIXME("(%p, %p): stub\n", This, pSynth);
72
73         return S_OK;
74 }
75
76 HRESULT WINAPI IDirectMusicSynthSinkImpl_SetMasterClock (LPDIRECTMUSICSYNTHSINK iface, IReferenceClock* pClock)
77 {
78         ICOM_THIS(IDirectMusicSynthSinkImpl,iface);
79
80         FIXME("(%p, %p): stub\n", This, pClock);
81
82         return S_OK;
83 }
84
85 HRESULT WINAPI IDirectMusicSynthSinkImpl_GetLatencyClock (LPDIRECTMUSICSYNTHSINK iface, IReferenceClock** ppClock)
86 {
87         ICOM_THIS(IDirectMusicSynthSinkImpl,iface);
88
89         FIXME("(%p, %p): stub\n", This, ppClock);
90
91         return S_OK;
92 }
93
94 HRESULT WINAPI IDirectMusicSynthSinkImpl_Activate (LPDIRECTMUSICSYNTHSINK iface, BOOL fEnable)
95 {
96         ICOM_THIS(IDirectMusicSynthSinkImpl,iface);
97
98         FIXME("(%p, %d): stub\n", This, fEnable);
99
100         return S_OK;
101 }
102
103 HRESULT WINAPI IDirectMusicSynthSinkImpl_SampleToRefTime (LPDIRECTMUSICSYNTHSINK iface, LONGLONG llSampleTime, REFERENCE_TIME* prfTime)
104 {
105         ICOM_THIS(IDirectMusicSynthSinkImpl,iface);
106
107         FIXME("(%p, %lli, %p): stub\n", This, llSampleTime, prfTime);
108
109         return S_OK;
110 }
111
112 HRESULT WINAPI IDirectMusicSynthSinkImpl_RefTimeToSample (LPDIRECTMUSICSYNTHSINK iface, REFERENCE_TIME rfTime, LONGLONG* pllSampleTime)
113 {
114         ICOM_THIS(IDirectMusicSynthSinkImpl,iface);
115
116         FIXME("(%p, %lli, %p): stub\n", This, rfTime, pllSampleTime );
117
118         return S_OK;
119 }
120
121 HRESULT WINAPI IDirectMusicSynthSinkImpl_SetDirectSound (LPDIRECTMUSICSYNTHSINK iface, LPDIRECTSOUND pDirectSound, LPDIRECTSOUNDBUFFER pDirectSoundBuffer)
122 {
123         ICOM_THIS(IDirectMusicSynthSinkImpl,iface);
124
125         FIXME("(%p, %p, %p): stub\n", This, pDirectSound, pDirectSoundBuffer);
126
127         return S_OK;
128 }
129
130 HRESULT WINAPI IDirectMusicSynthSinkImpl_GetDesiredBufferSize (LPDIRECTMUSICSYNTHSINK iface, LPDWORD pdwBufferSizeInSamples)
131 {
132         ICOM_THIS(IDirectMusicSynthSinkImpl,iface);
133
134         FIXME("(%p, %p): stub\n", This, pdwBufferSizeInSamples);
135
136         return S_OK;
137 }
138
139 ICOM_VTABLE(IDirectMusicSynthSink) DirectMusicSynthSink_Vtbl =
140 {
141     ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
142         IDirectMusicSynthSinkImpl_QueryInterface,
143         IDirectMusicSynthSinkImpl_AddRef,
144         IDirectMusicSynthSinkImpl_Release,
145         IDirectMusicSynthSinkImpl_Init,
146         IDirectMusicSynthSinkImpl_SetMasterClock,
147         IDirectMusicSynthSinkImpl_GetLatencyClock,
148         IDirectMusicSynthSinkImpl_Activate,
149         IDirectMusicSynthSinkImpl_SampleToRefTime,
150         IDirectMusicSynthSinkImpl_RefTimeToSample,
151         IDirectMusicSynthSinkImpl_SetDirectSound,
152         IDirectMusicSynthSinkImpl_GetDesiredBufferSize
153 };
154
155 /* for ClassFactory */
156 HRESULT WINAPI DMUSIC_CreateDirectMusicSynthSink (LPCGUID lpcGUID, LPDIRECTMUSICSYNTHSINK* ppDMSynthSink, LPUNKNOWN pUnkOuter)
157 {
158         IDirectMusicSynthSinkImpl *dmsink;
159         
160         TRACE("(%p,%p,%p)\n", lpcGUID, ppDMSynthSink, pUnkOuter);
161         if (IsEqualIID (lpcGUID, &IID_IDirectMusicSynthSink)) {
162                 dmsink = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicSynthSinkImpl));
163                 if (NULL == dmsink) {
164                         *ppDMSynthSink = (LPDIRECTMUSICSYNTHSINK) NULL;
165                         return E_OUTOFMEMORY;
166                 }
167                 dmsink->lpVtbl = &DirectMusicSynthSink_Vtbl;
168                 dmsink->ref = 1;
169                 *ppDMSynthSink = (LPDIRECTMUSICSYNTHSINK) dmsink;
170                 return S_OK;
171         }
172         
173         WARN("No interface found\n");
174         return E_NOINTERFACE;
175 }