rtoss - Blame information for rev 26

Subversion Repositories:
Rev:
Rev Author Line No. Line
14 roytam 1 #include "maplay.h"
2 #include "player.h"
3  
4 #if defined(MAPLAY_EXPORTS) && !defined(_WIN32_WCE)
5 BOOL __declspec(dllexport) APIENTRY DllMain( HANDLE hModule,
6                        DWORD  ul_reason_for_call,
7                        LPVOID lpReserved
8                                          )
9 {
10     return TRUE;
11 }
12 #endif
13  
14 HANDLE WINAPI MAP_Initialize()
15 {
16         CPlayer* pPlayer = new CPlayer();
17         return pPlayer;
18 }
19  
20 void WINAPI MAP_Uninitialize(HANDLE hLib)
21 {
22         CPlayer* pPlayer = (CPlayer*) hLib;
23         delete pPlayer;
24 }
25  
26 BOOL WINAPI MAP_Open(HANDLE hLib, LPCTSTR pszFile)
27 {
28         CPlayer* pPlayer = (CPlayer*) hLib;
29         return pPlayer->OpenFile(pszFile);
30 }
31  
32 void WINAPI MAP_Close(HANDLE hLib)
33 {
34         CPlayer* pPlayer = (CPlayer*) hLib;
35         pPlayer->Close();
36 }
37  
38 BOOL WINAPI MAP_Play(HANDLE hLib)
39 {
40         CPlayer* pPlayer = (CPlayer*) hLib;
41         return pPlayer->Play();
42 }
43  
44 void WINAPI MAP_Stop(HANDLE hLib)
45 {
46         CPlayer* pPlayer = (CPlayer*) hLib;
47         pPlayer->Stop();
48 }
49  
50 void WINAPI MAP_Pause(HANDLE hLib)
51 {
52         CPlayer* pPlayer = (CPlayer*) hLib;
53         pPlayer->Pause();
54 }
55  
56 BOOL WINAPI MAP_Ff(HANDLE hLib, long lSkip)
57 {
58         CPlayer* pPlayer = (CPlayer*) hLib;
59         return pPlayer->Ff(lSkip);
60 }
61  
62 BOOL WINAPI MAP_Rew(HANDLE hLib, long lSkip)
63 {
64         CPlayer* pPlayer = (CPlayer*) hLib;
65         return pPlayer->Rew(lSkip);
66 }
67  
68 BOOL WINAPI MAP_Seek(HANDLE hLib, long lTime)
69 {
70         CPlayer* pPlayer = (CPlayer*) hLib;
71         return pPlayer->Seek(lTime);
72 }
73  
74 long WINAPI MAP_GetDuration(HANDLE hLib)
75 {
76         CPlayer* pPlayer = (CPlayer*) hLib;
77         return pPlayer->GetDuration();
78 }
79  
80 BOOL WINAPI MAP_IsValidStream(HANDLE hLib, LPCTSTR pszFile)
81 {
82         CPlayer* pPlayer = (CPlayer*) hLib;
83  
84         if (IsValidFile(pszFile))
85                 return TRUE;
86  
87         if (pPlayer->OvIsValidFile(pszFile))
88                 return TRUE;
89  
90         if (pPlayer->WavIsValidFile(pszFile))
91                 return TRUE;
92  
93         if (pPlayer->PlugInIsValidFile(pszFile))
94                 return TRUE;
95  
96         return FALSE;
97 }
98  
99 void WINAPI MAP_SetMessageWindow(HANDLE hLib, HWND hwndMessage)
100 {
101         CPlayer* pPlayer = (CPlayer*) hLib;
102         pPlayer->SetMessageWindow(hwndMessage);
103 }
104  
105 long WINAPI MAP_GetCurrent(HANDLE hLib)
106 {
107         CPlayer* pPlayer = (CPlayer*) hLib;
108         return pPlayer->GetCurrent();
109 }
110  
111 void WINAPI MAP_SetEqualizer(HANDLE hLib, EQUALIZER* value)
112 {
113         CPlayer* pPlayer = (CPlayer*) hLib;
114         pPlayer->SetEqualizer(value);
115 }
116 void WINAPI MAP_GetEqualizer(HANDLE hLib, EQUALIZER* value)
117 {
118         CPlayer* pPlayer = (CPlayer*) hLib;
119         pPlayer->GetEqualizer(value);
120 }
121  
122 void WINAPI MAP_SetEffect(HANDLE hLib, int nEffect, EFFECT* value)
123 {
124         CPlayer* pPlayer = (CPlayer*) hLib;
125         pPlayer->SetEffect(nEffect, value);
126 }
127  
128 void WINAPI MAP_GetEffect(HANDLE hLib, int nEffect, EFFECT* value)
129 {
130         CPlayer* pPlayer = (CPlayer*) hLib;
131         pPlayer->GetEffect(nEffect, value);
132 }
133  
134 void WINAPI MAP_SetBassBoostLevel(HANDLE hLib, int nLevel)
135 {
136         CPlayer* pPlayer = (CPlayer*) hLib;
137         pPlayer->SetBassBoostLevel(nLevel);
138 }
139  
140 int WINAPI MAP_GetBassBoostLevel(HANDLE hLib)
141 {
142         CPlayer* pPlayer = (CPlayer*) hLib;
143         return pPlayer->GetBassBoostLevel();
144 }
145  
146 void WINAPI MAP_GetFileInfo(HANDLE hLib, MAP_INFORMATION* pInfo)
147 {
148         CPlayer* pPlayer = (CPlayer*) hLib;
149         pPlayer->GetFileInformation(pInfo);
150 }
151  
152 BOOL WINAPI MAP_GetId3Tag(HANDLE hLib, ID3TAGV1* pTag)
153 {
154         CPlayer* pPlayer = (CPlayer*) hLib;
155         return pPlayer->GetId3Tag(pTag);
156 }
157  
158 BOOL WINAPI MAP_SetId3Tag(HANDLE hLib, ID3TAGV1* pTag)
159 {
160         CPlayer* pPlayer = (CPlayer*) hLib;
161         return pPlayer->SetId3Tag(pTag);
162 }
163  
164 void WINAPI MAP_GetGenreString(HANDLE hLib, int nGenre, LPTSTR pszGenre)
165 {
166         if (nGenre >= 0 && nGenre <= 147)
167                 _tcscpy(pszGenre, genre_strings[nGenre]);
168 }
169  
170 BOOL WINAPI MAP_GetId3TagFile(HANDLE hLib, LPCTSTR pszFile, ID3TAGV1* pTag)
171 {
172         CPlayer* pPlayer = (CPlayer*) hLib;
173         if (pPlayer->PlugInGetId3TagFile(pszFile, pTag))
174                 return TRUE;
175  
176         if (pPlayer->OvGetId3TagFile(pszFile, pTag))
177                 return TRUE;
178  
179         if (!IsValidFile(pszFile))
180                 return FALSE;
181  
182         return GetId3Tag(pszFile, pTag);
183 }
184  
185 BOOL WINAPI MAP_SetId3TagFile(LPCTSTR pszFile, ID3TAGV1* pTag)
186 {
187         return SetId3Tag(pszFile, pTag);
188 }
189  
190 MAP_STATUS WINAPI MAP_GetStatus(HANDLE hLib)
191 {
192         CPlayer* pPlayer = (CPlayer*) hLib;
193         return pPlayer->GetStatus();
194 }
195  
196 BOOL WINAPI MAP_SetOptions(HANDLE hLib, MAP_OPTIONS* pOptions)
197 {
198         CPlayer* pPlayer = (CPlayer*) hLib;
199         return pPlayer->SetOptions(pOptions);
200 }
201  
202 void WINAPI MAP_GetOptions(HANDLE hLib, MAP_OPTIONS* pOptions)
203 {
204         CPlayer* pPlayer = (CPlayer*) hLib;
205         pPlayer->GetOptions(pOptions);
206 }
207  
208 BOOL WINAPI MAP_GetScanPeek(HANDLE hLib)
209 {
210         CPlayer* pPlayer = (CPlayer*) hLib;
211         return pPlayer->GetScanPeek();
212 }
213  
214 void WINAPI MAP_SetScanPeek(HANDLE hLib, BOOL fScan)
215 {
216         CPlayer* pPlayer = (CPlayer*) hLib;
217         pPlayer->SetScanPeek(fScan);
218 }
219  
220 void WINAPI MAP_AudioDeviceClose(HANDLE hLib)
221 {
222         CPlayer* pPlayer = (CPlayer*) hLib;
223         pPlayer->AudioDeviceClose();
224 }
225  
226 void WINAPI MAP_GetBufferInfo(HANDLE hLib, DWORD* pcbTotalAudio, DWORD* pcbBufferedAudio,
227                                                                          DWORD* pcbTotalStream, DWORD* pcbBufferedStream)
228 {
229         CPlayer* pPlayer = (CPlayer*) hLib;
230         pPlayer->GetBufferInfo(pcbTotalAudio, pcbBufferedAudio, pcbTotalStream, pcbBufferedStream);
231 }
232  
233 // for streaming
234 BOOL WINAPI MAP_OpenURL(HANDLE hLib, LPCTSTR pszURL)
235 {
236         CPlayer* pPlayer = (CPlayer*) hLib;
237         return pPlayer->OpenURL(pszURL);
238 }
239  
240 BOOL WINAPI MAP_GetStreamInfo(HANDLE hLib, LPTSTR pszName, LPTSTR pszGenre, LPTSTR pszURL)
241 {
242         CPlayer* pPlayer = (CPlayer*) hLib;
243         return pPlayer->GetStreamInfo(pszName, pszGenre, pszURL);
244 }
245  
246 BOOL WINAPI MAP_GetStreamTitle(HANDLE hLib, LPTSTR pszTitle)
247 {
248         CPlayer* pPlayer = (CPlayer*) hLib;
249         return pPlayer->GetStreamTitle(pszTitle);
250 }
251  
252 BOOL WINAPI MAP_SetStreamingOptions(HANDLE hLib, MAP_STREAMING_OPTIONS* pOptions)
253 {
254         CPlayer* pPlayer = (CPlayer*) hLib;
255         return pPlayer->SetStreamingOptions(pOptions);
256 }
257  
258 void WINAPI MAP_GetStreamingOptions(HANDLE hLib, MAP_STREAMING_OPTIONS* pOptions)
259 {
260         CPlayer* pPlayer = (CPlayer*) hLib;
261         pPlayer->GetStreamingOptions(pOptions);
262 }
263  
264 MAP_STREAMING_STATUS WINAPI MAP_GetStreamingStatus(HANDLE hLib)
265 {
266         CPlayer* pPlayer = (CPlayer*) hLib;
267         return pPlayer->GetStreamingStatus();
268 }
269  
270 int WINAPI MAP_GetStreamingBufferingCount(HANDLE hLib)
271 {
272         CPlayer* pPlayer = (CPlayer*) hLib;
273         return pPlayer->GetStreamingBufferingCount();
274 }
275  
276 int WINAPI MAP_GetDecoderPlugInCount(HANDLE hLib)
277 {
278         CPlayer* pPlayer = (CPlayer*) hLib;
279         return pPlayer->PlugInGetCount();
280 }
281  
282 MAP_DEC_PLUGIN* WINAPI MAP_GetDecoderPlugIn(HANDLE hLib, int nIndex)
283 {
284         CPlayer* pPlayer = (CPlayer*) hLib;
285         return pPlayer->PlugInGetInterface(nIndex);
26 roytam 286 }
287  
288 DWORD WINAPI MAP_GetVolume(HANDLE hLib, BOOL bSysVolume)
289 {
290         CPlayer* pPlayer = (CPlayer*) hLib;
291         return pPlayer->GetVolume(bSysVolume);
292 }
293  
294 void WINAPI MAP_SetVolume(HANDLE hLib, DWORD dwVolume, BOOL bSysVolume)
295 {
296         CPlayer* pPlayer = (CPlayer*) hLib;
297         pPlayer->SetVolume(dwVolume, bSysVolume);
298 }