]>
Commit | Line | Data |
---|---|---|
667ae9fe JB |
1 | From: Denis Oliver Kropp <dok@shizo.directfb.home> |
2 | Date: Thu, 28 Feb 2008 13:56:34 +0000 (+0100) | |
3 | Subject: [fusionsound] Follow API changes, removing remaining dependencies on <directfb.h>. | |
4 | X-Git-Url: http://git.directfb.org/?p=core%2FFusionSound.git;a=commitdiff_plain;h=3195b24014b5678b934db021a6958fcae9c09bb9 | |
5 | ||
6 | [fusionsound] Follow API changes, removing remaining dependencies on <directfb.h>. | |
7 | --- | |
8 | ||
9 | diff --git a/drivers/alsa.c b/drivers/alsa.c | |
10 | index 6b685d7..53c35a8 100644 | |
11 | --- a/drivers/alsa.c | |
12 | +++ b/drivers/alsa.c | |
13 | @@ -108,7 +108,7 @@ alsa_device_get_devname( const CoreSoundDeviceConfig *config ) | |
14 | return "default"; | |
15 | } | |
16 | ||
17 | -static DFBResult | |
18 | +static DirectResult | |
19 | alsa_device_set_configuration( snd_pcm_t *handle, | |
20 | CoreSoundDeviceConfig *config ) | |
21 | { | |
22 | @@ -124,7 +124,7 @@ alsa_device_set_configuration( snd_pcm_t *handle, | |
23 | ||
24 | if (snd_pcm_hw_params_any( handle, params ) < 0) { | |
25 | D_ERROR( "FusionSound/Device/Alsa: couldn't get hw params!\n" ); | |
26 | - return DFB_FAILURE; | |
27 | + return DR_FAILURE; | |
28 | } | |
29 | ||
30 | if (snd_pcm_hw_params_set_access( handle, params, | |
31 | @@ -133,19 +133,19 @@ alsa_device_set_configuration( snd_pcm_t *handle, | |
32 | : SND_PCM_ACCESS_RW_INTERLEAVED ) < 0) { | |
33 | D_ERROR( "FusionSound/Device/Alsa: couldn't set interleaved %saccess!\n", | |
34 | fs_config->dma ? "DMA " : "" ); | |
35 | - return DFB_FAILURE; | |
36 | + return DR_FAILURE; | |
37 | } | |
38 | ||
39 | if (snd_pcm_hw_params_set_format( handle, params, | |
40 | fs2alsa_format( config->format ) ) < 0) { | |
41 | D_ERROR( "FusionSound/Device/Alsa: couldn't set format!\n" ); | |
42 | - return DFB_UNSUPPORTED; | |
43 | + return DR_UNSUPPORTED; | |
44 | } | |
45 | ||
46 | if (snd_pcm_hw_params_set_channels( handle, params, | |
47 | FS_CHANNELS_FOR_MODE(config->mode) ) < 0) { | |
48 | D_ERROR( "FusionSound/Device/Alsa: couldn't set channels mode!\n" ); | |
49 | - return DFB_UNSUPPORTED; | |
50 | + return DR_UNSUPPORTED; | |
51 | } | |
52 | ||
53 | #if SND_LIB_VERSION >= 0x010009 | |
54 | @@ -157,14 +157,14 @@ alsa_device_set_configuration( snd_pcm_t *handle, | |
55 | if (snd_pcm_hw_params_set_rate_near( handle, params, | |
56 | &config->rate, &dir ) < 0) { | |
57 | D_ERROR( "FusionSound/Device/Alsa: couldn't set rate!\n" ); | |
58 | - return DFB_UNSUPPORTED; | |
59 | + return DR_UNSUPPORTED; | |
60 | } | |
61 | ||
62 | dir = 0; | |
63 | if (snd_pcm_hw_params_set_buffer_time_near( handle, params, | |
64 | &buffertime, &dir ) < 0) { | |
65 | D_ERROR( "FusionSound/Device/Alsa: couldn't set buffertime!\n" ); | |
66 | - return DFB_UNSUPPORTED; | |
67 | + return DR_UNSUPPORTED; | |
68 | } | |
69 | ||
70 | dir = 1; | |
71 | @@ -172,12 +172,12 @@ alsa_device_set_configuration( snd_pcm_t *handle, | |
72 | if (snd_pcm_hw_params_set_periods_near( handle, params, | |
73 | &periods, &dir ) < 0) { | |
74 | D_ERROR( "FusionSound/Device/Alsa: couldn't set period count!\n" ); | |
75 | - return DFB_UNSUPPORTED; | |
76 | + return DR_UNSUPPORTED; | |
77 | } | |
78 | ||
79 | if (snd_pcm_hw_params( handle, params ) < 0) { | |
80 | D_ERROR( "FusionSound/Device/Alsa: couldn't set hw params!\n" ); | |
81 | - return DFB_UNSUPPORTED; | |
82 | + return DR_UNSUPPORTED; | |
83 | } | |
84 | ||
85 | /* Workaround for ALSA >= 1.0.9 always returning the maximum supported buffersize. */ | |
86 | @@ -191,37 +191,37 @@ alsa_device_set_configuration( snd_pcm_t *handle, | |
87 | ||
88 | if (snd_pcm_prepare( handle ) < 0) { | |
89 | D_ERROR( "FusionSound/Device/Alsa: couldn't prepare stream!\n" ); | |
90 | - return DFB_FAILURE; | |
91 | + return DR_FAILURE; | |
92 | } | |
93 | ||
94 | - return DFB_OK; | |
95 | + return DR_OK; | |
96 | } | |
97 | ||
98 | -static DFBResult | |
99 | +static DirectResult | |
100 | alsa_device_getset_volume( float *get, float *set ) | |
101 | { | |
102 | - DFBResult ret = DFB_OK; | |
103 | + DirectResult ret = DR_OK; | |
104 | snd_mixer_t *mixer; | |
105 | snd_mixer_selem_id_t *sid; | |
106 | snd_mixer_elem_t *elem; | |
107 | long vol, min, max; | |
108 | ||
109 | if (snd_mixer_open( &mixer, 0 ) < 0) | |
110 | - return DFB_IO; | |
111 | + return DR_IO; | |
112 | ||
113 | if (snd_mixer_attach( mixer, fs_config->device ? : "default" ) < 0) { | |
114 | snd_mixer_close( mixer ); | |
115 | - return DFB_FAILURE; | |
116 | + return DR_FAILURE; | |
117 | } | |
118 | ||
119 | if (snd_mixer_selem_register( mixer, NULL, NULL ) < 0) { | |
120 | snd_mixer_close( mixer ); | |
121 | - return DFB_FAILURE; | |
122 | + return DR_FAILURE; | |
123 | } | |
124 | ||
125 | if (snd_mixer_load( mixer ) < 0) { | |
126 | snd_mixer_close( mixer ); | |
127 | - return DFB_FAILURE; | |
128 | + return DR_FAILURE; | |
129 | } | |
130 | ||
131 | snd_mixer_selem_id_malloc( &sid ); | |
132 | @@ -230,7 +230,7 @@ alsa_device_getset_volume( float *get, float *set ) | |
133 | elem = snd_mixer_find_selem( mixer, sid ); | |
134 | if (!elem) { | |
135 | snd_mixer_close( mixer ); | |
136 | - return DFB_UNSUPPORTED; | |
137 | + return DR_UNSUPPORTED; | |
138 | } | |
139 | ||
140 | snd_mixer_selem_get_playback_volume_range( elem, &min, &max ); | |
141 | @@ -239,12 +239,12 @@ alsa_device_getset_volume( float *get, float *set ) | |
142 | vol = *set * (float)(max - min) + min; | |
143 | ||
144 | if (snd_mixer_selem_set_playback_volume_all( elem, vol ) < 0) | |
145 | - ret = DFB_UNSUPPORTED; | |
146 | + ret = DR_UNSUPPORTED; | |
147 | } | |
148 | else { | |
149 | /* Assume equal level for all channels */ | |
150 | if (snd_mixer_selem_get_playback_volume( elem, 0, &vol ) < 0) | |
151 | - ret = DFB_UNSUPPORTED; | |
152 | + ret = DR_UNSUPPORTED; | |
153 | else | |
154 | *get = (float)(vol - min) / (float)(max - min); | |
155 | } | |
156 | @@ -257,7 +257,7 @@ alsa_device_getset_volume( float *get, float *set ) | |
157 | /******************************************************************************/ | |
158 | ||
159 | ||
160 | -static DFBResult | |
161 | +static DirectResult | |
162 | device_probe( void ) | |
163 | { | |
164 | snd_pcm_t *handle; | |
165 | @@ -265,10 +265,10 @@ device_probe( void ) | |
166 | if (snd_pcm_open( &handle, fs_config->device ? : "default", | |
167 | SND_PCM_STREAM_PLAYBACK, SND_PCM_NONBLOCK ) == 0) { | |
168 | snd_pcm_close( handle ); | |
169 | - return DFB_OK; | |
170 | + return DR_OK; | |
171 | } | |
172 | ||
173 | - return DFB_UNSUPPORTED; | |
174 | + return DR_UNSUPPORTED; | |
175 | } | |
176 | ||
177 | static void | |
178 | @@ -296,7 +296,7 @@ device_get_driver_info( SoundDriverInfo *info ) | |
179 | info->device_data_size = sizeof(AlsaDeviceData); | |
180 | } | |
181 | ||
182 | -static DFBResult | |
183 | +static DirectResult | |
184 | device_open( void *device_data, | |
185 | SoundDeviceInfo *device_info, | |
186 | CoreSoundDeviceConfig *config ) | |
187 | @@ -305,18 +305,18 @@ device_open( void *device_data, | |
188 | const char *dev; | |
189 | snd_ctl_t *ctl; | |
190 | snd_ctl_card_info_t *info; | |
191 | - DFBResult ret; | |
192 | + DirectResult ret; | |
193 | ||
194 | dev = fs_config->device ? : alsa_device_get_devname( config ); | |
195 | ||
196 | if (snd_pcm_open( &data->handle, dev, SND_PCM_STREAM_PLAYBACK, SND_PCM_NONBLOCK ) < 0) { | |
197 | D_ERROR( "FusionSound/Device/Alsa: couldn't open pcm device '%s'!\n", dev ); | |
198 | - return DFB_IO; | |
199 | + return DR_IO; | |
200 | } | |
201 | ||
202 | if (snd_pcm_nonblock( data->handle, 0 ) < 0) { | |
203 | D_ERROR( "FusionSound/Device/Alsa: couldn't disable non-blocking mode!\n" ); | |
204 | - return DFB_IO; | |
205 | + return DR_IO; | |
206 | } | |
207 | ||
208 | /* device name */ | |
209 | @@ -357,7 +357,7 @@ device_open( void *device_data, | |
210 | D_INFO( "FusionSound/Device/ALSA: DMA enabled.\n" ); | |
211 | } | |
212 | ||
213 | - return DFB_OK; | |
214 | + return DR_OK; | |
215 | } | |
216 | ||
217 | static int | |
218 | @@ -382,7 +382,7 @@ try_recover( snd_pcm_t *handle, int err ) | |
219 | return err; | |
220 | } | |
221 | ||
222 | -static DFBResult | |
223 | +static DirectResult | |
224 | device_get_buffer( void *device_data, u8 **addr, unsigned int *avail ) | |
225 | { | |
226 | AlsaDeviceData *data = device_data; | |
227 | @@ -403,7 +403,7 @@ device_get_buffer( void *device_data, u8 **addr, unsigned int *avail ) | |
228 | if (r < 0) { | |
229 | D_ERROR( "FusionSound/Device/ALSA: snd_pcm_avail_update() failed: %s\n", | |
230 | snd_strerror( r ) ); | |
231 | - return DFB_FAILURE; | |
232 | + return DR_FAILURE; | |
233 | } | |
234 | continue; | |
235 | } | |
236 | @@ -417,7 +417,7 @@ device_get_buffer( void *device_data, u8 **addr, unsigned int *avail ) | |
237 | if (r < 0) { | |
238 | D_ERROR( "FusionSound/Device/ALSA: snd_pcm_avail_update() failed: %s\n", | |
239 | snd_strerror( r ) ); | |
240 | - return DFB_FAILURE; | |
241 | + return DR_FAILURE; | |
242 | } | |
243 | continue; | |
244 | } | |
245 | @@ -429,7 +429,7 @@ device_get_buffer( void *device_data, u8 **addr, unsigned int *avail ) | |
246 | if (r < 0) { | |
247 | D_ERROR( "FusionSound/Device/ALSA: snd_pcm_mmap_begin() failed: %s\n", | |
248 | snd_strerror( r ) ); | |
249 | - return DFB_FAILURE; | |
250 | + return DR_FAILURE; | |
251 | } | |
252 | continue; | |
253 | } | |
254 | @@ -441,10 +441,10 @@ device_get_buffer( void *device_data, u8 **addr, unsigned int *avail ) | |
255 | } | |
256 | } | |
257 | ||
258 | - return DFB_OK; | |
259 | + return DR_OK; | |
260 | } | |
261 | ||
262 | -static DFBResult | |
263 | +static DirectResult | |
264 | device_commit_buffer( void *device_data, unsigned int frames ) | |
265 | { | |
266 | AlsaDeviceData *data = device_data; | |
267 | @@ -460,7 +460,7 @@ device_commit_buffer( void *device_data, unsigned int frames ) | |
268 | if (r < 0) { | |
269 | D_ERROR( "FusionSound/Device/ALSA: snd_pcm_writei() failed: %s\n", | |
270 | snd_strerror( r ) ); | |
271 | - return DFB_FAILURE; | |
272 | + return DR_FAILURE; | |
273 | } | |
274 | } | |
275 | frames -= r; | |
276 | @@ -475,7 +475,7 @@ device_commit_buffer( void *device_data, unsigned int frames ) | |
277 | if (r < 0) { | |
278 | D_ERROR( "FusionSound/Device/ALSA: snd_pcm_mmap_commit() failed: %s\n", | |
279 | snd_strerror( r ) ); | |
280 | - return DFB_FAILURE; | |
281 | + return DR_FAILURE; | |
282 | } | |
283 | continue; | |
284 | } | |
285 | @@ -483,7 +483,7 @@ device_commit_buffer( void *device_data, unsigned int frames ) | |
286 | } | |
287 | } | |
288 | ||
289 | - return DFB_OK; | |
290 | + return DR_OK; | |
291 | } | |
292 | ||
293 | static void | |
294 | @@ -496,19 +496,19 @@ device_get_output_delay( void *device_data, int *delay ) | |
295 | *delay = odelay; | |
296 | } | |
297 | ||
298 | -static DFBResult | |
299 | +static DirectResult | |
300 | device_get_volume( void *device_data, float *level ) | |
301 | { | |
302 | return alsa_device_getset_volume( level, NULL ); | |
303 | } | |
304 | ||
305 | -static DFBResult | |
306 | +static DirectResult | |
307 | device_set_volume( void *device_data, float level ) | |
308 | { | |
309 | return alsa_device_getset_volume( NULL, &level ); | |
310 | } | |
311 | ||
312 | -static DFBResult | |
313 | +static DirectResult | |
314 | device_suspend( void *device_data ) | |
315 | { | |
316 | AlsaDeviceData *data = device_data; | |
317 | @@ -517,21 +517,21 @@ device_suspend( void *device_data ) | |
318 | snd_pcm_close( data->handle ); | |
319 | data->handle = NULL; | |
320 | ||
321 | - return DFB_OK; | |
322 | + return DR_OK; | |
323 | } | |
324 | ||
325 | -static DFBResult | |
326 | +static DirectResult | |
327 | device_resume( void *device_data ) | |
328 | { | |
329 | AlsaDeviceData *data = device_data; | |
330 | const char *dev; | |
331 | - DFBResult ret; | |
332 | + DirectResult ret; | |
333 | ||
334 | dev = fs_config->device ? : alsa_device_get_devname( data->config ); | |
335 | ||
336 | if (snd_pcm_open( &data->handle, dev, SND_PCM_STREAM_PLAYBACK, 0 ) < 0) { | |
337 | D_ERROR( "FusionSound/Device/Alsa: couldn't reopen pcm device '%s'!\n", dev ); | |
338 | - return DFB_IO; | |
339 | + return DR_IO; | |
340 | } | |
341 | ||
342 | ret = alsa_device_set_configuration( data->handle, data->config ); | |
343 | diff --git a/drivers/oss.c b/drivers/oss.c | |
344 | index 9e9ce8d..9b3b16e 100644 | |
345 | --- a/drivers/oss.c | |
346 | +++ b/drivers/oss.c | |
347 | @@ -124,7 +124,7 @@ oss2fs_format( int format ) | |
348 | return -1; | |
349 | } | |
350 | ||
351 | -static DFBResult | |
352 | +static DirectResult | |
353 | oss_device_set_configuration( int fd, CoreSoundDeviceConfig *config ) | |
354 | { | |
355 | int fmt; | |
356 | @@ -137,7 +137,7 @@ oss_device_set_configuration( int fd, CoreSoundDeviceConfig *config ) | |
357 | ||
358 | fmt = fs2oss_format( config->format ); | |
359 | if (fmt == -1) | |
360 | - return DFB_UNSUPPORTED; | |
361 | + return DR_UNSUPPORTED; | |
362 | ||
363 | /* set application profile */ | |
364 | #if defined(SNDCTL_DSP_PROFILE) && defined(APF_NORMAL) | |
365 | @@ -149,20 +149,20 @@ oss_device_set_configuration( int fd, CoreSoundDeviceConfig *config ) | |
366 | if (ioctl( fd, SNDCTL_DSP_SETFMT, &fmt ) < 0 || | |
367 | oss2fs_format( fmt ) != config->format) { | |
368 | D_ERROR( "FusionSound/Device/OSS: unsupported format!\n" ); | |
369 | - return DFB_UNSUPPORTED; | |
370 | + return DR_UNSUPPORTED; | |
371 | } | |
372 | ||
373 | /* set number of channels */ | |
374 | if (ioctl( fd, SNDCTL_DSP_CHANNELS, &channels ) < 0 || | |
375 | channels != FS_CHANNELS_FOR_MODE(config->mode)) { | |
376 | D_ERROR( "FusionSound/Device/OSS: unsupported channels mode!\n" ); | |
377 | - return DFB_UNSUPPORTED; | |
378 | + return DR_UNSUPPORTED; | |
379 | } | |
380 | ||
381 | /* set sample rate */ | |
382 | if (ioctl( fd, SNDCTL_DSP_SPEED, &rate ) < 0) { | |
383 | D_ERROR( "FusionSound/Device/OSS: unable to set rate to '%d'!\n", config->rate ); | |
384 | - return DFB_UNSUPPORTED; | |
385 | + return DR_UNSUPPORTED; | |
386 | } | |
387 | ||
388 | /* query block size */ | |
389 | @@ -170,18 +170,18 @@ oss_device_set_configuration( int fd, CoreSoundDeviceConfig *config ) | |
390 | buffersize /= channels * FS_BYTES_PER_SAMPLE(config->format); | |
391 | if (buffersize < 1) { | |
392 | D_ERROR( "FusionSound/Device/OSS: unable to query block size!\n" ); | |
393 | - return DFB_UNSUPPORTED; | |
394 | + return DR_UNSUPPORTED; | |
395 | } | |
396 | ||
397 | config->rate = rate; | |
398 | config->buffersize = buffersize; | |
399 | ||
400 | - return DFB_OK; | |
401 | + return DR_OK; | |
402 | } | |
403 | ||
404 | /******************************************************************************/ | |
405 | ||
406 | -static DFBResult | |
407 | +static DirectResult | |
408 | device_probe( void ) | |
409 | { | |
410 | int fd, fmt; | |
411 | @@ -195,17 +195,17 @@ device_probe( void ) | |
412 | } | |
413 | ||
414 | if (fd < 0) | |
415 | - return DFB_IO; | |
416 | + return DR_IO; | |
417 | ||
418 | /* issue a generic ioctl to test the device */ | |
419 | if (ioctl( fd, SNDCTL_DSP_GETFMTS, &fmt ) < 0) { | |
420 | close( fd ); | |
421 | - return DFB_UNSUPPORTED; | |
422 | + return DR_UNSUPPORTED; | |
423 | } | |
424 | ||
425 | close( fd ); | |
426 | ||
427 | - return DFB_OK; | |
428 | + return DR_OK; | |
429 | } | |
430 | ||
431 | static void | |
432 | @@ -233,7 +233,7 @@ device_get_driver_info( SoundDriverInfo *info ) | |
433 | info->device_data_size = sizeof(OSSDeviceData); | |
434 | } | |
435 | ||
436 | -static DFBResult | |
437 | +static DirectResult | |
438 | device_open( void *device_data, | |
439 | SoundDeviceInfo *device_info, | |
440 | CoreSoundDeviceConfig *config ) | |
441 | @@ -241,7 +241,7 @@ device_open( void *device_data, | |
442 | OSSDeviceData *data = device_data; | |
443 | int mixer_fd; | |
444 | audio_buf_info info; | |
445 | - DFBResult ret; | |
446 | + DirectResult ret; | |
447 | ||
448 | /* open sound device in non-blocking mode */ | |
449 | if (fs_config->device) { | |
450 | @@ -254,7 +254,7 @@ device_open( void *device_data, | |
451 | ||
452 | if (data->fd < 0) { | |
453 | D_ERROR( "FusionSound/Device/OSS: Couldn't open output device!\n" ); | |
454 | - return DFB_IO; | |
455 | + return DR_IO; | |
456 | } | |
457 | ||
458 | /* reset to blocking mode */ | |
459 | @@ -303,10 +303,10 @@ device_open( void *device_data, | |
460 | close( mixer_fd ); | |
461 | } | |
462 | ||
463 | - return DFB_OK; | |
464 | + return DR_OK; | |
465 | } | |
466 | ||
467 | -static DFBResult | |
468 | +static DirectResult | |
469 | device_get_buffer( void *device_data, u8 **addr, unsigned int *avail ) | |
470 | { | |
471 | OSSDeviceData *data = device_data; | |
472 | @@ -314,21 +314,21 @@ device_get_buffer( void *device_data, u8 **addr, unsigned int *avail ) | |
473 | *addr = data->buffer; | |
474 | *avail = data->config->buffersize; | |
475 | ||
476 | - return DFB_OK; | |
477 | + return DR_OK; | |
478 | } | |
479 | ||
480 | -static DFBResult | |
481 | +static DirectResult | |
482 | device_commit_buffer( void *device_data, unsigned int frames ) | |
483 | { | |
484 | OSSDeviceData *data = device_data; | |
485 | ||
486 | if (write( data->fd, data->buffer, frames*data->bytes_per_frame ) < 0) { | |
487 | - DFBResult ret = errno2result( errno ); | |
488 | + DirectResult ret = errno2result( errno ); | |
489 | D_DERROR( ret, "FusionSound/Device/OSS: couldn't write %d frames!\n", frames ); | |
490 | return ret; | |
491 | } | |
492 | ||
493 | - return DFB_OK; | |
494 | + return DR_OK; | |
495 | } | |
496 | ||
497 | static void | |
498 | @@ -346,7 +346,7 @@ device_get_output_delay( void *device_data, int *delay ) | |
499 | *delay = (info.fragsize * info.fragstotal - info.bytes) / data->bytes_per_frame; | |
500 | } | |
501 | ||
502 | -static DFBResult | |
503 | +static DirectResult | |
504 | device_get_volume( void *device_data, float *level ) | |
505 | { | |
506 | int fd; | |
507 | @@ -354,22 +354,22 @@ device_get_volume( void *device_data, float *level ) | |
508 | ||
509 | fd = direct_try_open( "/dev/mixer", "/dev/sound/mixer", O_RDONLY, false ); | |
510 | if (fd < 0) | |
511 | - return DFB_IO; | |
512 | + return DR_IO; | |
513 | ||
514 | if (ioctl( fd, SOUND_MIXER_READ_PCM, &vol ) < 0) { | |
515 | D_PERROR( "FusionSound/Device/OSS: couldn't get volume level!\n" ); | |
516 | close( fd ); | |
517 | - return DFB_FAILURE; | |
518 | + return DR_FAILURE; | |
519 | } | |
520 | ||
521 | close( fd ); | |
522 | ||
523 | *level = (float)((vol & 0xff) + ((vol >> 8) & 0xff)) / 200.0f; | |
524 | ||
525 | - return DFB_OK; | |
526 | + return DR_OK; | |
527 | } | |
528 | ||
529 | -static DFBResult | |
530 | +static DirectResult | |
531 | device_set_volume( void *device_data, float level ) | |
532 | { | |
533 | int fd; | |
534 | @@ -377,22 +377,22 @@ device_set_volume( void *device_data, float level ) | |
535 | ||
536 | fd = direct_try_open( "/dev/mixer", "/dev/sound/mixer", O_RDONLY, false ); | |
537 | if (fd < 0) | |
538 | - return DFB_IO; | |
539 | + return DR_IO; | |
540 | ||
541 | vol = level * 100.0f; | |
542 | vol |= vol << 8; | |
543 | if (ioctl( fd, SOUND_MIXER_WRITE_PCM, &vol ) < 0) { | |
544 | D_PERROR( "FusionSound/Device/OSS: couldn't set volume level!\n" ); | |
545 | close( fd ); | |
546 | - return DFB_FAILURE; | |
547 | + return DR_FAILURE; | |
548 | } | |
549 | ||
550 | close( fd ); | |
551 | ||
552 | - return DFB_OK; | |
553 | + return DR_OK; | |
554 | } | |
555 | ||
556 | -static DFBResult | |
557 | +static DirectResult | |
558 | device_suspend( void *device_data ) | |
559 | { | |
560 | OSSDeviceData *data = device_data; | |
561 | @@ -401,21 +401,21 @@ device_suspend( void *device_data ) | |
562 | close( data->fd ); | |
563 | data->fd = -1; | |
564 | ||
565 | - return DFB_OK; | |
566 | + return DR_OK; | |
567 | } | |
568 | ||
569 | -static DFBResult | |
570 | +static DirectResult | |
571 | device_resume( void *device_data ) | |
572 | { | |
573 | OSSDeviceData *data = device_data; | |
574 | - DFBResult ret; | |
575 | + DirectResult ret; | |
576 | ||
577 | data->fd = (fs_config->device) | |
578 | ? open( fs_config->device, O_WRONLY ) | |
579 | : direct_try_open( "/dev/dsp", "/dev/sound/dsp", O_WRONLY, false ); | |
580 | if (data->fd < 0) { | |
581 | D_ERROR( "FusionSound/Device/OSS: Couldn't reopen output device!\n" ); | |
582 | - return DFB_IO; | |
583 | + return DR_IO; | |
584 | } | |
585 | ||
586 | ret = oss_device_set_configuration( data->fd, data->config ); | |
587 | @@ -427,7 +427,7 @@ device_resume( void *device_data ) | |
588 | ||
589 | fcntl( data->fd, F_SETFD, FD_CLOEXEC ); | |
590 | ||
591 | - return DFB_OK; | |
592 | + return DR_OK; | |
593 | } | |
594 | ||
595 | static void | |
596 | diff --git a/drivers/wave.c b/drivers/wave.c | |
597 | index f33a44d..a13514f 100644 | |
598 | --- a/drivers/wave.c | |
599 | +++ b/drivers/wave.c | |
600 | @@ -85,7 +85,7 @@ typedef struct { | |
601 | /******************************************************************************/ | |
602 | ||
603 | ||
604 | -static DFBResult | |
605 | +static DirectResult | |
606 | device_probe( void ) | |
607 | { | |
608 | int fd; | |
609 | @@ -93,7 +93,7 @@ device_probe( void ) | |
610 | ||
611 | /* load only when requested */ | |
612 | if (!fs_config->driver) | |
613 | - return DFB_UNSUPPORTED; | |
614 | + return DR_UNSUPPORTED; | |
615 | ||
616 | if (fs_config->device) { | |
617 | snprintf( path, sizeof(path), "%s", fs_config->device ); | |
618 | @@ -105,11 +105,11 @@ device_probe( void ) | |
619 | ||
620 | fd = open( path, O_WRONLY | O_CREAT | O_NOCTTY | O_NONBLOCK, 0644 ); | |
621 | if (fd < 0) | |
622 | - return DFB_UNSUPPORTED; | |
623 | + return DR_UNSUPPORTED; | |
624 | ||
625 | close( fd ); | |
626 | ||
627 | - return DFB_OK; | |
628 | + return DR_OK; | |
629 | } | |
630 | ||
631 | static void | |
632 | @@ -137,7 +137,7 @@ device_get_driver_info( SoundDriverInfo *info ) | |
633 | info->device_data_size = sizeof(WaveDeviceData); | |
634 | } | |
635 | ||
636 | -static DFBResult | |
637 | +static DirectResult | |
638 | device_open( void *device_data, | |
639 | SoundDeviceInfo *device_info, | |
640 | CoreSoundDeviceConfig *config ) | |
641 | @@ -147,7 +147,7 @@ device_open( void *device_data, | |
642 | char path[4096]; | |
643 | ||
644 | if (config->format == FSSF_FLOAT) | |
645 | - return DFB_UNSUPPORTED; | |
646 | + return DR_UNSUPPORTED; | |
647 | ||
648 | if (fs_config->device) { | |
649 | snprintf( path, sizeof(path), "%s", fs_config->device ); | |
650 | @@ -161,7 +161,7 @@ device_open( void *device_data, | |
651 | if (data->fd < 0) { | |
652 | D_ERROR( "FusionSound/Device/Wave: " | |
653 | "couldn't open '%s' for writing!\n", path ); | |
654 | - return DFB_IO; | |
655 | + return DR_IO; | |
656 | } | |
657 | ||
658 | /* close file descriptor on exec */ | |
659 | @@ -222,16 +222,16 @@ device_open( void *device_data, | |
660 | ||
661 | if (write( data->fd, &header, sizeof(header) ) < sizeof(header)) { | |
662 | D_ERROR( "FusionSound/Device/Wave: write error!\n" ); | |
663 | - return DFB_IO; | |
664 | + return DR_IO; | |
665 | } | |
666 | ||
667 | data->bits = FS_BITS_PER_SAMPLE(config->format); | |
668 | data->channels = FS_CHANNELS_FOR_MODE(config->mode); | |
669 | ||
670 | - return DFB_OK; | |
671 | + return DR_OK; | |
672 | } | |
673 | ||
674 | -static DFBResult | |
675 | +static DirectResult | |
676 | device_get_buffer( void *device_data, u8 **addr, unsigned int *avail ) | |
677 | { | |
678 | WaveDeviceData *data = device_data; | |
679 | @@ -239,10 +239,10 @@ device_get_buffer( void *device_data, u8 **addr, unsigned int *avail ) | |
680 | *addr = data->buffer; | |
681 | *avail = data->buffersize; | |
682 | ||
683 | - return DFB_OK; | |
684 | + return DR_OK; | |
685 | } | |
686 | ||
687 | -static DFBResult | |
688 | +static DirectResult | |
689 | device_commit_buffer( void *device_data, unsigned int frames ) | |
690 | { | |
691 | WaveDeviceData *data = device_data; | |
692 | @@ -274,7 +274,7 @@ device_commit_buffer( void *device_data, unsigned int frames ) | |
693 | ||
694 | write( data->fd, buf, frames * data->channels * data->bits >> 3 ); | |
695 | ||
696 | - return DFB_OK; | |
697 | + return DR_OK; | |
698 | } | |
699 | ||
700 | static void | |
701 | @@ -283,19 +283,19 @@ device_get_output_delay( void *device_data, int *delay ) | |
702 | *delay = 0; | |
703 | } | |
704 | ||
705 | -static DFBResult | |
706 | +static DirectResult | |
707 | device_get_volume( void *device_data, float *level ) | |
708 | { | |
709 | - return DFB_UNSUPPORTED; | |
710 | + return DR_UNSUPPORTED; | |
711 | } | |
712 | ||
713 | -static DFBResult | |
714 | +static DirectResult | |
715 | device_set_volume( void *device_data, float level ) | |
716 | { | |
717 | - return DFB_UNSUPPORTED; | |
718 | + return DR_UNSUPPORTED; | |
719 | } | |
720 | ||
721 | -static DFBResult | |
722 | +static DirectResult | |
723 | device_suspend( void *device_data ) | |
724 | { | |
725 | WaveDeviceData *data = device_data; | |
726 | @@ -306,10 +306,10 @@ device_suspend( void *device_data ) | |
727 | data->fd = -1; | |
728 | } | |
729 | ||
730 | - return DFB_OK; | |
731 | + return DR_OK; | |
732 | } | |
733 | ||
734 | -static DFBResult | |
735 | +static DirectResult | |
736 | device_resume( void *device_data ) | |
737 | { | |
738 | WaveDeviceData *data = device_data; | |
739 | @@ -327,13 +327,13 @@ device_resume( void *device_data ) | |
740 | data->fd = open( path, O_WRONLY | O_APPEND | O_NOCTTY ); | |
741 | if (data->fd < 0) { | |
742 | D_ERROR( "FusionSound/Device/Wave: couldn't reopen '%s'!\n", path ); | |
743 | - return DFB_IO; | |
744 | + return DR_IO; | |
745 | } | |
746 | ||
747 | fcntl( data->fd, F_SETFD, FD_CLOEXEC ); | |
748 | } | |
749 | ||
750 | - return DFB_OK; | |
751 | + return DR_OK; | |
752 | } | |
753 | ||
754 | static void | |
755 | diff --git a/examples/advanced.c b/examples/advanced.c | |
756 | index d9fa898..d62ce46 100644 | |
757 | --- a/examples/advanced.c | |
758 | +++ b/examples/advanced.c | |
759 | @@ -17,7 +17,7 @@ static IFusionSoundPlayback * | |
760 | prepare_test( IFusionSoundBuffer *buffer, | |
761 | const char *name ) | |
762 | { | |
763 | - DFBResult ret; | |
764 | + DirectResult ret; | |
765 | IFusionSoundPlayback *playback; | |
766 | ||
767 | ret = buffer->CreatePlayback (buffer, &playback); | |
768 | @@ -48,7 +48,7 @@ prepare_test( IFusionSoundBuffer *buffer, | |
769 | ||
770 | #define TEST(x...) \ | |
771 | do { \ | |
772 | - DFBResult ret = (x); \ | |
773 | + DirectResult ret = (x); \ | |
774 | if (ret) { \ | |
775 | fprintf( stderr, "FAILED!\n\n" ); \ | |
776 | FusionSoundError (#x, ret); \ | |
777 | @@ -191,7 +191,7 @@ do_playback_tests (IFusionSoundBuffer *buffer) | |
778 | ||
779 | int main (int argc, char *argv[]) | |
780 | { | |
781 | - DFBResult ret; | |
782 | + DirectResult ret; | |
783 | IFusionSound *sound; | |
784 | IFusionSoundBuffer *buffer; | |
785 | ||
786 | diff --git a/examples/loader.c b/examples/loader.c | |
787 | index 373efcb..eb4b0ff 100644 | |
788 | --- a/examples/loader.c | |
789 | +++ b/examples/loader.c | |
790 | @@ -43,27 +43,27 @@ static void fixup_sampledata(u16 *data, int len) | |
791 | } | |
792 | #endif | |
793 | ||
794 | -static DFBResult | |
795 | +static DirectResult | |
796 | read_file_header (int fd) | |
797 | { | |
798 | char buf[12]; | |
799 | ||
800 | if (read (fd, buf, 12) < 12) { | |
801 | fprintf (stderr, "Could not read at least 12 bytes!\n"); | |
802 | - return DFB_IO; | |
803 | + return DR_IO; | |
804 | } | |
805 | ||
806 | if (buf[0] != 'R' || buf[1] != 'I' || buf[2] != 'F' || buf[3] != 'F') { | |
807 | fprintf (stderr, "No RIFF header found!\n"); | |
808 | - return DFB_UNSUPPORTED; | |
809 | + return DR_UNSUPPORTED; | |
810 | } | |
811 | ||
812 | if (buf[8] != 'W' || buf[9] != 'A' || buf[10] != 'V' || buf[11] != 'E') { | |
813 | fprintf (stderr, "Not a WAVE!\n"); | |
814 | - return DFB_UNSUPPORTED; | |
815 | + return DR_UNSUPPORTED; | |
816 | } | |
817 | ||
818 | - return DFB_OK; | |
819 | + return DR_OK; | |
820 | } | |
821 | ||
822 | static int | |
823 | @@ -85,7 +85,7 @@ read_chunk_header (int fd, char *magic) | |
824 | IFusionSoundBuffer * | |
825 | load_sample (IFusionSound *sound, const char *filename) | |
826 | { | |
827 | - DFBResult ret; | |
828 | + DirectResult ret; | |
829 | int fd; | |
830 | FSBufferDescription desc; | |
831 | IFusionSoundBuffer *buffer; | |
832 | @@ -104,7 +104,7 @@ load_sample (IFusionSound *sound, const char *filename) | |
833 | return NULL; | |
834 | } | |
835 | ||
836 | - while (DFB_TRUE) { | |
837 | + while (DR_TRUE) { | |
838 | char magic[4]; | |
839 | ||
840 | len = read_chunk_header (fd, magic); | |
841 | @@ -168,7 +168,7 @@ load_sample (IFusionSound *sound, const char *filename) | |
842 | desc.sampleformat = (fmt.bitspersample == 8) ? FSSF_U8 : FSSF_S16; | |
843 | desc.samplerate = fmt.frequency; | |
844 | ||
845 | - while (DFB_TRUE) { | |
846 | + while (DR_TRUE) { | |
847 | char magic[4]; | |
848 | ||
849 | len = read_chunk_header (fd, magic); | |
850 | diff --git a/examples/music.c b/examples/music.c | |
851 | index 5656bfc..c30c462 100644 | |
852 | --- a/examples/music.c | |
853 | +++ b/examples/music.c | |
854 | @@ -56,7 +56,7 @@ cleanup( int s ) | |
855 | exit( s ); | |
856 | } | |
857 | ||
858 | -static DFBEnumerationResult | |
859 | +static DirectEnumerationResult | |
860 | track_display_callback( FSTrackID id, FSTrackDescription desc, void *ctx ) | |
861 | { | |
862 | printf( " Track %2d: %s - %s\n", id, | |
863 | @@ -66,10 +66,10 @@ track_display_callback( FSTrackID id, FSTrackDescription desc, void *ctx ) | |
864 | return DFENUM_OK; | |
865 | } | |
866 | ||
867 | -static DFBEnumerationResult | |
868 | +static DirectEnumerationResult | |
869 | track_playback_callback( FSTrackID id, FSTrackDescription desc, void *ctx ) | |
870 | { | |
871 | - DFBResult ret; | |
872 | + DirectResult ret; | |
873 | FSMusicProviderStatus status = FMSTATE_UNKNOWN; | |
874 | double len = 0; | |
875 | static int flags = FMPLAY_NOFX; | |
876 | @@ -220,7 +220,7 @@ track_playback_callback( FSTrackID id, FSTrackDescription desc, void *ctx ) | |
877 | int | |
878 | main( int argc, char *argv[] ) | |
879 | { | |
880 | - DFBResult ret; | |
881 | + DirectResult ret; | |
882 | ||
883 | ret = FusionSoundInit( &argc, &argv ); | |
884 | if (ret) | |
885 | diff --git a/examples/music_loader.c b/examples/music_loader.c | |
886 | index d97b5a4..76def1e 100644 | |
887 | --- a/examples/music_loader.c | |
888 | +++ b/examples/music_loader.c | |
889 | @@ -22,7 +22,7 @@ load_sample( IFusionSound *sound, const char *file ) | |
890 | void *data; | |
891 | int bytes; | |
892 | int frames = 0; | |
893 | - DFBResult ret; | |
894 | + DirectResult ret; | |
895 | ||
896 | ret = sound->CreateMusicProvider( sound, file, &provider ); | |
897 | if (ret) { | |
898 | @@ -68,7 +68,7 @@ main( int argc, char **argv ) | |
899 | { | |
900 | IFusionSound *sound; | |
901 | IFusionSoundBuffer *buffer; | |
902 | - DFBResult ret; | |
903 | + DirectResult ret; | |
904 | ||
905 | ret = FusionSoundInit( &argc, &argv ); | |
906 | if (ret) | |
907 | diff --git a/examples/player.c b/examples/player.c | |
908 | index 7fc065d..d622e4b 100644 | |
909 | --- a/examples/player.c | |
910 | +++ b/examples/player.c | |
911 | @@ -26,10 +26,10 @@ static IFusionSoundPlayback *playback; | |
912 | static int sample_length; | |
913 | ||
914 | ||
915 | -static DFBResult | |
916 | +static DirectResult | |
917 | create_playback( const char *filename ) | |
918 | { | |
919 | - DFBResult ret; | |
920 | + DirectResult ret; | |
921 | ||
922 | ret = FusionSoundCreate( &sound ); | |
923 | if (ret) { | |
924 | @@ -53,13 +53,13 @@ create_playback( const char *filename ) | |
925 | } | |
926 | else { | |
927 | playback->Start( playback, 0, -1 ); | |
928 | - return DFB_OK; | |
929 | + return DR_OK; | |
930 | } | |
931 | } | |
932 | ||
933 | sound->Release( sound ); | |
934 | ||
935 | - return DFB_FAILURE; | |
936 | + return DR_FAILURE; | |
937 | } | |
938 | ||
939 | static void | |
940 | @@ -101,17 +101,17 @@ slider_update( LiteSlider *slider, float pos, void *ctx ) | |
941 | static void | |
942 | button_pressed( LiteButton *button, void *ctx ) | |
943 | { | |
944 | - static DFBBoolean stopped; | |
945 | + static bool stopped; | |
946 | ||
947 | if (stopped) { | |
948 | playback->Continue( playback ); | |
949 | ||
950 | - stopped = DFB_FALSE; | |
951 | + stopped = false; | |
952 | } | |
953 | else { | |
954 | playback->Stop( playback ); | |
955 | ||
956 | - stopped = DFB_TRUE; | |
957 | + stopped = true; | |
958 | } | |
959 | } | |
960 | ||
961 | @@ -119,7 +119,7 @@ int | |
962 | main (int argc, char *argv[]) | |
963 | { | |
964 | int i; | |
965 | - DFBResult ret; | |
966 | + DirectResult ret; | |
967 | LiteLabel *label[5]; | |
968 | LiteSlider *slider[5]; | |
969 | LiteButton *playbutton; | |
970 | @@ -195,7 +195,7 @@ main (int argc, char *argv[]) | |
971 | lite_set_window_opacity( window, 0xff ); | |
972 | ||
973 | /* run the event loop with a timeout */ | |
974 | - while (lite_window_event_loop( window, 20 ) == DFB_TIMEOUT) { | |
975 | + while (lite_window_event_loop( window, 20 ) == DR_TIMEOUT) { | |
976 | int position = 0; | |
977 | ||
978 | playback->GetStatus( playback, NULL, &position ); | |
979 | diff --git a/examples/scope.c b/examples/scope.c | |
980 | index d84d130..89f7f9d 100644 | |
981 | --- a/examples/scope.c | |
982 | +++ b/examples/scope.c | |
983 | @@ -65,7 +65,7 @@ buffer_callback( int len, void *ctx ) | |
984 | { | |
985 | void *data; | |
986 | ||
987 | - if (buffer->Lock( buffer, &data, 0, 0 ) != DFB_OK) | |
988 | + if (buffer->Lock( buffer, &data, 0, 0 ) != DR_OK) | |
989 | return FMBCR_OK; | |
990 | ||
991 | /* draw scope */ | |
992 | @@ -79,21 +79,21 @@ buffer_callback( int len, void *ctx ) | |
993 | return FMBCR_OK; | |
994 | } | |
995 | ||
996 | -static DFBResult | |
997 | +static DirectResult | |
998 | create_playback( const char *filename ) | |
999 | { | |
1000 | FSBufferDescription b_desc; | |
1001 | FSStreamDescription s_desc; | |
1002 | - DFBResult err; | |
1003 | + DirectResult err; | |
1004 | ||
1005 | err = FusionSoundCreate( &sound ); | |
1006 | - if (err != DFB_OK) { | |
1007 | + if (err != DR_OK) { | |
1008 | FusionSoundError( "FusionSoundCreate() failed", err ); | |
1009 | return err; | |
1010 | } | |
1011 | ||
1012 | err = sound->CreateMusicProvider( sound, filename, &provider ); | |
1013 | - if (err != DFB_OK) { | |
1014 | + if (err != DR_OK) { | |
1015 | FusionSoundError( "CreateMusicProvider() failed", err ); | |
1016 | return err; | |
1017 | } | |
1018 | @@ -111,25 +111,25 @@ create_playback( const char *filename ) | |
1019 | s_desc.channels = 2; | |
1020 | ||
1021 | err = sound->CreateStream( sound, &s_desc, &stream ); | |
1022 | - if (err != DFB_OK) { | |
1023 | + if (err != DR_OK) { | |
1024 | FusionSoundError( "CreateStream() failed", err ); | |
1025 | return err; | |
1026 | } | |
1027 | ||
1028 | err = sound->CreateBuffer( sound, &b_desc, &buffer ); | |
1029 | - if (err != DFB_OK) { | |
1030 | + if (err != DR_OK) { | |
1031 | FusionSoundError( "CreateBuffer() failed", err ); | |
1032 | return err; | |
1033 | } | |
1034 | ||
1035 | err = provider->PlayToBuffer( provider, buffer, | |
1036 | buffer_callback, NULL ); | |
1037 | - if (err != DFB_OK) { | |
1038 | + if (err != DR_OK) { | |
1039 | FusionSoundError( "PlayToBuffer() failed", err ); | |
1040 | return err; | |
1041 | } | |
1042 | ||
1043 | - return DFB_OK; | |
1044 | + return DR_OK; | |
1045 | } | |
1046 | ||
1047 | static void | |
1048 | @@ -148,11 +148,11 @@ destroy_playback( void ) | |
1049 | int | |
1050 | main( int argc, char **argv ) | |
1051 | { | |
1052 | - DFBResult err; | |
1053 | + DirectResult err; | |
1054 | DFBRectangle rect; | |
1055 | ||
1056 | err = DirectFBInit( &argc, &argv ); | |
1057 | - if (err != DFB_OK) | |
1058 | + if (err != DR_OK) | |
1059 | DirectFBErrorFatal( "DirectFBInit() failed", err ); | |
1060 | ||
1061 | if (argc != 2) { | |
1062 | @@ -161,7 +161,7 @@ main( int argc, char **argv ) | |
1063 | } | |
1064 | ||
1065 | err = FusionSoundInit( &argc, &argv ); | |
1066 | - if (err != DFB_OK) | |
1067 | + if (err != DR_OK) | |
1068 | FusionSoundErrorFatal( "FusionSoundInit() failed", err ); | |
1069 | ||
1070 | /* initialize LiTE */ | |
1071 | @@ -184,7 +184,7 @@ main( int argc, char **argv ) | |
1072 | lite_set_window_opacity( window, 0xff ); | |
1073 | ||
1074 | /* initialize FusionSound and load track */ | |
1075 | - if (create_playback( argv[1] ) != DFB_OK) { | |
1076 | + if (create_playback( argv[1] ) != DR_OK) { | |
1077 | destroy_playback(); | |
1078 | lite_destroy_window( window ); | |
1079 | lite_close(); | |
1080 | @@ -192,12 +192,12 @@ main( int argc, char **argv ) | |
1081 | } | |
1082 | ||
1083 | /* event loop */ | |
1084 | - while (lite_window_event_loop( window, 20 ) == DFB_TIMEOUT) { | |
1085 | + while (lite_window_event_loop( window, 20 ) == DR_TIMEOUT) { | |
1086 | double pos; | |
1087 | ||
1088 | /* check if playback is finished */ | |
1089 | err = provider->GetPos( provider, &pos ); | |
1090 | - if (err == DFB_EOF) | |
1091 | + if (err == DR_EOF) | |
1092 | break; | |
1093 | } | |
1094 | ||
1095 | diff --git a/examples/simple.c b/examples/simple.c | |
1096 | index add23aa..9992b96 100644 | |
1097 | --- a/examples/simple.c | |
1098 | +++ b/examples/simple.c | |
1099 | @@ -12,7 +12,7 @@ | |
1100 | ||
1101 | int main (int argc, char *argv[]) | |
1102 | { | |
1103 | - DFBResult ret; | |
1104 | + DirectResult ret; | |
1105 | IFusionSound *sound; | |
1106 | IFusionSoundBuffer *buffer; | |
1107 | ||
1108 | diff --git a/examples/stream.c b/examples/stream.c | |
1109 | index e4549c9..ed64c9d 100644 | |
1110 | --- a/examples/stream.c | |
1111 | +++ b/examples/stream.c | |
1112 | @@ -13,7 +13,7 @@ | |
1113 | static void | |
1114 | feed_stream (IFusionSoundStream *stream) | |
1115 | { | |
1116 | - DFBResult ret; | |
1117 | + DirectResult ret; | |
1118 | int i; | |
1119 | s16 buf[16384]; | |
1120 | ||
1121 | @@ -49,7 +49,7 @@ feed_stream (IFusionSoundStream *stream) | |
1122 | int | |
1123 | main (int argc, char *argv[]) | |
1124 | { | |
1125 | - DFBResult ret; | |
1126 | + DirectResult ret; | |
1127 | IFusionSound *sound; | |
1128 | IFusionSoundStream *stream; | |
1129 | FSStreamDescription desc; | |
1130 | diff --git a/include/fusionsound.h b/include/fusionsound.h | |
1131 | index 26f97de..1bb94d2 100644 | |
1132 | --- a/include/fusionsound.h | |
1133 | +++ b/include/fusionsound.h | |
1134 | @@ -28,7 +28,7 @@ | |
1135 | #ifndef __FUSIONSOUND_H__ | |
1136 | #define __FUSIONSOUND_H__ | |
1137 | ||
1138 | -#include <directfb.h> | |
1139 | +#include <direct/interface.h> | |
1140 | ||
1141 | #ifdef __cplusplus | |
1142 | extern "C" | |
1143 | @@ -81,50 +81,50 @@ DECLARE_INTERFACE( IFusionSoundMusicProvider ) | |
1144 | * Parses the command-line and initializes some variables. You absolutely need to | |
1145 | * call this before doing anything else. Removes all options used by FusionSound from argv. | |
1146 | */ | |
1147 | -DFBResult FusionSoundInit( | |
1148 | - int *argc, /* pointer to main()'s argc */ | |
1149 | - char *(*argv[]) /* pointer to main()'s argv */ | |
1150 | - ); | |
1151 | +DirectResult FusionSoundInit( | |
1152 | + int *argc, /* pointer to main()'s argc */ | |
1153 | + char *(*argv[]) /* pointer to main()'s argv */ | |
1154 | + ); | |
1155 | ||
1156 | /* | |
1157 | * Sets configuration parameters supported on command line and in config file. | |
1158 | * Can only be called before FusionSoundCreate but after FusionSoundInit. | |
1159 | */ | |
1160 | -DFBResult FusionSoundSetOption( | |
1161 | - const char *name, | |
1162 | - const char *value | |
1163 | - ); | |
1164 | +DirectResult FusionSoundSetOption( | |
1165 | + const char *name, | |
1166 | + const char *value | |
1167 | + ); | |
1168 | ||
1169 | /* | |
1170 | * Creates the super interface. | |
1171 | */ | |
1172 | -DFBResult FusionSoundCreate( | |
1173 | - IFusionSound **ret_interface /* pointer to the created interface */ | |
1174 | - ); | |
1175 | +DirectResult FusionSoundCreate( | |
1176 | + IFusionSound **ret_interface /* pointer to the created interface */ | |
1177 | + ); | |
1178 | ||
1179 | /* | |
1180 | * Print a description of the result code along with an | |
1181 | * optional message that is put in front with a colon. | |
1182 | */ | |
1183 | -DFBResult FusionSoundError( | |
1184 | - const char *msg, /* optional message */ | |
1185 | - DFBResult result /* result code to interpret */ | |
1186 | - ); | |
1187 | +DirectResult FusionSoundError( | |
1188 | + const char *msg, /* optional message */ | |
1189 | + DirectResult result /* result code to interpret */ | |
1190 | + ); | |
1191 | ||
1192 | /* | |
1193 | * Behaves like FusionSoundError, but shuts down the calling application. | |
1194 | */ | |
1195 | -DFBResult FusionSoundErrorFatal( | |
1196 | - const char *msg, /* optional message */ | |
1197 | - DFBResult result /* result code to interpret */ | |
1198 | - ); | |
1199 | +DirectResult FusionSoundErrorFatal( | |
1200 | + const char *msg, /* optional message */ | |
1201 | + DirectResult result /* result code to interpret */ | |
1202 | + ); | |
1203 | ||
1204 | /* | |
1205 | * Returns a string describing 'result'. | |
1206 | */ | |
1207 | const char *FusionSoundErrorString( | |
1208 | - DFBResult result | |
1209 | - ); | |
1210 | + DirectResult result | |
1211 | + ); | |
1212 | ||
1213 | /* | |
1214 | * Retrieves information about supported command-line flags in the | |
1215 | @@ -423,7 +423,7 @@ typedef struct { | |
1216 | /* | |
1217 | * Called for each track provided by a music provider. | |
1218 | */ | |
1219 | -typedef DFBEnumerationResult (*FSTrackCallback) ( | |
1220 | +typedef DirectEnumerationResult (*FSTrackCallback) ( | |
1221 | FSTrackID track_id, | |
1222 | FSTrackDescription desc, | |
1223 | void *callbackdata | |
1224 | @@ -456,7 +456,7 @@ DEFINE_INTERFACE( IFusionSound, | |
1225 | /* | |
1226 | * Get a description of the sound device. | |
1227 | */ | |
1228 | - DFBResult (*GetDeviceDescription) ( | |
1229 | + DirectResult (*GetDeviceDescription) ( | |
1230 | IFusionSound *thiz, | |
1231 | FSDeviceDescription *ret_desc | |
1232 | ); | |
1233 | @@ -471,7 +471,7 @@ DEFINE_INTERFACE( IFusionSound, | |
1234 | * Default values for sample rate, sample format and number of channels | |
1235 | * depend on device configuration. | |
1236 | */ | |
1237 | - DFBResult (*CreateBuffer) ( | |
1238 | + DirectResult (*CreateBuffer) ( | |
1239 | IFusionSound *thiz, | |
1240 | const FSBufferDescription *desc, | |
1241 | IFusionSoundBuffer **interface | |
1242 | @@ -485,7 +485,7 @@ DEFINE_INTERFACE( IFusionSound, | |
1243 | * Default values for sample rate, sample format and number of channels | |
1244 | * depend on device configuration, while ring buffer length defaults to 1/5 seconds. | |
1245 | */ | |
1246 | - DFBResult (*CreateStream) ( | |
1247 | + DirectResult (*CreateStream) ( | |
1248 | IFusionSound *thiz, | |
1249 | const FSStreamDescription *desc, | |
1250 | IFusionSoundStream **interface | |
1251 | @@ -494,7 +494,7 @@ DEFINE_INTERFACE( IFusionSound, | |
1252 | /* | |
1253 | * Create a music provider. | |
1254 | */ | |
1255 | - DFBResult (*CreateMusicProvider) ( | |
1256 | + DirectResult (*CreateMusicProvider) ( | |
1257 | IFusionSound *thiz, | |
1258 | const char *filename, | |
1259 | IFusionSoundMusicProvider **interface | |
1260 | @@ -510,7 +510,7 @@ DEFINE_INTERFACE( IFusionSound, | |
1261 | * | |
1262 | * See also <i>SetMasterVolume()</i>. | |
1263 | */ | |
1264 | - DFBResult (*GetMasterVolume) ( | |
1265 | + DirectResult (*GetMasterVolume) ( | |
1266 | IFusionSound *thiz, | |
1267 | float *level | |
1268 | ); | |
1269 | @@ -523,7 +523,7 @@ DEFINE_INTERFACE( IFusionSound, | |
1270 | * | |
1271 | * See also <i>GetMasterVolume()</i>. | |
1272 | */ | |
1273 | - DFBResult (*SetMasterVolume) ( | |
1274 | + DirectResult (*SetMasterVolume) ( | |
1275 | IFusionSound *thiz, | |
1276 | float level | |
1277 | ); | |
1278 | @@ -536,7 +536,7 @@ DEFINE_INTERFACE( IFusionSound, | |
1279 | * | |
1280 | * See also <i>SetLocalVolume()</i>. | |
1281 | */ | |
1282 | - DFBResult (*GetLocalVolume) ( | |
1283 | + DirectResult (*GetLocalVolume) ( | |
1284 | IFusionSound *thiz, | |
1285 | float *level | |
1286 | ); | |
1287 | @@ -550,7 +550,7 @@ DEFINE_INTERFACE( IFusionSound, | |
1288 | * | |
1289 | * See also <i>GetLocalVolume()</i>. | |
1290 | */ | |
1291 | - DFBResult (*SetLocalVolume) ( | |
1292 | + DirectResult (*SetLocalVolume) ( | |
1293 | IFusionSound *thiz, | |
1294 | float level | |
1295 | ); | |
1296 | @@ -564,7 +564,7 @@ DEFINE_INTERFACE( IFusionSound, | |
1297 | * No other calls to FusionSound are allowed until <i>Resume()</i> | |
1298 | * has been called. | |
1299 | */ | |
1300 | - DFBResult (*Suspend) ( | |
1301 | + DirectResult (*Suspend) ( | |
1302 | IFusionSound *thiz | |
1303 | ); | |
1304 | ||
1305 | @@ -573,7 +573,7 @@ DEFINE_INTERFACE( IFusionSound, | |
1306 | * | |
1307 | * Only to be called after <i>Suspend()</i>. | |
1308 | */ | |
1309 | - DFBResult (*Resume) ( | |
1310 | + DirectResult (*Resume) ( | |
1311 | IFusionSound *thiz | |
1312 | ); | |
1313 | ) | |
1314 | @@ -622,7 +622,7 @@ DEFINE_INTERFACE( IFusionSoundBuffer, | |
1315 | /* | |
1316 | * Get a description of the buffer. | |
1317 | */ | |
1318 | - DFBResult (*GetDescription) ( | |
1319 | + DirectResult (*GetDescription) ( | |
1320 | IFusionSoundBuffer *thiz, | |
1321 | FSBufferDescription *ret_desc | |
1322 | ); | |
1323 | @@ -636,7 +636,7 @@ DEFINE_INTERFACE( IFusionSoundBuffer, | |
1324 | * Set the buffer position indicator (in frames) | |
1325 | * affecting subsequent playback and lock for access. | |
1326 | */ | |
1327 | - DFBResult (*SetPosition) ( | |
1328 | + DirectResult (*SetPosition) ( | |
1329 | IFusionSoundBuffer *thiz, | |
1330 | int position | |
1331 | ); | |
1332 | @@ -652,7 +652,7 @@ DEFINE_INTERFACE( IFusionSoundBuffer, | |
1333 | * | |
1334 | * See also <i>SetPosition()</i>. | |
1335 | */ | |
1336 | - DFBResult (*Lock) ( | |
1337 | + DirectResult (*Lock) ( | |
1338 | IFusionSoundBuffer *thiz, | |
1339 | void **ret_data, | |
1340 | int *ret_frames, | |
1341 | @@ -662,7 +662,7 @@ DEFINE_INTERFACE( IFusionSoundBuffer, | |
1342 | /* | |
1343 | * Unlock a buffer. | |
1344 | */ | |
1345 | - DFBResult (*Unlock) ( | |
1346 | + DirectResult (*Unlock) ( | |
1347 | IFusionSoundBuffer *thiz | |
1348 | ); | |
1349 | ||
1350 | @@ -679,7 +679,7 @@ DEFINE_INTERFACE( IFusionSoundBuffer, | |
1351 | * | |
1352 | * See also <i>CreatePlayback()</i>. | |
1353 | */ | |
1354 | - DFBResult (*Play) ( | |
1355 | + DirectResult (*Play) ( | |
1356 | IFusionSoundBuffer *thiz, | |
1357 | FSBufferPlayFlags flags | |
1358 | ); | |
1359 | @@ -692,7 +692,7 @@ DEFINE_INTERFACE( IFusionSoundBuffer, | |
1360 | * | |
1361 | * See also <i>CreatePlayback()</i>. | |
1362 | */ | |
1363 | - DFBResult (*Stop) ( | |
1364 | + DirectResult (*Stop) ( | |
1365 | IFusionSoundBuffer *thiz | |
1366 | ); | |
1367 | ||
1368 | @@ -704,7 +704,7 @@ DEFINE_INTERFACE( IFusionSoundBuffer, | |
1369 | * | |
1370 | * Each playback instance represents one concurrent playback of the buffer. | |
1371 | */ | |
1372 | - DFBResult (*CreatePlayback) ( | |
1373 | + DirectResult (*CreatePlayback) ( | |
1374 | IFusionSoundBuffer *thiz, | |
1375 | IFusionSoundPlayback **interface | |
1376 | ); | |
1377 | @@ -739,7 +739,7 @@ DEFINE_INTERFACE( IFusionSoundStream, | |
1378 | /* | |
1379 | * Get a description of the stream. | |
1380 | */ | |
1381 | - DFBResult (*GetDescription) ( | |
1382 | + DirectResult (*GetDescription) ( | |
1383 | IFusionSoundStream *thiz, | |
1384 | FSStreamDescription *ret_desc | |
1385 | ); | |
1386 | @@ -758,7 +758,7 @@ DEFINE_INTERFACE( IFusionSoundStream, | |
1387 | * | |
1388 | * If this method returns successfully, all data has been written. | |
1389 | */ | |
1390 | - DFBResult (*Write) ( | |
1391 | + DirectResult (*Write) ( | |
1392 | IFusionSoundStream *thiz, | |
1393 | const void *data, | |
1394 | int length | |
1395 | @@ -772,7 +772,7 @@ DEFINE_INTERFACE( IFusionSoundStream, | |
1396 | * | |
1397 | * Specifying a <b>length</b> of zero waits until playback has finished. | |
1398 | */ | |
1399 | - DFBResult (*Wait) ( | |
1400 | + DirectResult (*Wait) ( | |
1401 | IFusionSoundStream *thiz, | |
1402 | int length | |
1403 | ); | |
1404 | @@ -787,13 +787,13 @@ DEFINE_INTERFACE( IFusionSoundStream, | |
1405 | * | |
1406 | * Simply pass NULL for values that are not of interest. | |
1407 | */ | |
1408 | - DFBResult (*GetStatus) ( | |
1409 | + DirectResult (*GetStatus) ( | |
1410 | IFusionSoundStream *thiz, | |
1411 | int *filled, | |
1412 | int *total, | |
1413 | int *read_position, | |
1414 | int *write_position, | |
1415 | - DFBBoolean *playing | |
1416 | + bool *playing | |
1417 | ); | |
1418 | ||
1419 | /* | |
1420 | @@ -802,7 +802,7 @@ DEFINE_INTERFACE( IFusionSoundStream, | |
1421 | * This method stops the playback immediately and | |
1422 | * discards any buffered data. | |
1423 | */ | |
1424 | - DFBResult (*Flush) ( | |
1425 | + DirectResult (*Flush) ( | |
1426 | IFusionSoundStream *thiz | |
1427 | ); | |
1428 | ||
1429 | @@ -812,7 +812,7 @@ DEFINE_INTERFACE( IFusionSoundStream, | |
1430 | * This method discards any pending input data, | |
1431 | * making <i>Write()</i> return as soon as possible. | |
1432 | */ | |
1433 | - DFBResult (*Drop) ( | |
1434 | + DirectResult (*Drop) ( | |
1435 | IFusionSoundStream *thiz | |
1436 | ); | |
1437 | ||
1438 | @@ -830,7 +830,7 @@ DEFINE_INTERFACE( IFusionSoundStream, | |
1439 | * Even if the stream is not playing, e.g. due to pre-buffering, | |
1440 | * the method behaves as if the playback has just been started. | |
1441 | */ | |
1442 | - DFBResult (*GetPresentationDelay) ( | |
1443 | + DirectResult (*GetPresentationDelay) ( | |
1444 | IFusionSoundStream *thiz, | |
1445 | int *delay | |
1446 | ); | |
1447 | @@ -845,7 +845,7 @@ DEFINE_INTERFACE( IFusionSoundStream, | |
1448 | * This includes volume, pitch and pan settings as well as manual starting, pausing or | |
1449 | * stopping of the playback. | |
1450 | */ | |
1451 | - DFBResult (*GetPlayback) ( | |
1452 | + DirectResult (*GetPlayback) ( | |
1453 | IFusionSoundStream *thiz, | |
1454 | IFusionSoundPlayback **interface | |
1455 | ); | |
1456 | @@ -865,7 +865,7 @@ DEFINE_INTERFACE( IFusionSoundStream, | |
1457 | * After filling the ring buffer, call <i>Commit()</i> to submit | |
1458 | * the samples to the stream. | |
1459 | */ | |
1460 | - DFBResult (*Access) ( | |
1461 | + DirectResult (*Access) ( | |
1462 | IFusionSoundStream *thiz, | |
1463 | void **ret_data, | |
1464 | int *ret_avail | |
1465 | @@ -876,7 +876,7 @@ DEFINE_INTERFACE( IFusionSoundStream, | |
1466 | * | |
1467 | * Commit <b>length</b> frames of data written upon previous <i>Access()</i>. | |
1468 | */ | |
1469 | - DFBResult (*Commit) ( | |
1470 | + DirectResult (*Commit) ( | |
1471 | IFusionSoundStream *thiz, | |
1472 | int length | |
1473 | ); | |
1474 | @@ -928,7 +928,7 @@ DEFINE_INTERFACE( IFusionSoundPlayback, | |
1475 | * | |
1476 | * This method can be used for seeking if the playback is already running. | |
1477 | */ | |
1478 | - DFBResult (*Start) ( | |
1479 | + DirectResult (*Start) ( | |
1480 | IFusionSoundPlayback *thiz, | |
1481 | int start, | |
1482 | int stop | |
1483 | @@ -940,7 +940,7 @@ DEFINE_INTERFACE( IFusionSoundPlayback, | |
1484 | * This method stops a running playback. The playback can be continued | |
1485 | * by calling <i>Continue()</i> or restarted using <i>Start()</i>. | |
1486 | */ | |
1487 | - DFBResult (*Stop) ( | |
1488 | + DirectResult (*Stop) ( | |
1489 | IFusionSoundPlayback *thiz | |
1490 | ); | |
1491 | ||
1492 | @@ -963,7 +963,7 @@ DEFINE_INTERFACE( IFusionSoundPlayback, | |
1493 | * <i>IFusionSoundBuffer::Play()</i>, but rejects multiple concurrent | |
1494 | * playbacks. | |
1495 | */ | |
1496 | - DFBResult (*Continue) ( | |
1497 | + DirectResult (*Continue) ( | |
1498 | IFusionSoundPlayback *thiz | |
1499 | ); | |
1500 | ||
1501 | @@ -975,7 +975,7 @@ DEFINE_INTERFACE( IFusionSoundPlayback, | |
1502 | * If the playback is in looping mode the method returns immediately | |
1503 | * with an error. | |
1504 | */ | |
1505 | - DFBResult (*Wait) ( | |
1506 | + DirectResult (*Wait) ( | |
1507 | IFusionSoundPlayback *thiz | |
1508 | ); | |
1509 | ||
1510 | @@ -990,9 +990,9 @@ DEFINE_INTERFACE( IFusionSoundPlayback, | |
1511 | * It also returns the current playback <b>position</b> or the position | |
1512 | * where <i>Continue()</i> would start to play. | |
1513 | */ | |
1514 | - DFBResult (*GetStatus) ( | |
1515 | + DirectResult (*GetStatus) ( | |
1516 | IFusionSoundPlayback *thiz, | |
1517 | - DFBBoolean *running, | |
1518 | + bool *running, | |
1519 | int *position | |
1520 | ); | |
1521 | ||
1522 | @@ -1005,7 +1005,7 @@ DEFINE_INTERFACE( IFusionSoundPlayback, | |
1523 | * The <b>level</b> is a linear factor being 1.0f by default, currently | |
1524 | * ranges from 0.0f to 64.0f due to internal mixing limitations. | |
1525 | */ | |
1526 | - DFBResult (*SetVolume) ( | |
1527 | + DirectResult (*SetVolume) ( | |
1528 | IFusionSoundPlayback *thiz, | |
1529 | float level | |
1530 | ); | |
1531 | @@ -1015,7 +1015,7 @@ DEFINE_INTERFACE( IFusionSoundPlayback, | |
1532 | * | |
1533 | * The <b>value</b> ranges from -1.0f (left) to 1.0f (right). | |
1534 | */ | |
1535 | - DFBResult (*SetPan) ( | |
1536 | + DirectResult (*SetPan) ( | |
1537 | IFusionSoundPlayback *thiz, | |
1538 | float value | |
1539 | ); | |
1540 | @@ -1026,7 +1026,7 @@ DEFINE_INTERFACE( IFusionSoundPlayback, | |
1541 | * The <b>value</b> is a linear factor being 1.0f by default, currently | |
1542 | * ranges from 0.0f to 64.0f due to internal mixing limitations. | |
1543 | */ | |
1544 | - DFBResult (*SetPitch) ( | |
1545 | + DirectResult (*SetPitch) ( | |
1546 | IFusionSoundPlayback *thiz, | |
1547 | float value | |
1548 | ); | |
1549 | @@ -1034,7 +1034,7 @@ DEFINE_INTERFACE( IFusionSoundPlayback, | |
1550 | /* | |
1551 | * Set the direction of the playback. | |
1552 | */ | |
1553 | - DFBResult (*SetDirection) ( | |
1554 | + DirectResult (*SetDirection) ( | |
1555 | IFusionSoundPlayback *thiz, | |
1556 | FSPlaybackDirection direction | |
1557 | ); | |
1558 | @@ -1047,7 +1047,7 @@ DEFINE_INTERFACE( IFusionSoundPlayback, | |
1559 | * Levels are linear factors ranging from 0.0f to 1.0f and | |
1560 | * being 0.707f (-3dB) by default. | |
1561 | */ | |
1562 | - DFBResult (*SetDownmixLevels) ( | |
1563 | + DirectResult (*SetDownmixLevels) ( | |
1564 | IFusionSoundPlayback *thiz, | |
1565 | float center, | |
1566 | float rear | |
1567 | @@ -1077,7 +1077,7 @@ DEFINE_INTERFACE( IFusionSoundMusicProvider, | |
1568 | * Retrieve information about the music provider's | |
1569 | * capabilities. | |
1570 | */ | |
1571 | - DFBResult (*GetCapabilities) ( | |
1572 | + DirectResult (*GetCapabilities) ( | |
1573 | IFusionSoundMusicProvider *thiz, | |
1574 | FSMusicProviderCapabilities *ret_caps | |
1575 | ); | |
1576 | @@ -1090,7 +1090,7 @@ DEFINE_INTERFACE( IFusionSoundMusicProvider, | |
1577 | * used to select a track for playback using | |
1578 | * IFusionSoundMusicProvider::SelectTrack(). | |
1579 | */ | |
1580 | - DFBResult (*EnumTracks) ( | |
1581 | + DirectResult (*EnumTracks) ( | |
1582 | IFusionSoundMusicProvider *thiz, | |
1583 | FSTrackCallback callback, | |
1584 | void *callbackdata | |
1585 | @@ -1099,7 +1099,7 @@ DEFINE_INTERFACE( IFusionSoundMusicProvider, | |
1586 | /* | |
1587 | * Get the unique ID of the current track. | |
1588 | */ | |
1589 | - DFBResult (*GetTrackID) ( | |
1590 | + DirectResult (*GetTrackID) ( | |
1591 | IFusionSoundMusicProvider *thiz, | |
1592 | FSTrackID *ret_track_id | |
1593 | ); | |
1594 | @@ -1107,7 +1107,7 @@ DEFINE_INTERFACE( IFusionSoundMusicProvider, | |
1595 | /* | |
1596 | * Get a description of the current track. | |
1597 | */ | |
1598 | - DFBResult (*GetTrackDescription) ( | |
1599 | + DirectResult (*GetTrackDescription) ( | |
1600 | IFusionSoundMusicProvider *thiz, | |
1601 | FSTrackDescription *ret_desc | |
1602 | ); | |
1603 | @@ -1116,7 +1116,7 @@ DEFINE_INTERFACE( IFusionSoundMusicProvider, | |
1604 | * Get a stream description that best matches the music | |
1605 | * contained in the file. | |
1606 | */ | |
1607 | - DFBResult (*GetStreamDescription) ( | |
1608 | + DirectResult (*GetStreamDescription) ( | |
1609 | IFusionSoundMusicProvider *thiz, | |
1610 | FSStreamDescription *ret_desc | |
1611 | ); | |
1612 | @@ -1128,7 +1128,7 @@ DEFINE_INTERFACE( IFusionSoundMusicProvider, | |
1613 | * The music provider is responsible of returning a | |
1614 | * buffer description suitable for holding the whole track. | |
1615 | */ | |
1616 | - DFBResult (*GetBufferDescription) ( | |
1617 | + DirectResult (*GetBufferDescription) ( | |
1618 | IFusionSoundMusicProvider *thiz, | |
1619 | FSBufferDescription *ret_desc | |
1620 | ); | |
1621 | @@ -1138,7 +1138,7 @@ DEFINE_INTERFACE( IFusionSoundMusicProvider, | |
1622 | /* | |
1623 | * Select a track by its unique ID. | |
1624 | */ | |
1625 | - DFBResult (*SelectTrack) ( | |
1626 | + DirectResult (*SelectTrack) ( | |
1627 | IFusionSoundMusicProvider *thiz, | |
1628 | FSTrackID track_id | |
1629 | ); | |
1630 | @@ -1147,7 +1147,7 @@ DEFINE_INTERFACE( IFusionSoundMusicProvider, | |
1631 | * Play selected track rendering it into | |
1632 | * the destination stream. | |
1633 | */ | |
1634 | - DFBResult (*PlayToStream) ( | |
1635 | + DirectResult (*PlayToStream) ( | |
1636 | IFusionSoundMusicProvider *thiz, | |
1637 | IFusionSoundStream *destination | |
1638 | ); | |
1639 | @@ -1162,7 +1162,7 @@ DEFINE_INTERFACE( IFusionSoundMusicProvider, | |
1640 | * samples per channels actually written | |
1641 | * to the destination buffer. | |
1642 | */ | |
1643 | - DFBResult (*PlayToBuffer) ( | |
1644 | + DirectResult (*PlayToBuffer) ( | |
1645 | IFusionSoundMusicProvider *thiz, | |
1646 | IFusionSoundBuffer *destination, | |
1647 | FMBufferCallback callback, | |
1648 | @@ -1172,14 +1172,14 @@ DEFINE_INTERFACE( IFusionSoundMusicProvider, | |
1649 | /* | |
1650 | * Stop playback. | |
1651 | */ | |
1652 | - DFBResult (*Stop) ( | |
1653 | + DirectResult (*Stop) ( | |
1654 | IFusionSoundMusicProvider *thiz | |
1655 | ); | |
1656 | ||
1657 | /* | |
1658 | * Get playback status. | |
1659 | */ | |
1660 | - DFBResult (*GetStatus) ( | |
1661 | + DirectResult (*GetStatus) ( | |
1662 | IFusionSoundMusicProvider *thiz, | |
1663 | FSMusicProviderStatus *ret_status | |
1664 | ); | |
1665 | @@ -1189,7 +1189,7 @@ DEFINE_INTERFACE( IFusionSoundMusicProvider, | |
1666 | /* | |
1667 | * Seeks to a position within the current track. | |
1668 | */ | |
1669 | - DFBResult (*SeekTo) ( | |
1670 | + DirectResult (*SeekTo) ( | |
1671 | IFusionSoundMusicProvider *thiz, | |
1672 | double seconds | |
1673 | ); | |
1674 | @@ -1197,7 +1197,7 @@ DEFINE_INTERFACE( IFusionSoundMusicProvider, | |
1675 | /* | |
1676 | * Gets current position within the current track. | |
1677 | */ | |
1678 | - DFBResult (*GetPos) ( | |
1679 | + DirectResult (*GetPos) ( | |
1680 | IFusionSoundMusicProvider *thiz, | |
1681 | double *ret_seconds | |
1682 | ); | |
1683 | @@ -1205,7 +1205,7 @@ DEFINE_INTERFACE( IFusionSoundMusicProvider, | |
1684 | /* | |
1685 | * Gets the length of the current track. | |
1686 | */ | |
1687 | - DFBResult (*GetLength) ( | |
1688 | + DirectResult (*GetLength) ( | |
1689 | IFusionSoundMusicProvider *thiz, | |
1690 | double *ret_seconds | |
1691 | ); | |
1692 | @@ -1215,7 +1215,7 @@ DEFINE_INTERFACE( IFusionSoundMusicProvider, | |
1693 | /* | |
1694 | * Set the flags controlling playback. | |
1695 | */ | |
1696 | - DFBResult (*SetPlaybackFlags) ( | |
1697 | + DirectResult (*SetPlaybackFlags) ( | |
1698 | IFusionSoundMusicProvider *thiz, | |
1699 | FSMusicProviderPlaybackFlags flags | |
1700 | ); | |
1701 | @@ -1228,7 +1228,7 @@ DEFINE_INTERFACE( IFusionSoundMusicProvider, | |
1702 | * if the specified <b>timeout</b> in milliseconds | |
1703 | * is non-zero, until timeout expires. | |
1704 | */ | |
1705 | - DFBResult (*WaitStatus) ( | |
1706 | + DirectResult (*WaitStatus) ( | |
1707 | IFusionSoundMusicProvider *thiz, | |
1708 | FSMusicProviderStatus mask, | |
1709 | unsigned int timeout | |
1710 | diff --git a/interfaces/IFusionSound/ifusionsound_module.c b/interfaces/IFusionSound/ifusionsound_module.c | |
1711 | index 3cd23a3..a1025fa 100644 | |
1712 | --- a/interfaces/IFusionSound/ifusionsound_module.c | |
1713 | +++ b/interfaces/IFusionSound/ifusionsound_module.c | |
1714 | @@ -36,9 +36,9 @@ | |
1715 | #include <direct/interface.h> | |
1716 | ||
1717 | ||
1718 | -static DFBResult Probe( void *arg ); | |
1719 | +static DirectResult Probe( void *arg ); | |
1720 | ||
1721 | -static DFBResult Construct( IFusionSound *thiz, void *arg ); | |
1722 | +static DirectResult Construct( IFusionSound *thiz, void *arg ); | |
1723 | ||
1724 | #include <direct/interface_implementation.h> | |
1725 | ||
1726 | @@ -47,17 +47,17 @@ DIRECT_INTERFACE_IMPLEMENTATION( IFusionSound, default ) | |
1727 | ||
1728 | /* exported symbols */ | |
1729 | ||
1730 | -static DFBResult | |
1731 | +static DirectResult | |
1732 | Probe( void *arg ) | |
1733 | { | |
1734 | - return DFB_OK; | |
1735 | + return DR_OK; | |
1736 | } | |
1737 | ||
1738 | -static DFBResult | |
1739 | +static DirectResult | |
1740 | Construct( IFusionSound *thiz, | |
1741 | void *arg ) | |
1742 | { | |
1743 | - DFBResult ret; | |
1744 | + DirectResult ret; | |
1745 | ||
1746 | ret = FusionSoundInit( NULL, NULL ); | |
1747 | if (ret) { | |
1748 | diff --git a/interfaces/IFusionSoundMusicProvider/ifusionsoundmusicprovider_cdda.c b/interfaces/IFusionSoundMusicProvider/ifusionsoundmusicprovider_cdda.c | |
1749 | index 4e5269d..20603a6 100644 | |
1750 | --- a/interfaces/IFusionSoundMusicProvider/ifusionsoundmusicprovider_cdda.c | |
1751 | +++ b/interfaces/IFusionSoundMusicProvider/ifusionsoundmusicprovider_cdda.c | |
1752 | @@ -47,10 +47,10 @@ | |
1753 | #include <direct/thread.h> | |
1754 | #include <direct/util.h> | |
1755 | ||
1756 | -static DFBResult | |
1757 | +static DirectResult | |
1758 | Probe( IFusionSoundMusicProvider_ProbeContext *ctx ); | |
1759 | ||
1760 | -static DFBResult | |
1761 | +static DirectResult | |
1762 | Construct( IFusionSoundMusicProvider *thiz, | |
1763 | const char *filename, | |
1764 | DirectStream *stream ); | |
1765 | @@ -116,21 +116,21 @@ typedef struct { | |
1766 | ||
1767 | #include <linux/cdrom.h> | |
1768 | ||
1769 | -static DFBResult | |
1770 | +static DirectResult | |
1771 | cdda_probe( int fd ) | |
1772 | { | |
1773 | struct cdrom_tochdr tochdr; | |
1774 | ||
1775 | if (ioctl( fd, CDROM_DRIVE_STATUS, CDSL_CURRENT ) != CDS_DISC_OK) | |
1776 | - return DFB_UNSUPPORTED; | |
1777 | + return DR_UNSUPPORTED; | |
1778 | ||
1779 | if (ioctl( fd, CDROMREADTOCHDR, &tochdr ) < 0) | |
1780 | - return DFB_UNSUPPORTED; | |
1781 | + return DR_UNSUPPORTED; | |
1782 | ||
1783 | - return DFB_OK; | |
1784 | + return DR_OK; | |
1785 | } | |
1786 | ||
1787 | -static DFBResult | |
1788 | +static DirectResult | |
1789 | cdda_build_tracklits( int fd, struct cdda_track **ret_tracks, | |
1790 | unsigned int *ret_num ) | |
1791 | { | |
1792 | @@ -146,14 +146,14 @@ cdda_build_tracklits( int fd, struct cdda_track **ret_tracks, | |
1793 | if (ioctl( fd, CDROMREADTOCHDR, &tochdr ) == -1) { | |
1794 | D_PERROR( "IFusionSoundMusicProvide_CDDA: " | |
1795 | "ioctl( CDROMREADTOCHDR ) failed!\n" ); | |
1796 | - return DFB_IO; | |
1797 | + return DR_IO; | |
1798 | } | |
1799 | ||
1800 | ms.addr_format = CDROM_LBA; | |
1801 | if (ioctl( fd, CDROMMULTISESSION, &ms ) == -1) { | |
1802 | D_PERROR( "IFusionSoundMusicProvide_CDDA: " | |
1803 | "ioctl( CDROMMULTISESSION ) failed!\n" ); | |
1804 | - return DFB_IO; | |
1805 | + return DR_IO; | |
1806 | } | |
1807 | ||
1808 | total_tracks = tochdr.cdth_trk1 - tochdr.cdth_trk0 + 1; | |
1809 | @@ -172,7 +172,7 @@ cdda_build_tracklits( int fd, struct cdda_track **ret_tracks, | |
1810 | D_PERROR( "IFusionSoundMusicProvide_CDDA: " | |
1811 | "ioctl( CDROMREADTOCENTRY ) failed!\n" ); | |
1812 | D_FREE( tracks ); | |
1813 | - return DFB_IO; | |
1814 | + return DR_IO; | |
1815 | } | |
1816 | ||
1817 | /* skip data tracks */ | |
1818 | @@ -190,7 +190,7 @@ cdda_build_tracklits( int fd, struct cdda_track **ret_tracks, | |
1819 | ||
1820 | if (total_tracks < 1) { | |
1821 | D_FREE( tracks ); | |
1822 | - return DFB_FAILURE; | |
1823 | + return DR_FAILURE; | |
1824 | } | |
1825 | ||
1826 | memset( &tocentry, 0, sizeof(tocentry) ); | |
1827 | @@ -202,7 +202,7 @@ cdda_build_tracklits( int fd, struct cdda_track **ret_tracks, | |
1828 | D_PERROR( "IFusionSoundMusicProvide_CDDA: " | |
1829 | "ioctl( CDROMREADTOCENTRY ) failed!\n" ); | |
1830 | D_FREE( tracks ); | |
1831 | - return DFB_IO; | |
1832 | + return DR_IO; | |
1833 | } | |
1834 | ||
1835 | if (!ms.xa_flag) { | |
1836 | @@ -221,7 +221,7 @@ cdda_build_tracklits( int fd, struct cdda_track **ret_tracks, | |
1837 | *ret_tracks = tracks; | |
1838 | *ret_num = total_tracks; | |
1839 | ||
1840 | - return DFB_OK; | |
1841 | + return DR_OK; | |
1842 | } | |
1843 | ||
1844 | static int | |
1845 | @@ -246,18 +246,18 @@ cdda_read_audio( int fd, u8 *buf, int pos, int len ) | |
1846 | ||
1847 | #include <sys/cdio.h> | |
1848 | ||
1849 | -static DFBResult | |
1850 | +static DirectResult | |
1851 | cdda_probe( int fd ) | |
1852 | { | |
1853 | struct ioc_toc_header tochdr; | |
1854 | ||
1855 | if (ioctl( fd, CDIOREADTOCHEADER, &tochdr ) < 0) | |
1856 | - return DFB_UNSUPPORTED; | |
1857 | + return DR_UNSUPPORTED; | |
1858 | ||
1859 | - return DFB_OK; | |
1860 | + return DR_OK; | |
1861 | } | |
1862 | ||
1863 | -static DFBResult | |
1864 | +static DirectResult | |
1865 | cdda_build_tracklits( int fd, struct cdda_track **ret_tracks, | |
1866 | unsigned int *ret_num ) | |
1867 | { | |
1868 | @@ -272,7 +272,7 @@ cdda_build_tracklits( int fd, struct cdda_track **ret_tracks, | |
1869 | if (ioctl( fd, CDIOREADTOCHEADER, &tochdr ) == -1) { | |
1870 | D_PERROR( "IFusionSoundMusicProvide_CDDA: " | |
1871 | "ioctl( CDIOREADTOCHEADER ) failed!\n" ); | |
1872 | - return DFB_IO; | |
1873 | + return DR_IO; | |
1874 | } | |
1875 | ||
1876 | total_tracks = tochdr.ending_track - tochdr.starting_track + 1; | |
1877 | @@ -291,7 +291,7 @@ cdda_build_tracklits( int fd, struct cdda_track **ret_tracks, | |
1878 | D_PERROR( "IFusionSoundMusicProvide_CDDA: " | |
1879 | "ioctl( CDIOREADTOCENTRY ) failed!\n" ); | |
1880 | D_FREE( tracks ); | |
1881 | - return DFB_IO; | |
1882 | + return DR_IO; | |
1883 | } | |
1884 | ||
1885 | /* skip data tracks */ | |
1886 | @@ -309,7 +309,7 @@ cdda_build_tracklits( int fd, struct cdda_track **ret_tracks, | |
1887 | ||
1888 | if (total_tracks < 1) { | |
1889 | D_FREE( tracks ); | |
1890 | - return DFB_FAILURE; | |
1891 | + return DR_FAILURE; | |
1892 | } | |
1893 | ||
1894 | memset( &tocentry, 0, sizeof(tocentry) ); | |
1895 | @@ -321,7 +321,7 @@ cdda_build_tracklits( int fd, struct cdda_track **ret_tracks, | |
1896 | D_PERROR( "IFusionSoundMusicProvide_CDDA: " | |
1897 | "ioctl( CDIOREADTOCENTRY ) failed!\n" ); | |
1898 | D_FREE( tracks ); | |
1899 | - return DFB_IO; | |
1900 | + return DR_IO; | |
1901 | } | |
1902 | ||
1903 | msf_lba = tocentry.entry.addr; | |
1904 | @@ -336,7 +336,7 @@ cdda_build_tracklits( int fd, struct cdda_track **ret_tracks, | |
1905 | *ret_tracks = tracks; | |
1906 | *ret_num = total_tracks; | |
1907 | ||
1908 | - return DFB_OK; | |
1909 | + return DR_OK; | |
1910 | } | |
1911 | ||
1912 | static int | |
1913 | @@ -359,18 +359,18 @@ cdda_read_audio( int fd, u8 *buf, int pos, int len ) | |
1914 | ||
1915 | #else | |
1916 | ||
1917 | -static DFBResult | |
1918 | +static DirectResult | |
1919 | cdda_probe( int fd ) | |
1920 | { | |
1921 | D_WARN( "unsupported system" ); | |
1922 | - return DFB_UNSUPPORTED; | |
1923 | + return DR_UNSUPPORTED; | |
1924 | } | |
1925 | ||
1926 | -static DFBResult | |
1927 | +static DirectResult | |
1928 | cdda_build_tracklits( int fd, struct cdda_track **ret_tracks, | |
1929 | unsigned int *ret_num ) | |
1930 | { | |
1931 | - return DFB_UNSUPPORTED; | |
1932 | + return DR_UNSUPPORTED; | |
1933 | } | |
1934 | ||
1935 | static int | |
1936 | @@ -648,17 +648,17 @@ IFusionSoundMusicProvider_CDDA_Destruct( IFusionSoundMusicProvider *thiz ) | |
1937 | DIRECT_DEALLOCATE_INTERFACE( thiz ); | |
1938 | } | |
1939 | ||
1940 | -static DFBResult | |
1941 | +static DirectResult | |
1942 | IFusionSoundMusicProvider_CDDA_AddRef( IFusionSoundMusicProvider *thiz ) | |
1943 | { | |
1944 | DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_CDDA ) | |
1945 | ||
1946 | data->ref++; | |
1947 | ||
1948 | - return DFB_OK; | |
1949 | + return DR_OK; | |
1950 | } | |
1951 | ||
1952 | -static DFBResult | |
1953 | +static DirectResult | |
1954 | IFusionSoundMusicProvider_CDDA_Release( IFusionSoundMusicProvider *thiz ) | |
1955 | { | |
1956 | DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_CDDA ) | |
1957 | @@ -666,24 +666,24 @@ IFusionSoundMusicProvider_CDDA_Release( IFusionSoundMusicProvider *thiz ) | |
1958 | if (--data->ref == 0) | |
1959 | IFusionSoundMusicProvider_CDDA_Destruct( thiz ); | |
1960 | ||
1961 | - return DFB_OK; | |
1962 | + return DR_OK; | |
1963 | } | |
1964 | ||
1965 | -static DFBResult | |
1966 | +static DirectResult | |
1967 | IFusionSoundMusicProvider_CDDA_GetCapabilities( IFusionSoundMusicProvider *thiz, | |
1968 | FSMusicProviderCapabilities *caps ) | |
1969 | { | |
1970 | DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_CDDA ) | |
1971 | ||
1972 | if (!caps) | |
1973 | - return DFB_INVARG; | |
1974 | + return DR_INVARG; | |
1975 | ||
1976 | *caps = FMCAPS_BASIC | FMCAPS_SEEK; | |
1977 | ||
1978 | - return DFB_OK; | |
1979 | + return DR_OK; | |
1980 | } | |
1981 | ||
1982 | -static DFBResult | |
1983 | +static DirectResult | |
1984 | IFusionSoundMusicProvider_CDDA_EnumTracks( IFusionSoundMusicProvider *thiz, | |
1985 | FSTrackCallback callback, | |
1986 | void *callbackdata ) | |
1987 | @@ -694,7 +694,7 @@ IFusionSoundMusicProvider_CDDA_EnumTracks( IFusionSoundMusicProvider *thiz, | |
1988 | DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_CDDA ) | |
1989 | ||
1990 | if (!callback) | |
1991 | - return DFB_INVARG; | |
1992 | + return DR_INVARG; | |
1993 | ||
1994 | for (i = 0; i < data->total_tracks; i++) { | |
1995 | struct cdda_track *track = &data->tracks[i]; | |
1996 | @@ -718,24 +718,24 @@ IFusionSoundMusicProvider_CDDA_EnumTracks( IFusionSoundMusicProvider *thiz, | |
1997 | break; | |
1998 | } | |
1999 | ||
2000 | - return DFB_OK; | |
2001 | + return DR_OK; | |
2002 | } | |
2003 | ||
2004 | -static DFBResult | |
2005 | +static DirectResult | |
2006 | IFusionSoundMusicProvider_CDDA_GetTrackID( IFusionSoundMusicProvider *thiz, | |
2007 | FSTrackID *ret_track_id ) | |
2008 | { | |
2009 | DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_CDDA ) | |
2010 | ||
2011 | if (!ret_track_id) | |
2012 | - return DFB_INVARG; | |
2013 | + return DR_INVARG; | |
2014 | ||
2015 | *ret_track_id = data->current_track; | |
2016 | ||
2017 | - return DFB_OK; | |
2018 | + return DR_OK; | |
2019 | } | |
2020 | ||
2021 | -static DFBResult | |
2022 | +static DirectResult | |
2023 | IFusionSoundMusicProvider_CDDA_GetTrackDescription( IFusionSoundMusicProvider *thiz, | |
2024 | FSTrackDescription *desc ) | |
2025 | { | |
2026 | @@ -744,7 +744,7 @@ IFusionSoundMusicProvider_CDDA_GetTrackDescription( IFusionSoundMusicProvider *t | |
2027 | DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_CDDA ) | |
2028 | ||
2029 | if (!desc) | |
2030 | - return DFB_INVARG; | |
2031 | + return DR_INVARG; | |
2032 | ||
2033 | memset( desc, 0, sizeof(FSTrackDescription) ); | |
2034 | ||
2035 | @@ -763,17 +763,17 @@ IFusionSoundMusicProvider_CDDA_GetTrackDescription( IFusionSoundMusicProvider *t | |
2036 | direct_snputs( desc->encoding, "PCM 16 bit", FS_TRACK_DESC_ENCODING_LENGTH ); | |
2037 | desc->bitrate = CD_FRAMES_PER_SECOND * CD_BYTES_PER_FRAME * 8; | |
2038 | ||
2039 | - return DFB_OK; | |
2040 | + return DR_OK; | |
2041 | } | |
2042 | ||
2043 | -static DFBResult | |
2044 | +static DirectResult | |
2045 | IFusionSoundMusicProvider_CDDA_GetStreamDescription( IFusionSoundMusicProvider *thiz, | |
2046 | FSStreamDescription *desc ) | |
2047 | { | |
2048 | DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_CDDA ) | |
2049 | ||
2050 | if (!desc) | |
2051 | - return DFB_INVARG; | |
2052 | + return DR_INVARG; | |
2053 | ||
2054 | desc->flags = FSSDF_SAMPLERATE | FSSDF_CHANNELS | | |
2055 | FSSDF_SAMPLEFORMAT | FSSDF_BUFFERSIZE; | |
2056 | @@ -782,10 +782,10 @@ IFusionSoundMusicProvider_CDDA_GetStreamDescription( IFusionSoundMusicProvider * | |
2057 | desc->sampleformat = FSSF_S16; | |
2058 | desc->buffersize = 4704; | |
2059 | ||
2060 | - return DFB_OK; | |
2061 | + return DR_OK; | |
2062 | } | |
2063 | ||
2064 | -static DFBResult | |
2065 | +static DirectResult | |
2066 | IFusionSoundMusicProvider_CDDA_GetBufferDescription( IFusionSoundMusicProvider *thiz, | |
2067 | FSBufferDescription *desc ) | |
2068 | { | |
2069 | @@ -794,7 +794,7 @@ IFusionSoundMusicProvider_CDDA_GetBufferDescription( IFusionSoundMusicProvider * | |
2070 | DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_CDDA ) | |
2071 | ||
2072 | if (!desc) | |
2073 | - return DFB_INVARG; | |
2074 | + return DR_INVARG; | |
2075 | ||
2076 | track = &data->tracks[data->current_track]; | |
2077 | ||
2078 | @@ -807,23 +807,23 @@ IFusionSoundMusicProvider_CDDA_GetBufferDescription( IFusionSoundMusicProvider * | |
2079 | if (desc->length > FS_MAX_FRAMES) | |
2080 | desc->length = FS_MAX_FRAMES; | |
2081 | ||
2082 | - return DFB_OK; | |
2083 | + return DR_OK; | |
2084 | } | |
2085 | ||
2086 | -static DFBResult | |
2087 | +static DirectResult | |
2088 | IFusionSoundMusicProvider_CDDA_SelectTrack( IFusionSoundMusicProvider *thiz, | |
2089 | FSTrackID track_id ) | |
2090 | { | |
2091 | DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_CDDA ) | |
2092 | ||
2093 | if (track_id > data->total_tracks) | |
2094 | - return DFB_INVARG; | |
2095 | + return DR_INVARG; | |
2096 | ||
2097 | pthread_mutex_lock( &data->lock ); | |
2098 | data->current_track = track_id; | |
2099 | pthread_mutex_unlock( &data->lock ); | |
2100 | ||
2101 | - return DFB_OK; | |
2102 | + return DR_OK; | |
2103 | } | |
2104 | ||
2105 | static void* | |
2106 | @@ -914,7 +914,7 @@ CDDAStreamThread( DirectThread *thread, void *ctx ) | |
2107 | return NULL; | |
2108 | } | |
2109 | ||
2110 | -static DFBResult | |
2111 | +static DirectResult | |
2112 | IFusionSoundMusicProvider_CDDA_PlayToStream( IFusionSoundMusicProvider *thiz, | |
2113 | IFusionSoundStream *destination ) | |
2114 | { | |
2115 | @@ -924,17 +924,17 @@ IFusionSoundMusicProvider_CDDA_PlayToStream( IFusionSoundMusicProvider *thiz, | |
2116 | DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_CDDA ) | |
2117 | ||
2118 | if (!destination) | |
2119 | - return DFB_INVARG; | |
2120 | + return DR_INVARG; | |
2121 | ||
2122 | destination->GetDescription( destination, &desc ); | |
2123 | ||
2124 | /* check whether destination samplerate is supported */ | |
2125 | if (desc.samplerate != 44100) | |
2126 | - return DFB_UNSUPPORTED; | |
2127 | + return DR_UNSUPPORTED; | |
2128 | ||
2129 | /* check whether number of channels is supported */ | |
2130 | if (desc.channels > 2) | |
2131 | - return DFB_UNSUPPORTED; | |
2132 | + return DR_UNSUPPORTED; | |
2133 | ||
2134 | /* check whether destination format is supported */ | |
2135 | switch (desc.sampleformat) { | |
2136 | @@ -945,12 +945,12 @@ IFusionSoundMusicProvider_CDDA_PlayToStream( IFusionSoundMusicProvider *thiz, | |
2137 | case FSSF_FLOAT: | |
2138 | break; | |
2139 | default: | |
2140 | - return DFB_UNSUPPORTED; | |
2141 | + return DR_UNSUPPORTED; | |
2142 | } | |
2143 | ||
2144 | /* check destination buffer size */ | |
2145 | if (desc.buffersize < CD_BYTES_PER_FRAME/4) | |
2146 | - return DFB_UNSUPPORTED; | |
2147 | + return DR_UNSUPPORTED; | |
2148 | ||
2149 | pthread_mutex_lock( &data->lock ); | |
2150 | ||
2151 | @@ -985,7 +985,7 @@ IFusionSoundMusicProvider_CDDA_PlayToStream( IFusionSoundMusicProvider *thiz, | |
2152 | ||
2153 | pthread_mutex_unlock( &data->lock ); | |
2154 | ||
2155 | - return DFB_OK; | |
2156 | + return DR_OK; | |
2157 | } | |
2158 | ||
2159 | static void* | |
2160 | @@ -1013,7 +1013,7 @@ CDDABufferThread( DirectThread *thread, void *ctx ) | |
2161 | data->tracks[data->current_track].length - pos ); | |
2162 | pos += data->tracks[data->current_track].start; | |
2163 | ||
2164 | - if (buffer->Lock( buffer, (void*)&dst, &size, 0 ) != DFB_OK) { | |
2165 | + if (buffer->Lock( buffer, (void*)&dst, &size, 0 ) != DR_OK) { | |
2166 | D_ERROR( "IFusionSoundMusicProvider_CDDA: " | |
2167 | "Couldn't lock destination buffer!\n" ); | |
2168 | data->status = FMSTATE_FINISHED; | |
2169 | @@ -1073,7 +1073,7 @@ CDDABufferThread( DirectThread *thread, void *ctx ) | |
2170 | return NULL; | |
2171 | } | |
2172 | ||
2173 | -static DFBResult | |
2174 | +static DirectResult | |
2175 | IFusionSoundMusicProvider_CDDA_PlayToBuffer( IFusionSoundMusicProvider *thiz, | |
2176 | IFusionSoundBuffer *destination, | |
2177 | FMBufferCallback callback, | |
2178 | @@ -1085,17 +1085,17 @@ IFusionSoundMusicProvider_CDDA_PlayToBuffer( IFusionSoundMusicProvider *thiz, | |
2179 | DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_CDDA ) | |
2180 | ||
2181 | if (!destination) | |
2182 | - return DFB_INVARG; | |
2183 | + return DR_INVARG; | |
2184 | ||
2185 | destination->GetDescription( destination, &desc ); | |
2186 | ||
2187 | /* check whether destination samplerate is supported */ | |
2188 | if (desc.samplerate != 44100) | |
2189 | - return DFB_UNSUPPORTED; | |
2190 | + return DR_UNSUPPORTED; | |
2191 | ||
2192 | /* check whether number of channels is supported */ | |
2193 | if (desc.channels > 2) | |
2194 | - return DFB_UNSUPPORTED; | |
2195 | + return DR_UNSUPPORTED; | |
2196 | ||
2197 | /* check whether destination format is supported */ | |
2198 | switch (desc.sampleformat) { | |
2199 | @@ -1106,12 +1106,12 @@ IFusionSoundMusicProvider_CDDA_PlayToBuffer( IFusionSoundMusicProvider *thiz, | |
2200 | case FSSF_FLOAT: | |
2201 | break; | |
2202 | default: | |
2203 | - return DFB_UNSUPPORTED; | |
2204 | + return DR_UNSUPPORTED; | |
2205 | } | |
2206 | ||
2207 | /* check destination buffer size */ | |
2208 | if (desc.length < CD_BYTES_PER_FRAME/4) | |
2209 | - return DFB_UNSUPPORTED; | |
2210 | + return DR_UNSUPPORTED; | |
2211 | ||
2212 | pthread_mutex_lock( &data->lock ); | |
2213 | ||
2214 | @@ -1148,10 +1148,10 @@ IFusionSoundMusicProvider_CDDA_PlayToBuffer( IFusionSoundMusicProvider *thiz, | |
2215 | ||
2216 | pthread_mutex_unlock( &data->lock ); | |
2217 | ||
2218 | - return DFB_OK; | |
2219 | + return DR_OK; | |
2220 | } | |
2221 | ||
2222 | -static DFBResult | |
2223 | +static DirectResult | |
2224 | IFusionSoundMusicProvider_CDDA_Stop( IFusionSoundMusicProvider *thiz ) | |
2225 | { | |
2226 | DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_CDDA ) | |
2227 | @@ -1164,24 +1164,24 @@ IFusionSoundMusicProvider_CDDA_Stop( IFusionSoundMusicProvider *thiz ) | |
2228 | ||
2229 | pthread_mutex_unlock( &data->lock ); | |
2230 | ||
2231 | - return DFB_OK; | |
2232 | + return DR_OK; | |
2233 | } | |
2234 | ||
2235 | -static DFBResult | |
2236 | +static DirectResult | |
2237 | IFusionSoundMusicProvider_CDDA_GetStatus( IFusionSoundMusicProvider *thiz, | |
2238 | FSMusicProviderStatus *status ) | |
2239 | { | |
2240 | DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_CDDA ) | |
2241 | ||
2242 | if (!status) | |
2243 | - return DFB_INVARG; | |
2244 | + return DR_INVARG; | |
2245 | ||
2246 | *status = data->status; | |
2247 | ||
2248 | - return DFB_OK; | |
2249 | + return DR_OK; | |
2250 | } | |
2251 | ||
2252 | -static DFBResult | |
2253 | +static DirectResult | |
2254 | IFusionSoundMusicProvider_CDDA_SeekTo( IFusionSoundMusicProvider *thiz, | |
2255 | double seconds ) | |
2256 | { | |
2257 | @@ -1191,22 +1191,22 @@ IFusionSoundMusicProvider_CDDA_SeekTo( IFusionSoundMusicProvider *thiz, | |
2258 | DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_CDDA ) | |
2259 | ||
2260 | if (seconds < 0.0) | |
2261 | - return DFB_INVARG; | |
2262 | + return DR_INVARG; | |
2263 | ||
2264 | track = &data->tracks[data->current_track]; | |
2265 | frame = seconds * CD_FRAMES_PER_SECOND; | |
2266 | if (frame >= track->length) | |
2267 | - return DFB_UNSUPPORTED; | |
2268 | + return DR_UNSUPPORTED; | |
2269 | ||
2270 | pthread_mutex_lock( &data->lock ); | |
2271 | track->frame = frame; | |
2272 | data->seeked = true; | |
2273 | pthread_mutex_unlock( &data->lock ); | |
2274 | ||
2275 | - return DFB_OK; | |
2276 | + return DR_OK; | |
2277 | } | |
2278 | ||
2279 | -static DFBResult | |
2280 | +static DirectResult | |
2281 | IFusionSoundMusicProvider_CDDA_GetPos( IFusionSoundMusicProvider *thiz, | |
2282 | double *seconds ) | |
2283 | { | |
2284 | @@ -1215,15 +1215,15 @@ IFusionSoundMusicProvider_CDDA_GetPos( IFusionSoundMusicProvider *thiz, | |
2285 | DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_CDDA ) | |
2286 | ||
2287 | if (!seconds) | |
2288 | - return DFB_INVARG; | |
2289 | + return DR_INVARG; | |
2290 | ||
2291 | track = &data->tracks[data->current_track]; | |
2292 | *seconds = (double)track->frame / CD_FRAMES_PER_SECOND; | |
2293 | ||
2294 | - return DFB_OK; | |
2295 | + return DR_OK; | |
2296 | } | |
2297 | ||
2298 | -static DFBResult | |
2299 | +static DirectResult | |
2300 | IFusionSoundMusicProvider_CDDA_GetLength( IFusionSoundMusicProvider *thiz, | |
2301 | double *seconds ) | |
2302 | { | |
2303 | @@ -1232,29 +1232,29 @@ IFusionSoundMusicProvider_CDDA_GetLength( IFusionSoundMusicProvider *thiz, | |
2304 | DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_CDDA ) | |
2305 | ||
2306 | if (!seconds) | |
2307 | - return DFB_INVARG; | |
2308 | + return DR_INVARG; | |
2309 | ||
2310 | track = &data->tracks[data->current_track]; | |
2311 | *seconds = (double)track->length / CD_FRAMES_PER_SECOND; | |
2312 | ||
2313 | - return DFB_OK; | |
2314 | + return DR_OK; | |
2315 | } | |
2316 | ||
2317 | -static DFBResult | |
2318 | +static DirectResult | |
2319 | IFusionSoundMusicProvider_CDDA_SetPlaybackFlags( IFusionSoundMusicProvider *thiz, | |
2320 | FSMusicProviderPlaybackFlags flags ) | |
2321 | { | |
2322 | DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_CDDA ) | |
2323 | ||
2324 | if (flags & ~FMPLAY_LOOPING) | |
2325 | - return DFB_UNSUPPORTED; | |
2326 | + return DR_UNSUPPORTED; | |
2327 | ||
2328 | data->flags = flags; | |
2329 | ||
2330 | - return DFB_OK; | |
2331 | + return DR_OK; | |
2332 | } | |
2333 | ||
2334 | -static DFBResult | |
2335 | +static DirectResult | |
2336 | IFusionSoundMusicProvider_CDDA_WaitStatus( IFusionSoundMusicProvider *thiz, | |
2337 | FSMusicProviderStatus mask, | |
2338 | unsigned int timeout ) | |
2339 | @@ -1262,7 +1262,7 @@ IFusionSoundMusicProvider_CDDA_WaitStatus( IFusionSoundMusicProvider *thiz, | |
2340 | DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_CDDA ) | |
2341 | ||
2342 | if (!mask || mask & ~FMSTATE_ALL) | |
2343 | - return DFB_INVARG; | |
2344 | + return DR_INVARG; | |
2345 | ||
2346 | if (timeout) { | |
2347 | struct timespec t; | |
2348 | @@ -1274,18 +1274,18 @@ IFusionSoundMusicProvider_CDDA_WaitStatus( IFusionSoundMusicProvider *thiz, | |
2349 | ||
2350 | #ifdef HAVE_PTHREAD_MUTEX_TIMEDLOCK | |
2351 | if (pthread_mutex_timedlock( &data->lock, &t )) | |
2352 | - return DFB_TIMEOUT; | |
2353 | + return DR_TIMEOUT; | |
2354 | #else | |
2355 | while (pthread_mutex_trylock( &data->lock )) { | |
2356 | usleep( 1000 ); | |
2357 | if (direct_clock_get_abs_micros() >= s) | |
2358 | - return DFB_TIMEOUT; | |
2359 | + return DR_TIMEOUT; | |
2360 | } | |
2361 | #endif | |
2362 | while (!(data->status & mask)) { | |
2363 | if (pthread_cond_timedwait( &data->cond, &data->lock, &t ) == ETIMEDOUT) { | |
2364 | pthread_mutex_unlock( &data->lock ); | |
2365 | - return DFB_TIMEOUT; | |
2366 | + return DR_TIMEOUT; | |
2367 | } | |
2368 | } | |
2369 | } | |
2370 | @@ -1298,23 +1298,23 @@ IFusionSoundMusicProvider_CDDA_WaitStatus( IFusionSoundMusicProvider *thiz, | |
2371 | ||
2372 | pthread_mutex_unlock( &data->lock ); | |
2373 | ||
2374 | - return DFB_OK; | |
2375 | + return DR_OK; | |
2376 | } | |
2377 | ||
2378 | /* exported symbols */ | |
2379 | ||
2380 | -static DFBResult | |
2381 | +static DirectResult | |
2382 | Probe( IFusionSoundMusicProvider_ProbeContext *ctx ) | |
2383 | { | |
2384 | return cdda_probe( direct_stream_fileno( ctx->stream ) ); | |
2385 | } | |
2386 | ||
2387 | -static DFBResult | |
2388 | +static DirectResult | |
2389 | Construct( IFusionSoundMusicProvider *thiz, | |
2390 | const char *filename, | |
2391 | DirectStream *stream ) | |
2392 | { | |
2393 | - DFBResult err; | |
2394 | + DirectResult err; | |
2395 | ||
2396 | DIRECT_ALLOCATE_INTERFACE_DATA( thiz, IFusionSoundMusicProvider_CDDA ) | |
2397 | ||
2398 | @@ -1324,7 +1324,7 @@ Construct( IFusionSoundMusicProvider *thiz, | |
2399 | data->fd = dup( direct_stream_fileno( stream ) ); | |
2400 | if (data->fd < 0) { | |
2401 | IFusionSoundMusicProvider_CDDA_Destruct( thiz ); | |
2402 | - return DFB_IO; | |
2403 | + return DR_IO; | |
2404 | } | |
2405 | ||
2406 | /* reset to blocking mode */ | |
2407 | @@ -1332,7 +1332,7 @@ Construct( IFusionSoundMusicProvider *thiz, | |
2408 | fcntl( data->fd, F_GETFL ) & ~O_NONBLOCK ); | |
2409 | ||
2410 | err = cdda_build_tracklits( data->fd, &data->tracks, &data->total_tracks ); | |
2411 | - if (err != DFB_OK) { | |
2412 | + if (err != DR_OK) { | |
2413 | IFusionSoundMusicProvider_CDDA_Destruct( thiz ); | |
2414 | return err; | |
2415 | } | |
2416 | @@ -1364,6 +1364,6 @@ Construct( IFusionSoundMusicProvider *thiz, | |
2417 | thiz->SetPlaybackFlags = IFusionSoundMusicProvider_CDDA_SetPlaybackFlags; | |
2418 | thiz->WaitStatus = IFusionSoundMusicProvider_CDDA_WaitStatus; | |
2419 | ||
2420 | - return DFB_OK; | |
2421 | + return DR_OK; | |
2422 | } | |
2423 | ||
2424 | diff --git a/interfaces/IFusionSoundMusicProvider/ifusionsoundmusicprovider_ffmpeg.c b/interfaces/IFusionSoundMusicProvider/ifusionsoundmusicprovider_ffmpeg.c | |
2425 | index 9302248..2a99a16 100644 | |
2426 | --- a/interfaces/IFusionSoundMusicProvider/ifusionsoundmusicprovider_ffmpeg.c | |
2427 | +++ b/interfaces/IFusionSoundMusicProvider/ifusionsoundmusicprovider_ffmpeg.c | |
2428 | @@ -44,10 +44,10 @@ | |
2429 | #include <avcodec.h> | |
2430 | #include <avformat.h> | |
2431 | ||
2432 | -static DFBResult | |
2433 | +static DirectResult | |
2434 | Probe( IFusionSoundMusicProvider_ProbeContext *ctx ); | |
2435 | ||
2436 | -static DFBResult | |
2437 | +static DirectResult | |
2438 | Construct( IFusionSoundMusicProvider *thiz, | |
2439 | const char *filename, | |
2440 | DirectStream *stream ); | |
2441 | @@ -113,7 +113,7 @@ av_read_callback( void *opaque, uint8_t *buf, int size ) | |
2442 | ret = direct_stream_read( data->stream, size, buf+len, &read ); | |
2443 | if (ret) { | |
2444 | if (!len) | |
2445 | - return (ret == DFB_EOF) ? 0 : -1; | |
2446 | + return (ret == DR_EOF) ? 0 : -1; | |
2447 | break; | |
2448 | } | |
2449 | len += read; | |
2450 | @@ -147,11 +147,11 @@ av_seek_callback( void *opaque, offset_t offset, int whence ) | |
2451 | ret = direct_stream_seek( data->stream, pos-offset ); | |
2452 | break; | |
2453 | default: | |
2454 | - ret = DFB_UNSUPPORTED; | |
2455 | + ret = DR_UNSUPPORTED; | |
2456 | break; | |
2457 | } | |
2458 | ||
2459 | - if (ret != DFB_OK) | |
2460 | + if (ret != DR_OK) | |
2461 | return -1; | |
2462 | ||
2463 | return direct_stream_offset( data->stream ); | |
2464 | @@ -435,17 +435,17 @@ IFusionSoundMusicProvider_FFmpeg_Destruct( IFusionSoundMusicProvider *thiz ) | |
2465 | DIRECT_DEALLOCATE_INTERFACE( thiz ); | |
2466 | } | |
2467 | ||
2468 | -static DFBResult | |
2469 | +static DirectResult | |
2470 | IFusionSoundMusicProvider_FFmpeg_AddRef( IFusionSoundMusicProvider *thiz ) | |
2471 | { | |
2472 | DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_FFmpeg ) | |
2473 | ||
2474 | data->ref++; | |
2475 | ||
2476 | - return DFB_OK; | |
2477 | + return DR_OK; | |
2478 | } | |
2479 | ||
2480 | -static DFBResult | |
2481 | +static DirectResult | |
2482 | IFusionSoundMusicProvider_FFmpeg_Release( IFusionSoundMusicProvider *thiz ) | |
2483 | { | |
2484 | DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_FFmpeg ) | |
2485 | @@ -453,33 +453,33 @@ IFusionSoundMusicProvider_FFmpeg_Release( IFusionSoundMusicProvider *thiz ) | |
2486 | if (--data->ref == 0) | |
2487 | IFusionSoundMusicProvider_FFmpeg_Destruct( thiz ); | |
2488 | ||
2489 | - return DFB_OK; | |
2490 | + return DR_OK; | |
2491 | } | |
2492 | ||
2493 | -static DFBResult | |
2494 | +static DirectResult | |
2495 | IFusionSoundMusicProvider_FFmpeg_GetCapabilities( IFusionSoundMusicProvider *thiz, | |
2496 | FSMusicProviderCapabilities *caps ) | |
2497 | { | |
2498 | DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_FFmpeg ) | |
2499 | ||
2500 | if (!caps) | |
2501 | - return DFB_INVARG; | |
2502 | + return DR_INVARG; | |
2503 | ||
2504 | *caps = FMCAPS_BASIC; | |
2505 | if (direct_stream_seekable( data->stream )) | |
2506 | *caps |= FMCAPS_SEEK; | |
2507 | ||
2508 | - return DFB_OK; | |
2509 | + return DR_OK; | |
2510 | } | |
2511 | ||
2512 | -static DFBResult | |
2513 | +static DirectResult | |
2514 | IFusionSoundMusicProvider_FFmpeg_GetTrackDescription( IFusionSoundMusicProvider *thiz, | |
2515 | FSTrackDescription *desc ) | |
2516 | { | |
2517 | DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_FFmpeg ) | |
2518 | ||
2519 | if (!desc) | |
2520 | - return DFB_INVARG; | |
2521 | + return DR_INVARG; | |
2522 | ||
2523 | direct_snputs( desc->artist, data->ctx->author, FS_TRACK_DESC_ARTIST_LENGTH ); | |
2524 | direct_snputs( desc->title, data->ctx->title, FS_TRACK_DESC_TITLE_LENGTH ); | |
2525 | @@ -490,17 +490,17 @@ IFusionSoundMusicProvider_FFmpeg_GetTrackDescription( IFusionSoundMusicProvider | |
2526 | desc->bitrate = data->codec->bit_rate; | |
2527 | desc->replaygain = desc->replaygain_album = 0; | |
2528 | ||
2529 | - return DFB_OK; | |
2530 | + return DR_OK; | |
2531 | } | |
2532 | ||
2533 | -static DFBResult | |
2534 | +static DirectResult | |
2535 | IFusionSoundMusicProvider_FFmpeg_GetStreamDescription( IFusionSoundMusicProvider *thiz, | |
2536 | FSStreamDescription *desc ) | |
2537 | { | |
2538 | DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_FFmpeg ) | |
2539 | ||
2540 | if (!desc) | |
2541 | - return DFB_INVARG; | |
2542 | + return DR_INVARG; | |
2543 | ||
2544 | desc->flags = FSSDF_SAMPLERATE | FSSDF_CHANNELS | | |
2545 | FSSDF_SAMPLEFORMAT | FSSDF_BUFFERSIZE; | |
2546 | @@ -509,17 +509,17 @@ IFusionSoundMusicProvider_FFmpeg_GetStreamDescription( IFusionSoundMusicProvider | |
2547 | desc->sampleformat = FSSF_S16; | |
2548 | desc->buffersize = desc->samplerate/8; | |
2549 | ||
2550 | - return DFB_OK; | |
2551 | + return DR_OK; | |
2552 | } | |
2553 | ||
2554 | -static DFBResult | |
2555 | +static DirectResult | |
2556 | IFusionSoundMusicProvider_FFmpeg_GetBufferDescription( IFusionSoundMusicProvider *thiz, | |
2557 | FSBufferDescription *desc ) | |
2558 | { | |
2559 | DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_FFmpeg ) | |
2560 | ||
2561 | if (!desc) | |
2562 | - return DFB_INVARG; | |
2563 | + return DR_INVARG; | |
2564 | ||
2565 | desc->flags = FSBDF_SAMPLERATE | FSBDF_CHANNELS | | |
2566 | FSBDF_SAMPLEFORMAT | FSBDF_LENGTH; | |
2567 | @@ -531,7 +531,7 @@ IFusionSoundMusicProvider_FFmpeg_GetBufferDescription( IFusionSoundMusicProvider | |
2568 | else | |
2569 | desc->length = MIN((s64)data->ctx->duration*desc->samplerate/AV_TIME_BASE, FS_MAX_FRAMES); | |
2570 | ||
2571 | - return DFB_OK; | |
2572 | + return DR_OK; | |
2573 | } | |
2574 | ||
2575 | static void* | |
2576 | @@ -644,7 +644,7 @@ FFmpegStreamThread( DirectThread *thread, void *ctx ) | |
2577 | return (void*)0; | |
2578 | } | |
2579 | ||
2580 | -static DFBResult | |
2581 | +static DirectResult | |
2582 | IFusionSoundMusicProvider_FFmpeg_PlayToStream( IFusionSoundMusicProvider *thiz, | |
2583 | IFusionSoundStream *destination ) | |
2584 | { | |
2585 | @@ -653,16 +653,16 @@ IFusionSoundMusicProvider_FFmpeg_PlayToStream( IFusionSoundMusicProvider *thiz, | |
2586 | DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_FFmpeg ) | |
2587 | ||
2588 | if (!destination) | |
2589 | - return DFB_INVARG; | |
2590 | + return DR_INVARG; | |
2591 | ||
2592 | if (data->dest.stream == destination) | |
2593 | - return DFB_OK; | |
2594 | + return DR_OK; | |
2595 | ||
2596 | destination->GetDescription( destination, &desc ); | |
2597 | ||
2598 | /* check whether destination samplerate is supported */ | |
2599 | if (desc.samplerate != data->codec->sample_rate) | |
2600 | - return DFB_UNSUPPORTED; | |
2601 | + return DR_UNSUPPORTED; | |
2602 | ||
2603 | /* check whether destination format is supported */ | |
2604 | switch (desc.sampleformat) { | |
2605 | @@ -673,7 +673,7 @@ IFusionSoundMusicProvider_FFmpeg_PlayToStream( IFusionSoundMusicProvider *thiz, | |
2606 | case FSSF_FLOAT: | |
2607 | break; | |
2608 | default: | |
2609 | - return DFB_UNSUPPORTED; | |
2610 | + return DR_UNSUPPORTED; | |
2611 | } | |
2612 | ||
2613 | /* check whether destination mode is supported */ | |
2614 | @@ -693,7 +693,7 @@ IFusionSoundMusicProvider_FFmpeg_PlayToStream( IFusionSoundMusicProvider *thiz, | |
2615 | case FSCM_SURROUND51: | |
2616 | break; | |
2617 | default: | |
2618 | - return DFB_UNSUPPORTED; | |
2619 | + return DR_UNSUPPORTED; | |
2620 | } | |
2621 | ||
2622 | pthread_mutex_lock( &data->lock ); | |
2623 | @@ -703,7 +703,7 @@ IFusionSoundMusicProvider_FFmpeg_PlayToStream( IFusionSoundMusicProvider *thiz, | |
2624 | if (data->finished) { | |
2625 | if (av_seek_frame( data->ctx, -1, 0, AVSEEK_FLAG_BACKWARD ) < 0) { | |
2626 | pthread_mutex_unlock( &data->lock ); | |
2627 | - return DFB_UNSUPPORTED; | |
2628 | + return DR_UNSUPPORTED; | |
2629 | } | |
2630 | data->finished = false; | |
2631 | } | |
2632 | @@ -712,7 +712,7 @@ IFusionSoundMusicProvider_FFmpeg_PlayToStream( IFusionSoundMusicProvider *thiz, | |
2633 | data->buf = D_MALLOC( AVCODEC_MAX_AUDIO_FRAME_SIZE ); | |
2634 | if (!data->buf) { | |
2635 | pthread_mutex_unlock( &data->lock ); | |
2636 | - return DFB_NOSYSTEMMEMORY; | |
2637 | + return DR_NOLOCALMEMORY; | |
2638 | } | |
2639 | } | |
2640 | ||
2641 | @@ -730,7 +730,7 @@ IFusionSoundMusicProvider_FFmpeg_PlayToStream( IFusionSoundMusicProvider *thiz, | |
2642 | ||
2643 | pthread_mutex_unlock( &data->lock ); | |
2644 | ||
2645 | - return DFB_OK; | |
2646 | + return DR_OK; | |
2647 | } | |
2648 | ||
2649 | static void* | |
2650 | @@ -860,7 +860,7 @@ FFmpegBufferThread( DirectThread *thread, void *ctx ) | |
2651 | return (void*)0; | |
2652 | } | |
2653 | ||
2654 | -static DFBResult | |
2655 | +static DirectResult | |
2656 | IFusionSoundMusicProvider_FFmpeg_PlayToBuffer( IFusionSoundMusicProvider *thiz, | |
2657 | IFusionSoundBuffer *destination, | |
2658 | FMBufferCallback callback, | |
2659 | @@ -871,16 +871,16 @@ IFusionSoundMusicProvider_FFmpeg_PlayToBuffer( IFusionSoundMusicProvider *thiz, | |
2660 | DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_FFmpeg ) | |
2661 | ||
2662 | if (!destination) | |
2663 | - return DFB_INVARG; | |
2664 | + return DR_INVARG; | |
2665 | ||
2666 | if (data->dest.buffer == destination) | |
2667 | - return DFB_OK; | |
2668 | + return DR_OK; | |
2669 | ||
2670 | destination->GetDescription( destination, &desc ); | |
2671 | ||
2672 | /* check whether destination samplerate is supported */ | |
2673 | if (desc.samplerate != data->codec->sample_rate) | |
2674 | - return DFB_UNSUPPORTED; | |
2675 | + return DR_UNSUPPORTED; | |
2676 | ||
2677 | /* check whether destination format is supported */ | |
2678 | switch (desc.sampleformat) { | |
2679 | @@ -891,7 +891,7 @@ IFusionSoundMusicProvider_FFmpeg_PlayToBuffer( IFusionSoundMusicProvider *thiz, | |
2680 | case FSSF_FLOAT: | |
2681 | break; | |
2682 | default: | |
2683 | - return DFB_UNSUPPORTED; | |
2684 | + return DR_UNSUPPORTED; | |
2685 | } | |
2686 | ||
2687 | /* check whether destination mode is supported */ | |
2688 | @@ -911,7 +911,7 @@ IFusionSoundMusicProvider_FFmpeg_PlayToBuffer( IFusionSoundMusicProvider *thiz, | |
2689 | case FSCM_SURROUND51: | |
2690 | break; | |
2691 | default: | |
2692 | - return DFB_UNSUPPORTED; | |
2693 | + return DR_UNSUPPORTED; | |
2694 | } | |
2695 | ||
2696 | pthread_mutex_lock( &data->lock ); | |
2697 | @@ -921,7 +921,7 @@ IFusionSoundMusicProvider_FFmpeg_PlayToBuffer( IFusionSoundMusicProvider *thiz, | |
2698 | if (data->finished) { | |
2699 | if (av_seek_frame( data->ctx, -1, 0, AVSEEK_FLAG_BACKWARD ) < 0) { | |
2700 | pthread_mutex_unlock( &data->lock ); | |
2701 | - return DFB_UNSUPPORTED; | |
2702 | + return DR_UNSUPPORTED; | |
2703 | } | |
2704 | data->finished = false; | |
2705 | } | |
2706 | @@ -930,7 +930,7 @@ IFusionSoundMusicProvider_FFmpeg_PlayToBuffer( IFusionSoundMusicProvider *thiz, | |
2707 | data->buf = D_MALLOC( AVCODEC_MAX_AUDIO_FRAME_SIZE ); | |
2708 | if (!data->buf) { | |
2709 | pthread_mutex_unlock( &data->lock ); | |
2710 | - return DFB_NOSYSTEMMEMORY; | |
2711 | + return DR_NOLOCALMEMORY; | |
2712 | } | |
2713 | } | |
2714 | ||
2715 | @@ -951,10 +951,10 @@ IFusionSoundMusicProvider_FFmpeg_PlayToBuffer( IFusionSoundMusicProvider *thiz, | |
2716 | ||
2717 | pthread_mutex_unlock( &data->lock ); | |
2718 | ||
2719 | - return DFB_OK; | |
2720 | + return DR_OK; | |
2721 | } | |
2722 | ||
2723 | -static DFBResult | |
2724 | +static DirectResult | |
2725 | IFusionSoundMusicProvider_FFmpeg_Stop( IFusionSoundMusicProvider *thiz ) | |
2726 | { | |
2727 | DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_FFmpeg ) | |
2728 | @@ -967,41 +967,41 @@ IFusionSoundMusicProvider_FFmpeg_Stop( IFusionSoundMusicProvider *thiz ) | |
2729 | ||
2730 | pthread_mutex_unlock( &data->lock ); | |
2731 | ||
2732 | - return DFB_OK; | |
2733 | + return DR_OK; | |
2734 | } | |
2735 | ||
2736 | -static DFBResult | |
2737 | +static DirectResult | |
2738 | IFusionSoundMusicProvider_FFmpeg_GetStatus( IFusionSoundMusicProvider *thiz, | |
2739 | FSMusicProviderStatus *status ) | |
2740 | { | |
2741 | DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_FFmpeg ) | |
2742 | ||
2743 | if (!status) | |
2744 | - return DFB_INVARG; | |
2745 | + return DR_INVARG; | |
2746 | ||
2747 | *status = data->status; | |
2748 | ||
2749 | - return DFB_OK; | |
2750 | + return DR_OK; | |
2751 | } | |
2752 | ||
2753 | -static DFBResult | |
2754 | +static DirectResult | |
2755 | IFusionSoundMusicProvider_FFmpeg_SeekTo( IFusionSoundMusicProvider *thiz, | |
2756 | double seconds ) | |
2757 | { | |
2758 | - DFBResult ret; | |
2759 | + DirectResult ret; | |
2760 | s64 time; | |
2761 | ||
2762 | DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_FFmpeg ) | |
2763 | ||
2764 | if (seconds < 0.0) | |
2765 | - return DFB_INVARG; | |
2766 | + return DR_INVARG; | |
2767 | ||
2768 | if (!direct_stream_seekable( data->stream )) | |
2769 | - return DFB_UNSUPPORTED; | |
2770 | + return DR_UNSUPPORTED; | |
2771 | ||
2772 | time = seconds * AV_TIME_BASE; | |
2773 | if (data->ctx->duration != AV_NOPTS_VALUE && time > data->ctx->duration) | |
2774 | - return DFB_OK; | |
2775 | + return DR_OK; | |
2776 | ||
2777 | pthread_mutex_lock( &data->lock ); | |
2778 | ||
2779 | @@ -1010,10 +1010,10 @@ IFusionSoundMusicProvider_FFmpeg_SeekTo( IFusionSoundMusicProvider *thiz, | |
2780 | data->seeked = true; | |
2781 | data->finished = false; | |
2782 | data->pts = time; | |
2783 | - ret = DFB_OK; | |
2784 | + ret = DR_OK; | |
2785 | } | |
2786 | else { | |
2787 | - ret = DFB_FAILURE; | |
2788 | + ret = DR_FAILURE; | |
2789 | } | |
2790 | ||
2791 | pthread_mutex_unlock( &data->lock ); | |
2792 | @@ -1021,7 +1021,7 @@ IFusionSoundMusicProvider_FFmpeg_SeekTo( IFusionSoundMusicProvider *thiz, | |
2793 | return ret; | |
2794 | } | |
2795 | ||
2796 | -static DFBResult | |
2797 | +static DirectResult | |
2798 | IFusionSoundMusicProvider_FFmpeg_GetPos( IFusionSoundMusicProvider *thiz, | |
2799 | double *seconds ) | |
2800 | { | |
2801 | @@ -1030,7 +1030,7 @@ IFusionSoundMusicProvider_FFmpeg_GetPos( IFusionSoundMusicProvider *thiz, | |
2802 | DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_FFmpeg ) | |
2803 | ||
2804 | if (!seconds) | |
2805 | - return DFB_INVARG; | |
2806 | + return DR_INVARG; | |
2807 | ||
2808 | pos = data->pts; | |
2809 | if (data->dest.stream) { | |
2810 | @@ -1042,43 +1042,43 @@ IFusionSoundMusicProvider_FFmpeg_GetPos( IFusionSoundMusicProvider *thiz, | |
2811 | ||
2812 | *seconds = (double)pos / AV_TIME_BASE; | |
2813 | ||
2814 | - return DFB_OK; | |
2815 | + return DR_OK; | |
2816 | } | |
2817 | ||
2818 | -static DFBResult | |
2819 | +static DirectResult | |
2820 | IFusionSoundMusicProvider_FFmpeg_GetLength( IFusionSoundMusicProvider *thiz, | |
2821 | double *seconds ) | |
2822 | { | |
2823 | DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_FFmpeg ) | |
2824 | ||
2825 | if (!seconds) | |
2826 | - return DFB_INVARG; | |
2827 | + return DR_INVARG; | |
2828 | ||
2829 | if (data->ctx->duration > 0) { | |
2830 | *seconds = (double)data->ctx->duration / AV_TIME_BASE; | |
2831 | - return DFB_OK; | |
2832 | + return DR_OK; | |
2833 | } | |
2834 | ||
2835 | *seconds = 0.0; | |
2836 | ||
2837 | - return DFB_UNSUPPORTED; | |
2838 | + return DR_UNSUPPORTED; | |
2839 | } | |
2840 | ||
2841 | -static DFBResult | |
2842 | +static DirectResult | |
2843 | IFusionSoundMusicProvider_FFmpeg_SetPlaybackFlags( IFusionSoundMusicProvider *thiz, | |
2844 | FSMusicProviderPlaybackFlags flags ) | |
2845 | { | |
2846 | DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_FFmpeg ) | |
2847 | ||
2848 | if (flags & ~FMPLAY_LOOPING) | |
2849 | - return DFB_UNSUPPORTED; | |
2850 | + return DR_UNSUPPORTED; | |
2851 | ||
2852 | data->flags = flags; | |
2853 | ||
2854 | - return DFB_OK; | |
2855 | + return DR_OK; | |
2856 | } | |
2857 | ||
2858 | -static DFBResult | |
2859 | +static DirectResult | |
2860 | IFusionSoundMusicProvider_FFmpeg_WaitStatus( IFusionSoundMusicProvider *thiz, | |
2861 | FSMusicProviderStatus mask, | |
2862 | unsigned int timeout ) | |
2863 | @@ -1086,7 +1086,7 @@ IFusionSoundMusicProvider_FFmpeg_WaitStatus( IFusionSoundMusicProvider *thiz, | |
2864 | DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_FFmpeg ) | |
2865 | ||
2866 | if (!mask || mask & ~FMSTATE_ALL) | |
2867 | - return DFB_INVARG; | |
2868 | + return DR_INVARG; | |
2869 | ||
2870 | if (timeout) { | |
2871 | struct timespec t; | |
2872 | @@ -1098,18 +1098,18 @@ IFusionSoundMusicProvider_FFmpeg_WaitStatus( IFusionSoundMusicProvider *thiz, | |
2873 | ||
2874 | #ifdef HAVE_PTHREAD_MUTEX_TIMEDLOCK | |
2875 | if (pthread_mutex_timedlock( &data->lock, &t )) | |
2876 | - return DFB_TIMEOUT; | |
2877 | + return DR_TIMEOUT; | |
2878 | #else | |
2879 | while (pthread_mutex_trylock( &data->lock )) { | |
2880 | usleep( 1000 ); | |
2881 | if (direct_clock_get_abs_micros() >= s) | |
2882 | - return DFB_TIMEOUT; | |
2883 | + return DR_TIMEOUT; | |
2884 | } | |
2885 | #endif | |
2886 | while (!(data->status & mask)) { | |
2887 | if (pthread_cond_timedwait( &data->cond, &data->lock, &t ) == ETIMEDOUT) { | |
2888 | pthread_mutex_unlock( &data->lock ); | |
2889 | - return DFB_TIMEOUT; | |
2890 | + return DR_TIMEOUT; | |
2891 | } | |
2892 | } | |
2893 | } | |
2894 | @@ -1122,12 +1122,12 @@ IFusionSoundMusicProvider_FFmpeg_WaitStatus( IFusionSoundMusicProvider *thiz, | |
2895 | ||
2896 | pthread_mutex_unlock( &data->lock ); | |
2897 | ||
2898 | - return DFB_OK; | |
2899 | + return DR_OK; | |
2900 | } | |
2901 | ||
2902 | /*****************************************************************************/ | |
2903 | ||
2904 | -static DFBResult | |
2905 | +static DirectResult | |
2906 | Probe( IFusionSoundMusicProvider_ProbeContext *ctx ) | |
2907 | { | |
2908 | AVProbeData pd; | |
2909 | @@ -1146,13 +1146,13 @@ Probe( IFusionSoundMusicProvider_ProbeContext *ctx ) | |
2910 | !strcmp( format->name, "aac" ) || | |
2911 | !strcmp( format->name, "ac3" ) || | |
2912 | !strcmp( format->name, "flac" )) | |
2913 | - return DFB_OK; | |
2914 | + return DR_OK; | |
2915 | } | |
2916 | ||
2917 | - return DFB_UNSUPPORTED; | |
2918 | + return DR_UNSUPPORTED; | |
2919 | } | |
2920 | ||
2921 | -static DFBResult | |
2922 | +static DirectResult | |
2923 | Construct( IFusionSoundMusicProvider *thiz, | |
2924 | const char *filename, | |
2925 | DirectStream *stream ) | |
2926 | @@ -1178,7 +1178,7 @@ Construct( IFusionSoundMusicProvider *thiz, | |
2927 | fmt = av_probe_input_format( &pd, 1 ); | |
2928 | if (!fmt) { | |
2929 | IFusionSoundMusicProvider_FFmpeg_Destruct( thiz ); | |
2930 | - return DFB_INIT; | |
2931 | + return DR_INIT; | |
2932 | } | |
2933 | ||
2934 | data->iobuf = D_MALLOC( 4096 ); | |
2935 | @@ -1192,19 +1192,19 @@ Construct( IFusionSoundMusicProvider *thiz, | |
2936 | direct_stream_seekable( stream ) ? av_seek_callback : NULL ) < 0) { | |
2937 | D_ERROR( "IFusionSoundMusicProvider_FFmpeg: init_put_byte() failed!\n" ); | |
2938 | IFusionSoundMusicProvider_FFmpeg_Destruct( thiz ); | |
2939 | - return DFB_INIT; | |
2940 | + return DR_INIT; | |
2941 | } | |
2942 | ||
2943 | if (av_open_input_stream( &data->ctx, &data->pb, filename, fmt, NULL ) < 0) { | |
2944 | D_ERROR( "IFusionSoundMusicProvider_FFmpeg: av_open_input_stream() failed!\n" ); | |
2945 | IFusionSoundMusicProvider_FFmpeg_Destruct( thiz ); | |
2946 | - return DFB_FAILURE; | |
2947 | + return DR_FAILURE; | |
2948 | } | |
2949 | ||
2950 | if (av_find_stream_info( data->ctx ) < 0) { | |
2951 | D_ERROR( "IFusionSoundMusicProvider_FFmpeg: couldn't find stream info!\n" ); | |
2952 | IFusionSoundMusicProvider_FFmpeg_Destruct( thiz ); | |
2953 | - return DFB_FAILURE; | |
2954 | + return DR_FAILURE; | |
2955 | } | |
2956 | ||
2957 | for (i = 0; i < data->ctx->nb_streams; i++) { | |
2958 | @@ -1217,7 +1217,7 @@ Construct( IFusionSoundMusicProvider *thiz, | |
2959 | if (!data->st) { | |
2960 | D_ERROR( "IFusionSoundMusicProvider_FFmpeg: couldn't find audio stream!\n" ); | |
2961 | IFusionSoundMusicProvider_FFmpeg_Destruct( thiz ); | |
2962 | - return DFB_FAILURE; | |
2963 | + return DR_FAILURE; | |
2964 | } | |
2965 | ||
2966 | data->codec = data->st->codec; | |
2967 | @@ -1225,7 +1225,7 @@ Construct( IFusionSoundMusicProvider *thiz, | |
2968 | if (!c || avcodec_open( data->codec, c ) < 0) { | |
2969 | D_ERROR( "IFusionSoundMusicProvider_FFmpeg: couldn't find audio decoder!\n" ); | |
2970 | IFusionSoundMusicProvider_FFmpeg_Destruct( thiz ); | |
2971 | - return DFB_FAILURE; | |
2972 | + return DR_FAILURE; | |
2973 | } | |
2974 | ||
2975 | direct_util_recursive_pthread_mutex_init( &data->lock ); | |
2976 | @@ -1248,5 +1248,5 @@ Construct( IFusionSoundMusicProvider *thiz, | |
2977 | thiz->SetPlaybackFlags = IFusionSoundMusicProvider_FFmpeg_SetPlaybackFlags; | |
2978 | thiz->WaitStatus = IFusionSoundMusicProvider_FFmpeg_WaitStatus; | |
2979 | ||
2980 | - return DFB_OK; | |
2981 | + return DR_OK; | |
2982 | } | |
2983 | diff --git a/interfaces/IFusionSoundMusicProvider/ifusionsoundmusicprovider_mad.c b/interfaces/IFusionSoundMusicProvider/ifusionsoundmusicprovider_mad.c | |
2984 | index 04efb9f..bd45b3f 100644 | |
2985 | --- a/interfaces/IFusionSoundMusicProvider/ifusionsoundmusicprovider_mad.c | |
2986 | +++ b/interfaces/IFusionSoundMusicProvider/ifusionsoundmusicprovider_mad.c | |
2987 | @@ -44,10 +44,10 @@ | |
2988 | #include <mad.h> | |
2989 | ||
2990 | ||
2991 | -static DFBResult | |
2992 | +static DirectResult | |
2993 | Probe( IFusionSoundMusicProvider_ProbeContext *ctx ); | |
2994 | ||
2995 | -static DFBResult | |
2996 | +static DirectResult | |
2997 | Construct( IFusionSoundMusicProvider *thiz, | |
2998 | const char *filename, | |
2999 | DirectStream *stream ); | |
3000 | @@ -429,17 +429,17 @@ IFusionSoundMusicProvider_Mad_Destruct( IFusionSoundMusicProvider *thiz ) | |
3001 | DIRECT_DEALLOCATE_INTERFACE( thiz ); | |
3002 | } | |
3003 | ||
3004 | -static DFBResult | |
3005 | +static DirectResult | |
3006 | IFusionSoundMusicProvider_Mad_AddRef( IFusionSoundMusicProvider *thiz ) | |
3007 | { | |
3008 | DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_Mad ) | |
3009 | ||
3010 | data->ref++; | |
3011 | ||
3012 | - return DFB_OK; | |
3013 | + return DR_OK; | |
3014 | } | |
3015 | ||
3016 | -static DFBResult | |
3017 | +static DirectResult | |
3018 | IFusionSoundMusicProvider_Mad_Release( IFusionSoundMusicProvider *thiz ) | |
3019 | { | |
3020 | DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_Mad ) | |
3021 | @@ -447,47 +447,47 @@ IFusionSoundMusicProvider_Mad_Release( IFusionSoundMusicProvider *thiz ) | |
3022 | if (--data->ref == 0) | |
3023 | IFusionSoundMusicProvider_Mad_Destruct( thiz ); | |
3024 | ||
3025 | - return DFB_OK; | |
3026 | + return DR_OK; | |
3027 | } | |
3028 | ||
3029 | -static DFBResult | |
3030 | +static DirectResult | |
3031 | IFusionSoundMusicProvider_Mad_GetCapabilities( IFusionSoundMusicProvider *thiz, | |
3032 | FSMusicProviderCapabilities *caps ) | |
3033 | { | |
3034 | DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_Mad ) | |
3035 | ||
3036 | if (!caps) | |
3037 | - return DFB_INVARG; | |
3038 | + return DR_INVARG; | |
3039 | ||
3040 | *caps = FMCAPS_BASIC | FMCAPS_HALFRATE; | |
3041 | if (direct_stream_seekable( data->s )) | |
3042 | *caps |= FMCAPS_SEEK; | |
3043 | ||
3044 | - return DFB_OK; | |
3045 | + return DR_OK; | |
3046 | } | |
3047 | ||
3048 | -static DFBResult | |
3049 | +static DirectResult | |
3050 | IFusionSoundMusicProvider_Mad_GetTrackDescription( IFusionSoundMusicProvider *thiz, | |
3051 | FSTrackDescription *desc ) | |
3052 | { | |
3053 | DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_Mad ) | |
3054 | ||
3055 | if (!desc) | |
3056 | - return DFB_INVARG; | |
3057 | + return DR_INVARG; | |
3058 | ||
3059 | *desc = data->desc; | |
3060 | ||
3061 | - return DFB_OK; | |
3062 | + return DR_OK; | |
3063 | } | |
3064 | ||
3065 | -static DFBResult | |
3066 | +static DirectResult | |
3067 | IFusionSoundMusicProvider_Mad_GetStreamDescription( IFusionSoundMusicProvider *thiz, | |
3068 | FSStreamDescription *desc ) | |
3069 | { | |
3070 | DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_Mad ) | |
3071 | ||
3072 | if (!desc) | |
3073 | - return DFB_INVARG; | |
3074 | + return DR_INVARG; | |
3075 | ||
3076 | desc->flags = FSSDF_SAMPLERATE | FSSDF_CHANNELS | | |
3077 | FSSDF_SAMPLEFORMAT | FSSDF_BUFFERSIZE; | |
3078 | @@ -496,17 +496,17 @@ IFusionSoundMusicProvider_Mad_GetStreamDescription( IFusionSoundMusicProvider *t | |
3079 | desc->sampleformat = FSSF_S32; | |
3080 | desc->buffersize = data->samplerate/8; | |
3081 | ||
3082 | - return DFB_OK; | |
3083 | + return DR_OK; | |
3084 | } | |
3085 | ||
3086 | -static DFBResult | |
3087 | +static DirectResult | |
3088 | IFusionSoundMusicProvider_Mad_GetBufferDescription( IFusionSoundMusicProvider *thiz, | |
3089 | FSBufferDescription *desc ) | |
3090 | { | |
3091 | DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_Mad ) | |
3092 | ||
3093 | if (!desc) | |
3094 | - return DFB_INVARG; | |
3095 | + return DR_INVARG; | |
3096 | ||
3097 | desc->flags = FSBDF_SAMPLERATE | FSBDF_CHANNELS | | |
3098 | FSBDF_SAMPLEFORMAT | FSBDF_LENGTH; | |
3099 | @@ -515,7 +515,7 @@ IFusionSoundMusicProvider_Mad_GetBufferDescription( IFusionSoundMusicProvider *t | |
3100 | desc->sampleformat = FSSF_S32; | |
3101 | desc->length = MIN(data->frames, FS_MAX_FRAMES); | |
3102 | ||
3103 | - return DFB_OK; | |
3104 | + return DR_OK; | |
3105 | } | |
3106 | ||
3107 | static void* | |
3108 | @@ -529,7 +529,7 @@ MadStreamThread( DirectThread *thread, void *ctx ) | |
3109 | direct_stream_wait( data->s, data->read_size, NULL ); | |
3110 | ||
3111 | while (data->status == FMSTATE_PLAY) { | |
3112 | - DFBResult ret = DFB_OK; | |
3113 | + DirectResult ret = DR_OK; | |
3114 | unsigned int len = data->read_size; | |
3115 | int offset = 0; | |
3116 | struct timeval tv = { 0, 500 }; | |
3117 | @@ -554,7 +554,7 @@ MadStreamThread( DirectThread *thread, void *ctx ) | |
3118 | ||
3119 | if (offset < data->read_size) { | |
3120 | ret = direct_stream_wait( data->s, data->read_size, &tv ); | |
3121 | - if (ret != DFB_TIMEOUT) { | |
3122 | + if (ret != DR_TIMEOUT) { | |
3123 | ret = direct_stream_read( data->s, | |
3124 | data->read_size-offset, | |
3125 | data->read_buffer+offset, &len ); | |
3126 | @@ -562,7 +562,7 @@ MadStreamThread( DirectThread *thread, void *ctx ) | |
3127 | } | |
3128 | ||
3129 | if (ret) { | |
3130 | - if (ret == DFB_EOF) { | |
3131 | + if (ret == DR_EOF) { | |
3132 | if (data->flags & FMPLAY_LOOPING) { | |
3133 | direct_stream_seek( data->s, 0 ); | |
3134 | } | |
3135 | @@ -616,7 +616,7 @@ MadStreamThread( DirectThread *thread, void *ctx ) | |
3136 | return NULL; | |
3137 | } | |
3138 | ||
3139 | -static DFBResult | |
3140 | +static DirectResult | |
3141 | IFusionSoundMusicProvider_Mad_PlayToStream( IFusionSoundMusicProvider *thiz, | |
3142 | IFusionSoundStream *destination ) | |
3143 | { | |
3144 | @@ -625,21 +625,21 @@ IFusionSoundMusicProvider_Mad_PlayToStream( IFusionSoundMusicProvider *thiz, | |
3145 | DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_Mad ) | |
3146 | ||
3147 | if (!destination) | |
3148 | - return DFB_INVARG; | |
3149 | + return DR_INVARG; | |
3150 | ||
3151 | if (data->dest.stream == destination) | |
3152 | - return DFB_OK; | |
3153 | + return DR_OK; | |
3154 | ||
3155 | destination->GetDescription( destination, &desc ); | |
3156 | ||
3157 | /* check whether destination samplerate is supported */ | |
3158 | if (desc.samplerate != data->samplerate && | |
3159 | desc.samplerate != data->samplerate/2) | |
3160 | - return DFB_UNSUPPORTED; | |
3161 | + return DR_UNSUPPORTED; | |
3162 | ||
3163 | /* check whether number of channels is supported */ | |
3164 | if (desc.channels > 6) | |
3165 | - return DFB_UNSUPPORTED; | |
3166 | + return DR_UNSUPPORTED; | |
3167 | ||
3168 | /* check whether destination format is supported */ | |
3169 | switch (desc.sampleformat) { | |
3170 | @@ -650,7 +650,7 @@ IFusionSoundMusicProvider_Mad_PlayToStream( IFusionSoundMusicProvider *thiz, | |
3171 | case FSSF_FLOAT: | |
3172 | break; | |
3173 | default: | |
3174 | - return DFB_UNSUPPORTED; | |
3175 | + return DR_UNSUPPORTED; | |
3176 | } | |
3177 | ||
3178 | pthread_mutex_lock( &data->lock ); | |
3179 | @@ -691,7 +691,7 @@ IFusionSoundMusicProvider_Mad_PlayToStream( IFusionSoundMusicProvider *thiz, | |
3180 | ||
3181 | pthread_mutex_unlock( &data->lock ); | |
3182 | ||
3183 | - return DFB_OK; | |
3184 | + return DR_OK; | |
3185 | } | |
3186 | ||
3187 | static void* | |
3188 | @@ -709,7 +709,7 @@ MadBufferThread( DirectThread *thread, void *ctx ) | |
3189 | direct_stream_wait( data->s, data->read_size, NULL ); | |
3190 | ||
3191 | while (data->status == FMSTATE_PLAY) { | |
3192 | - DFBResult ret = DFB_OK; | |
3193 | + DirectResult ret = DR_OK; | |
3194 | unsigned int len = data->read_size; | |
3195 | int offset = 0; | |
3196 | struct timeval tv = { 0, 500 }; | |
3197 | @@ -732,7 +732,7 @@ MadBufferThread( DirectThread *thread, void *ctx ) | |
3198 | ||
3199 | if (offset < data->read_size) { | |
3200 | ret = direct_stream_wait( data->s, data->read_size, &tv ); | |
3201 | - if (ret != DFB_TIMEOUT) { | |
3202 | + if (ret != DR_TIMEOUT) { | |
3203 | ret = direct_stream_read( data->s, | |
3204 | data->read_size-offset, | |
3205 | data->read_buffer+offset, &len ); | |
3206 | @@ -740,7 +740,7 @@ MadBufferThread( DirectThread *thread, void *ctx ) | |
3207 | } | |
3208 | ||
3209 | if (ret) { | |
3210 | - if (ret == DFB_EOF) { | |
3211 | + if (ret == DR_EOF) { | |
3212 | if (data->flags & FMPLAY_LOOPING) { | |
3213 | direct_stream_seek( data->s, 0 ); | |
3214 | } | |
3215 | @@ -778,7 +778,7 @@ MadBufferThread( DirectThread *thread, void *ctx ) | |
3216 | mad_synth_frame( &data->synth, &data->frame ); | |
3217 | len = pcm->length; | |
3218 | ||
3219 | - if (buffer->Lock( buffer, (void*)&dst, &size, 0 ) != DFB_OK) { | |
3220 | + if (buffer->Lock( buffer, (void*)&dst, &size, 0 ) != DR_OK) { | |
3221 | D_ERROR( "IFusionSoundMusicProvider_Mad: Couldn't lock buffer!\n" ); | |
3222 | break; | |
3223 | } | |
3224 | @@ -814,7 +814,7 @@ MadBufferThread( DirectThread *thread, void *ctx ) | |
3225 | return NULL; | |
3226 | } | |
3227 | ||
3228 | -static DFBResult | |
3229 | +static DirectResult | |
3230 | IFusionSoundMusicProvider_Mad_PlayToBuffer( IFusionSoundMusicProvider *thiz, | |
3231 | IFusionSoundBuffer *destination, | |
3232 | FMBufferCallback callback, | |
3233 | @@ -825,21 +825,21 @@ IFusionSoundMusicProvider_Mad_PlayToBuffer( IFusionSoundMusicProvider *thiz, | |
3234 | DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_Mad ) | |
3235 | ||
3236 | if (!destination) | |
3237 | - return DFB_INVARG; | |
3238 | + return DR_INVARG; | |
3239 | ||
3240 | if (data->dest.buffer == destination) | |
3241 | - return DFB_OK; | |
3242 | + return DR_OK; | |
3243 | ||
3244 | destination->GetDescription( destination, &desc ); | |
3245 | ||
3246 | /* check whether destination samplerate is supported */ | |
3247 | if (desc.samplerate != data->samplerate && | |
3248 | desc.samplerate != data->samplerate/2) | |
3249 | - return DFB_UNSUPPORTED; | |
3250 | + return DR_UNSUPPORTED; | |
3251 | ||
3252 | /* check whether number of channels is supported */ | |
3253 | if (desc.channels > 6) | |
3254 | - return DFB_UNSUPPORTED; | |
3255 | + return DR_UNSUPPORTED; | |
3256 | ||
3257 | /* check whether destination format is supported */ | |
3258 | switch (desc.sampleformat) { | |
3259 | @@ -850,7 +850,7 @@ IFusionSoundMusicProvider_Mad_PlayToBuffer( IFusionSoundMusicProvider *thiz, | |
3260 | case FSSF_FLOAT: | |
3261 | break; | |
3262 | default: | |
3263 | - return DFB_UNSUPPORTED; | |
3264 | + return DR_UNSUPPORTED; | |
3265 | } | |
3266 | ||
3267 | pthread_mutex_lock( &data->lock ); | |
3268 | @@ -895,10 +895,10 @@ IFusionSoundMusicProvider_Mad_PlayToBuffer( IFusionSoundMusicProvider *thiz, | |
3269 | ||
3270 | pthread_mutex_unlock( &data->lock ); | |
3271 | ||
3272 | - return DFB_OK; | |
3273 | + return DR_OK; | |
3274 | } | |
3275 | ||
3276 | -static DFBResult | |
3277 | +static DirectResult | |
3278 | IFusionSoundMusicProvider_Mad_Stop( IFusionSoundMusicProvider *thiz ) | |
3279 | { | |
3280 | DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_Mad ) | |
3281 | @@ -911,35 +911,35 @@ IFusionSoundMusicProvider_Mad_Stop( IFusionSoundMusicProvider *thiz ) | |
3282 | ||
3283 | pthread_mutex_unlock( &data->lock ); | |
3284 | ||
3285 | - return DFB_OK; | |
3286 | + return DR_OK; | |
3287 | } | |
3288 | ||
3289 | -static DFBResult | |
3290 | +static DirectResult | |
3291 | IFusionSoundMusicProvider_Mad_GetStatus( IFusionSoundMusicProvider *thiz, | |
3292 | FSMusicProviderStatus *status ) | |
3293 | { | |
3294 | DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_Mad ) | |
3295 | ||
3296 | if (!status) | |
3297 | - return DFB_INVARG; | |
3298 | + return DR_INVARG; | |
3299 | ||
3300 | *status = data->status; | |
3301 | ||
3302 | - return DFB_OK; | |
3303 | + return DR_OK; | |
3304 | } | |
3305 | ||
3306 | -static DFBResult | |
3307 | +static DirectResult | |
3308 | IFusionSoundMusicProvider_Mad_SeekTo( IFusionSoundMusicProvider *thiz, | |
3309 | double seconds ) | |
3310 | { | |
3311 | - DFBResult ret = DFB_FAILURE; | |
3312 | + DirectResult ret = DR_FAILURE; | |
3313 | double rate; | |
3314 | unsigned int off; | |
3315 | ||
3316 | DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_Mad ) | |
3317 | ||
3318 | if (seconds < 0.0) | |
3319 | - return DFB_INVARG; | |
3320 | + return DR_INVARG; | |
3321 | ||
3322 | pthread_mutex_lock( &data->lock ); | |
3323 | ||
3324 | @@ -947,7 +947,7 @@ IFusionSoundMusicProvider_Mad_SeekTo( IFusionSoundMusicProvider *thiz, | |
3325 | if (rate) { | |
3326 | off = (seconds*rate); | |
3327 | ret = direct_stream_seek( data->s, off ); | |
3328 | - if (ret == DFB_OK) { | |
3329 | + if (ret == DR_OK) { | |
3330 | data->seeked = true; | |
3331 | data->finished = false; | |
3332 | } | |
3333 | @@ -958,7 +958,7 @@ IFusionSoundMusicProvider_Mad_SeekTo( IFusionSoundMusicProvider *thiz, | |
3334 | return ret; | |
3335 | } | |
3336 | ||
3337 | -static DFBResult | |
3338 | +static DirectResult | |
3339 | IFusionSoundMusicProvider_Mad_GetPos( IFusionSoundMusicProvider *thiz, | |
3340 | double *seconds ) | |
3341 | { | |
3342 | @@ -968,10 +968,10 @@ IFusionSoundMusicProvider_Mad_GetPos( IFusionSoundMusicProvider *thiz, | |
3343 | DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_Mad ) | |
3344 | ||
3345 | if (!seconds) | |
3346 | - return DFB_INVARG; | |
3347 | + return DR_INVARG; | |
3348 | ||
3349 | if (!data->desc.bitrate) | |
3350 | - return DFB_UNSUPPORTED; | |
3351 | + return DR_UNSUPPORTED; | |
3352 | ||
3353 | pos = direct_stream_offset( data->s ); | |
3354 | if (data->status == FMSTATE_PLAY && data->stream.this_frame) { | |
3355 | @@ -982,41 +982,41 @@ IFusionSoundMusicProvider_Mad_GetPos( IFusionSoundMusicProvider *thiz, | |
3356 | rate = (data->desc.bitrate ? : data->frame.header.bitrate) >> 3; | |
3357 | *seconds = (double)pos / rate; | |
3358 | ||
3359 | - return DFB_OK; | |
3360 | + return DR_OK; | |
3361 | } | |
3362 | ||
3363 | -static DFBResult | |
3364 | +static DirectResult | |
3365 | IFusionSoundMusicProvider_Mad_GetLength( IFusionSoundMusicProvider *thiz, | |
3366 | double *seconds ) | |
3367 | { | |
3368 | DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_Mad ) | |
3369 | ||
3370 | if (!seconds) | |
3371 | - return DFB_INVARG; | |
3372 | + return DR_INVARG; | |
3373 | ||
3374 | *seconds = data->length; | |
3375 | ||
3376 | - return DFB_OK; | |
3377 | + return DR_OK; | |
3378 | } | |
3379 | ||
3380 | -static DFBResult | |
3381 | +static DirectResult | |
3382 | IFusionSoundMusicProvider_Mad_SetPlaybackFlags( IFusionSoundMusicProvider *thiz, | |
3383 | FSMusicProviderPlaybackFlags flags ) | |
3384 | { | |
3385 | DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_Mad ) | |
3386 | ||
3387 | if (flags & ~FMPLAY_LOOPING) | |
3388 | - return DFB_UNSUPPORTED; | |
3389 | + return DR_UNSUPPORTED; | |
3390 | ||
3391 | if (flags & FMPLAY_LOOPING && !direct_stream_seekable( data->s )) | |
3392 | - return DFB_UNSUPPORTED; | |
3393 | + return DR_UNSUPPORTED; | |
3394 | ||
3395 | data->flags = flags; | |
3396 | ||
3397 | - return DFB_OK; | |
3398 | + return DR_OK; | |
3399 | } | |
3400 | ||
3401 | -static DFBResult | |
3402 | +static DirectResult | |
3403 | IFusionSoundMusicProvider_Mad_WaitStatus( IFusionSoundMusicProvider *thiz, | |
3404 | FSMusicProviderStatus mask, | |
3405 | unsigned int timeout ) | |
3406 | @@ -1024,7 +1024,7 @@ IFusionSoundMusicProvider_Mad_WaitStatus( IFusionSoundMusicProvider *thiz, | |
3407 | DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_Mad ) | |
3408 | ||
3409 | if (!mask || mask & ~FMSTATE_ALL) | |
3410 | - return DFB_INVARG; | |
3411 | + return DR_INVARG; | |
3412 | ||
3413 | if (timeout) { | |
3414 | struct timespec t; | |
3415 | @@ -1036,18 +1036,18 @@ IFusionSoundMusicProvider_Mad_WaitStatus( IFusionSoundMusicProvider *thiz, | |
3416 | ||
3417 | #ifdef HAVE_PTHREAD_MUTEX_TIMEDLOCK | |
3418 | if (pthread_mutex_timedlock( &data->lock, &t )) | |
3419 | - return DFB_TIMEOUT; | |
3420 | + return DR_TIMEOUT; | |
3421 | #else | |
3422 | while (pthread_mutex_trylock( &data->lock )) { | |
3423 | usleep( 1000 ); | |
3424 | if (direct_clock_get_abs_micros() >= s) | |
3425 | - return DFB_TIMEOUT; | |
3426 | + return DR_TIMEOUT; | |
3427 | } | |
3428 | #endif | |
3429 | while (!(data->status & mask)) { | |
3430 | if (pthread_cond_timedwait( &data->cond, &data->lock, &t ) == ETIMEDOUT) { | |
3431 | pthread_mutex_unlock( &data->lock ); | |
3432 | - return DFB_TIMEOUT; | |
3433 | + return DR_TIMEOUT; | |
3434 | } | |
3435 | } | |
3436 | } | |
3437 | @@ -1060,38 +1060,38 @@ IFusionSoundMusicProvider_Mad_WaitStatus( IFusionSoundMusicProvider *thiz, | |
3438 | ||
3439 | pthread_mutex_unlock( &data->lock ); | |
3440 | ||
3441 | - return DFB_OK; | |
3442 | + return DR_OK; | |
3443 | } | |
3444 | ||
3445 | /* exported symbols */ | |
3446 | ||
3447 | -static DFBResult | |
3448 | +static DirectResult | |
3449 | Probe( IFusionSoundMusicProvider_ProbeContext *ctx ) | |
3450 | { | |
3451 | char *ext; | |
3452 | ||
3453 | if (ctx->mimetype && !strcmp( ctx->mimetype, "audio/mpeg" )) | |
3454 | - return DFB_OK; | |
3455 | + return DR_OK; | |
3456 | ||
3457 | ext = strrchr( ctx->filename, '.' ); | |
3458 | if (ext) { | |
3459 | if (!strcasecmp( ext, ".mp1" ) || | |
3460 | !strcasecmp( ext, ".mp2" ) || | |
3461 | !strcasecmp( ext, ".mp3" )) | |
3462 | - return DFB_OK; | |
3463 | + return DR_OK; | |
3464 | } | |
3465 | ||
3466 | /* Detect by contents ? */ | |
3467 | ||
3468 | - return DFB_UNSUPPORTED; | |
3469 | + return DR_UNSUPPORTED; | |
3470 | } | |
3471 | ||
3472 | -static DFBResult | |
3473 | +static DirectResult | |
3474 | Construct( IFusionSoundMusicProvider *thiz, | |
3475 | const char *filename, | |
3476 | DirectStream *stream ) | |
3477 | { | |
3478 | - DFBResult ret; | |
3479 | + DirectResult ret; | |
3480 | u8 buf[16384]; | |
3481 | unsigned int pos = 0; | |
3482 | unsigned int len; | |
3483 | @@ -1149,7 +1149,7 @@ Construct( IFusionSoundMusicProvider *thiz, | |
3484 | if (error) { | |
3485 | D_ERROR( "IFusionSoundMusicProvider_Mad: Couldn't find a valid frame!\n" ); | |
3486 | IFusionSoundMusicProvider_Mad_Destruct( thiz ); | |
3487 | - return DFB_FAILURE; | |
3488 | + return DR_FAILURE; | |
3489 | } | |
3490 | ||
3491 | header = data->frame.header; | |
3492 | @@ -1251,6 +1251,6 @@ Construct( IFusionSoundMusicProvider *thiz, | |
3493 | thiz->SetPlaybackFlags = IFusionSoundMusicProvider_Mad_SetPlaybackFlags; | |
3494 | thiz->WaitStatus = IFusionSoundMusicProvider_Mad_WaitStatus; | |
3495 | ||
3496 | - return DFB_OK; | |
3497 | + return DR_OK; | |
3498 | } | |
3499 | ||
3500 | diff --git a/interfaces/IFusionSoundMusicProvider/ifusionsoundmusicprovider_playlist.c b/interfaces/IFusionSoundMusicProvider/ifusionsoundmusicprovider_playlist.c | |
3501 | index 7baf8eb..ca7ca3f 100644 | |
3502 | --- a/interfaces/IFusionSoundMusicProvider/ifusionsoundmusicprovider_playlist.c | |
3503 | +++ b/interfaces/IFusionSoundMusicProvider/ifusionsoundmusicprovider_playlist.c | |
3504 | @@ -36,10 +36,10 @@ | |
3505 | #include <direct/util.h> | |
3506 | ||
3507 | ||
3508 | -static DFBResult | |
3509 | +static DirectResult | |
3510 | Probe( IFusionSoundMusicProvider_ProbeContext *ctx ); | |
3511 | ||
3512 | -static DFBResult | |
3513 | +static DirectResult | |
3514 | Construct( IFusionSoundMusicProvider *thiz, | |
3515 | const char *filename, | |
3516 | DirectStream *stream ); | |
3517 | @@ -94,7 +94,7 @@ typedef struct { | |
3518 | ||
3519 | /*****************************************************************************/ | |
3520 | ||
3521 | -static DFBResult | |
3522 | +static DirectResult | |
3523 | add_media( FSTrackID id, | |
3524 | const char *url, | |
3525 | const char *artist, | |
3526 | @@ -124,7 +124,7 @@ add_media( FSTrackID id, | |
3527 | ||
3528 | direct_list_append( (DirectLink**)playlist, &entry->link ); | |
3529 | ||
3530 | - return DFB_OK; | |
3531 | + return DR_OK; | |
3532 | } | |
3533 | ||
3534 | static void | |
3535 | @@ -703,17 +703,17 @@ IFusionSoundMusicProvider_Playlist_Destruct( IFusionSoundMusicProvider *thiz ) | |
3536 | DIRECT_DEALLOCATE_INTERFACE( thiz ); | |
3537 | } | |
3538 | ||
3539 | -static DFBResult | |
3540 | +static DirectResult | |
3541 | IFusionSoundMusicProvider_Playlist_AddRef( IFusionSoundMusicProvider *thiz ) | |
3542 | { | |
3543 | DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_Playlist ) | |
3544 | ||
3545 | data->ref++; | |
3546 | ||
3547 | - return DFB_OK; | |
3548 | + return DR_OK; | |
3549 | } | |
3550 | ||
3551 | -static DFBResult | |
3552 | +static DirectResult | |
3553 | IFusionSoundMusicProvider_Playlist_Release( IFusionSoundMusicProvider *thiz ) | |
3554 | { | |
3555 | DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_Playlist ) | |
3556 | @@ -721,10 +721,10 @@ IFusionSoundMusicProvider_Playlist_Release( IFusionSoundMusicProvider *thiz ) | |
3557 | if (--data->ref == 0) | |
3558 | IFusionSoundMusicProvider_Playlist_Destruct( thiz ); | |
3559 | ||
3560 | - return DFB_OK; | |
3561 | + return DR_OK; | |
3562 | } | |
3563 | ||
3564 | -static DFBResult | |
3565 | +static DirectResult | |
3566 | IFusionSoundMusicProvider_Playlist_GetCapabilities( IFusionSoundMusicProvider *thiz, | |
3567 | FSMusicProviderCapabilities *caps ) | |
3568 | { | |
3569 | @@ -733,10 +733,10 @@ IFusionSoundMusicProvider_Playlist_GetCapabilities( IFusionSoundMusicProvider | |
3570 | if (data->selected->provider) | |
3571 | return data->selected->provider->GetCapabilities( data->selected->provider, caps ); | |
3572 | ||
3573 | - return DFB_UNSUPPORTED; | |
3574 | + return DR_UNSUPPORTED; | |
3575 | } | |
3576 | ||
3577 | -static DFBResult | |
3578 | +static DirectResult | |
3579 | IFusionSoundMusicProvider_Playlist_EnumTracks( IFusionSoundMusicProvider *thiz, | |
3580 | FSTrackCallback callback, | |
3581 | void *callbackdata ) | |
3582 | @@ -746,7 +746,7 @@ IFusionSoundMusicProvider_Playlist_EnumTracks( IFusionSoundMusicProvider *thiz, | |
3583 | DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_Playlist ) | |
3584 | ||
3585 | if (!callback) | |
3586 | - return DFB_INVARG; | |
3587 | + return DR_INVARG; | |
3588 | ||
3589 | direct_list_foreach_safe (entry, tmp, data->playlist) { | |
3590 | FSTrackDescription desc; | |
3591 | @@ -768,27 +768,27 @@ IFusionSoundMusicProvider_Playlist_EnumTracks( IFusionSoundMusicProvider *thiz, | |
3592 | } | |
3593 | ||
3594 | if (callback( entry->id, desc, callbackdata )) | |
3595 | - return DFB_INTERRUPTED; | |
3596 | + return DR_INTERRUPTED; | |
3597 | } | |
3598 | ||
3599 | - return DFB_OK; | |
3600 | + return DR_OK; | |
3601 | } | |
3602 | ||
3603 | -static DFBResult | |
3604 | +static DirectResult | |
3605 | IFusionSoundMusicProvider_Playlist_GetTrackID( IFusionSoundMusicProvider *thiz, | |
3606 | FSTrackID *track_id ) | |
3607 | { | |
3608 | DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_Playlist ) | |
3609 | ||
3610 | if (!track_id) | |
3611 | - return DFB_INVARG; | |
3612 | + return DR_INVARG; | |
3613 | ||
3614 | *track_id = data->selected->id; | |
3615 | ||
3616 | - return DFB_OK; | |
3617 | + return DR_OK; | |
3618 | } | |
3619 | ||
3620 | -static DFBResult | |
3621 | +static DirectResult | |
3622 | IFusionSoundMusicProvider_Playlist_GetTrackDescription( IFusionSoundMusicProvider *thiz, | |
3623 | FSTrackDescription *desc ) | |
3624 | { | |
3625 | @@ -797,7 +797,7 @@ IFusionSoundMusicProvider_Playlist_GetTrackDescription( IFusionSoundMusicProvide | |
3626 | DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_Playlist ) | |
3627 | ||
3628 | if (!desc) | |
3629 | - return DFB_INVARG; | |
3630 | + return DR_INVARG; | |
3631 | ||
3632 | entry = data->selected; | |
3633 | ||
3634 | @@ -817,10 +817,10 @@ IFusionSoundMusicProvider_Playlist_GetTrackDescription( IFusionSoundMusicProvide | |
3635 | direct_snputs( desc->album, entry->album, sizeof(desc->album) ); | |
3636 | } | |
3637 | ||
3638 | - return DFB_OK; | |
3639 | + return DR_OK; | |
3640 | } | |
3641 | ||
3642 | -static DFBResult | |
3643 | +static DirectResult | |
3644 | IFusionSoundMusicProvider_Playlist_GetStreamDescription( IFusionSoundMusicProvider *thiz, | |
3645 | FSStreamDescription *desc ) | |
3646 | { | |
3647 | @@ -829,10 +829,10 @@ IFusionSoundMusicProvider_Playlist_GetStreamDescription( IFusionSoundMusicProvid | |
3648 | if (data->selected->provider) | |
3649 | return data->selected->provider->GetStreamDescription( data->selected->provider, desc ); | |
3650 | ||
3651 | - return DFB_UNSUPPORTED; | |
3652 | + return DR_UNSUPPORTED; | |
3653 | } | |
3654 | ||
3655 | -static DFBResult | |
3656 | +static DirectResult | |
3657 | IFusionSoundMusicProvider_Playlist_GetBufferDescription( IFusionSoundMusicProvider *thiz, | |
3658 | FSBufferDescription *desc ) | |
3659 | { | |
3660 | @@ -841,10 +841,10 @@ IFusionSoundMusicProvider_Playlist_GetBufferDescription( IFusionSoundMusicProvid | |
3661 | if (data->selected->provider) | |
3662 | return data->selected->provider->GetBufferDescription( data->selected->provider, desc ); | |
3663 | ||
3664 | - return DFB_UNSUPPORTED; | |
3665 | + return DR_UNSUPPORTED; | |
3666 | } | |
3667 | ||
3668 | -static DFBResult | |
3669 | +static DirectResult | |
3670 | IFusionSoundMusicProvider_Playlist_SelectTrack( IFusionSoundMusicProvider *thiz, | |
3671 | FSTrackID track_id ) | |
3672 | { | |
3673 | @@ -854,7 +854,7 @@ IFusionSoundMusicProvider_Playlist_SelectTrack( IFusionSoundMusicProvider *thiz, | |
3674 | ||
3675 | direct_list_foreach (entry, data->playlist) { | |
3676 | IFusionSoundMusicProvider *provider; | |
3677 | - DFBResult ret; | |
3678 | + DirectResult ret; | |
3679 | ||
3680 | if (entry->id != track_id) | |
3681 | continue; | |
3682 | @@ -886,17 +886,17 @@ IFusionSoundMusicProvider_Playlist_SelectTrack( IFusionSoundMusicProvider *thiz, | |
3683 | ||
3684 | entry->provider = provider; | |
3685 | ||
3686 | - return DFB_OK; | |
3687 | + return DR_OK; | |
3688 | } | |
3689 | ||
3690 | - return DFB_ITEMNOTFOUND; | |
3691 | + return DR_ITEMNOTFOUND; | |
3692 | } | |
3693 | ||
3694 | -static DFBResult | |
3695 | +static DirectResult | |
3696 | IFusionSoundMusicProvider_Playlist_PlayToStream( IFusionSoundMusicProvider *thiz, | |
3697 | IFusionSoundStream *destination ) | |
3698 | { | |
3699 | - DFBResult ret = DFB_UNSUPPORTED; | |
3700 | + DirectResult ret = DR_UNSUPPORTED; | |
3701 | ||
3702 | DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_Playlist ) | |
3703 | ||
3704 | @@ -911,7 +911,7 @@ IFusionSoundMusicProvider_Playlist_PlayToStream( IFusionSoundMusicProvider *thiz | |
3705 | ||
3706 | if (data->selected->provider) { | |
3707 | ret = data->selected->provider->PlayToStream( data->selected->provider, destination ); | |
3708 | - if (ret == DFB_OK) { | |
3709 | + if (ret == DR_OK) { | |
3710 | destination->AddRef( destination ); | |
3711 | data->stream = destination; | |
3712 | } | |
3713 | @@ -920,13 +920,13 @@ IFusionSoundMusicProvider_Playlist_PlayToStream( IFusionSoundMusicProvider *thiz | |
3714 | return ret; | |
3715 | } | |
3716 | ||
3717 | -static DFBResult | |
3718 | +static DirectResult | |
3719 | IFusionSoundMusicProvider_Playlist_PlayToBuffer( IFusionSoundMusicProvider *thiz, | |
3720 | IFusionSoundBuffer *destination, | |
3721 | FMBufferCallback callback, | |
3722 | void *ctx ) | |
3723 | { | |
3724 | - DFBResult ret = DFB_UNSUPPORTED; | |
3725 | + DirectResult ret = DR_UNSUPPORTED; | |
3726 | ||
3727 | DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_Playlist ) | |
3728 | ||
3729 | @@ -942,7 +942,7 @@ IFusionSoundMusicProvider_Playlist_PlayToBuffer( IFusionSoundMusicProvider *thiz | |
3730 | if (data->selected->provider) { | |
3731 | ret = data->selected->provider->PlayToBuffer( data->selected->provider, | |
3732 | destination, callback, ctx ); | |
3733 | - if (ret == DFB_OK) { | |
3734 | + if (ret == DR_OK) { | |
3735 | destination->AddRef( destination ); | |
3736 | data->buffer = destination; | |
3737 | data->callback = callback; | |
3738 | @@ -953,7 +953,7 @@ IFusionSoundMusicProvider_Playlist_PlayToBuffer( IFusionSoundMusicProvider *thiz | |
3739 | return ret; | |
3740 | } | |
3741 | ||
3742 | -static DFBResult | |
3743 | +static DirectResult | |
3744 | IFusionSoundMusicProvider_Playlist_Stop( IFusionSoundMusicProvider *thiz ) | |
3745 | { | |
3746 | DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_Playlist ) | |
3747 | @@ -970,10 +970,10 @@ IFusionSoundMusicProvider_Playlist_Stop( IFusionSoundMusicProvider *thiz ) | |
3748 | if (data->selected->provider) | |
3749 | return data->selected->provider->Stop( data->selected->provider ); | |
3750 | ||
3751 | - return DFB_UNSUPPORTED; | |
3752 | + return DR_UNSUPPORTED; | |
3753 | } | |
3754 | ||
3755 | -static DFBResult | |
3756 | +static DirectResult | |
3757 | IFusionSoundMusicProvider_Playlist_GetStatus( IFusionSoundMusicProvider *thiz, | |
3758 | FSMusicProviderStatus *status ) | |
3759 | { | |
3760 | @@ -982,10 +982,10 @@ IFusionSoundMusicProvider_Playlist_GetStatus( IFusionSoundMusicProvider *thiz, | |
3761 | if (data->selected->provider) | |
3762 | return data->selected->provider->GetStatus( data->selected->provider, status ); | |
3763 | ||
3764 | - return DFB_UNSUPPORTED; | |
3765 | + return DR_UNSUPPORTED; | |
3766 | } | |
3767 | ||
3768 | -static DFBResult | |
3769 | +static DirectResult | |
3770 | IFusionSoundMusicProvider_Playlist_SeekTo( IFusionSoundMusicProvider *thiz, | |
3771 | double seconds ) | |
3772 | { | |
3773 | @@ -994,10 +994,10 @@ IFusionSoundMusicProvider_Playlist_SeekTo( IFusionSoundMusicProvider *thiz, | |
3774 | if (data->selected->provider) | |
3775 | return data->selected->provider->SeekTo( data->selected->provider, seconds ); | |
3776 | ||
3777 | - return DFB_UNSUPPORTED; | |
3778 | + return DR_UNSUPPORTED; | |
3779 | } | |
3780 | ||
3781 | -static DFBResult | |
3782 | +static DirectResult | |
3783 | IFusionSoundMusicProvider_Playlist_GetPos( IFusionSoundMusicProvider *thiz, | |
3784 | double *seconds ) | |
3785 | { | |
3786 | @@ -1006,10 +1006,10 @@ IFusionSoundMusicProvider_Playlist_GetPos( IFusionSoundMusicProvider *thiz, | |
3787 | if (data->selected->provider) | |
3788 | return data->selected->provider->GetPos( data->selected->provider, seconds ); | |
3789 | ||
3790 | - return DFB_UNSUPPORTED; | |
3791 | + return DR_UNSUPPORTED; | |
3792 | } | |
3793 | ||
3794 | -static DFBResult | |
3795 | +static DirectResult | |
3796 | IFusionSoundMusicProvider_Playlist_GetLength( IFusionSoundMusicProvider *thiz, | |
3797 | double *seconds ) | |
3798 | { | |
3799 | @@ -1018,10 +1018,10 @@ IFusionSoundMusicProvider_Playlist_GetLength( IFusionSoundMusicProvider *thiz, | |
3800 | if (data->selected->provider) | |
3801 | return data->selected->provider->GetLength( data->selected->provider, seconds ); | |
3802 | ||
3803 | - return DFB_UNSUPPORTED; | |
3804 | + return DR_UNSUPPORTED; | |
3805 | } | |
3806 | ||
3807 | -static DFBResult | |
3808 | +static DirectResult | |
3809 | IFusionSoundMusicProvider_Playlist_SetPlaybackFlags( IFusionSoundMusicProvider *thiz, | |
3810 | FSMusicProviderPlaybackFlags flags ) | |
3811 | { | |
3812 | @@ -1032,10 +1032,10 @@ IFusionSoundMusicProvider_Playlist_SetPlaybackFlags( IFusionSoundMusicProvider | |
3813 | if (data->selected->provider) | |
3814 | return data->selected->provider->SetPlaybackFlags( data->selected->provider, flags ); | |
3815 | ||
3816 | - return DFB_UNSUPPORTED; | |
3817 | + return DR_UNSUPPORTED; | |
3818 | } | |
3819 | ||
3820 | -static DFBResult | |
3821 | +static DirectResult | |
3822 | IFusionSoundMusicProvider_Playlist_WaitStatus( IFusionSoundMusicProvider *thiz, | |
3823 | FSMusicProviderStatus mask, | |
3824 | unsigned int timeout ) | |
3825 | @@ -1045,22 +1045,22 @@ IFusionSoundMusicProvider_Playlist_WaitStatus( IFusionSoundMusicProvider *thiz, | |
3826 | if (data->selected->provider) | |
3827 | return data->selected->provider->WaitStatus( data->selected->provider, mask, timeout ); | |
3828 | ||
3829 | - return DFB_UNSUPPORTED; | |
3830 | + return DR_UNSUPPORTED; | |
3831 | } | |
3832 | ||
3833 | /* exported symbols */ | |
3834 | ||
3835 | -static DFBResult | |
3836 | +static DirectResult | |
3837 | Probe( IFusionSoundMusicProvider_ProbeContext *ctx ) | |
3838 | { | |
3839 | if (get_playlist_type( ctx->mimetype, ctx->filename, | |
3840 | (const char*)ctx->header, sizeof(ctx->header) )) | |
3841 | - return DFB_OK; | |
3842 | + return DR_OK; | |
3843 | ||
3844 | - return DFB_UNSUPPORTED; | |
3845 | + return DR_UNSUPPORTED; | |
3846 | } | |
3847 | ||
3848 | -static DFBResult | |
3849 | +static DirectResult | |
3850 | Construct( IFusionSoundMusicProvider *thiz, | |
3851 | const char *filename, | |
3852 | DirectStream *stream ) | |
3853 | @@ -1088,7 +1088,7 @@ Construct( IFusionSoundMusicProvider *thiz, | |
3854 | if (direct_stream_read( stream, size, src+pos, &len )) { | |
3855 | D_FREE( src ); | |
3856 | DIRECT_DEALLOCATE_INTERFACE( thiz ); | |
3857 | - return DFB_IO; | |
3858 | + return DR_IO; | |
3859 | } | |
3860 | pos += len; | |
3861 | } | |
3862 | @@ -1110,7 +1110,7 @@ Construct( IFusionSoundMusicProvider *thiz, | |
3863 | ||
3864 | if (!src) { | |
3865 | DIRECT_DEALLOCATE_INTERFACE( thiz ); | |
3866 | - return DFB_IO; | |
3867 | + return DR_IO; | |
3868 | } | |
3869 | } | |
3870 | src[size] = 0; | |
3871 | @@ -1143,7 +1143,7 @@ Construct( IFusionSoundMusicProvider *thiz, | |
3872 | ||
3873 | if (!data->playlist) { | |
3874 | DIRECT_DEALLOCATE_INTERFACE( thiz ); | |
3875 | - return DFB_FAILURE; | |
3876 | + return DR_FAILURE; | |
3877 | } | |
3878 | ||
3879 | /* initialize function pointers */ | |
3880 | @@ -1169,5 +1169,5 @@ Construct( IFusionSoundMusicProvider *thiz, | |
3881 | /* select first media */ | |
3882 | thiz->SelectTrack( thiz, data->playlist->id ); | |
3883 | ||
3884 | - return DFB_OK; | |
3885 | + return DR_OK; | |
3886 | } | |
3887 | diff --git a/interfaces/IFusionSoundMusicProvider/ifusionsoundmusicprovider_timidity.c b/interfaces/IFusionSoundMusicProvider/ifusionsoundmusicprovider_timidity.c | |
3888 | index 0a0abce..23b1d29 100644 | |
3889 | --- a/interfaces/IFusionSoundMusicProvider/ifusionsoundmusicprovider_timidity.c | |
3890 | +++ b/interfaces/IFusionSoundMusicProvider/ifusionsoundmusicprovider_timidity.c | |
3891 | @@ -42,10 +42,10 @@ | |
3892 | ||
3893 | #include <timidity.h> | |
3894 | ||
3895 | -static DFBResult | |
3896 | +static DirectResult | |
3897 | Probe( IFusionSoundMusicProvider_ProbeContext *ctx ); | |
3898 | ||
3899 | -static DFBResult | |
3900 | +static DirectResult | |
3901 | Construct( IFusionSoundMusicProvider *thiz, | |
3902 | const char *filename, | |
3903 | DirectStream *stream ); | |
3904 | @@ -186,18 +186,18 @@ IFusionSoundMusicProvider_Timidity_Destruct( IFusionSoundMusicProvider *thiz ) | |
3905 | pthread_mutex_unlock( &timidity_lock ); | |
3906 | } | |
3907 | ||
3908 | -static DFBResult | |
3909 | +static DirectResult | |
3910 | IFusionSoundMusicProvider_Timidity_AddRef( IFusionSoundMusicProvider *thiz ) | |
3911 | { | |
3912 | DIRECT_INTERFACE_GET_DATA (IFusionSoundMusicProvider_Timidity) | |
3913 | ||
3914 | data->ref++; | |
3915 | ||
3916 | - return DFB_OK; | |
3917 | + return DR_OK; | |
3918 | } | |
3919 | ||
3920 | ||
3921 | -static DFBResult | |
3922 | +static DirectResult | |
3923 | IFusionSoundMusicProvider_Timidity_Release( IFusionSoundMusicProvider *thiz ) | |
3924 | { | |
3925 | DIRECT_INTERFACE_GET_DATA (IFusionSoundMusicProvider_Timidity) | |
3926 | @@ -205,10 +205,10 @@ IFusionSoundMusicProvider_Timidity_Release( IFusionSoundMusicProvider *thiz ) | |
3927 | if (--data->ref == 0) | |
3928 | IFusionSoundMusicProvider_Timidity_Destruct( thiz ); | |
3929 | ||
3930 | - return DFB_OK; | |
3931 | + return DR_OK; | |
3932 | } | |
3933 | ||
3934 | -static DFBResult | |
3935 | +static DirectResult | |
3936 | IFusionSoundMusicProvider_Timidity_GetCapabilities( | |
3937 | IFusionSoundMusicProvider *thiz, | |
3938 | FSMusicProviderCapabilities *caps ) | |
3939 | @@ -216,14 +216,14 @@ IFusionSoundMusicProvider_Timidity_GetCapabilities( | |
3940 | DIRECT_INTERFACE_GET_DATA (IFusionSoundMusicProvider_Timidity) | |
3941 | ||
3942 | if (!caps) | |
3943 | - return DFB_INVARG; | |
3944 | + return DR_INVARG; | |
3945 | ||
3946 | *caps = FMCAPS_BASIC | FMCAPS_SEEK | FMCAPS_RESAMPLE; | |
3947 | ||
3948 | - return DFB_OK; | |
3949 | + return DR_OK; | |
3950 | } | |
3951 | ||
3952 | -static DFBResult | |
3953 | +static DirectResult | |
3954 | IFusionSoundMusicProvider_Timidity_GetTrackDescription( | |
3955 | IFusionSoundMusicProvider *thiz, | |
3956 | FSTrackDescription *desc ) | |
3957 | @@ -231,15 +231,15 @@ IFusionSoundMusicProvider_Timidity_GetTrackDescription( | |
3958 | DIRECT_INTERFACE_GET_DATA (IFusionSoundMusicProvider_Timidity) | |
3959 | ||
3960 | if (!desc) | |
3961 | - return DFB_INVARG; | |
3962 | + return DR_INVARG; | |
3963 | ||
3964 | memset( desc, 0, sizeof(FSTrackDescription) ); | |
3965 | snprintf( desc->encoding, FS_TRACK_DESC_ENCODING_LENGTH, "MIDI" ); | |
3966 | ||
3967 | - return DFB_OK; | |
3968 | + return DR_OK; | |
3969 | } | |
3970 | ||
3971 | -static DFBResult | |
3972 | +static DirectResult | |
3973 | IFusionSoundMusicProvider_Timidity_GetStreamDescription( | |
3974 | IFusionSoundMusicProvider *thiz, | |
3975 | FSStreamDescription *desc ) | |
3976 | @@ -247,7 +247,7 @@ IFusionSoundMusicProvider_Timidity_GetStreamDescription( | |
3977 | DIRECT_INTERFACE_GET_DATA (IFusionSoundMusicProvider_Timidity) | |
3978 | ||
3979 | if (!desc) | |
3980 | - return DFB_INVARG; | |
3981 | + return DR_INVARG; | |
3982 | ||
3983 | desc->flags = FSSDF_SAMPLERATE | FSSDF_CHANNELS | | |
3984 | FSSDF_SAMPLEFORMAT | FSSDF_BUFFERSIZE; | |
3985 | @@ -256,10 +256,10 @@ IFusionSoundMusicProvider_Timidity_GetStreamDescription( | |
3986 | desc->sampleformat = FSSF_S16; | |
3987 | desc->buffersize = 11025; | |
3988 | ||
3989 | - return DFB_OK; | |
3990 | + return DR_OK; | |
3991 | } | |
3992 | ||
3993 | -static DFBResult | |
3994 | +static DirectResult | |
3995 | IFusionSoundMusicProvider_Timidity_GetBufferDescription( | |
3996 | IFusionSoundMusicProvider *thiz, | |
3997 | FSBufferDescription *desc ) | |
3998 | @@ -267,7 +267,7 @@ IFusionSoundMusicProvider_Timidity_GetBufferDescription( | |
3999 | DIRECT_INTERFACE_GET_DATA (IFusionSoundMusicProvider_Timidity) | |
4000 | ||
4001 | if (!desc) | |
4002 | - return DFB_INVARG; | |
4003 | + return DR_INVARG; | |
4004 | ||
4005 | desc->flags = FSBDF_SAMPLERATE | FSBDF_CHANNELS | | |
4006 | FSBDF_SAMPLEFORMAT | FSBDF_LENGTH; | |
4007 | @@ -276,7 +276,7 @@ IFusionSoundMusicProvider_Timidity_GetBufferDescription( | |
4008 | desc->sampleformat = FSSF_S16; | |
4009 | desc->length = (data->song_length) ? (data->song_length*441/10) : 44100; | |
4010 | ||
4011 | - return DFB_OK; | |
4012 | + return DR_OK; | |
4013 | } | |
4014 | ||
4015 | static void* | |
4016 | @@ -326,7 +326,7 @@ TimidityStreamThread( DirectThread *thread, void *ctx ) | |
4017 | return NULL; | |
4018 | } | |
4019 | ||
4020 | -static DFBResult | |
4021 | +static DirectResult | |
4022 | IFusionSoundMusicProvider_Timidity_PlayToStream( | |
4023 | IFusionSoundMusicProvider *thiz, | |
4024 | IFusionSoundStream *destination ) | |
4025 | @@ -338,19 +338,19 @@ IFusionSoundMusicProvider_Timidity_PlayToStream( | |
4026 | DIRECT_INTERFACE_GET_DATA (IFusionSoundMusicProvider_Timidity) | |
4027 | ||
4028 | if (!destination) | |
4029 | - return DFB_INVARG; | |
4030 | + return DR_INVARG; | |
4031 | ||
4032 | destination->GetDescription( destination, &desc ); | |
4033 | ||
4034 | if (desc.channels > 2) | |
4035 | - return DFB_UNSUPPORTED; | |
4036 | + return DR_UNSUPPORTED; | |
4037 | ||
4038 | switch (desc.sampleformat) { | |
4039 | case FSSF_U8: | |
4040 | case FSSF_S16: | |
4041 | break; | |
4042 | default: | |
4043 | - return DFB_UNSUPPORTED; | |
4044 | + return DR_UNSUPPORTED; | |
4045 | } | |
4046 | ||
4047 | pthread_mutex_lock( &data->lock ); | |
4048 | @@ -362,7 +362,7 @@ IFusionSoundMusicProvider_Timidity_PlayToStream( | |
4049 | if (!stream) { | |
4050 | D_ERROR( "IFusionSoundMusicProvider_Timidity: couldn't open input stream!\n" ); | |
4051 | pthread_mutex_unlock( &data->lock ); | |
4052 | - return DFB_FAILURE; | |
4053 | + return DR_FAILURE; | |
4054 | } | |
4055 | ||
4056 | options.rate = desc.samplerate; | |
4057 | @@ -377,7 +377,7 @@ IFusionSoundMusicProvider_Timidity_PlayToStream( | |
4058 | if (!data->song) { | |
4059 | D_ERROR( "IFusionSoundMusicProvider_Timidity: couldn't load song!\n" ); | |
4060 | pthread_mutex_unlock( &data->lock ); | |
4061 | - return DFB_FAILURE; | |
4062 | + return DR_FAILURE; | |
4063 | } | |
4064 | ||
4065 | data->song_length = mid_song_get_total_time( data->song ); | |
4066 | @@ -405,7 +405,7 @@ IFusionSoundMusicProvider_Timidity_PlayToStream( | |
4067 | ||
4068 | pthread_mutex_unlock( &data->lock ); | |
4069 | ||
4070 | - return DFB_OK; | |
4071 | + return DR_OK; | |
4072 | } | |
4073 | ||
4074 | static void* | |
4075 | @@ -435,7 +435,7 @@ TimidityBufferThread( DirectThread *thread, void *ctx ) | |
4076 | ||
4077 | data->song_pos = mid_song_get_time( data->song ); | |
4078 | ||
4079 | - if (data->buffer->Lock( data->buffer, &ptr, &len, 0 ) != DFB_OK) { | |
4080 | + if (data->buffer->Lock( data->buffer, &ptr, &len, 0 ) != DR_OK) { | |
4081 | D_ERROR( "IFusionSoundMusicProvider_Timidity: couldn't lock buffer!\n" ); | |
4082 | data->status = FMSTATE_FINISHED; | |
4083 | pthread_cond_broadcast( &data->cond ); | |
4084 | @@ -471,7 +471,7 @@ TimidityBufferThread( DirectThread *thread, void *ctx ) | |
4085 | return NULL; | |
4086 | } | |
4087 | ||
4088 | -static DFBResult | |
4089 | +static DirectResult | |
4090 | IFusionSoundMusicProvider_Timidity_PlayToBuffer( | |
4091 | IFusionSoundMusicProvider *thiz, | |
4092 | IFusionSoundBuffer *destination, | |
4093 | @@ -485,19 +485,19 @@ IFusionSoundMusicProvider_Timidity_PlayToBuffer( | |
4094 | DIRECT_INTERFACE_GET_DATA (IFusionSoundMusicProvider_Timidity) | |
4095 | ||
4096 | if (!destination) | |
4097 | - return DFB_INVARG; | |
4098 | + return DR_INVARG; | |
4099 | ||
4100 | destination->GetDescription( destination, &desc ); | |
4101 | ||
4102 | if (desc.channels > 2) | |
4103 | - return DFB_UNSUPPORTED; | |
4104 | + return DR_UNSUPPORTED; | |
4105 | ||
4106 | switch (desc.sampleformat) { | |
4107 | case FSSF_U8: | |
4108 | case FSSF_S16: | |
4109 | break; | |
4110 | default: | |
4111 | - return DFB_UNSUPPORTED; | |
4112 | + return DR_UNSUPPORTED; | |
4113 | } | |
4114 | ||
4115 | pthread_mutex_lock( &data->lock ); | |
4116 | @@ -509,7 +509,7 @@ IFusionSoundMusicProvider_Timidity_PlayToBuffer( | |
4117 | if (!stream) { | |
4118 | D_ERROR( "IFusionSoundMusicProvider_Timidity: couldn't open input stream!\n" ); | |
4119 | pthread_mutex_unlock( &data->lock ); | |
4120 | - return DFB_FAILURE; | |
4121 | + return DR_FAILURE; | |
4122 | } | |
4123 | ||
4124 | options.rate = desc.samplerate; | |
4125 | @@ -524,7 +524,7 @@ IFusionSoundMusicProvider_Timidity_PlayToBuffer( | |
4126 | if (!data->song) { | |
4127 | D_ERROR( "IFusionSoundMusicProvider_Timidity: couldn't load song!\n" ); | |
4128 | pthread_mutex_unlock( &data->lock ); | |
4129 | - return DFB_FAILURE; | |
4130 | + return DR_FAILURE; | |
4131 | } | |
4132 | ||
4133 | data->song_length = mid_song_get_total_time( data->song ); | |
4134 | @@ -553,10 +553,10 @@ IFusionSoundMusicProvider_Timidity_PlayToBuffer( | |
4135 | ||
4136 | pthread_mutex_unlock( &data->lock ); | |
4137 | ||
4138 | - return DFB_OK; | |
4139 | + return DR_OK; | |
4140 | } | |
4141 | ||
4142 | -static DFBResult | |
4143 | +static DirectResult | |
4144 | IFusionSoundMusicProvider_Timidity_Stop( IFusionSoundMusicProvider *thiz ) | |
4145 | { | |
4146 | DIRECT_INTERFACE_GET_DATA (IFusionSoundMusicProvider_Timidity) | |
4147 | @@ -569,31 +569,31 @@ IFusionSoundMusicProvider_Timidity_Stop( IFusionSoundMusicProvider *thiz ) | |
4148 | ||
4149 | pthread_mutex_unlock( &data->lock ); | |
4150 | ||
4151 | - return DFB_OK; | |
4152 | + return DR_OK; | |
4153 | } | |
4154 | ||
4155 | -static DFBResult | |
4156 | +static DirectResult | |
4157 | IFusionSoundMusicProvider_Timidity_GetStatus( IFusionSoundMusicProvider *thiz, | |
4158 | FSMusicProviderStatus *status ) | |
4159 | { | |
4160 | DIRECT_INTERFACE_GET_DATA (IFusionSoundMusicProvider_Timidity) | |
4161 | ||
4162 | if (!status) | |
4163 | - return DFB_INVARG; | |
4164 | + return DR_INVARG; | |
4165 | ||
4166 | *status = data->status; | |
4167 | ||
4168 | - return DFB_OK; | |
4169 | + return DR_OK; | |
4170 | } | |
4171 | ||
4172 | -static DFBResult | |
4173 | +static DirectResult | |
4174 | IFusionSoundMusicProvider_Timidity_SeekTo( IFusionSoundMusicProvider *thiz, | |
4175 | double seconds ) | |
4176 | { | |
4177 | DIRECT_INTERFACE_GET_DATA (IFusionSoundMusicProvider_Timidity) | |
4178 | ||
4179 | if (seconds < 0.0) | |
4180 | - return DFB_INVARG; | |
4181 | + return DR_INVARG; | |
4182 | ||
4183 | pthread_mutex_lock( &data->lock ); | |
4184 | ||
4185 | @@ -603,38 +603,38 @@ IFusionSoundMusicProvider_Timidity_SeekTo( IFusionSoundMusicProvider *thiz, | |
4186 | ||
4187 | pthread_mutex_unlock( &data->lock ); | |
4188 | ||
4189 | - return DFB_OK; | |
4190 | + return DR_OK; | |
4191 | } | |
4192 | ||
4193 | -static DFBResult | |
4194 | +static DirectResult | |
4195 | IFusionSoundMusicProvider_Timidity_GetPos( IFusionSoundMusicProvider *thiz, | |
4196 | double *seconds ) | |
4197 | { | |
4198 | DIRECT_INTERFACE_GET_DATA (IFusionSoundMusicProvider_Timidity) | |
4199 | ||
4200 | if (!seconds) | |
4201 | - return DFB_INVARG; | |
4202 | + return DR_INVARG; | |
4203 | ||
4204 | *seconds = (double)data->song_pos / 1000.0; | |
4205 | ||
4206 | - return DFB_OK; | |
4207 | + return DR_OK; | |
4208 | } | |
4209 | ||
4210 | -static DFBResult | |
4211 | +static DirectResult | |
4212 | IFusionSoundMusicProvider_Timidity_GetLength( IFusionSoundMusicProvider *thiz, | |
4213 | double *seconds ) | |
4214 | { | |
4215 | DIRECT_INTERFACE_GET_DATA (IFusionSoundMusicProvider_Timidity) | |
4216 | ||
4217 | if (!seconds) | |
4218 | - return DFB_INVARG; | |
4219 | + return DR_INVARG; | |
4220 | ||
4221 | *seconds = (double)data->song_length / 1000.0; | |
4222 | ||
4223 | - return DFB_OK; | |
4224 | + return DR_OK; | |
4225 | } | |
4226 | ||
4227 | -static DFBResult | |
4228 | +static DirectResult | |
4229 | IFusionSoundMusicProvider_Timidity_SetPlaybackFlags( | |
4230 | IFusionSoundMusicProvider *thiz, | |
4231 | FSMusicProviderPlaybackFlags flags ) | |
4232 | @@ -642,14 +642,14 @@ IFusionSoundMusicProvider_Timidity_SetPlaybackFlags( | |
4233 | DIRECT_INTERFACE_GET_DATA (IFusionSoundMusicProvider_Timidity) | |
4234 | ||
4235 | if (flags & ~FMPLAY_LOOPING) | |
4236 | - return DFB_UNSUPPORTED; | |
4237 | + return DR_UNSUPPORTED; | |
4238 | ||
4239 | data->flags = flags; | |
4240 | ||
4241 | - return DFB_OK; | |
4242 | + return DR_OK; | |
4243 | } | |
4244 | ||
4245 | -static DFBResult | |
4246 | +static DirectResult | |
4247 | IFusionSoundMusicProvider_Timidity_WaitStatus( IFusionSoundMusicProvider *thiz, | |
4248 | FSMusicProviderStatus mask, | |
4249 | unsigned int timeout ) | |
4250 | @@ -657,7 +657,7 @@ IFusionSoundMusicProvider_Timidity_WaitStatus( IFusionSoundMusicProvider *thiz, | |
4251 | DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_Timidity ) | |
4252 | ||
4253 | if (!mask || mask & ~FMSTATE_ALL) | |
4254 | - return DFB_INVARG; | |
4255 | + return DR_INVARG; | |
4256 | ||
4257 | if (timeout) { | |
4258 | struct timespec t; | |
4259 | @@ -669,18 +669,18 @@ IFusionSoundMusicProvider_Timidity_WaitStatus( IFusionSoundMusicProvider *thiz, | |
4260 | ||
4261 | #ifdef HAVE_PTHREAD_MUTEX_TIMEDLOCK | |
4262 | if (pthread_mutex_timedlock( &data->lock, &t )) | |
4263 | - return DFB_TIMEOUT; | |
4264 | + return DR_TIMEOUT; | |
4265 | #else | |
4266 | while (pthread_mutex_trylock( &data->lock )) { | |
4267 | usleep( 1000 ); | |
4268 | if (direct_clock_get_abs_micros() >= s) | |
4269 | - return DFB_TIMEOUT; | |
4270 | + return DR_TIMEOUT; | |
4271 | } | |
4272 | #endif | |
4273 | while (!(data->status & mask)) { | |
4274 | if (pthread_cond_timedwait( &data->cond, &data->lock, &t ) == ETIMEDOUT) { | |
4275 | pthread_mutex_unlock( &data->lock ); | |
4276 | - return DFB_TIMEOUT; | |
4277 | + return DR_TIMEOUT; | |
4278 | } | |
4279 | } | |
4280 | } | |
4281 | @@ -693,22 +693,22 @@ IFusionSoundMusicProvider_Timidity_WaitStatus( IFusionSoundMusicProvider *thiz, | |
4282 | ||
4283 | pthread_mutex_unlock( &data->lock ); | |
4284 | ||
4285 | - return DFB_OK; | |
4286 | + return DR_OK; | |
4287 | } | |
4288 | ||
4289 | ||
4290 | /* exported symbols */ | |
4291 | ||
4292 | -static DFBResult | |
4293 | +static DirectResult | |
4294 | Probe( IFusionSoundMusicProvider_ProbeContext *ctx ) | |
4295 | { | |
4296 | if (!memcmp( ctx->header, "MThd", 4 )) | |
4297 | - return DFB_OK; | |
4298 | + return DR_OK; | |
4299 | ||
4300 | - return DFB_UNSUPPORTED; | |
4301 | + return DR_UNSUPPORTED; | |
4302 | } | |
4303 | ||
4304 | -static DFBResult | |
4305 | +static DirectResult | |
4306 | Construct( IFusionSoundMusicProvider *thiz, | |
4307 | const char *filename, | |
4308 | DirectStream *stream ) | |
4309 | @@ -718,7 +718,7 @@ Construct( IFusionSoundMusicProvider *thiz, | |
4310 | if (mid_init( NULL ) < 0) { | |
4311 | D_ERROR( "IFsusionSoundMusicProvider_Timidity: couldn't initialize TiMidity!\n" ); | |
4312 | pthread_mutex_unlock( &timidity_lock ); | |
4313 | - return DFB_INIT; | |
4314 | + return DR_INIT; | |
4315 | } | |
4316 | } | |
4317 | timidity_refs++; | |
4318 | @@ -751,5 +751,5 @@ Construct( IFusionSoundMusicProvider *thiz, | |
4319 | thiz->SetPlaybackFlags = IFusionSoundMusicProvider_Timidity_SetPlaybackFlags; | |
4320 | thiz->WaitStatus = IFusionSoundMusicProvider_Timidity_WaitStatus; | |
4321 | ||
4322 | - return DFB_OK; | |
4323 | + return DR_OK; | |
4324 | } | |
4325 | diff --git a/interfaces/IFusionSoundMusicProvider/ifusionsoundmusicprovider_vorbis.c b/interfaces/IFusionSoundMusicProvider/ifusionsoundmusicprovider_vorbis.c | |
4326 | index c84d15f..6d30f10 100644 | |
4327 | --- a/interfaces/IFusionSoundMusicProvider/ifusionsoundmusicprovider_vorbis.c | |
4328 | +++ b/interfaces/IFusionSoundMusicProvider/ifusionsoundmusicprovider_vorbis.c | |
4329 | @@ -51,10 +51,10 @@ | |
4330 | # include <vorbis/vorbisfile.h> | |
4331 | #endif | |
4332 | ||
4333 | -static DFBResult | |
4334 | +static DirectResult | |
4335 | Probe( IFusionSoundMusicProvider_ProbeContext *ctx ); | |
4336 | ||
4337 | -static DFBResult | |
4338 | +static DirectResult | |
4339 | Construct( IFusionSoundMusicProvider *thiz, | |
4340 | const char *filename, | |
4341 | DirectStream *stream ); | |
4342 | @@ -442,7 +442,7 @@ ov_read_callback( void *dst, size_t size, size_t nmemb, void *ctx ) | |
4343 | if (ret) { | |
4344 | memset( dst+length, 0, total-length ); | |
4345 | if (!length) | |
4346 | - return (ret == DFB_EOF) ? 0 : -1; | |
4347 | + return (ret == DR_EOF) ? 0 : -1; | |
4348 | break; | |
4349 | } | |
4350 | length += read; | |
4351 | @@ -456,7 +456,7 @@ ov_seek_callback( void *ctx, ogg_int64_t offset, int whence ) | |
4352 | { | |
4353 | DirectStream *stream = ctx; | |
4354 | unsigned int pos = 0; | |
4355 | - DirectResult ret = DFB_UNSUPPORTED; | |
4356 | + DirectResult ret = DR_UNSUPPORTED; | |
4357 | ||
4358 | if (!direct_stream_seekable( stream ) || direct_stream_remote( stream )) | |
4359 | return -1; | |
4360 | @@ -560,17 +560,17 @@ IFusionSoundMusicProvider_Vorbis_Destruct( IFusionSoundMusicProvider *thiz ) | |
4361 | DIRECT_DEALLOCATE_INTERFACE( thiz ); | |
4362 | } | |
4363 | ||
4364 | -static DFBResult | |
4365 | +static DirectResult | |
4366 | IFusionSoundMusicProvider_Vorbis_AddRef( IFusionSoundMusicProvider *thiz ) | |
4367 | { | |
4368 | DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_Vorbis ) | |
4369 | ||
4370 | data->ref++; | |
4371 | ||
4372 | - return DFB_OK; | |
4373 | + return DR_OK; | |
4374 | } | |
4375 | ||
4376 | -static DFBResult | |
4377 | +static DirectResult | |
4378 | IFusionSoundMusicProvider_Vorbis_Release( IFusionSoundMusicProvider *thiz ) | |
4379 | { | |
4380 | DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_Vorbis ) | |
4381 | @@ -578,17 +578,17 @@ IFusionSoundMusicProvider_Vorbis_Release( IFusionSoundMusicProvider *thiz ) | |
4382 | if (--data->ref == 0) | |
4383 | IFusionSoundMusicProvider_Vorbis_Destruct( thiz ); | |
4384 | ||
4385 | - return DFB_OK; | |
4386 | + return DR_OK; | |
4387 | } | |
4388 | ||
4389 | -static DFBResult | |
4390 | +static DirectResult | |
4391 | IFusionSoundMusicProvider_Vorbis_GetCapabilities( IFusionSoundMusicProvider *thiz, | |
4392 | FSMusicProviderCapabilities *caps ) | |
4393 | { | |
4394 | DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_Vorbis ) | |
4395 | ||
4396 | if (!caps) | |
4397 | - return DFB_INVARG; | |
4398 | + return DR_INVARG; | |
4399 | ||
4400 | #ifdef USE_TREMOR | |
4401 | *caps = FMCAPS_BASIC; | |
4402 | @@ -598,7 +598,7 @@ IFusionSoundMusicProvider_Vorbis_GetCapabilities( IFusionSoundMusicProvider *t | |
4403 | if (direct_stream_seekable( data->stream )) | |
4404 | *caps |= FMCAPS_SEEK; | |
4405 | ||
4406 | - return DFB_OK; | |
4407 | + return DR_OK; | |
4408 | } | |
4409 | ||
4410 | static inline float | |
4411 | @@ -685,28 +685,28 @@ vorbis_get_metadata( OggVorbis_File *vf, | |
4412 | desc->replaygain_album = vorbis_compute_gain( album_gain, album_peak ); | |
4413 | } | |
4414 | ||
4415 | -static DFBResult | |
4416 | +static DirectResult | |
4417 | IFusionSoundMusicProvider_Vorbis_GetTrackDescription( IFusionSoundMusicProvider *thiz, | |
4418 | FSTrackDescription *desc ) | |
4419 | { | |
4420 | DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_Vorbis ) | |
4421 | ||
4422 | if (!desc) | |
4423 | - return DFB_INVARG; | |
4424 | + return DR_INVARG; | |
4425 | ||
4426 | vorbis_get_metadata( &data->vf, desc ); | |
4427 | ||
4428 | - return DFB_OK; | |
4429 | + return DR_OK; | |
4430 | } | |
4431 | ||
4432 | -static DFBResult | |
4433 | +static DirectResult | |
4434 | IFusionSoundMusicProvider_Vorbis_GetStreamDescription( IFusionSoundMusicProvider *thiz, | |
4435 | FSStreamDescription *desc ) | |
4436 | { | |
4437 | DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_Vorbis ) | |
4438 | ||
4439 | if (!desc) | |
4440 | - return DFB_INVARG; | |
4441 | + return DR_INVARG; | |
4442 | ||
4443 | desc->flags = FSSDF_SAMPLERATE | FSSDF_CHANNELS | | |
4444 | FSSDF_SAMPLEFORMAT | FSSDF_BUFFERSIZE; | |
4445 | @@ -719,17 +719,17 @@ IFusionSoundMusicProvider_Vorbis_GetStreamDescription( IFusionSoundMusicProvider | |
4446 | #endif | |
4447 | desc->buffersize = desc->samplerate/8; | |
4448 | ||
4449 | - return DFB_OK; | |
4450 | + return DR_OK; | |
4451 | } | |
4452 | ||
4453 | -static DFBResult | |
4454 | +static DirectResult | |
4455 | IFusionSoundMusicProvider_Vorbis_GetBufferDescription( IFusionSoundMusicProvider *thiz, | |
4456 | FSBufferDescription *desc ) | |
4457 | { | |
4458 | DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_Vorbis ) | |
4459 | ||
4460 | if (!desc) | |
4461 | - return DFB_INVARG; | |
4462 | + return DR_INVARG; | |
4463 | ||
4464 | desc->flags = FSBDF_SAMPLERATE | FSBDF_CHANNELS | | |
4465 | FSBDF_SAMPLEFORMAT | FSBDF_LENGTH; | |
4466 | @@ -742,7 +742,7 @@ IFusionSoundMusicProvider_Vorbis_GetBufferDescription( IFusionSoundMusicProvider | |
4467 | #endif | |
4468 | desc->length = MIN(ov_pcm_total( &data->vf, -1 ), FS_MAX_FRAMES); | |
4469 | ||
4470 | - return DFB_OK; | |
4471 | + return DR_OK; | |
4472 | } | |
4473 | ||
4474 | static void* | |
4475 | @@ -818,7 +818,7 @@ VorbisStreamThread( DirectThread *thread, void *ctx ) | |
4476 | return NULL; | |
4477 | } | |
4478 | ||
4479 | -static DFBResult | |
4480 | +static DirectResult | |
4481 | IFusionSoundMusicProvider_Vorbis_PlayToStream( IFusionSoundMusicProvider *thiz, | |
4482 | IFusionSoundStream *destination ) | |
4483 | { | |
4484 | @@ -827,21 +827,21 @@ IFusionSoundMusicProvider_Vorbis_PlayToStream( IFusionSoundMusicProvider *thiz, | |
4485 | DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_Vorbis ) | |
4486 | ||
4487 | if (!destination) | |
4488 | - return DFB_INVARG; | |
4489 | + return DR_INVARG; | |
4490 | ||
4491 | if (data->dest.stream == destination) | |
4492 | - return DFB_OK; | |
4493 | + return DR_OK; | |
4494 | ||
4495 | destination->GetDescription( destination, &desc ); | |
4496 | ||
4497 | /* check if destination samplerate is supported */ | |
4498 | #ifdef USE_TREMOR | |
4499 | if (desc.samplerate != data->info->rate) | |
4500 | - return DFB_UNSUPPORTED; | |
4501 | + return DR_UNSUPPORTED; | |
4502 | #else | |
4503 | if (desc.samplerate != data->info->rate && | |
4504 | desc.samplerate != data->info->rate/2) | |
4505 | - return DFB_UNSUPPORTED; | |
4506 | + return DR_UNSUPPORTED; | |
4507 | #endif | |
4508 | ||
4509 | /* check if destination format is supported */ | |
4510 | @@ -853,7 +853,7 @@ IFusionSoundMusicProvider_Vorbis_PlayToStream( IFusionSoundMusicProvider *thiz, | |
4511 | case FSSF_FLOAT: | |
4512 | break; | |
4513 | default: | |
4514 | - return DFB_UNSUPPORTED; | |
4515 | + return DR_UNSUPPORTED; | |
4516 | } | |
4517 | ||
4518 | /* check if destination mode is supported */ | |
4519 | @@ -873,7 +873,7 @@ IFusionSoundMusicProvider_Vorbis_PlayToStream( IFusionSoundMusicProvider *thiz, | |
4520 | case FSCM_SURROUND51: | |
4521 | break; | |
4522 | default: | |
4523 | - return DFB_UNSUPPORTED; | |
4524 | + return DR_UNSUPPORTED; | |
4525 | } | |
4526 | ||
4527 | pthread_mutex_lock( &data->lock ); | |
4528 | @@ -884,7 +884,7 @@ IFusionSoundMusicProvider_Vorbis_PlayToStream( IFusionSoundMusicProvider *thiz, | |
4529 | if (desc.samplerate == data->info->rate/2) { | |
4530 | if (ov_halfrate( &data->vf, 1 )) { | |
4531 | pthread_mutex_unlock( &data->lock ); | |
4532 | - return DFB_UNSUPPORTED; | |
4533 | + return DR_UNSUPPORTED; | |
4534 | } | |
4535 | } else { | |
4536 | ov_halfrate( &data->vf, 0 ); | |
4537 | @@ -915,7 +915,7 @@ IFusionSoundMusicProvider_Vorbis_PlayToStream( IFusionSoundMusicProvider *thiz, | |
4538 | ||
4539 | pthread_mutex_unlock( &data->lock ); | |
4540 | ||
4541 | - return DFB_OK; | |
4542 | + return DR_OK; | |
4543 | } | |
4544 | ||
4545 | static void* | |
4546 | @@ -947,7 +947,7 @@ VorbisBufferThread( DirectThread *thread, void *ctx ) | |
4547 | break; | |
4548 | } | |
4549 | ||
4550 | - if (buffer->Lock( buffer, (void*)&dst, &size, 0 ) != DFB_OK) { | |
4551 | + if (buffer->Lock( buffer, (void*)&dst, &size, 0 ) != DR_OK) { | |
4552 | D_ERROR( "IFusionSoundMusicProvider_Vorbis: " | |
4553 | "Couldn't lock buffer!\n" ); | |
4554 | pthread_mutex_unlock( &data->lock ); | |
4555 | @@ -1005,7 +1005,7 @@ VorbisBufferThread( DirectThread *thread, void *ctx ) | |
4556 | return NULL; | |
4557 | } | |
4558 | ||
4559 | -static DFBResult | |
4560 | +static DirectResult | |
4561 | IFusionSoundMusicProvider_Vorbis_PlayToBuffer( IFusionSoundMusicProvider *thiz, | |
4562 | IFusionSoundBuffer *destination, | |
4563 | FMBufferCallback callback, | |
4564 | @@ -1016,21 +1016,21 @@ IFusionSoundMusicProvider_Vorbis_PlayToBuffer( IFusionSoundMusicProvider *thiz, | |
4565 | DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_Vorbis ) | |
4566 | ||
4567 | if (!destination) | |
4568 | - return DFB_INVARG; | |
4569 | + return DR_INVARG; | |
4570 | ||
4571 | if (data->dest.buffer == destination) | |
4572 | - return DFB_OK; | |
4573 | + return DR_OK; | |
4574 | ||
4575 | destination->GetDescription( destination, &desc ); | |
4576 | ||
4577 | /* check if destination samplerate is supported */ | |
4578 | #ifdef USE_TREMOR | |
4579 | if (desc.samplerate != data->info->rate) | |
4580 | - return DFB_UNSUPPORTED; | |
4581 | + return DR_UNSUPPORTED; | |
4582 | #else | |
4583 | if (desc.samplerate != data->info->rate && | |
4584 | desc.samplerate != data->info->rate/2) | |
4585 | - return DFB_UNSUPPORTED; | |
4586 | + return DR_UNSUPPORTED; | |
4587 | #endif | |
4588 | ||
4589 | /* check if destination format is supported */ | |
4590 | @@ -1042,7 +1042,7 @@ IFusionSoundMusicProvider_Vorbis_PlayToBuffer( IFusionSoundMusicProvider *thiz, | |
4591 | case FSSF_FLOAT: | |
4592 | break; | |
4593 | default: | |
4594 | - return DFB_UNSUPPORTED; | |
4595 | + return DR_UNSUPPORTED; | |
4596 | } | |
4597 | ||
4598 | /* check if destination mode is supported */ | |
4599 | @@ -1062,7 +1062,7 @@ IFusionSoundMusicProvider_Vorbis_PlayToBuffer( IFusionSoundMusicProvider *thiz, | |
4600 | case FSCM_SURROUND51: | |
4601 | break; | |
4602 | default: | |
4603 | - return DFB_UNSUPPORTED; | |
4604 | + return DR_UNSUPPORTED; | |
4605 | } | |
4606 | ||
4607 | pthread_mutex_lock( &data->lock ); | |
4608 | @@ -1073,7 +1073,7 @@ IFusionSoundMusicProvider_Vorbis_PlayToBuffer( IFusionSoundMusicProvider *thiz, | |
4609 | if (desc.samplerate == data->info->rate/2) { | |
4610 | if (ov_halfrate( &data->vf, 1 )) { | |
4611 | pthread_mutex_unlock( &data->lock ); | |
4612 | - return DFB_UNSUPPORTED; | |
4613 | + return DR_UNSUPPORTED; | |
4614 | } | |
4615 | } else { | |
4616 | ov_halfrate( &data->vf, 0 ); | |
4617 | @@ -1108,10 +1108,10 @@ IFusionSoundMusicProvider_Vorbis_PlayToBuffer( IFusionSoundMusicProvider *thiz, | |
4618 | ||
4619 | pthread_mutex_unlock( &data->lock ); | |
4620 | ||
4621 | - return DFB_OK; | |
4622 | + return DR_OK; | |
4623 | } | |
4624 | ||
4625 | -static DFBResult | |
4626 | +static DirectResult | |
4627 | IFusionSoundMusicProvider_Vorbis_Stop( IFusionSoundMusicProvider *thiz ) | |
4628 | { | |
4629 | DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_Vorbis ) | |
4630 | @@ -1124,33 +1124,33 @@ IFusionSoundMusicProvider_Vorbis_Stop( IFusionSoundMusicProvider *thiz ) | |
4631 | ||
4632 | pthread_mutex_unlock( &data->lock ); | |
4633 | ||
4634 | - return DFB_OK; | |
4635 | + return DR_OK; | |
4636 | } | |
4637 | ||
4638 | -static DFBResult | |
4639 | +static DirectResult | |
4640 | IFusionSoundMusicProvider_Vorbis_GetStatus( IFusionSoundMusicProvider *thiz, | |
4641 | FSMusicProviderStatus *status ) | |
4642 | { | |
4643 | DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_Vorbis ) | |
4644 | ||
4645 | if (!status) | |
4646 | - return DFB_INVARG; | |
4647 | + return DR_INVARG; | |
4648 | ||
4649 | *status = data->status; | |
4650 | ||
4651 | - return DFB_OK; | |
4652 | + return DR_OK; | |
4653 | } | |
4654 | ||
4655 | -static DFBResult | |
4656 | +static DirectResult | |
4657 | IFusionSoundMusicProvider_Vorbis_SeekTo( IFusionSoundMusicProvider *thiz, | |
4658 | double seconds ) | |
4659 | { | |
4660 | - DFBResult ret = DFB_OK; | |
4661 | + DirectResult ret = DR_OK; | |
4662 | ||
4663 | DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_Vorbis ) | |
4664 | ||
4665 | if (seconds < 0.0) | |
4666 | - return DFB_INVARG; | |
4667 | + return DR_INVARG; | |
4668 | ||
4669 | pthread_mutex_lock( &data->lock ); | |
4670 | ||
4671 | @@ -1158,7 +1158,7 @@ IFusionSoundMusicProvider_Vorbis_SeekTo( IFusionSoundMusicProvider *thiz, | |
4672 | unsigned int off; | |
4673 | ||
4674 | if (!data->info->bitrate_nominal) | |
4675 | - return DFB_UNSUPPORTED; | |
4676 | + return DR_UNSUPPORTED; | |
4677 | ||
4678 | off = seconds * (double)(data->info->bitrate_nominal >> 3); | |
4679 | ret = direct_stream_seek( data->stream, off ); | |
4680 | @@ -1168,10 +1168,10 @@ IFusionSoundMusicProvider_Vorbis_SeekTo( IFusionSoundMusicProvider *thiz, | |
4681 | seconds *= 1000; | |
4682 | #endif | |
4683 | if (ov_time_seek( &data->vf, seconds )) | |
4684 | - ret = DFB_FAILURE; | |
4685 | + ret = DR_FAILURE; | |
4686 | } | |
4687 | ||
4688 | - if (ret == DFB_OK) { | |
4689 | + if (ret == DR_OK) { | |
4690 | data->seeked = true; | |
4691 | data->finished = false; | |
4692 | } | |
4693 | @@ -1181,14 +1181,14 @@ IFusionSoundMusicProvider_Vorbis_SeekTo( IFusionSoundMusicProvider *thiz, | |
4694 | return ret; | |
4695 | } | |
4696 | ||
4697 | -static DFBResult | |
4698 | +static DirectResult | |
4699 | IFusionSoundMusicProvider_Vorbis_GetPos( IFusionSoundMusicProvider *thiz, | |
4700 | double *seconds ) | |
4701 | { | |
4702 | DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_Vorbis ) | |
4703 | ||
4704 | if (!seconds) | |
4705 | - return DFB_INVARG; | |
4706 | + return DR_INVARG; | |
4707 | ||
4708 | #ifdef USE_TREMOR | |
4709 | *seconds = (double)ov_time_tell( &data->vf ) / 1000.0; | |
4710 | @@ -1196,10 +1196,10 @@ IFusionSoundMusicProvider_Vorbis_GetPos( IFusionSoundMusicProvider *thiz, | |
4711 | *seconds = ov_time_tell( &data->vf ); | |
4712 | #endif | |
4713 | ||
4714 | - return DFB_OK; | |
4715 | + return DR_OK; | |
4716 | } | |
4717 | ||
4718 | -static DFBResult | |
4719 | +static DirectResult | |
4720 | IFusionSoundMusicProvider_Vorbis_GetLength( IFusionSoundMusicProvider *thiz, | |
4721 | double *seconds ) | |
4722 | { | |
4723 | @@ -1208,7 +1208,7 @@ IFusionSoundMusicProvider_Vorbis_GetLength( IFusionSoundMusicProvider *thiz, | |
4724 | DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_Vorbis ) | |
4725 | ||
4726 | if (!seconds) | |
4727 | - return DFB_INVARG; | |
4728 | + return DR_INVARG; | |
4729 | ||
4730 | #ifdef USE_TREMOR | |
4731 | length = (double)ov_time_total( &data->vf, -1 ) / 1000.0; | |
4732 | @@ -1224,27 +1224,27 @@ IFusionSoundMusicProvider_Vorbis_GetLength( IFusionSoundMusicProvider *thiz, | |
4733 | ||
4734 | *seconds = length; | |
4735 | ||
4736 | - return DFB_OK; | |
4737 | + return DR_OK; | |
4738 | } | |
4739 | ||
4740 | -static DFBResult | |
4741 | +static DirectResult | |
4742 | IFusionSoundMusicProvider_Vorbis_SetPlaybackFlags( IFusionSoundMusicProvider *thiz, | |
4743 | FSMusicProviderPlaybackFlags flags ) | |
4744 | { | |
4745 | DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_Vorbis ) | |
4746 | ||
4747 | if (flags & ~FMPLAY_LOOPING) | |
4748 | - return DFB_UNSUPPORTED; | |
4749 | + return DR_UNSUPPORTED; | |
4750 | ||
4751 | if (flags & FMPLAY_LOOPING && !direct_stream_seekable( data->stream )) | |
4752 | - return DFB_UNSUPPORTED; | |
4753 | + return DR_UNSUPPORTED; | |
4754 | ||
4755 | data->flags = flags; | |
4756 | ||
4757 | - return DFB_OK; | |
4758 | + return DR_OK; | |
4759 | } | |
4760 | ||
4761 | -static DFBResult | |
4762 | +static DirectResult | |
4763 | IFusionSoundMusicProvider_Vorbis_WaitStatus( IFusionSoundMusicProvider *thiz, | |
4764 | FSMusicProviderStatus mask, | |
4765 | unsigned int timeout ) | |
4766 | @@ -1252,7 +1252,7 @@ IFusionSoundMusicProvider_Vorbis_WaitStatus( IFusionSoundMusicProvider *thiz, | |
4767 | DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_Vorbis) | |
4768 | ||
4769 | if (!mask || mask & ~FMSTATE_ALL) | |
4770 | - return DFB_INVARG; | |
4771 | + return DR_INVARG; | |
4772 | ||
4773 | if (timeout) { | |
4774 | struct timespec t; | |
4775 | @@ -1264,18 +1264,18 @@ IFusionSoundMusicProvider_Vorbis_WaitStatus( IFusionSoundMusicProvider *thiz, | |
4776 | ||
4777 | #ifdef HAVE_PTHREAD_MUTEX_TIMEDLOCK | |
4778 | if (pthread_mutex_timedlock( &data->lock, &t )) | |
4779 | - return DFB_TIMEOUT; | |
4780 | + return DR_TIMEOUT; | |
4781 | #else | |
4782 | while (pthread_mutex_trylock( &data->lock )) { | |
4783 | usleep( 1000 ); | |
4784 | if (direct_clock_get_abs_micros() >= s) | |
4785 | - return DFB_TIMEOUT; | |
4786 | + return DR_TIMEOUT; | |
4787 | } | |
4788 | #endif | |
4789 | while (!(data->status & mask)) { | |
4790 | if (pthread_cond_timedwait( &data->cond, &data->lock, &t ) == ETIMEDOUT) { | |
4791 | pthread_mutex_unlock( &data->lock ); | |
4792 | - return DFB_TIMEOUT; | |
4793 | + return DR_TIMEOUT; | |
4794 | } | |
4795 | } | |
4796 | } | |
4797 | @@ -1288,23 +1288,23 @@ IFusionSoundMusicProvider_Vorbis_WaitStatus( IFusionSoundMusicProvider *thiz, | |
4798 | ||
4799 | pthread_mutex_unlock( &data->lock ); | |
4800 | ||
4801 | - return DFB_OK; | |
4802 | + return DR_OK; | |
4803 | } | |
4804 | ||
4805 | ||
4806 | /* exported symbols */ | |
4807 | ||
4808 | -static DFBResult | |
4809 | +static DirectResult | |
4810 | Probe( IFusionSoundMusicProvider_ProbeContext *ctx ) | |
4811 | { | |
4812 | if (!memcmp( &ctx->header[0], "OggS", 4 ) && | |
4813 | !memcmp( &ctx->header[29], "vorbis", 6 )) | |
4814 | - return DFB_OK; | |
4815 | + return DR_OK; | |
4816 | ||
4817 | - return DFB_UNSUPPORTED; | |
4818 | + return DR_UNSUPPORTED; | |
4819 | } | |
4820 | ||
4821 | -static DFBResult | |
4822 | +static DirectResult | |
4823 | Construct( IFusionSoundMusicProvider *thiz, | |
4824 | const char *filename, | |
4825 | DirectStream *stream ) | |
4826 | @@ -1326,7 +1326,7 @@ Construct( IFusionSoundMusicProvider *thiz, | |
4827 | D_ERROR( "IFusionSoundMusicProvider_Vorbis: " | |
4828 | "Error opening ogg/vorbis stream!\n" ); | |
4829 | IFusionSoundMusicProvider_Vorbis_Destruct( thiz ); | |
4830 | - return DFB_FAILURE; | |
4831 | + return DR_FAILURE; | |
4832 | } | |
4833 | ||
4834 | data->info = ov_info( &data->vf, -1 ); | |
4835 | @@ -1334,7 +1334,7 @@ Construct( IFusionSoundMusicProvider *thiz, | |
4836 | D_ERROR( "IFusionSoundMusicProvider_Vorbis: " | |
4837 | "Error getting stream informations!\n" ); | |
4838 | IFusionSoundMusicProvider_Vorbis_Destruct( thiz ); | |
4839 | - return DFB_FAILURE; | |
4840 | + return DR_FAILURE; | |
4841 | } | |
4842 | ||
4843 | direct_util_recursive_pthread_mutex_init( &data->lock ); | |
4844 | @@ -1357,6 +1357,6 @@ Construct( IFusionSoundMusicProvider *thiz, | |
4845 | thiz->SetPlaybackFlags = IFusionSoundMusicProvider_Vorbis_SetPlaybackFlags; | |
4846 | thiz->WaitStatus = IFusionSoundMusicProvider_Vorbis_WaitStatus; | |
4847 | ||
4848 | - return DFB_OK; | |
4849 | + return DR_OK; | |
4850 | } | |
4851 | ||
4852 | diff --git a/interfaces/IFusionSoundMusicProvider/ifusionsoundmusicprovider_wave.c b/interfaces/IFusionSoundMusicProvider/ifusionsoundmusicprovider_wave.c | |
4853 | index be8b519..01ab270 100644 | |
4854 | --- a/interfaces/IFusionSoundMusicProvider/ifusionsoundmusicprovider_wave.c | |
4855 | +++ b/interfaces/IFusionSoundMusicProvider/ifusionsoundmusicprovider_wave.c | |
4856 | @@ -43,10 +43,10 @@ | |
4857 | #include <misc/sound_util.h> | |
4858 | ||
4859 | ||
4860 | -static DFBResult | |
4861 | +static DirectResult | |
4862 | Probe( IFusionSoundMusicProvider_ProbeContext *ctx ); | |
4863 | ||
4864 | -static DFBResult | |
4865 | +static DirectResult | |
4866 | Construct( IFusionSoundMusicProvider *thiz, | |
4867 | const char *filename, | |
4868 | DirectStream *stream ); | |
4869 | @@ -366,17 +366,17 @@ IFusionSoundMusicProvider_Wave_Destruct( IFusionSoundMusicProvider *thiz ) | |
4870 | DIRECT_DEALLOCATE_INTERFACE( thiz ); | |
4871 | } | |
4872 | ||
4873 | -static DFBResult | |
4874 | +static DirectResult | |
4875 | IFusionSoundMusicProvider_Wave_AddRef( IFusionSoundMusicProvider *thiz ) | |
4876 | { | |
4877 | DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_Wave ) | |
4878 | ||
4879 | data->ref++; | |
4880 | ||
4881 | - return DFB_OK; | |
4882 | + return DR_OK; | |
4883 | } | |
4884 | ||
4885 | -static DFBResult | |
4886 | +static DirectResult | |
4887 | IFusionSoundMusicProvider_Wave_Release( IFusionSoundMusicProvider *thiz ) | |
4888 | { | |
4889 | DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_Wave ) | |
4890 | @@ -384,34 +384,34 @@ IFusionSoundMusicProvider_Wave_Release( IFusionSoundMusicProvider *thiz ) | |
4891 | if (--data->ref == 0) | |
4892 | IFusionSoundMusicProvider_Wave_Destruct( thiz ); | |
4893 | ||
4894 | - return DFB_OK; | |
4895 | + return DR_OK; | |
4896 | } | |
4897 | ||
4898 | -static DFBResult | |
4899 | +static DirectResult | |
4900 | IFusionSoundMusicProvider_Wave_GetCapabilities( IFusionSoundMusicProvider *thiz, | |
4901 | FSMusicProviderCapabilities *caps ) | |
4902 | { | |
4903 | DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_Wave ) | |
4904 | ||
4905 | if (!caps) | |
4906 | - return DFB_INVARG; | |
4907 | + return DR_INVARG; | |
4908 | ||
4909 | if (direct_stream_seekable( data->stream )) | |
4910 | *caps = FMCAPS_BASIC | FMCAPS_SEEK; | |
4911 | else | |
4912 | *caps = FMCAPS_BASIC; | |
4913 | ||
4914 | - return DFB_OK; | |
4915 | + return DR_OK; | |
4916 | } | |
4917 | ||
4918 | -static DFBResult | |
4919 | +static DirectResult | |
4920 | IFusionSoundMusicProvider_Wave_GetTrackDescription( IFusionSoundMusicProvider *thiz, | |
4921 | FSTrackDescription *desc ) | |
4922 | { | |
4923 | DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_Wave ) | |
4924 | ||
4925 | if (!desc) | |
4926 | - return DFB_INVARG; | |
4927 | + return DR_INVARG; | |
4928 | ||
4929 | memset( desc, 0, sizeof(FSTrackDescription) ); | |
4930 | snprintf( desc->encoding, | |
4931 | @@ -420,17 +420,17 @@ IFusionSoundMusicProvider_Wave_GetTrackDescription( IFusionSoundMusicProvider *t | |
4932 | FS_BITS_PER_SAMPLE(data->format) ); | |
4933 | desc->bitrate = data->samplerate * data->channels * FS_BITS_PER_SAMPLE(data->format); | |
4934 | ||
4935 | - return DFB_OK; | |
4936 | + return DR_OK; | |
4937 | } | |
4938 | ||
4939 | -static DFBResult | |
4940 | +static DirectResult | |
4941 | IFusionSoundMusicProvider_Wave_GetStreamDescription( IFusionSoundMusicProvider *thiz, | |
4942 | FSStreamDescription *desc ) | |
4943 | { | |
4944 | DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_Wave ) | |
4945 | ||
4946 | if (!desc) | |
4947 | - return DFB_INVARG; | |
4948 | + return DR_INVARG; | |
4949 | ||
4950 | desc->flags = FSSDF_SAMPLERATE | FSSDF_CHANNELS | | |
4951 | FSSDF_SAMPLEFORMAT | FSSDF_BUFFERSIZE; | |
4952 | @@ -439,17 +439,17 @@ IFusionSoundMusicProvider_Wave_GetStreamDescription( IFusionSoundMusicProvider * | |
4953 | desc->sampleformat = data->format; | |
4954 | desc->buffersize = data->samplerate/10; | |
4955 | ||
4956 | - return DFB_OK; | |
4957 | + return DR_OK; | |
4958 | } | |
4959 | ||
4960 | -static DFBResult | |
4961 | +static DirectResult | |
4962 | IFusionSoundMusicProvider_Wave_GetBufferDescription( IFusionSoundMusicProvider *thiz, | |
4963 | FSBufferDescription *desc ) | |
4964 | { | |
4965 | DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_Wave ) | |
4966 | ||
4967 | if (!desc) | |
4968 | - return DFB_INVARG; | |
4969 | + return DR_INVARG; | |
4970 | ||
4971 | desc->flags = FSBDF_LENGTH | FSBDF_CHANNELS | | |
4972 | FSBDF_SAMPLEFORMAT | FSBDF_SAMPLERATE; | |
4973 | @@ -460,7 +460,7 @@ IFusionSoundMusicProvider_Wave_GetBufferDescription( IFusionSoundMusicProvider * | |
4974 | if (desc->length > FS_MAX_FRAMES) | |
4975 | desc->length = FS_MAX_FRAMES; | |
4976 | ||
4977 | - return DFB_OK; | |
4978 | + return DR_OK; | |
4979 | } | |
4980 | ||
4981 | static void* | |
4982 | @@ -472,7 +472,7 @@ WaveStreamThread( DirectThread *thread, void *ctx ) | |
4983 | void *src = data->src_buffer; | |
4984 | ||
4985 | while (data->status == FMSTATE_PLAY) { | |
4986 | - DFBResult ret; | |
4987 | + DirectResult ret; | |
4988 | unsigned int len = 0; | |
4989 | unsigned int pos = 0; | |
4990 | struct timeval tv = { 0, 1000 }; | |
4991 | @@ -502,7 +502,7 @@ WaveStreamThread( DirectThread *thread, void *ctx ) | |
4992 | } | |
4993 | ||
4994 | ret = direct_stream_wait( data->stream, count, &tv ); | |
4995 | - if (ret != DFB_TIMEOUT) { | |
4996 | + if (ret != DR_TIMEOUT) { | |
4997 | ret = direct_stream_read( data->stream, count, src, &len ); | |
4998 | len /= data->framesize; | |
4999 | } | |
5000 | @@ -513,7 +513,7 @@ WaveStreamThread( DirectThread *thread, void *ctx ) | |
5001 | } | |
5002 | ||
5003 | if (ret) { | |
5004 | - if (ret == DFB_EOF) { | |
5005 | + if (ret == DR_EOF) { | |
5006 | if (data->flags & FMPLAY_LOOPING) { | |
5007 | direct_stream_seek( data->stream, data->headsize ); | |
5008 | } | |
5009 | @@ -556,7 +556,7 @@ WaveStreamThread( DirectThread *thread, void *ctx ) | |
5010 | return NULL; | |
5011 | } | |
5012 | ||
5013 | -static DFBResult | |
5014 | +static DirectResult | |
5015 | IFusionSoundMusicProvider_Wave_PlayToStream( IFusionSoundMusicProvider *thiz, | |
5016 | IFusionSoundStream *destination ) | |
5017 | { | |
5018 | @@ -566,16 +566,16 @@ IFusionSoundMusicProvider_Wave_PlayToStream( IFusionSoundMusicProvider *thiz, | |
5019 | DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_Wave ) | |
5020 | ||
5021 | if (!destination) | |
5022 | - return DFB_INVARG; | |
5023 | + return DR_INVARG; | |
5024 | ||
5025 | if (data->dest.stream == destination) | |
5026 | - return DFB_OK; | |
5027 | + return DR_OK; | |
5028 | ||
5029 | destination->GetDescription( destination, &desc ); | |
5030 | ||
5031 | /* check if destination samplerate is supported */ | |
5032 | if (desc.samplerate != data->samplerate) | |
5033 | - return DFB_UNSUPPORTED; | |
5034 | + return DR_UNSUPPORTED; | |
5035 | ||
5036 | /* check if destination format is supported */ | |
5037 | switch (desc.sampleformat) { | |
5038 | @@ -586,7 +586,7 @@ IFusionSoundMusicProvider_Wave_PlayToStream( IFusionSoundMusicProvider *thiz, | |
5039 | case FSSF_FLOAT: | |
5040 | break; | |
5041 | default: | |
5042 | - return DFB_UNSUPPORTED; | |
5043 | + return DR_UNSUPPORTED; | |
5044 | } | |
5045 | ||
5046 | /* check if destination mode is supported */ | |
5047 | @@ -606,7 +606,7 @@ IFusionSoundMusicProvider_Wave_PlayToStream( IFusionSoundMusicProvider *thiz, | |
5048 | case FSCM_SURROUND51: | |
5049 | break; | |
5050 | default: | |
5051 | - return DFB_UNSUPPORTED; | |
5052 | + return DR_UNSUPPORTED; | |
5053 | } | |
5054 | ||
5055 | pthread_mutex_lock( &data->lock ); | |
5056 | @@ -646,7 +646,7 @@ IFusionSoundMusicProvider_Wave_PlayToStream( IFusionSoundMusicProvider *thiz, | |
5057 | ||
5058 | pthread_mutex_unlock( &data->lock ); | |
5059 | ||
5060 | - return DFB_OK; | |
5061 | + return DR_OK; | |
5062 | } | |
5063 | ||
5064 | static void* | |
5065 | @@ -659,7 +659,7 @@ WaveBufferThread( DirectThread *thread, void *ctx ) | |
5066 | size_t count = data->dest.length * data->framesize; | |
5067 | ||
5068 | while (data->status == FMSTATE_PLAY) { | |
5069 | - DFBResult ret; | |
5070 | + DirectResult ret; | |
5071 | void *dst; | |
5072 | int size; | |
5073 | unsigned int len = 0; | |
5074 | @@ -673,7 +673,7 @@ WaveBufferThread( DirectThread *thread, void *ctx ) | |
5075 | } | |
5076 | ||
5077 | if (!data->src_buffer) { | |
5078 | - if (buffer->Lock( buffer, &dst, 0, &size ) != DFB_OK) { | |
5079 | + if (buffer->Lock( buffer, &dst, 0, &size ) != DR_OK) { | |
5080 | D_ERROR( "IFusionSoundMusicProvider_Wave: " | |
5081 | "Couldn't lock buffer!" ); | |
5082 | pthread_mutex_unlock( &data->lock ); | |
5083 | @@ -685,14 +685,14 @@ WaveBufferThread( DirectThread *thread, void *ctx ) | |
5084 | } | |
5085 | ||
5086 | ret = direct_stream_wait( data->stream, size, &tv ); | |
5087 | - if (ret != DFB_TIMEOUT) | |
5088 | + if (ret != DR_TIMEOUT) | |
5089 | ret = direct_stream_read( data->stream, size, dst, &len ); | |
5090 | ||
5091 | if (!data->src_buffer) | |
5092 | buffer->Unlock( buffer ); | |
5093 | ||
5094 | if (ret) { | |
5095 | - if (ret == DFB_EOF) { | |
5096 | + if (ret == DR_EOF) { | |
5097 | if (data->flags & FMPLAY_LOOPING) { | |
5098 | direct_stream_seek( data->stream, data->headsize ); | |
5099 | } | |
5100 | @@ -714,7 +714,7 @@ WaveBufferThread( DirectThread *thread, void *ctx ) | |
5101 | ||
5102 | if (data->src_buffer) { | |
5103 | while (len > 0) { | |
5104 | - if (buffer->Lock( buffer, &dst, &size, 0 ) != DFB_OK) { | |
5105 | + if (buffer->Lock( buffer, &dst, &size, 0 ) != DR_OK) { | |
5106 | D_ERROR( "IFusionSoundMusicProvider_Wave: " | |
5107 | "Couldn't lock buffer!" ); | |
5108 | break; | |
5109 | @@ -753,7 +753,7 @@ WaveBufferThread( DirectThread *thread, void *ctx ) | |
5110 | return NULL; | |
5111 | } | |
5112 | ||
5113 | -static DFBResult | |
5114 | +static DirectResult | |
5115 | IFusionSoundMusicProvider_Wave_PlayToBuffer( IFusionSoundMusicProvider *thiz, | |
5116 | IFusionSoundBuffer *destination, | |
5117 | FMBufferCallback callback, | |
5118 | @@ -764,16 +764,16 @@ IFusionSoundMusicProvider_Wave_PlayToBuffer( IFusionSoundMusicProvider *thiz, | |
5119 | DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_Wave ) | |
5120 | ||
5121 | if (!destination) | |
5122 | - return DFB_INVARG; | |
5123 | + return DR_INVARG; | |
5124 | ||
5125 | if (data->dest.buffer == destination) | |
5126 | - return DFB_OK; | |
5127 | + return DR_OK; | |
5128 | ||
5129 | destination->GetDescription( destination, &desc ); | |
5130 | ||
5131 | /* check if destination samplerate is supported */ | |
5132 | if (desc.samplerate != data->samplerate) | |
5133 | - return DFB_UNSUPPORTED; | |
5134 | + return DR_UNSUPPORTED; | |
5135 | ||
5136 | /* check if destination format is supported */ | |
5137 | switch (desc.sampleformat) { | |
5138 | @@ -784,7 +784,7 @@ IFusionSoundMusicProvider_Wave_PlayToBuffer( IFusionSoundMusicProvider *thiz, | |
5139 | case FSSF_FLOAT: | |
5140 | break; | |
5141 | default: | |
5142 | - return DFB_UNSUPPORTED; | |
5143 | + return DR_UNSUPPORTED; | |
5144 | } | |
5145 | ||
5146 | /* check if destination mode is supported */ | |
5147 | @@ -804,7 +804,7 @@ IFusionSoundMusicProvider_Wave_PlayToBuffer( IFusionSoundMusicProvider *thiz, | |
5148 | case FSCM_SURROUND51: | |
5149 | break; | |
5150 | default: | |
5151 | - return DFB_UNSUPPORTED; | |
5152 | + return DR_UNSUPPORTED; | |
5153 | } | |
5154 | ||
5155 | pthread_mutex_lock( &data->lock ); | |
5156 | @@ -846,10 +846,10 @@ IFusionSoundMusicProvider_Wave_PlayToBuffer( IFusionSoundMusicProvider *thiz, | |
5157 | ||
5158 | pthread_mutex_unlock( &data->lock ); | |
5159 | ||
5160 | - return DFB_OK; | |
5161 | + return DR_OK; | |
5162 | } | |
5163 | ||
5164 | -static DFBResult | |
5165 | +static DirectResult | |
5166 | IFusionSoundMusicProvider_Wave_Stop( IFusionSoundMusicProvider *thiz ) | |
5167 | { | |
5168 | DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_Wave ) | |
5169 | @@ -862,44 +862,44 @@ IFusionSoundMusicProvider_Wave_Stop( IFusionSoundMusicProvider *thiz ) | |
5170 | ||
5171 | pthread_mutex_unlock( &data->lock ); | |
5172 | ||
5173 | - return DFB_OK; | |
5174 | + return DR_OK; | |
5175 | } | |
5176 | ||
5177 | -static DFBResult | |
5178 | +static DirectResult | |
5179 | IFusionSoundMusicProvider_Wave_GetStatus( IFusionSoundMusicProvider *thiz, | |
5180 | FSMusicProviderStatus *status ) | |
5181 | { | |
5182 | DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_Wave ) | |
5183 | ||
5184 | if (!status) | |
5185 | - return DFB_INVARG; | |
5186 | + return DR_INVARG; | |
5187 | ||
5188 | *status = data->status; | |
5189 | ||
5190 | - return DFB_OK; | |
5191 | + return DR_OK; | |
5192 | } | |
5193 | ||
5194 | -static DFBResult | |
5195 | +static DirectResult | |
5196 | IFusionSoundMusicProvider_Wave_SeekTo( IFusionSoundMusicProvider *thiz, | |
5197 | double seconds ) | |
5198 | { | |
5199 | - DFBResult ret; | |
5200 | + DirectResult ret; | |
5201 | int offset; | |
5202 | ||
5203 | DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_Wave ) | |
5204 | ||
5205 | if (seconds < 0.0) | |
5206 | - return DFB_INVARG; | |
5207 | + return DR_INVARG; | |
5208 | ||
5209 | offset = (double)data->samplerate * seconds; | |
5210 | offset = offset * data->framesize; | |
5211 | if (data->datasize && offset > data->datasize) | |
5212 | - return DFB_UNSUPPORTED; | |
5213 | + return DR_UNSUPPORTED; | |
5214 | offset += data->headsize; | |
5215 | ||
5216 | pthread_mutex_lock( &data->lock ); | |
5217 | ret = direct_stream_seek( data->stream, offset ); | |
5218 | - if (ret == DFB_OK) { | |
5219 | + if (ret == DR_OK) { | |
5220 | data->seeked = true; | |
5221 | data->finished = false; | |
5222 | } | |
5223 | @@ -908,53 +908,53 @@ IFusionSoundMusicProvider_Wave_SeekTo( IFusionSoundMusicProvider *thiz, | |
5224 | return ret; | |
5225 | } | |
5226 | ||
5227 | -static DFBResult | |
5228 | +static DirectResult | |
5229 | IFusionSoundMusicProvider_Wave_GetPos( IFusionSoundMusicProvider *thiz, | |
5230 | double *seconds ) | |
5231 | { | |
5232 | DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_Wave ) | |
5233 | ||
5234 | if (!seconds) | |
5235 | - return DFB_INVARG; | |
5236 | + return DR_INVARG; | |
5237 | ||
5238 | *seconds = (double) direct_stream_offset( data->stream ) / | |
5239 | (double)(data->samplerate * data->framesize); | |
5240 | ||
5241 | - return DFB_OK; | |
5242 | + return DR_OK; | |
5243 | } | |
5244 | ||
5245 | -static DFBResult | |
5246 | +static DirectResult | |
5247 | IFusionSoundMusicProvider_Wave_GetLength( IFusionSoundMusicProvider *thiz, | |
5248 | double *seconds ) | |
5249 | { | |
5250 | DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_Wave ) | |
5251 | ||
5252 | if (!seconds) | |
5253 | - return DFB_INVARG; | |
5254 | + return DR_INVARG; | |
5255 | ||
5256 | *seconds = data->length; | |
5257 | ||
5258 | - return DFB_OK; | |
5259 | + return DR_OK; | |
5260 | } | |
5261 | ||
5262 | -static DFBResult | |
5263 | +static DirectResult | |
5264 | IFusionSoundMusicProvider_Wave_SetPlaybackFlags( IFusionSoundMusicProvider *thiz, | |
5265 | FSMusicProviderPlaybackFlags flags ) | |
5266 | { | |
5267 | DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_Wave ) | |
5268 | ||
5269 | if (flags & ~FMPLAY_LOOPING) | |
5270 | - return DFB_UNSUPPORTED; | |
5271 | + return DR_UNSUPPORTED; | |
5272 | ||
5273 | if (flags & FMPLAY_LOOPING && !direct_stream_seekable( data->stream )) | |
5274 | - return DFB_UNSUPPORTED; | |
5275 | + return DR_UNSUPPORTED; | |
5276 | ||
5277 | data->flags = flags; | |
5278 | ||
5279 | - return DFB_OK; | |
5280 | + return DR_OK; | |
5281 | } | |
5282 | ||
5283 | -static DFBResult | |
5284 | +static DirectResult | |
5285 | IFusionSoundMusicProvider_Wave_WaitStatus( IFusionSoundMusicProvider *thiz, | |
5286 | FSMusicProviderStatus mask, | |
5287 | unsigned int timeout ) | |
5288 | @@ -962,7 +962,7 @@ IFusionSoundMusicProvider_Wave_WaitStatus( IFusionSoundMusicProvider *thiz, | |
5289 | DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_Wave ) | |
5290 | ||
5291 | if (!mask || mask & ~FMSTATE_ALL) | |
5292 | - return DFB_INVARG; | |
5293 | + return DR_INVARG; | |
5294 | ||
5295 | if (timeout) { | |
5296 | struct timespec t; | |
5297 | @@ -974,18 +974,18 @@ IFusionSoundMusicProvider_Wave_WaitStatus( IFusionSoundMusicProvider *thiz, | |
5298 | ||
5299 | #ifdef HAVE_PTHREAD_MUTEX_TIMEDLOCK | |
5300 | if (pthread_mutex_timedlock( &data->lock, &t )) | |
5301 | - return DFB_TIMEOUT; | |
5302 | + return DR_TIMEOUT; | |
5303 | #else | |
5304 | while (pthread_mutex_trylock( &data->lock )) { | |
5305 | usleep( 1000 ); | |
5306 | if (direct_clock_get_abs_micros() >= s) | |
5307 | - return DFB_TIMEOUT; | |
5308 | + return DR_TIMEOUT; | |
5309 | } | |
5310 | #endif | |
5311 | while (!(data->status & mask)) { | |
5312 | if (pthread_cond_timedwait( &data->cond, &data->lock, &t ) == ETIMEDOUT) { | |
5313 | pthread_mutex_unlock( &data->lock ); | |
5314 | - return DFB_TIMEOUT; | |
5315 | + return DR_TIMEOUT; | |
5316 | } | |
5317 | } | |
5318 | } | |
5319 | @@ -998,12 +998,12 @@ IFusionSoundMusicProvider_Wave_WaitStatus( IFusionSoundMusicProvider *thiz, | |
5320 | ||
5321 | pthread_mutex_unlock( &data->lock ); | |
5322 | ||
5323 | - return DFB_OK; | |
5324 | + return DR_OK; | |
5325 | } | |
5326 | ||
5327 | /****/ | |
5328 | ||
5329 | -static DFBResult | |
5330 | +static DirectResult | |
5331 | parse_headers( DirectStream *stream, u32 *ret_samplerate, | |
5332 | int *ret_channels, int *ret_format, | |
5333 | u32 *ret_headsize, u32 *ret_datasize ) | |
5334 | @@ -1024,13 +1024,13 @@ parse_headers( DirectStream *stream, u32 *ret_samplerate, | |
5335 | unsigned int len = 0; \ | |
5336 | direct_stream_wait( stream, count, NULL ); \ | |
5337 | if (direct_stream_read( stream, count, buf, &len ) || len < (count)) \ | |
5338 | - return DFB_UNSUPPORTED;\ | |
5339 | + return DR_UNSUPPORTED;\ | |
5340 | } | |
5341 | ||
5342 | wave_read( buf, 4 ); | |
5343 | if (buf[0] != 'R' || buf[1] != 'I' || buf[2] != 'F' || buf[3] != 'F') { | |
5344 | D_DEBUG( "IFusionSoundMusicProvider_Wave: No RIFF header found.\n" ); | |
5345 | - return DFB_UNSUPPORTED; | |
5346 | + return DR_UNSUPPORTED; | |
5347 | } | |
5348 | ||
5349 | /* actually ignore chunksize */ | |
5350 | @@ -1039,13 +1039,13 @@ parse_headers( DirectStream *stream, u32 *ret_samplerate, | |
5351 | wave_read( buf, 4 ); | |
5352 | if (buf[0] != 'W' || buf[1] != 'A' || buf[2] != 'V' || buf[3] != 'E') { | |
5353 | D_DEBUG( "IFusionSoundMusicProvider_Wave: No WAVE header found.\n" ); | |
5354 | - return DFB_UNSUPPORTED; | |
5355 | + return DR_UNSUPPORTED; | |
5356 | } | |
5357 | ||
5358 | wave_read( buf, 4 ); | |
5359 | if (buf[0] != 'f' || buf[1] != 'm' || buf[2] != 't' || buf[3] != ' ') { | |
5360 | D_DEBUG( "IFusionSoundMusicProvider_Wave: Expected 'fmt ' header.\n" ); | |
5361 | - return DFB_UNSUPPORTED; | |
5362 | + return DR_UNSUPPORTED; | |
5363 | } | |
5364 | ||
5365 | wave_read( &fmt_len, 4 ); | |
5366 | @@ -1056,7 +1056,7 @@ parse_headers( DirectStream *stream, u32 *ret_samplerate, | |
5367 | D_DEBUG( "IFusionSoundMusicProvider_Wave: " | |
5368 | "fmt chunk expected to be at least %zu bytes (got %d).\n", | |
5369 | sizeof(fmt), fmt_len ); | |
5370 | - return DFB_UNSUPPORTED; | |
5371 | + return DR_UNSUPPORTED; | |
5372 | } | |
5373 | ||
5374 | wave_read( &fmt, sizeof(fmt) ); | |
5375 | @@ -1072,33 +1072,33 @@ parse_headers( DirectStream *stream, u32 *ret_samplerate, | |
5376 | if (fmt.encoding != 1) { | |
5377 | D_DEBUG( "IFusionSoundMusicProvider_Wave: " | |
5378 | "Unsupported encoding (%d).\n", fmt.encoding ); | |
5379 | - return DFB_UNSUPPORTED; | |
5380 | + return DR_UNSUPPORTED; | |
5381 | } | |
5382 | if (fmt.channels < 1) { | |
5383 | D_DEBUG( "IFusionSoundMusicProvider_Wave: " | |
5384 | "Invalid number of channels (%d).\n", fmt.channels ); | |
5385 | - return DFB_UNSUPPORTED; | |
5386 | + return DR_UNSUPPORTED; | |
5387 | } | |
5388 | if (fmt.frequency < 1000) { | |
5389 | D_DEBUG( "IFusionSoundMusicProvider_Wave: " | |
5390 | "Unsupported frequency (%dHz).\n", fmt.frequency ); | |
5391 | - return DFB_UNSUPPORTED; | |
5392 | + return DR_UNSUPPORTED; | |
5393 | } | |
5394 | if (fmt.bitspersample != 8 && fmt.bitspersample != 16 && | |
5395 | fmt.bitspersample != 24 && fmt.bitspersample != 32) { | |
5396 | D_DEBUG( "IFusionSoundMusicProvider_Wave: " | |
5397 | "Unsupported sample format (%d bits).\n", fmt.bitspersample ); | |
5398 | - return DFB_UNSUPPORTED; | |
5399 | + return DR_UNSUPPORTED; | |
5400 | } | |
5401 | if (fmt.byterate != (fmt.frequency * fmt.channels * fmt.bitspersample >> 3)) { | |
5402 | D_DEBUG( "IFusionSoundMusicProvider_Wave: " | |
5403 | "Invalid byterate (%d).\n", fmt.byterate ); | |
5404 | - return DFB_UNSUPPORTED; | |
5405 | + return DR_UNSUPPORTED; | |
5406 | } | |
5407 | if (fmt.blockalign != (fmt.channels * fmt.bitspersample >> 3)) { | |
5408 | D_DEBUG( "IFusionSoundMusicProvider_Wave: " | |
5409 | "Invalid blockalign (%d).\n", fmt.blockalign ); | |
5410 | - return DFB_UNSUPPORTED; | |
5411 | + return DR_UNSUPPORTED; | |
5412 | } | |
5413 | ||
5414 | if (fmt_len > sizeof(fmt)) { | |
5415 | @@ -1139,27 +1139,27 @@ parse_headers( DirectStream *stream, u32 *ret_samplerate, | |
5416 | ||
5417 | #undef wave_read | |
5418 | ||
5419 | - return DFB_OK; | |
5420 | + return DR_OK; | |
5421 | } | |
5422 | ||
5423 | /* exported symbols */ | |
5424 | ||
5425 | -static DFBResult | |
5426 | +static DirectResult | |
5427 | Probe( IFusionSoundMusicProvider_ProbeContext *ctx ) | |
5428 | { | |
5429 | if (!memcmp( ctx->header+0, "RIFF", 4 ) && | |
5430 | !memcmp( ctx->header+8, "WAVEfmt ", 8 )) | |
5431 | - return DFB_OK; | |
5432 | + return DR_OK; | |
5433 | ||
5434 | - return DFB_UNSUPPORTED; | |
5435 | + return DR_UNSUPPORTED; | |
5436 | } | |
5437 | ||
5438 | -static DFBResult | |
5439 | +static DirectResult | |
5440 | Construct( IFusionSoundMusicProvider *thiz, | |
5441 | const char *filename, | |
5442 | DirectStream *stream ) | |
5443 | { | |
5444 | - DFBResult ret; | |
5445 | + DirectResult ret; | |
5446 | unsigned int size; | |
5447 | int format; | |
5448 | ||
5449 | @@ -1193,7 +1193,7 @@ Construct( IFusionSoundMusicProvider *thiz, | |
5450 | default: | |
5451 | D_BUG( "unexpected sample format" ); | |
5452 | IFusionSoundMusicProvider_Wave_Destruct( thiz ); | |
5453 | - return DFB_BUG; | |
5454 | + return DR_BUG; | |
5455 | } | |
5456 | ||
5457 | data->framesize = data->channels * FS_BYTES_PER_SAMPLE(data->format); | |
5458 | @@ -1229,6 +1229,6 @@ Construct( IFusionSoundMusicProvider *thiz, | |
5459 | thiz->SetPlaybackFlags = IFusionSoundMusicProvider_Wave_SetPlaybackFlags; | |
5460 | thiz->WaitStatus = IFusionSoundMusicProvider_Wave_WaitStatus; | |
5461 | ||
5462 | - return DFB_OK; | |
5463 | + return DR_OK; | |
5464 | } | |
5465 | ||
5466 | diff --git a/proxy/dispatcher/ifusionsound_dispatcher.c b/proxy/dispatcher/ifusionsound_dispatcher.c | |
5467 | index 7d90cc9..7b5269c 100644 | |
5468 | --- a/proxy/dispatcher/ifusionsound_dispatcher.c | |
5469 | +++ b/proxy/dispatcher/ifusionsound_dispatcher.c | |
5470 | @@ -49,8 +49,8 @@ | |
5471 | ||
5472 | #include "ifusionsound_dispatcher.h" | |
5473 | ||
5474 | -static DFBResult Probe(); | |
5475 | -static DFBResult Construct( IFusionSound *thiz, | |
5476 | +static DirectResult Probe(); | |
5477 | +static DirectResult Construct( IFusionSound *thiz, | |
5478 | VoodooManager *manager, | |
5479 | VoodooInstanceID *ret_instance ); | |
5480 | ||
5481 | @@ -80,17 +80,17 @@ IFusionSound_Dispatcher_Destruct( IFusionSound *thiz ) | |
5482 | ||
5483 | /***********************************************************************************************/ | |
5484 | ||
5485 | -static DFBResult | |
5486 | +static DirectResult | |
5487 | IFusionSound_Dispatcher_AddRef( IFusionSound *thiz ) | |
5488 | { | |
5489 | DIRECT_INTERFACE_GET_DATA(IFusionSound_Dispatcher) | |
5490 | ||
5491 | data->ref++; | |
5492 | ||
5493 | - return DFB_OK; | |
5494 | + return DR_OK; | |
5495 | } | |
5496 | ||
5497 | -static DFBResult | |
5498 | +static DirectResult | |
5499 | IFusionSound_Dispatcher_Release( IFusionSound *thiz ) | |
5500 | { | |
5501 | DIRECT_INTERFACE_GET_DATA(IFusionSound_Dispatcher) | |
5502 | @@ -98,98 +98,98 @@ IFusionSound_Dispatcher_Release( IFusionSound *thiz ) | |
5503 | if (--data->ref == 0) | |
5504 | IFusionSound_Dispatcher_Destruct( thiz ); | |
5505 | ||
5506 | - return DFB_OK; | |
5507 | + return DR_OK; | |
5508 | } | |
5509 | ||
5510 | -static DFBResult | |
5511 | +static DirectResult | |
5512 | IFusionSound_Dispatcher_GetDeviceDescription( IFusionSound *thiz, | |
5513 | FSDeviceDescription *desc ) | |
5514 | { | |
5515 | DIRECT_INTERFACE_GET_DATA(IFusionSound_Dispatcher) | |
5516 | ||
5517 | - return DFB_UNIMPLEMENTED; | |
5518 | + return DR_UNIMPLEMENTED; | |
5519 | } | |
5520 | ||
5521 | -static DFBResult | |
5522 | +static DirectResult | |
5523 | IFusionSound_Dispatcher_CreateBuffer( IFusionSound *thiz, | |
5524 | const FSBufferDescription *desc, | |
5525 | IFusionSoundBuffer **ret_interface ) | |
5526 | { | |
5527 | DIRECT_INTERFACE_GET_DATA(IFusionSound_Dispatcher) | |
5528 | ||
5529 | - return DFB_UNIMPLEMENTED; | |
5530 | + return DR_UNIMPLEMENTED; | |
5531 | } | |
5532 | ||
5533 | -static DFBResult | |
5534 | +static DirectResult | |
5535 | IFusionSound_Dispatcher_CreateStream( IFusionSound *thiz, | |
5536 | const FSStreamDescription *desc, | |
5537 | IFusionSoundStream **ret_interface ) | |
5538 | { | |
5539 | DIRECT_INTERFACE_GET_DATA(IFusionSound_Dispatcher) | |
5540 | ||
5541 | - return DFB_UNIMPLEMENTED; | |
5542 | + return DR_UNIMPLEMENTED; | |
5543 | } | |
5544 | ||
5545 | -static DFBResult | |
5546 | +static DirectResult | |
5547 | IFusionSound_Dispatcher_CreateMusicProvider( IFusionSound *thiz, | |
5548 | const char *filename, | |
5549 | IFusionSoundMusicProvider **ret_interface ) | |
5550 | { | |
5551 | DIRECT_INTERFACE_GET_DATA(IFusionSound_Dispatcher) | |
5552 | ||
5553 | - return DFB_UNIMPLEMENTED; | |
5554 | + return DR_UNIMPLEMENTED; | |
5555 | } | |
5556 | ||
5557 | -static DFBResult | |
5558 | +static DirectResult | |
5559 | IFusionSound_Dispatcher_GetMasterVolume( IFusionSound *thiz, | |
5560 | float *level ) | |
5561 | { | |
5562 | DIRECT_INTERFACE_GET_DATA(IFusionSound_Dispatcher) | |
5563 | ||
5564 | - return DFB_UNIMPLEMENTED; | |
5565 | + return DR_UNIMPLEMENTED; | |
5566 | } | |
5567 | ||
5568 | -static DFBResult | |
5569 | +static DirectResult | |
5570 | IFusionSound_Dispatcher_SetMasterVolume( IFusionSound *thiz, | |
5571 | float level ) | |
5572 | { | |
5573 | DIRECT_INTERFACE_GET_DATA(IFusionSound_Dispatcher) | |
5574 | ||
5575 | - return DFB_UNIMPLEMENTED; | |
5576 | + return DR_UNIMPLEMENTED; | |
5577 | } | |
5578 | ||
5579 | -static DFBResult | |
5580 | +static DirectResult | |
5581 | IFusionSound_Dispatcher_GetLocalVolume( IFusionSound *thiz, | |
5582 | float *level ) | |
5583 | { | |
5584 | DIRECT_INTERFACE_GET_DATA(IFusionSound_Dispatcher) | |
5585 | ||
5586 | - return DFB_UNIMPLEMENTED; | |
5587 | + return DR_UNIMPLEMENTED; | |
5588 | } | |
5589 | ||
5590 | -static DFBResult | |
5591 | +static DirectResult | |
5592 | IFusionSound_Dispatcher_SetLocalVolume( IFusionSound *thiz, | |
5593 | float level ) | |
5594 | { | |
5595 | DIRECT_INTERFACE_GET_DATA(IFusionSound_Dispatcher) | |
5596 | ||
5597 | - return DFB_UNIMPLEMENTED; | |
5598 | + return DR_UNIMPLEMENTED; | |
5599 | } | |
5600 | ||
5601 | -static DFBResult | |
5602 | +static DirectResult | |
5603 | IFusionSound_Dispatcher_Suspend( IFusionSound *thiz ) | |
5604 | { | |
5605 | DIRECT_INTERFACE_GET_DATA(IFusionSound_Dispatcher) | |
5606 | ||
5607 | - return DFB_UNIMPLEMENTED; | |
5608 | + return DR_UNIMPLEMENTED; | |
5609 | } | |
5610 | ||
5611 | -static DFBResult | |
5612 | +static DirectResult | |
5613 | IFusionSound_Dispatcher_Resume( IFusionSound *thiz ) | |
5614 | { | |
5615 | DIRECT_INTERFACE_GET_DATA(IFusionSound_Dispatcher) | |
5616 | ||
5617 | - return DFB_UNIMPLEMENTED; | |
5618 | + return DR_UNIMPLEMENTED; | |
5619 | } | |
5620 | ||
5621 | /**************************************************************************************************/ | |
5622 | @@ -208,7 +208,7 @@ Dispatch_GetDeviceDescription( IFusionSound *thiz, IFusionSound *real, | |
5623 | return ret; | |
5624 | ||
5625 | return voodoo_manager_respond( manager, msg->header.serial, | |
5626 | - DFB_OK, VOODOO_INSTANCE_NONE, | |
5627 | + DR_OK, VOODOO_INSTANCE_NONE, | |
5628 | VMBT_DATA, sizeof(FSDeviceDescription), &desc, | |
5629 | VMBT_NONE ); | |
5630 | } | |
5631 | @@ -244,7 +244,7 @@ Dispatch_CreateBuffer( IFusionSound *thiz, IFusionSound *real, | |
5632 | } | |
5633 | ||
5634 | return voodoo_manager_respond( manager, msg->header.serial, | |
5635 | - DFB_OK, instance, | |
5636 | + DR_OK, instance, | |
5637 | VMBT_DATA, sizeof(FSBufferDescription), &dsc, | |
5638 | VMBT_NONE ); | |
5639 | } | |
5640 | @@ -280,7 +280,7 @@ Dispatch_CreateStream( IFusionSound *thiz, IFusionSound *real, | |
5641 | } | |
5642 | ||
5643 | return voodoo_manager_respond( manager, msg->header.serial, | |
5644 | - DFB_OK, instance, | |
5645 | + DR_OK, instance, | |
5646 | VMBT_DATA, sizeof(FSStreamDescription), &dsc, | |
5647 | VMBT_NONE ); | |
5648 | } | |
5649 | @@ -313,7 +313,7 @@ Dispatch_CreateMusicProvider( IFusionSound *thiz, IFusionSound *real, | |
5650 | } | |
5651 | ||
5652 | return voodoo_manager_respond( manager, msg->header.serial, | |
5653 | - DFB_OK, instance, | |
5654 | + DR_OK, instance, | |
5655 | VMBT_NONE ); | |
5656 | } | |
5657 | ||
5658 | @@ -452,18 +452,18 @@ Dispatch( void *dispatcher, void *real, VoodooManager *manager, VoodooRequestMes | |
5659 | HANDLE_CASE(Resume); | |
5660 | } | |
5661 | ||
5662 | - return DFB_NOSUCHMETHOD; | |
5663 | + return DR_NOSUCHMETHOD; | |
5664 | } | |
5665 | ||
5666 | #undef HANDLE_CASE | |
5667 | ||
5668 | /**************************************************************************************************/ | |
5669 | ||
5670 | -static DFBResult | |
5671 | +static DirectResult | |
5672 | Probe() | |
5673 | { | |
5674 | /* This implementation has to be loaded explicitly. */ | |
5675 | - return DFB_UNSUPPORTED; | |
5676 | + return DR_UNSUPPORTED; | |
5677 | } | |
5678 | ||
5679 | /* | |
5680 | @@ -471,10 +471,10 @@ Probe() | |
5681 | * | |
5682 | * Fills in function pointers and intializes data structure. | |
5683 | */ | |
5684 | -static DFBResult | |
5685 | +static DirectResult | |
5686 | Construct( IFusionSound *thiz, VoodooManager *manager, VoodooInstanceID *ret_instance ) | |
5687 | { | |
5688 | - DFBResult ret; | |
5689 | + DirectResult ret; | |
5690 | IFusionSound *real; | |
5691 | VoodooInstanceID instance; | |
5692 | ||
5693 | @@ -512,6 +512,6 @@ Construct( IFusionSound *thiz, VoodooManager *manager, VoodooInstanceID *ret_ins | |
5694 | thiz->Suspend = IFusionSound_Dispatcher_Suspend; | |
5695 | thiz->Resume = IFusionSound_Dispatcher_Resume; | |
5696 | ||
5697 | - return DFB_OK; | |
5698 | + return DR_OK; | |
5699 | } | |
5700 | ||
5701 | diff --git a/proxy/dispatcher/ifusionsoundbuffer_dispatcher.c b/proxy/dispatcher/ifusionsoundbuffer_dispatcher.c | |
5702 | index 6357ec0..84b4a71 100644 | |
5703 | --- a/proxy/dispatcher/ifusionsoundbuffer_dispatcher.c | |
5704 | +++ b/proxy/dispatcher/ifusionsoundbuffer_dispatcher.c | |
5705 | @@ -48,8 +48,8 @@ | |
5706 | ||
5707 | #include <ifusionsoundbuffer_dispatcher.h> | |
5708 | ||
5709 | -static DFBResult Probe(); | |
5710 | -static DFBResult Construct( IFusionSoundBuffer *thiz, | |
5711 | +static DirectResult Probe(); | |
5712 | +static DirectResult Construct( IFusionSoundBuffer *thiz, | |
5713 | IFusionSoundBuffer *real, | |
5714 | VoodooManager *manager, | |
5715 | VoodooInstanceID super, | |
5716 | @@ -86,17 +86,17 @@ IFusionSoundBuffer_Dispatcher_Destruct( IFusionSoundBuffer *thiz ) | |
5717 | ||
5718 | /***********************************************************************************************/ | |
5719 | ||
5720 | -static DFBResult | |
5721 | +static DirectResult | |
5722 | IFusionSoundBuffer_Dispatcher_AddRef( IFusionSoundBuffer *thiz ) | |
5723 | { | |
5724 | DIRECT_INTERFACE_GET_DATA(IFusionSoundBuffer_Dispatcher) | |
5725 | ||
5726 | data->ref++; | |
5727 | ||
5728 | - return DFB_OK; | |
5729 | + return DR_OK; | |
5730 | } | |
5731 | ||
5732 | -static DFBResult | |
5733 | +static DirectResult | |
5734 | IFusionSoundBuffer_Dispatcher_Release( IFusionSoundBuffer *thiz ) | |
5735 | { | |
5736 | DIRECT_INTERFACE_GET_DATA(IFusionSoundBuffer_Dispatcher) | |
5737 | @@ -104,29 +104,29 @@ IFusionSoundBuffer_Dispatcher_Release( IFusionSoundBuffer *thiz ) | |
5738 | if (--data->ref == 0) | |
5739 | IFusionSoundBuffer_Dispatcher_Destruct( thiz ); | |
5740 | ||
5741 | - return DFB_OK; | |
5742 | + return DR_OK; | |
5743 | } | |
5744 | ||
5745 | ||
5746 | -static DFBResult | |
5747 | +static DirectResult | |
5748 | IFusionSoundBuffer_Dispatcher_GetDescription( IFusionSoundBuffer *thiz, | |
5749 | FSBufferDescription *desc ) | |
5750 | { | |
5751 | DIRECT_INTERFACE_GET_DATA(IFusionSoundBuffer_Dispatcher) | |
5752 | ||
5753 | - return DFB_UNIMPLEMENTED; | |
5754 | + return DR_UNIMPLEMENTED; | |
5755 | } | |
5756 | ||
5757 | -static DFBResult | |
5758 | +static DirectResult | |
5759 | IFusionSoundBuffer_Dispatcher_SetPosition( IFusionSoundBuffer *thiz, | |
5760 | int position ) | |
5761 | { | |
5762 | DIRECT_INTERFACE_GET_DATA(IFusionSoundBuffer_Dispatcher) | |
5763 | ||
5764 | - return DFB_UNIMPLEMENTED; | |
5765 | + return DR_UNIMPLEMENTED; | |
5766 | } | |
5767 | ||
5768 | -static DFBResult | |
5769 | +static DirectResult | |
5770 | IFusionSoundBuffer_Dispatcher_Lock( IFusionSoundBuffer *thiz, | |
5771 | void **ret_data, | |
5772 | int *ret_frames, | |
5773 | @@ -134,41 +134,41 @@ IFusionSoundBuffer_Dispatcher_Lock( IFusionSoundBuffer *thiz, | |
5774 | { | |
5775 | DIRECT_INTERFACE_GET_DATA(IFusionSoundBuffer_Dispatcher) | |
5776 | ||
5777 | - return DFB_UNIMPLEMENTED; | |
5778 | + return DR_UNIMPLEMENTED; | |
5779 | } | |
5780 | ||
5781 | -static DFBResult | |
5782 | +static DirectResult | |
5783 | IFusionSoundBuffer_Dispatcher_Unlock( IFusionSoundBuffer *thiz ) | |
5784 | { | |
5785 | DIRECT_INTERFACE_GET_DATA(IFusionSoundBuffer_Dispatcher) | |
5786 | ||
5787 | - return DFB_UNIMPLEMENTED; | |
5788 | + return DR_UNIMPLEMENTED; | |
5789 | } | |
5790 | ||
5791 | -static DFBResult | |
5792 | +static DirectResult | |
5793 | IFusionSoundBuffer_Dispatcher_Play( IFusionSoundBuffer *thiz, | |
5794 | FSBufferPlayFlags flags ) | |
5795 | { | |
5796 | DIRECT_INTERFACE_GET_DATA(IFusionSoundBuffer_Dispatcher) | |
5797 | ||
5798 | - return DFB_UNIMPLEMENTED; | |
5799 | + return DR_UNIMPLEMENTED; | |
5800 | } | |
5801 | ||
5802 | -static DFBResult | |
5803 | +static DirectResult | |
5804 | IFusionSoundBuffer_Dispatcher_Stop( IFusionSoundBuffer *thiz ) | |
5805 | { | |
5806 | DIRECT_INTERFACE_GET_DATA(IFusionSoundBuffer_Dispatcher) | |
5807 | ||
5808 | - return DFB_UNIMPLEMENTED; | |
5809 | + return DR_UNIMPLEMENTED; | |
5810 | } | |
5811 | ||
5812 | -static DFBResult | |
5813 | +static DirectResult | |
5814 | IFusionSoundBuffer_Dispatcher_CreatePlayback( IFusionSoundBuffer *thiz, | |
5815 | IFusionSoundPlayback **ret_interface ) | |
5816 | { | |
5817 | DIRECT_INTERFACE_GET_DATA(IFusionSoundBuffer_Dispatcher) | |
5818 | ||
5819 | - return DFB_UNIMPLEMENTED; | |
5820 | + return DR_UNIMPLEMENTED; | |
5821 | } | |
5822 | ||
5823 | /***********************************************************************************************/ | |
5824 | @@ -187,7 +187,7 @@ Dispatch_GetDescription( IFusionSoundBuffer *thiz, IFusionSoundBuffer *real, | |
5825 | return ret; | |
5826 | ||
5827 | return voodoo_manager_respond( manager, msg->header.serial, | |
5828 | - DFB_OK, VOODOO_INSTANCE_NONE, | |
5829 | + DR_OK, VOODOO_INSTANCE_NONE, | |
5830 | VMBT_DATA, sizeof(FSBufferDescription), &desc, | |
5831 | VMBT_NONE ); | |
5832 | } | |
5833 | @@ -220,7 +220,7 @@ Dispatch_Lock( IFusionSoundBuffer *thiz, IFusionSoundBuffer *real, | |
5834 | DIRECT_INTERFACE_GET_DATA(IFusionSoundBuffer_Dispatcher) | |
5835 | ||
5836 | /* Nothing to do. */ | |
5837 | - return DFB_OK; | |
5838 | + return DR_OK; | |
5839 | } | |
5840 | ||
5841 | static DirectResult | |
5842 | @@ -251,7 +251,7 @@ Dispatch_Unlock( IFusionSoundBuffer *thiz, IFusionSoundBuffer *real, | |
5843 | real->Unlock( real ); | |
5844 | ||
5845 | return voodoo_manager_respond( manager, msg->header.serial, | |
5846 | - DFB_OK, VOODOO_INSTANCE_NONE, | |
5847 | + DR_OK, VOODOO_INSTANCE_NONE, | |
5848 | VMBT_NONE ); | |
5849 | } | |
5850 | ||
5851 | @@ -283,7 +283,7 @@ Dispatch_Unlock_DPACK( IFusionSoundBuffer *thiz, IFusionSoundBuffer *real, | |
5852 | real->Unlock( real ); | |
5853 | ||
5854 | return voodoo_manager_respond( manager, msg->header.serial, | |
5855 | - DFB_OK, VOODOO_INSTANCE_NONE, | |
5856 | + DR_OK, VOODOO_INSTANCE_NONE, | |
5857 | VMBT_NONE ); | |
5858 | } | |
5859 | ||
5860 | @@ -345,7 +345,7 @@ Dispatch_CreatePlayback( IFusionSoundBuffer *thiz, IFusionSoundBuffer *real, | |
5861 | } | |
5862 | ||
5863 | return voodoo_manager_respond( manager, msg->header.serial, | |
5864 | - DFB_OK, instance, | |
5865 | + DR_OK, instance, | |
5866 | VMBT_NONE ); | |
5867 | } | |
5868 | ||
5869 | @@ -374,18 +374,18 @@ Dispatch( void *dispatcher, void *real, VoodooManager *manager, VoodooRequestMes | |
5870 | HANDLE_CASE(CreatePlayback); | |
5871 | } | |
5872 | ||
5873 | - return DFB_NOSUCHMETHOD; | |
5874 | + return DR_NOSUCHMETHOD; | |
5875 | } | |
5876 | ||
5877 | #undef HANDLE_CASE | |
5878 | ||
5879 | /**************************************************************************************************/ | |
5880 | ||
5881 | -static DFBResult | |
5882 | +static DirectResult | |
5883 | Probe() | |
5884 | { | |
5885 | /* This implementation has to be loaded explicitly. */ | |
5886 | - return DFB_UNSUPPORTED; | |
5887 | + return DR_UNSUPPORTED; | |
5888 | } | |
5889 | ||
5890 | /* | |
5891 | @@ -393,7 +393,7 @@ Probe() | |
5892 | * | |
5893 | * Fills in function pointers and intializes data structure. | |
5894 | */ | |
5895 | -static DFBResult | |
5896 | +static DirectResult | |
5897 | Construct( IFusionSoundBuffer *thiz, | |
5898 | IFusionSoundBuffer *real, | |
5899 | VoodooManager *manager, | |
5900 | @@ -401,7 +401,7 @@ Construct( IFusionSoundBuffer *thiz, | |
5901 | void *arg, /* Optional arguments to constructor */ | |
5902 | VoodooInstanceID *ret_instance ) | |
5903 | { | |
5904 | - DFBResult ret; | |
5905 | + DirectResult ret; | |
5906 | VoodooInstanceID instance; | |
5907 | FSBufferDescription dsc; | |
5908 | ||
5909 | @@ -434,7 +434,7 @@ Construct( IFusionSoundBuffer *thiz, | |
5910 | thiz->Stop = IFusionSoundBuffer_Dispatcher_Stop; | |
5911 | thiz->CreatePlayback = IFusionSoundBuffer_Dispatcher_CreatePlayback; | |
5912 | ||
5913 | - return DFB_OK; | |
5914 | + return DR_OK; | |
5915 | } | |
5916 | ||
5917 | ||
5918 | diff --git a/proxy/dispatcher/ifusionsoundplayback_dispatcher.c b/proxy/dispatcher/ifusionsoundplayback_dispatcher.c | |
5919 | index 7262b94..766cecd 100644 | |
5920 | --- a/proxy/dispatcher/ifusionsoundplayback_dispatcher.c | |
5921 | +++ b/proxy/dispatcher/ifusionsoundplayback_dispatcher.c | |
5922 | @@ -46,8 +46,8 @@ | |
5923 | ||
5924 | #include <ifusionsoundplayback_dispatcher.h> | |
5925 | ||
5926 | -static DFBResult Probe(); | |
5927 | -static DFBResult Construct( IFusionSoundPlayback *thiz, | |
5928 | +static DirectResult Probe(); | |
5929 | +static DirectResult Construct( IFusionSoundPlayback *thiz, | |
5930 | IFusionSoundPlayback *real, | |
5931 | VoodooManager *manager, | |
5932 | VoodooInstanceID super, | |
5933 | @@ -80,17 +80,17 @@ IFusionSoundPlayback_Dispatcher_Destruct( IFusionSoundPlayback *thiz ) | |
5934 | ||
5935 | /***********************************************************************************************/ | |
5936 | ||
5937 | -static DFBResult | |
5938 | +static DirectResult | |
5939 | IFusionSoundPlayback_Dispatcher_AddRef( IFusionSoundPlayback *thiz ) | |
5940 | { | |
5941 | DIRECT_INTERFACE_GET_DATA(IFusionSoundPlayback_Dispatcher) | |
5942 | ||
5943 | data->ref++; | |
5944 | ||
5945 | - return DFB_OK; | |
5946 | + return DR_OK; | |
5947 | } | |
5948 | ||
5949 | -static DFBResult | |
5950 | +static DirectResult | |
5951 | IFusionSoundPlayback_Dispatcher_Release( IFusionSoundPlayback *thiz ) | |
5952 | { | |
5953 | DIRECT_INTERFACE_GET_DATA(IFusionSoundPlayback_Dispatcher) | |
5954 | @@ -98,97 +98,97 @@ IFusionSoundPlayback_Dispatcher_Release( IFusionSoundPlayback *thiz ) | |
5955 | if (--data->ref == 0) | |
5956 | IFusionSoundPlayback_Dispatcher_Destruct( thiz ); | |
5957 | ||
5958 | - return DFB_OK; | |
5959 | + return DR_OK; | |
5960 | } | |
5961 | ||
5962 | -static DFBResult | |
5963 | +static DirectResult | |
5964 | IFusionSoundPlayback_Dispatcher_Start( IFusionSoundPlayback *thiz, | |
5965 | int start, | |
5966 | int stop ) | |
5967 | { | |
5968 | DIRECT_INTERFACE_GET_DATA(IFusionSoundPlayback_Dispatcher) | |
5969 | ||
5970 | - return DFB_UNIMPLEMENTED; | |
5971 | + return DR_UNIMPLEMENTED; | |
5972 | } | |
5973 | ||
5974 | -static DFBResult | |
5975 | +static DirectResult | |
5976 | IFusionSoundPlayback_Dispatcher_Stop( IFusionSoundPlayback *thiz ) | |
5977 | { | |
5978 | DIRECT_INTERFACE_GET_DATA(IFusionSoundPlayback_Dispatcher) | |
5979 | ||
5980 | - return DFB_UNIMPLEMENTED; | |
5981 | + return DR_UNIMPLEMENTED; | |
5982 | } | |
5983 | ||
5984 | -static DFBResult | |
5985 | +static DirectResult | |
5986 | IFusionSoundPlayback_Dispatcher_Continue( IFusionSoundPlayback *thiz ) | |
5987 | { | |
5988 | DIRECT_INTERFACE_GET_DATA(IFusionSoundPlayback_Dispatcher) | |
5989 | ||
5990 | - return DFB_UNIMPLEMENTED; | |
5991 | + return DR_UNIMPLEMENTED; | |
5992 | } | |
5993 | ||
5994 | -static DFBResult | |
5995 | +static DirectResult | |
5996 | IFusionSoundPlayback_Dispatcher_Wait( IFusionSoundPlayback *thiz ) | |
5997 | { | |
5998 | DIRECT_INTERFACE_GET_DATA(IFusionSoundPlayback_Dispatcher) | |
5999 | ||
6000 | - return DFB_UNIMPLEMENTED; | |
6001 | + return DR_UNIMPLEMENTED; | |
6002 | } | |
6003 | ||
6004 | -static DFBResult | |
6005 | +static DirectResult | |
6006 | IFusionSoundPlayback_Dispatcher_GetStatus( IFusionSoundPlayback *thiz, | |
6007 | - DFBBoolean *ret_playing, | |
6008 | + bool *ret_playing, | |
6009 | int *ret_position ) | |
6010 | { | |
6011 | DIRECT_INTERFACE_GET_DATA(IFusionSoundPlayback_Dispatcher) | |
6012 | ||
6013 | - return DFB_UNIMPLEMENTED; | |
6014 | + return DR_UNIMPLEMENTED; | |
6015 | } | |
6016 | ||
6017 | -static DFBResult | |
6018 | +static DirectResult | |
6019 | IFusionSoundPlayback_Dispatcher_SetVolume( IFusionSoundPlayback *thiz, | |
6020 | float level ) | |
6021 | { | |
6022 | DIRECT_INTERFACE_GET_DATA(IFusionSoundPlayback_Dispatcher) | |
6023 | ||
6024 | - return DFB_UNIMPLEMENTED; | |
6025 | + return DR_UNIMPLEMENTED; | |
6026 | } | |
6027 | ||
6028 | -static DFBResult | |
6029 | +static DirectResult | |
6030 | IFusionSoundPlayback_Dispatcher_SetPan( IFusionSoundPlayback *thiz, | |
6031 | float value ) | |
6032 | { | |
6033 | DIRECT_INTERFACE_GET_DATA(IFusionSoundPlayback_Dispatcher) | |
6034 | ||
6035 | - return DFB_UNIMPLEMENTED; | |
6036 | + return DR_UNIMPLEMENTED; | |
6037 | } | |
6038 | ||
6039 | -static DFBResult | |
6040 | +static DirectResult | |
6041 | IFusionSoundPlayback_Dispatcher_SetPitch( IFusionSoundPlayback *thiz, | |
6042 | float value ) | |
6043 | { | |
6044 | DIRECT_INTERFACE_GET_DATA(IFusionSoundPlayback_Dispatcher) | |
6045 | ||
6046 | - return DFB_UNIMPLEMENTED; | |
6047 | + return DR_UNIMPLEMENTED; | |
6048 | } | |
6049 | ||
6050 | -static DFBResult | |
6051 | +static DirectResult | |
6052 | IFusionSoundPlayback_Dispatcher_SetDirection( IFusionSoundPlayback *thiz, | |
6053 | FSPlaybackDirection direction ) | |
6054 | { | |
6055 | DIRECT_INTERFACE_GET_DATA(IFusionSoundPlayback_Dispatcher) | |
6056 | ||
6057 | - return DFB_UNIMPLEMENTED; | |
6058 | + return DR_UNIMPLEMENTED; | |
6059 | } | |
6060 | ||
6061 | -static DFBResult | |
6062 | +static DirectResult | |
6063 | IFusionSoundPlayback_Dispatcher_SetDownmixLevels( IFusionSoundPlayback *thiz, | |
6064 | float center, | |
6065 | float rear ) | |
6066 | { | |
6067 | DIRECT_INTERFACE_GET_DATA(IFusionSoundPlayback_Dispatcher) | |
6068 | ||
6069 | - return DFB_UNIMPLEMENTED; | |
6070 | + return DR_UNIMPLEMENTED; | |
6071 | } | |
6072 | ||
6073 | /**************************************************************************************************/ | |
6074 | @@ -266,7 +266,7 @@ Dispatch_GetStatus( IFusionSoundPlayback *thiz, IFusionSoundPlayback *real, | |
6075 | VoodooManager *manager, VoodooRequestMessage *msg ) | |
6076 | { | |
6077 | DirectResult ret; | |
6078 | - DFBBoolean playing; | |
6079 | + bool playing; | |
6080 | int position; | |
6081 | ||
6082 | DIRECT_INTERFACE_GET_DATA(IFusionSoundPlayback_Dispatcher) | |
6083 | @@ -276,7 +276,7 @@ Dispatch_GetStatus( IFusionSoundPlayback *thiz, IFusionSoundPlayback *real, | |
6084 | return ret; | |
6085 | ||
6086 | return voodoo_manager_respond( manager, msg->header.serial, | |
6087 | - DFB_OK, VOODOO_INSTANCE_NONE, | |
6088 | + DR_OK, VOODOO_INSTANCE_NONE, | |
6089 | VMBT_INT, playing, | |
6090 | VMBT_INT, position, | |
6091 | VMBT_NONE ); | |
6092 | @@ -418,18 +418,18 @@ Dispatch( void *dispatcher, void *real, VoodooManager *manager, VoodooRequestMes | |
6093 | HANDLE_CASE(SetDownmixLevels); | |
6094 | } | |
6095 | ||
6096 | - return DFB_NOSUCHMETHOD; | |
6097 | + return DR_NOSUCHMETHOD; | |
6098 | } | |
6099 | ||
6100 | #undef HANDLE_CASE | |
6101 | ||
6102 | /**************************************************************************************************/ | |
6103 | ||
6104 | -static DFBResult | |
6105 | +static DirectResult | |
6106 | Probe() | |
6107 | { | |
6108 | /* This implementation has to be loaded explicitly. */ | |
6109 | - return DFB_UNSUPPORTED; | |
6110 | + return DR_UNSUPPORTED; | |
6111 | } | |
6112 | ||
6113 | /* | |
6114 | @@ -437,7 +437,7 @@ Probe() | |
6115 | * | |
6116 | * Fills in function pointers and intializes data structure. | |
6117 | */ | |
6118 | -static DFBResult | |
6119 | +static DirectResult | |
6120 | Construct( IFusionSoundPlayback *thiz, | |
6121 | IFusionSoundPlayback *real, | |
6122 | VoodooManager *manager, | |
6123 | @@ -445,7 +445,7 @@ Construct( IFusionSoundPlayback *thiz, | |
6124 | void *arg, /* Optional arguments to constructor */ | |
6125 | VoodooInstanceID *ret_instance ) | |
6126 | { | |
6127 | - DFBResult ret; | |
6128 | + DirectResult ret; | |
6129 | VoodooInstanceID instance; | |
6130 | ||
6131 | DIRECT_ALLOCATE_INTERFACE_DATA(thiz, IFusionSoundPlayback_Dispatcher) | |
6132 | @@ -475,6 +475,6 @@ Construct( IFusionSoundPlayback *thiz, | |
6133 | thiz->SetDirection = IFusionSoundPlayback_Dispatcher_SetDirection; | |
6134 | thiz->SetDownmixLevels = IFusionSoundPlayback_Dispatcher_SetDownmixLevels; | |
6135 | ||
6136 | - return DFB_OK; | |
6137 | + return DR_OK; | |
6138 | } | |
6139 | ||
6140 | diff --git a/proxy/dispatcher/ifusionsoundstream_dispatcher.c b/proxy/dispatcher/ifusionsoundstream_dispatcher.c | |
6141 | index d01b6ab..b8728da 100644 | |
6142 | --- a/proxy/dispatcher/ifusionsoundstream_dispatcher.c | |
6143 | +++ b/proxy/dispatcher/ifusionsoundstream_dispatcher.c | |
6144 | @@ -48,8 +48,8 @@ | |
6145 | ||
6146 | #include <ifusionsoundstream_dispatcher.h> | |
6147 | ||
6148 | -static DFBResult Probe(); | |
6149 | -static DFBResult Construct( IFusionSoundStream *thiz, | |
6150 | +static DirectResult Probe(); | |
6151 | +static DirectResult Construct( IFusionSoundStream *thiz, | |
6152 | IFusionSoundStream *real, | |
6153 | VoodooManager *manager, | |
6154 | VoodooInstanceID super, | |
6155 | @@ -86,17 +86,17 @@ IFusionSoundStream_Dispatcher_Destruct( IFusionSoundStream *thiz ) | |
6156 | ||
6157 | /***********************************************************************************************/ | |
6158 | ||
6159 | -static DFBResult | |
6160 | +static DirectResult | |
6161 | IFusionSoundStream_Dispatcher_AddRef( IFusionSoundStream *thiz ) | |
6162 | { | |
6163 | DIRECT_INTERFACE_GET_DATA(IFusionSoundStream_Dispatcher) | |
6164 | ||
6165 | data->ref++; | |
6166 | ||
6167 | - return DFB_OK; | |
6168 | + return DR_OK; | |
6169 | } | |
6170 | ||
6171 | -static DFBResult | |
6172 | +static DirectResult | |
6173 | IFusionSoundStream_Dispatcher_Release( IFusionSoundStream *thiz ) | |
6174 | { | |
6175 | DIRECT_INTERFACE_GET_DATA(IFusionSoundStream_Dispatcher) | |
6176 | @@ -104,101 +104,101 @@ IFusionSoundStream_Dispatcher_Release( IFusionSoundStream *thiz ) | |
6177 | if (--data->ref == 0) | |
6178 | IFusionSoundStream_Dispatcher_Destruct( thiz ); | |
6179 | ||
6180 | - return DFB_OK; | |
6181 | + return DR_OK; | |
6182 | } | |
6183 | ||
6184 | -static DFBResult | |
6185 | +static DirectResult | |
6186 | IFusionSoundStream_Dispatcher_GetDescription( IFusionSoundStream *thiz, | |
6187 | FSStreamDescription *desc ) | |
6188 | { | |
6189 | DIRECT_INTERFACE_GET_DATA(IFusionSoundStream_Dispatcher) | |
6190 | ||
6191 | - return DFB_UNIMPLEMENTED; | |
6192 | + return DR_UNIMPLEMENTED; | |
6193 | } | |
6194 | ||
6195 | -static DFBResult | |
6196 | +static DirectResult | |
6197 | IFusionSoundStream_Dispatcher_Write( IFusionSoundStream *thiz, | |
6198 | const void *sample_data, | |
6199 | int length ) | |
6200 | { | |
6201 | DIRECT_INTERFACE_GET_DATA(IFusionSoundStream_Dispatcher) | |
6202 | ||
6203 | - return DFB_UNIMPLEMENTED; | |
6204 | + return DR_UNIMPLEMENTED; | |
6205 | } | |
6206 | ||
6207 | -static DFBResult | |
6208 | +static DirectResult | |
6209 | IFusionSoundStream_Dispatcher_Wait( IFusionSoundStream *thiz, | |
6210 | int length ) | |
6211 | { | |
6212 | DIRECT_INTERFACE_GET_DATA(IFusionSoundStream_Dispatcher) | |
6213 | ||
6214 | - return DFB_UNIMPLEMENTED; | |
6215 | + return DR_UNIMPLEMENTED; | |
6216 | } | |
6217 | ||
6218 | -static DFBResult | |
6219 | +static DirectResult | |
6220 | IFusionSoundStream_Dispatcher_GetStatus( IFusionSoundStream *thiz, | |
6221 | int *filled, | |
6222 | int *total, | |
6223 | int *read_position, | |
6224 | int *write_position, | |
6225 | - DFBBoolean *playing ) | |
6226 | + bool *playing ) | |
6227 | { | |
6228 | DIRECT_INTERFACE_GET_DATA(IFusionSoundStream_Dispatcher) | |
6229 | ||
6230 | - return DFB_UNIMPLEMENTED; | |
6231 | + return DR_UNIMPLEMENTED; | |
6232 | } | |
6233 | ||
6234 | -static DFBResult | |
6235 | +static DirectResult | |
6236 | IFusionSoundStream_Dispatcher_Flush( IFusionSoundStream *thiz ) | |
6237 | { | |
6238 | DIRECT_INTERFACE_GET_DATA(IFusionSoundStream_Dispatcher) | |
6239 | ||
6240 | - return DFB_UNIMPLEMENTED; | |
6241 | + return DR_UNIMPLEMENTED; | |
6242 | } | |
6243 | ||
6244 | -static DFBResult | |
6245 | +static DirectResult | |
6246 | IFusionSoundStream_Dispatcher_Drop( IFusionSoundStream *thiz ) | |
6247 | { | |
6248 | DIRECT_INTERFACE_GET_DATA(IFusionSoundStream_Dispatcher) | |
6249 | ||
6250 | - return DFB_UNIMPLEMENTED; | |
6251 | + return DR_UNIMPLEMENTED; | |
6252 | } | |
6253 | ||
6254 | -static DFBResult | |
6255 | +static DirectResult | |
6256 | IFusionSoundStream_Dispatcher_GetPresentationDelay( IFusionSoundStream *thiz, | |
6257 | int *delay ) | |
6258 | { | |
6259 | DIRECT_INTERFACE_GET_DATA(IFusionSoundStream_Dispatcher) | |
6260 | ||
6261 | - return DFB_UNIMPLEMENTED; | |
6262 | + return DR_UNIMPLEMENTED; | |
6263 | } | |
6264 | ||
6265 | -static DFBResult | |
6266 | +static DirectResult | |
6267 | IFusionSoundStream_Dispatcher_GetPlayback( IFusionSoundStream *thiz, | |
6268 | IFusionSoundPlayback **ret_interface ) | |
6269 | { | |
6270 | DIRECT_INTERFACE_GET_DATA(IFusionSoundStream_Dispatcher) | |
6271 | ||
6272 | - return DFB_UNIMPLEMENTED; | |
6273 | + return DR_UNIMPLEMENTED; | |
6274 | } | |
6275 | ||
6276 | -static DFBResult | |
6277 | +static DirectResult | |
6278 | IFusionSoundStream_Dispatcher_Access( IFusionSoundStream *thiz, | |
6279 | void **ret_data, | |
6280 | int *ret_avail ) | |
6281 | { | |
6282 | DIRECT_INTERFACE_GET_DATA(IFusionSoundStream_Dispatcher) | |
6283 | ||
6284 | - return DFB_UNIMPLEMENTED; | |
6285 | + return DR_UNIMPLEMENTED; | |
6286 | } | |
6287 | ||
6288 | -static DFBResult | |
6289 | +static DirectResult | |
6290 | IFusionSoundStream_Dispatcher_Commit( IFusionSoundStream *thiz, | |
6291 | int length ) | |
6292 | { | |
6293 | DIRECT_INTERFACE_GET_DATA(IFusionSoundStream_Dispatcher) | |
6294 | ||
6295 | - return DFB_UNIMPLEMENTED; | |
6296 | + return DR_UNIMPLEMENTED; | |
6297 | } | |
6298 | ||
6299 | /**************************************************************************************************/ | |
6300 | @@ -217,7 +217,7 @@ Dispatch_GetDescription( IFusionSoundStream *thiz, IFusionSoundStream *real, | |
6301 | return ret; | |
6302 | ||
6303 | return voodoo_manager_respond( manager, msg->header.serial, | |
6304 | - DFB_OK, VOODOO_INSTANCE_NONE, | |
6305 | + DR_OK, VOODOO_INSTANCE_NONE, | |
6306 | VMBT_DATA, sizeof(FSStreamDescription), &desc, | |
6307 | VMBT_NONE ); | |
6308 | } | |
6309 | @@ -303,7 +303,7 @@ Dispatch_GetStatus( IFusionSoundStream *thiz, IFusionSoundStream *real, | |
6310 | int total; | |
6311 | int read_pos; | |
6312 | int write_pos; | |
6313 | - DFBBoolean playing; | |
6314 | + bool playing; | |
6315 | ||
6316 | DIRECT_INTERFACE_GET_DATA(IFusionSoundStream_Dispatcher) | |
6317 | ||
6318 | @@ -388,7 +388,7 @@ Dispatch_GetPlayback( IFusionSoundStream *thiz, IFusionSoundStream *real, | |
6319 | } | |
6320 | ||
6321 | return voodoo_manager_respond( manager, msg->header.serial, | |
6322 | - DFB_OK, instance, | |
6323 | + DR_OK, instance, | |
6324 | VMBT_NONE ); | |
6325 | } | |
6326 | ||
6327 | @@ -398,7 +398,7 @@ Dispatch_Access( IFusionSoundStream *thiz, IFusionSoundStream *real, | |
6328 | { | |
6329 | D_UNIMPLEMENTED(); | |
6330 | ||
6331 | - return DFB_UNIMPLEMENTED; | |
6332 | + return DR_UNIMPLEMENTED; | |
6333 | } | |
6334 | ||
6335 | static DirectResult | |
6336 | @@ -407,7 +407,7 @@ Dispatch_Commit( IFusionSoundStream *thiz, IFusionSoundStream *real, | |
6337 | { | |
6338 | D_UNIMPLEMENTED(); | |
6339 | ||
6340 | - return DFB_UNIMPLEMENTED; | |
6341 | + return DR_UNIMPLEMENTED; | |
6342 | } | |
6343 | ||
6344 | #define HANDLE_CASE(name) \ | |
6345 | @@ -441,18 +441,18 @@ Dispatch( void *dispatcher, void *real, VoodooManager *manager, VoodooRequestMes | |
6346 | HANDLE_CASE(Commit); | |
6347 | } | |
6348 | ||
6349 | - return DFB_NOSUCHMETHOD; | |
6350 | + return DR_NOSUCHMETHOD; | |
6351 | } | |
6352 | ||
6353 | #undef HANDLE_CASE | |
6354 | ||
6355 | /**************************************************************************************************/ | |
6356 | ||
6357 | -static DFBResult | |
6358 | +static DirectResult | |
6359 | Probe() | |
6360 | { | |
6361 | /* This implementation has to be loaded explicitly. */ | |
6362 | - return DFB_UNSUPPORTED; | |
6363 | + return DR_UNSUPPORTED; | |
6364 | } | |
6365 | ||
6366 | /* | |
6367 | @@ -460,7 +460,7 @@ Probe() | |
6368 | * | |
6369 | * Fills in function pointers and intializes data structure. | |
6370 | */ | |
6371 | -static DFBResult | |
6372 | +static DirectResult | |
6373 | Construct( IFusionSoundStream *thiz, | |
6374 | IFusionSoundStream *real, | |
6375 | VoodooManager *manager, | |
6376 | @@ -468,7 +468,7 @@ Construct( IFusionSoundStream *thiz, | |
6377 | void *arg, /* Optional arguments to constructor */ | |
6378 | VoodooInstanceID *ret_instance ) | |
6379 | { | |
6380 | - DFBResult ret; | |
6381 | + DirectResult ret; | |
6382 | VoodooInstanceID instance; | |
6383 | FSStreamDescription dsc; | |
6384 | ||
6385 | @@ -504,6 +504,6 @@ Construct( IFusionSoundStream *thiz, | |
6386 | thiz->Access = IFusionSoundStream_Dispatcher_Access; | |
6387 | thiz->Commit = IFusionSoundStream_Dispatcher_Commit; | |
6388 | ||
6389 | - return DFB_OK; | |
6390 | + return DR_OK; | |
6391 | } | |
6392 | ||
6393 | diff --git a/proxy/requestor/ifusionsound_requestor.c b/proxy/requestor/ifusionsound_requestor.c | |
6394 | index 6bf34b4..024f581 100644 | |
6395 | --- a/proxy/requestor/ifusionsound_requestor.c | |
6396 | +++ b/proxy/requestor/ifusionsound_requestor.c | |
6397 | @@ -48,8 +48,8 @@ | |
6398 | ||
6399 | #include <ifusionsound_dispatcher.h> | |
6400 | ||
6401 | -static DFBResult Probe(); | |
6402 | -static DFBResult Construct( IFusionSound *thiz, const char *host, int session ); | |
6403 | +static DirectResult Probe(); | |
6404 | +static DirectResult Construct( IFusionSound *thiz, const char *host, int session ); | |
6405 | ||
6406 | #include <direct/interface_implementation.h> | |
6407 | ||
6408 | @@ -82,17 +82,17 @@ IFusionSound_Requestor_Destruct( IFusionSound *thiz ) | |
6409 | ||
6410 | /**************************************************************************************************/ | |
6411 | ||
6412 | -static DFBResult | |
6413 | +static DirectResult | |
6414 | IFusionSound_Requestor_AddRef( IFusionSound *thiz ) | |
6415 | { | |
6416 | DIRECT_INTERFACE_GET_DATA(IFusionSound_Requestor) | |
6417 | ||
6418 | data->ref++; | |
6419 | ||
6420 | - return DFB_OK; | |
6421 | + return DR_OK; | |
6422 | } | |
6423 | ||
6424 | -static DFBResult | |
6425 | +static DirectResult | |
6426 | IFusionSound_Requestor_Release( IFusionSound *thiz ) | |
6427 | { | |
6428 | DIRECT_INTERFACE_GET_DATA(IFusionSound_Requestor) | |
6429 | @@ -100,10 +100,10 @@ IFusionSound_Requestor_Release( IFusionSound *thiz ) | |
6430 | if (--data->ref == 0) | |
6431 | IFusionSound_Requestor_Destruct( thiz ); | |
6432 | ||
6433 | - return DFB_OK; | |
6434 | + return DR_OK; | |
6435 | } | |
6436 | ||
6437 | -static DFBResult | |
6438 | +static DirectResult | |
6439 | IFusionSound_Requestor_GetDeviceDescription( IFusionSound *thiz, | |
6440 | FSDeviceDescription *desc ) | |
6441 | { | |
6442 | @@ -120,7 +120,7 @@ IFusionSound_Requestor_GetDeviceDescription( IFusionSound *thiz, | |
6443 | return ret; | |
6444 | ||
6445 | ret = response->result; | |
6446 | - if (ret == DFB_OK) { | |
6447 | + if (ret == DR_OK) { | |
6448 | VoodooMessageParser parser; | |
6449 | ||
6450 | VOODOO_PARSER_BEGIN( parser, response ); | |
6451 | @@ -133,7 +133,7 @@ IFusionSound_Requestor_GetDeviceDescription( IFusionSound *thiz, | |
6452 | return ret; | |
6453 | } | |
6454 | ||
6455 | -static DFBResult | |
6456 | +static DirectResult | |
6457 | IFusionSound_Requestor_CreateBuffer( IFusionSound *thiz, | |
6458 | const FSBufferDescription *desc, | |
6459 | IFusionSoundBuffer **ret_interface ) | |
6460 | @@ -147,7 +147,7 @@ IFusionSound_Requestor_CreateBuffer( IFusionSound *thiz, | |
6461 | DIRECT_INTERFACE_GET_DATA(IFusionSound_Requestor) | |
6462 | ||
6463 | if (!desc || !ret_interface) | |
6464 | - return DFB_INVARG; | |
6465 | + return DR_INVARG; | |
6466 | ||
6467 | ret = voodoo_manager_request( data->manager, data->instance, | |
6468 | IFUSIONSOUND_METHOD_ID_CreateBuffer, VREQ_RESPOND, &response, | |
6469 | @@ -157,7 +157,7 @@ IFusionSound_Requestor_CreateBuffer( IFusionSound *thiz, | |
6470 | return ret; | |
6471 | ||
6472 | ret = response->result; | |
6473 | - if (ret == DFB_OK) { | |
6474 | + if (ret == DR_OK) { | |
6475 | VOODOO_PARSER_BEGIN( parser, response ); | |
6476 | VOODOO_PARSER_GET_DATA( parser, dsc ); | |
6477 | VOODOO_PARSER_END( parser ); | |
6478 | @@ -173,7 +173,7 @@ IFusionSound_Requestor_CreateBuffer( IFusionSound *thiz, | |
6479 | return ret; | |
6480 | } | |
6481 | ||
6482 | -static DFBResult | |
6483 | +static DirectResult | |
6484 | IFusionSound_Requestor_CreateStream( IFusionSound *thiz, | |
6485 | const FSStreamDescription *desc, | |
6486 | IFusionSoundStream **ret_interface ) | |
6487 | @@ -187,7 +187,7 @@ IFusionSound_Requestor_CreateStream( IFusionSound *thiz, | |
6488 | DIRECT_INTERFACE_GET_DATA(IFusionSound_Requestor) | |
6489 | ||
6490 | if (!ret_interface) | |
6491 | - return DFB_INVARG; | |
6492 | + return DR_INVARG; | |
6493 | ||
6494 | ret = voodoo_manager_request( data->manager, data->instance, | |
6495 | IFUSIONSOUND_METHOD_ID_CreateStream, VREQ_RESPOND, &response, | |
6496 | @@ -197,7 +197,7 @@ IFusionSound_Requestor_CreateStream( IFusionSound *thiz, | |
6497 | return ret; | |
6498 | ||
6499 | ret = response->result; | |
6500 | - if (ret == DFB_OK) { | |
6501 | + if (ret == DR_OK) { | |
6502 | VOODOO_PARSER_BEGIN( parser, response ); | |
6503 | VOODOO_PARSER_GET_DATA( parser, dsc ); | |
6504 | VOODOO_PARSER_END( parser ); | |
6505 | @@ -213,7 +213,7 @@ IFusionSound_Requestor_CreateStream( IFusionSound *thiz, | |
6506 | return ret; | |
6507 | } | |
6508 | ||
6509 | -static DFBResult | |
6510 | +static DirectResult | |
6511 | IFusionSound_Requestor_CreateMusicProvider( IFusionSound *thiz, | |
6512 | const char *filename, | |
6513 | IFusionSoundMusicProvider **ret_interface ) | |
6514 | @@ -226,7 +226,7 @@ IFusionSound_Requestor_CreateMusicProvider( IFusionSound *thiz, | |
6515 | DIRECT_INTERFACE_GET_DATA(IFusionSound_Requestor) | |
6516 | ||
6517 | if (!filename || !ret_interface) | |
6518 | - return DFB_INVARG; | |
6519 | + return DR_INVARG; | |
6520 | ||
6521 | ret = voodoo_manager_request( data->manager, data->instance, | |
6522 | IFUSIONSOUND_METHOD_ID_CreateMusicProvider, | |
6523 | @@ -237,7 +237,7 @@ IFusionSound_Requestor_CreateMusicProvider( IFusionSound *thiz, | |
6524 | return ret; | |
6525 | ||
6526 | ret = response->result; | |
6527 | - if (ret == DFB_OK) | |
6528 | + if (ret == DR_OK) | |
6529 | ret = voodoo_construct_requestor( data->manager, "IFusionSoundMusicProvider", | |
6530 | response->instance, NULL, &interface ); | |
6531 | ||
6532 | @@ -251,13 +251,13 @@ IFusionSound_Requestor_CreateMusicProvider( IFusionSound *thiz, | |
6533 | ||
6534 | /* Check arguments */ | |
6535 | if (!filename || !ret_interface) | |
6536 | - return DFB_INVARG; | |
6537 | + return DR_INVARG; | |
6538 | ||
6539 | return IFusionSoundMusicProvider_Create( filename, ret_interface ); | |
6540 | #endif | |
6541 | } | |
6542 | ||
6543 | -static DFBResult | |
6544 | +static DirectResult | |
6545 | IFusionSound_Requestor_GetMasterVolume( IFusionSound *thiz, | |
6546 | float *level ) | |
6547 | { | |
6548 | @@ -268,7 +268,7 @@ IFusionSound_Requestor_GetMasterVolume( IFusionSound *thiz, | |
6549 | DIRECT_INTERFACE_GET_DATA(IFusionSound_Requestor) | |
6550 | ||
6551 | if (!level) | |
6552 | - return DFB_INVARG; | |
6553 | + return DR_INVARG; | |
6554 | ||
6555 | ret = voodoo_manager_request( data->manager, data->instance, | |
6556 | IFUSIONSOUND_METHOD_ID_GetMasterVolume, VREQ_RESPOND, &response, | |
6557 | @@ -291,7 +291,7 @@ IFusionSound_Requestor_GetMasterVolume( IFusionSound *thiz, | |
6558 | return ret; | |
6559 | } | |
6560 | ||
6561 | -static DFBResult | |
6562 | +static DirectResult | |
6563 | IFusionSound_Requestor_SetMasterVolume( IFusionSound *thiz, | |
6564 | float level ) | |
6565 | { | |
6566 | @@ -314,7 +314,7 @@ IFusionSound_Requestor_SetMasterVolume( IFusionSound *thiz, | |
6567 | return ret; | |
6568 | } | |
6569 | ||
6570 | -static DFBResult | |
6571 | +static DirectResult | |
6572 | IFusionSound_Requestor_GetLocalVolume( IFusionSound *thiz, | |
6573 | float *level ) | |
6574 | { | |
6575 | @@ -325,7 +325,7 @@ IFusionSound_Requestor_GetLocalVolume( IFusionSound *thiz, | |
6576 | DIRECT_INTERFACE_GET_DATA(IFusionSound_Requestor) | |
6577 | ||
6578 | if (!level) | |
6579 | - return DFB_INVARG; | |
6580 | + return DR_INVARG; | |
6581 | ||
6582 | ret = voodoo_manager_request( data->manager, data->instance, | |
6583 | IFUSIONSOUND_METHOD_ID_GetLocalVolume, VREQ_RESPOND, &response, | |
6584 | @@ -348,7 +348,7 @@ IFusionSound_Requestor_GetLocalVolume( IFusionSound *thiz, | |
6585 | return ret; | |
6586 | } | |
6587 | ||
6588 | -static DFBResult | |
6589 | +static DirectResult | |
6590 | IFusionSound_Requestor_SetLocalVolume( IFusionSound *thiz, | |
6591 | float level ) | |
6592 | { | |
6593 | @@ -371,7 +371,7 @@ IFusionSound_Requestor_SetLocalVolume( IFusionSound *thiz, | |
6594 | return ret; | |
6595 | } | |
6596 | ||
6597 | -static DFBResult | |
6598 | +static DirectResult | |
6599 | IFusionSound_Requestor_Suspend( IFusionSound *thiz ) | |
6600 | { | |
6601 | DirectResult ret; | |
6602 | @@ -392,7 +392,7 @@ IFusionSound_Requestor_Suspend( IFusionSound *thiz ) | |
6603 | return ret; | |
6604 | } | |
6605 | ||
6606 | -static DFBResult | |
6607 | +static DirectResult | |
6608 | IFusionSound_Requestor_Resume( IFusionSound *thiz ) | |
6609 | { | |
6610 | DirectResult ret; | |
6611 | @@ -415,11 +415,11 @@ IFusionSound_Requestor_Resume( IFusionSound *thiz ) | |
6612 | ||
6613 | /**************************************************************************************************/ | |
6614 | ||
6615 | -static DFBResult | |
6616 | +static DirectResult | |
6617 | Probe() | |
6618 | { | |
6619 | /* This implementation has to be loaded explicitly. */ | |
6620 | - return DFB_UNSUPPORTED; | |
6621 | + return DR_UNSUPPORTED; | |
6622 | } | |
6623 | ||
6624 | /* | |
6625 | @@ -427,10 +427,10 @@ Probe() | |
6626 | * | |
6627 | * Fills in function pointers and intializes data structure. | |
6628 | */ | |
6629 | -static DFBResult | |
6630 | +static DirectResult | |
6631 | Construct( IFusionSound *thiz, const char *host, int session ) | |
6632 | { | |
6633 | - DFBResult ret; | |
6634 | + DirectResult ret; | |
6635 | ||
6636 | DIRECT_ALLOCATE_INTERFACE_DATA(thiz, IFusionSound_Requestor) | |
6637 | ||
6638 | @@ -464,7 +464,7 @@ Construct( IFusionSound *thiz, const char *host, int session ) | |
6639 | thiz->Suspend = IFusionSound_Requestor_Suspend; | |
6640 | thiz->Resume = IFusionSound_Requestor_Resume; | |
6641 | ||
6642 | - return DFB_OK; | |
6643 | + return DR_OK; | |
6644 | } | |
6645 | ||
6646 | ||
6647 | diff --git a/proxy/requestor/ifusionsoundbuffer_requestor.c b/proxy/requestor/ifusionsoundbuffer_requestor.c | |
6648 | index a846ecf..af3171f 100644 | |
6649 | --- a/proxy/requestor/ifusionsoundbuffer_requestor.c | |
6650 | +++ b/proxy/requestor/ifusionsoundbuffer_requestor.c | |
6651 | @@ -50,8 +50,8 @@ | |
6652 | ||
6653 | #include <ifusionsoundbuffer_dispatcher.h> | |
6654 | ||
6655 | -static DFBResult Probe(); | |
6656 | -static DFBResult Construct( IFusionSoundBuffer *thiz, | |
6657 | +static DirectResult Probe(); | |
6658 | +static DirectResult Construct( IFusionSoundBuffer *thiz, | |
6659 | VoodooManager *manager, | |
6660 | VoodooInstanceID instance, | |
6661 | void *arg ); | |
6662 | @@ -106,17 +106,17 @@ IFusionSoundBuffer_Requestor_Destruct( IFusionSoundBuffer *thiz ) | |
6663 | ||
6664 | /**************************************************************************************************/ | |
6665 | ||
6666 | -static DFBResult | |
6667 | +static DirectResult | |
6668 | IFusionSoundBuffer_Requestor_AddRef( IFusionSoundBuffer *thiz ) | |
6669 | { | |
6670 | DIRECT_INTERFACE_GET_DATA(IFusionSoundBuffer_Requestor) | |
6671 | ||
6672 | data->ref++; | |
6673 | ||
6674 | - return DFB_UNIMPLEMENTED; | |
6675 | + return DR_UNIMPLEMENTED; | |
6676 | } | |
6677 | ||
6678 | -static DFBResult | |
6679 | +static DirectResult | |
6680 | IFusionSoundBuffer_Requestor_Release( IFusionSoundBuffer *thiz ) | |
6681 | { | |
6682 | DIRECT_INTERFACE_GET_DATA(IFusionSoundBuffer_Requestor) | |
6683 | @@ -124,11 +124,11 @@ IFusionSoundBuffer_Requestor_Release( IFusionSoundBuffer *thiz ) | |
6684 | if (--data->ref == 0) | |
6685 | IFusionSoundBuffer_Requestor_Destruct( thiz ); | |
6686 | ||
6687 | - return DFB_UNIMPLEMENTED; | |
6688 | + return DR_UNIMPLEMENTED; | |
6689 | } | |
6690 | ||
6691 | ||
6692 | -static DFBResult | |
6693 | +static DirectResult | |
6694 | IFusionSoundBuffer_Requestor_GetDescription( IFusionSoundBuffer *thiz, | |
6695 | FSBufferDescription *desc ) | |
6696 | { | |
6697 | @@ -138,7 +138,7 @@ IFusionSoundBuffer_Requestor_GetDescription( IFusionSoundBuffer *thiz, | |
6698 | DIRECT_INTERFACE_GET_DATA(IFusionSoundBuffer_Requestor) | |
6699 | ||
6700 | if (!desc) | |
6701 | - return DFB_INVARG; | |
6702 | + return DR_INVARG; | |
6703 | ||
6704 | ret = voodoo_manager_request( data->manager, data->instance, | |
6705 | IFUSIONSOUNDBUFFER_METHOD_ID_GetDescription, | |
6706 | @@ -148,7 +148,7 @@ IFusionSoundBuffer_Requestor_GetDescription( IFusionSoundBuffer *thiz, | |
6707 | return ret; | |
6708 | ||
6709 | ret = response->result; | |
6710 | - if (ret == DFB_OK) { | |
6711 | + if (ret == DR_OK) { | |
6712 | VoodooMessageParser parser; | |
6713 | ||
6714 | VOODOO_PARSER_BEGIN( parser, response ); | |
6715 | @@ -161,7 +161,7 @@ IFusionSoundBuffer_Requestor_GetDescription( IFusionSoundBuffer *thiz, | |
6716 | return ret; | |
6717 | } | |
6718 | ||
6719 | -static DFBResult | |
6720 | +static DirectResult | |
6721 | IFusionSoundBuffer_Requestor_SetPosition( IFusionSoundBuffer *thiz, | |
6722 | int position ) | |
6723 | { | |
6724 | @@ -171,7 +171,7 @@ IFusionSoundBuffer_Requestor_SetPosition( IFusionSoundBuffer *thiz, | |
6725 | DIRECT_INTERFACE_GET_DATA(IFusionSoundBuffer_Requestor) | |
6726 | ||
6727 | if (position < 0 || position >= data->frames) | |
6728 | - return DFB_INVARG; | |
6729 | + return DR_INVARG; | |
6730 | ||
6731 | ret = voodoo_manager_request( data->manager, data->instance, | |
6732 | IFUSIONSOUNDBUFFER_METHOD_ID_SetPosition, VREQ_RESPOND, &response, | |
6733 | @@ -181,7 +181,7 @@ IFusionSoundBuffer_Requestor_SetPosition( IFusionSoundBuffer *thiz, | |
6734 | return ret; | |
6735 | ||
6736 | ret = response->result; | |
6737 | - if (ret == DFB_OK) | |
6738 | + if (ret == DR_OK) | |
6739 | data->position = position; | |
6740 | ||
6741 | voodoo_manager_finish_request( data->manager, response ); | |
6742 | @@ -189,7 +189,7 @@ IFusionSoundBuffer_Requestor_SetPosition( IFusionSoundBuffer *thiz, | |
6743 | return ret; | |
6744 | } | |
6745 | ||
6746 | -static DFBResult | |
6747 | +static DirectResult | |
6748 | IFusionSoundBuffer_Requestor_Lock( IFusionSoundBuffer *thiz, | |
6749 | void **ret_data, | |
6750 | int *ret_frames, | |
6751 | @@ -198,10 +198,10 @@ IFusionSoundBuffer_Requestor_Lock( IFusionSoundBuffer *thiz, | |
6752 | DIRECT_INTERFACE_GET_DATA(IFusionSoundBuffer_Requestor) | |
6753 | ||
6754 | if (!ret_data) | |
6755 | - return DFB_INVARG; | |
6756 | + return DR_INVARG; | |
6757 | ||
6758 | if (data->locked) | |
6759 | - return DFB_LOCKED; | |
6760 | + return DR_LOCKED; | |
6761 | ||
6762 | *ret_data = data->buffer; | |
6763 | ||
6764 | @@ -213,10 +213,10 @@ IFusionSoundBuffer_Requestor_Lock( IFusionSoundBuffer *thiz, | |
6765 | ||
6766 | data->locked = true; | |
6767 | ||
6768 | - return DFB_OK; | |
6769 | + return DR_OK; | |
6770 | } | |
6771 | ||
6772 | -static DFBResult | |
6773 | +static DirectResult | |
6774 | IFusionSoundBuffer_Requestor_Unlock( IFusionSoundBuffer *thiz ) | |
6775 | { | |
6776 | DirectResult ret; | |
6777 | @@ -228,7 +228,7 @@ IFusionSoundBuffer_Requestor_Unlock( IFusionSoundBuffer *thiz ) | |
6778 | DIRECT_INTERFACE_GET_DATA(IFusionSoundBuffer_Requestor) | |
6779 | ||
6780 | if (!data->locked) | |
6781 | - return DFB_OK; | |
6782 | + return DR_OK; | |
6783 | ||
6784 | src = data->buffer + data->position * data->bytes_per_frame; | |
6785 | offset = 0; | |
6786 | @@ -259,10 +259,10 @@ IFusionSoundBuffer_Requestor_Unlock( IFusionSoundBuffer *thiz ) | |
6787 | ||
6788 | data->locked = false; | |
6789 | ||
6790 | - return DFB_OK; | |
6791 | + return DR_OK; | |
6792 | } | |
6793 | ||
6794 | -static DFBResult | |
6795 | +static DirectResult | |
6796 | IFusionSoundBuffer_Requestor_Unlock_DPACK( IFusionSoundBuffer *thiz ) | |
6797 | { | |
6798 | DirectResult ret; | |
6799 | @@ -274,7 +274,7 @@ IFusionSoundBuffer_Requestor_Unlock_DPACK( IFusionSoundBuffer *thiz ) | |
6800 | DIRECT_INTERFACE_GET_DATA(IFusionSoundBuffer_Requestor) | |
6801 | ||
6802 | if (!data->locked) | |
6803 | - return DFB_OK; | |
6804 | + return DR_OK; | |
6805 | ||
6806 | src = data->buffer + data->position * data->bytes_per_frame; | |
6807 | offset = 0; | |
6808 | @@ -309,10 +309,10 @@ IFusionSoundBuffer_Requestor_Unlock_DPACK( IFusionSoundBuffer *thiz ) | |
6809 | ||
6810 | data->locked = false; | |
6811 | ||
6812 | - return DFB_OK; | |
6813 | + return DR_OK; | |
6814 | } | |
6815 | ||
6816 | -static DFBResult | |
6817 | +static DirectResult | |
6818 | IFusionSoundBuffer_Requestor_Play( IFusionSoundBuffer *thiz, | |
6819 | FSBufferPlayFlags flags ) | |
6820 | { | |
6821 | @@ -322,7 +322,7 @@ IFusionSoundBuffer_Requestor_Play( IFusionSoundBuffer *thiz, | |
6822 | DIRECT_INTERFACE_GET_DATA(IFusionSoundBuffer_Requestor) | |
6823 | ||
6824 | if (flags & ~FSPLAY_ALL) | |
6825 | - return DFB_INVARG; | |
6826 | + return DR_INVARG; | |
6827 | ||
6828 | ret = voodoo_manager_request( data->manager, data->instance, | |
6829 | IFUSIONSOUNDBUFFER_METHOD_ID_Play, VREQ_RESPOND, &response, | |
6830 | @@ -338,7 +338,7 @@ IFusionSoundBuffer_Requestor_Play( IFusionSoundBuffer *thiz, | |
6831 | return ret; | |
6832 | } | |
6833 | ||
6834 | -static DFBResult | |
6835 | +static DirectResult | |
6836 | IFusionSoundBuffer_Requestor_Stop( IFusionSoundBuffer *thiz ) | |
6837 | { | |
6838 | DirectResult ret; | |
6839 | @@ -359,7 +359,7 @@ IFusionSoundBuffer_Requestor_Stop( IFusionSoundBuffer *thiz ) | |
6840 | return ret; | |
6841 | } | |
6842 | ||
6843 | -static DFBResult | |
6844 | +static DirectResult | |
6845 | IFusionSoundBuffer_Requestor_CreatePlayback( IFusionSoundBuffer *thiz, | |
6846 | IFusionSoundPlayback **ret_interface ) | |
6847 | { | |
6848 | @@ -370,7 +370,7 @@ IFusionSoundBuffer_Requestor_CreatePlayback( IFusionSoundBuffer *thiz, | |
6849 | DIRECT_INTERFACE_GET_DATA(IFusionSoundBuffer_Requestor) | |
6850 | ||
6851 | if (!ret_interface) | |
6852 | - return DFB_INVARG; | |
6853 | + return DR_INVARG; | |
6854 | ||
6855 | ret = voodoo_manager_request( data->manager, data->instance, | |
6856 | IFUSIONSOUNDBUFFER_METHOD_ID_CreatePlayback, VREQ_RESPOND, &response, | |
6857 | @@ -379,7 +379,7 @@ IFusionSoundBuffer_Requestor_CreatePlayback( IFusionSoundBuffer *thiz, | |
6858 | return ret; | |
6859 | ||
6860 | ret = response->result; | |
6861 | - if (ret == DFB_OK) | |
6862 | + if (ret == DR_OK) | |
6863 | ret = voodoo_construct_requestor( data->manager, "IFusionSoundPlayback", | |
6864 | response->instance, NULL, &interface ); | |
6865 | ||
6866 | @@ -392,11 +392,11 @@ IFusionSoundBuffer_Requestor_CreatePlayback( IFusionSoundBuffer *thiz, | |
6867 | ||
6868 | /**************************************************************************************************/ | |
6869 | ||
6870 | -static DFBResult | |
6871 | +static DirectResult | |
6872 | Probe() | |
6873 | { | |
6874 | /* This implementation has to be loaded explicitly. */ | |
6875 | - return DFB_UNSUPPORTED; | |
6876 | + return DR_UNSUPPORTED; | |
6877 | } | |
6878 | ||
6879 | /* | |
6880 | @@ -404,7 +404,7 @@ Probe() | |
6881 | * | |
6882 | * Fills in function pointers and intializes data structure. | |
6883 | */ | |
6884 | -static DFBResult | |
6885 | +static DirectResult | |
6886 | Construct( IFusionSoundBuffer *thiz, | |
6887 | VoodooManager *manager, | |
6888 | VoodooInstanceID instance, | |
6889 | @@ -440,7 +440,7 @@ Construct( IFusionSoundBuffer *thiz, | |
6890 | thiz->Stop = IFusionSoundBuffer_Requestor_Stop; | |
6891 | thiz->CreatePlayback = IFusionSoundBuffer_Requestor_CreatePlayback; | |
6892 | ||
6893 | - return DFB_OK; | |
6894 | + return DR_OK; | |
6895 | } | |
6896 | ||
6897 | ||
6898 | diff --git a/proxy/requestor/ifusionsoundplayback_requestor.c b/proxy/requestor/ifusionsoundplayback_requestor.c | |
6899 | index a85fdb4..4dca795 100644 | |
6900 | --- a/proxy/requestor/ifusionsoundplayback_requestor.c | |
6901 | +++ b/proxy/requestor/ifusionsoundplayback_requestor.c | |
6902 | @@ -46,8 +46,8 @@ | |
6903 | ||
6904 | #include <ifusionsoundplayback_dispatcher.h> | |
6905 | ||
6906 | -static DFBResult Probe(); | |
6907 | -static DFBResult Construct( IFusionSoundPlayback *thiz, | |
6908 | +static DirectResult Probe(); | |
6909 | +static DirectResult Construct( IFusionSoundPlayback *thiz, | |
6910 | VoodooManager *manager, | |
6911 | VoodooInstanceID instance, | |
6912 | void *arg ); | |
6913 | @@ -84,17 +84,17 @@ IFusionSoundPlayback_Requestor_Destruct( IFusionSoundPlayback *thiz ) | |
6914 | ||
6915 | /**************************************************************************************************/ | |
6916 | ||
6917 | -static DFBResult | |
6918 | +static DirectResult | |
6919 | IFusionSoundPlayback_Requestor_AddRef( IFusionSoundPlayback *thiz ) | |
6920 | { | |
6921 | DIRECT_INTERFACE_GET_DATA(IFusionSoundPlayback_Requestor) | |
6922 | ||
6923 | data->ref++; | |
6924 | ||
6925 | - return DFB_OK; | |
6926 | + return DR_OK; | |
6927 | } | |
6928 | ||
6929 | -static DFBResult | |
6930 | +static DirectResult | |
6931 | IFusionSoundPlayback_Requestor_Release( IFusionSoundPlayback *thiz ) | |
6932 | { | |
6933 | DIRECT_INTERFACE_GET_DATA(IFusionSoundPlayback_Requestor) | |
6934 | @@ -102,10 +102,10 @@ IFusionSoundPlayback_Requestor_Release( IFusionSoundPlayback *thiz ) | |
6935 | if (--data->ref == 0) | |
6936 | IFusionSoundPlayback_Requestor_Destruct( thiz ); | |
6937 | ||
6938 | - return DFB_OK; | |
6939 | + return DR_OK; | |
6940 | } | |
6941 | ||
6942 | -static DFBResult | |
6943 | +static DirectResult | |
6944 | IFusionSoundPlayback_Requestor_Start( IFusionSoundPlayback *thiz, | |
6945 | int start, | |
6946 | int stop ) | |
6947 | @@ -116,7 +116,7 @@ IFusionSoundPlayback_Requestor_Start( IFusionSoundPlayback *thiz, | |
6948 | DIRECT_INTERFACE_GET_DATA(IFusionSoundPlayback_Requestor) | |
6949 | ||
6950 | if (start < 0) | |
6951 | - return DFB_INVARG; | |
6952 | + return DR_INVARG; | |
6953 | ||
6954 | ret = voodoo_manager_request( data->manager, data->instance, | |
6955 | IFUSIONSOUNDPLAYBACK_METHOD_ID_Start, VREQ_RESPOND, &response, | |
6956 | @@ -134,7 +134,7 @@ IFusionSoundPlayback_Requestor_Start( IFusionSoundPlayback *thiz, | |
6957 | } | |
6958 | ||
6959 | ||
6960 | -static DFBResult | |
6961 | +static DirectResult | |
6962 | IFusionSoundPlayback_Requestor_Stop( IFusionSoundPlayback *thiz ) | |
6963 | { | |
6964 | DirectResult ret; | |
6965 | @@ -155,7 +155,7 @@ IFusionSoundPlayback_Requestor_Stop( IFusionSoundPlayback *thiz ) | |
6966 | return ret; | |
6967 | } | |
6968 | ||
6969 | -static DFBResult | |
6970 | +static DirectResult | |
6971 | IFusionSoundPlayback_Requestor_Continue( IFusionSoundPlayback *thiz ) | |
6972 | { | |
6973 | DirectResult ret; | |
6974 | @@ -176,7 +176,7 @@ IFusionSoundPlayback_Requestor_Continue( IFusionSoundPlayback *thiz ) | |
6975 | return ret; | |
6976 | } | |
6977 | ||
6978 | -static DFBResult | |
6979 | +static DirectResult | |
6980 | IFusionSoundPlayback_Requestor_Wait( IFusionSoundPlayback *thiz ) | |
6981 | { | |
6982 | DirectResult ret; | |
6983 | @@ -197,20 +197,20 @@ IFusionSoundPlayback_Requestor_Wait( IFusionSoundPlayback *thiz ) | |
6984 | return ret; | |
6985 | } | |
6986 | ||
6987 | -static DFBResult | |
6988 | +static DirectResult | |
6989 | IFusionSoundPlayback_Requestor_GetStatus( IFusionSoundPlayback *thiz, | |
6990 | - DFBBoolean *ret_playing, | |
6991 | + bool *ret_playing, | |
6992 | int *ret_position ) | |
6993 | { | |
6994 | DirectResult ret; | |
6995 | VoodooResponseMessage *response; | |
6996 | - DFBBoolean playing = DFB_FALSE; | |
6997 | + bool playing = DR_FALSE; | |
6998 | int position = 0; | |
6999 | ||
7000 | DIRECT_INTERFACE_GET_DATA(IFusionSoundPlayback_Requestor) | |
7001 | ||
7002 | if (!ret_playing && !ret_position) | |
7003 | - return DFB_OK; | |
7004 | + return DR_OK; | |
7005 | ||
7006 | ret = voodoo_manager_request( data->manager, data->instance, | |
7007 | IFUSIONSOUNDPLAYBACK_METHOD_ID_GetStatus, VREQ_RESPOND, &response, | |
7008 | @@ -219,7 +219,7 @@ IFusionSoundPlayback_Requestor_GetStatus( IFusionSoundPlayback *thiz, | |
7009 | return ret; | |
7010 | ||
7011 | ret = response->result; | |
7012 | - if (ret == DFB_OK) { | |
7013 | + if (ret == DR_OK) { | |
7014 | VoodooMessageParser parser; | |
7015 | ||
7016 | VOODOO_PARSER_BEGIN( parser, response ); | |
7017 | @@ -239,7 +239,7 @@ IFusionSoundPlayback_Requestor_GetStatus( IFusionSoundPlayback *thiz, | |
7018 | return ret; | |
7019 | } | |
7020 | ||
7021 | -static DFBResult | |
7022 | +static DirectResult | |
7023 | IFusionSoundPlayback_Requestor_SetVolume( IFusionSoundPlayback *thiz, | |
7024 | float level ) | |
7025 | { | |
7026 | @@ -249,7 +249,7 @@ IFusionSoundPlayback_Requestor_SetVolume( IFusionSoundPlayback *thiz, | |
7027 | DIRECT_INTERFACE_GET_DATA(IFusionSoundPlayback_Requestor) | |
7028 | ||
7029 | if (level < 0.0f || level > 64.f) | |
7030 | - return DFB_INVARG; | |
7031 | + return DR_INVARG; | |
7032 | ||
7033 | ret = voodoo_manager_request( data->manager, data->instance, | |
7034 | IFUSIONSOUNDPLAYBACK_METHOD_ID_SetVolume, VREQ_RESPOND, &response, | |
7035 | @@ -265,7 +265,7 @@ IFusionSoundPlayback_Requestor_SetVolume( IFusionSoundPlayback *thiz, | |
7036 | return ret; | |
7037 | } | |
7038 | ||
7039 | -static DFBResult | |
7040 | +static DirectResult | |
7041 | IFusionSoundPlayback_Requestor_SetPan( IFusionSoundPlayback *thiz, | |
7042 | float value ) | |
7043 | { | |
7044 | @@ -275,7 +275,7 @@ IFusionSoundPlayback_Requestor_SetPan( IFusionSoundPlayback *thiz, | |
7045 | DIRECT_INTERFACE_GET_DATA(IFusionSoundPlayback_Requestor) | |
7046 | ||
7047 | if (value < -1.0f || value > 1.0f) | |
7048 | - return DFB_INVARG; | |
7049 | + return DR_INVARG; | |
7050 | ||
7051 | ret = voodoo_manager_request( data->manager, data->instance, | |
7052 | IFUSIONSOUNDPLAYBACK_METHOD_ID_SetPan, VREQ_RESPOND, &response, | |
7053 | @@ -291,7 +291,7 @@ IFusionSoundPlayback_Requestor_SetPan( IFusionSoundPlayback *thiz, | |
7054 | return ret; | |
7055 | } | |
7056 | ||
7057 | -static DFBResult | |
7058 | +static DirectResult | |
7059 | IFusionSoundPlayback_Requestor_SetPitch( IFusionSoundPlayback *thiz, | |
7060 | float value ) | |
7061 | { | |
7062 | @@ -301,7 +301,7 @@ IFusionSoundPlayback_Requestor_SetPitch( IFusionSoundPlayback *thiz, | |
7063 | DIRECT_INTERFACE_GET_DATA(IFusionSoundPlayback_Requestor) | |
7064 | ||
7065 | if (value < 0.0f || value > 64.0f) | |
7066 | - return DFB_INVARG; | |
7067 | + return DR_INVARG; | |
7068 | ||
7069 | ret = voodoo_manager_request( data->manager, data->instance, | |
7070 | IFUSIONSOUNDPLAYBACK_METHOD_ID_SetPitch, VREQ_RESPOND, &response, | |
7071 | @@ -317,7 +317,7 @@ IFusionSoundPlayback_Requestor_SetPitch( IFusionSoundPlayback *thiz, | |
7072 | return ret; | |
7073 | } | |
7074 | ||
7075 | -static DFBResult | |
7076 | +static DirectResult | |
7077 | IFusionSoundPlayback_Requestor_SetDirection( IFusionSoundPlayback *thiz, | |
7078 | FSPlaybackDirection direction ) | |
7079 | { | |
7080 | @@ -331,7 +331,7 @@ IFusionSoundPlayback_Requestor_SetDirection( IFusionSoundPlayback *thiz, | |
7081 | case FSPD_BACKWARD: | |
7082 | break; | |
7083 | default: | |
7084 | - return DFB_INVARG; | |
7085 | + return DR_INVARG; | |
7086 | } | |
7087 | ||
7088 | ret = voodoo_manager_request( data->manager, data->instance, | |
7089 | @@ -348,7 +348,7 @@ IFusionSoundPlayback_Requestor_SetDirection( IFusionSoundPlayback *thiz, | |
7090 | return ret; | |
7091 | } | |
7092 | ||
7093 | -static DFBResult | |
7094 | +static DirectResult | |
7095 | IFusionSoundPlayback_Requestor_SetDownmixLevels( IFusionSoundPlayback *thiz, | |
7096 | float center, | |
7097 | float rear ) | |
7098 | @@ -359,10 +359,10 @@ IFusionSoundPlayback_Requestor_SetDownmixLevels( IFusionSoundPlayback *thiz, | |
7099 | DIRECT_INTERFACE_GET_DATA(IFusionSoundPlayback_Requestor) | |
7100 | ||
7101 | if (center < 0.0f || center > 1.0f) | |
7102 | - return DFB_INVARG; | |
7103 | + return DR_INVARG; | |
7104 | ||
7105 | if (rear < 0.0f || rear > 1.0f) | |
7106 | - return DFB_INVARG; | |
7107 | + return DR_INVARG; | |
7108 | ||
7109 | ret = voodoo_manager_request( data->manager, data->instance, | |
7110 | IFUSIONSOUNDPLAYBACK_METHOD_ID_SetDownmixLevels, VREQ_RESPOND, &response, | |
7111 | @@ -381,11 +381,11 @@ IFusionSoundPlayback_Requestor_SetDownmixLevels( IFusionSoundPlayback *thiz, | |
7112 | ||
7113 | /**************************************************************************************************/ | |
7114 | ||
7115 | -static DFBResult | |
7116 | +static DirectResult | |
7117 | Probe() | |
7118 | { | |
7119 | /* This implementation has to be loaded explicitly. */ | |
7120 | - return DFB_UNSUPPORTED; | |
7121 | + return DR_UNSUPPORTED; | |
7122 | } | |
7123 | ||
7124 | /* | |
7125 | @@ -393,7 +393,7 @@ Probe() | |
7126 | * | |
7127 | * Fills in function pointers and intializes data structure. | |
7128 | */ | |
7129 | -static DFBResult | |
7130 | +static DirectResult | |
7131 | Construct( IFusionSoundPlayback *thiz, | |
7132 | VoodooManager *manager, | |
7133 | VoodooInstanceID instance, | |
7134 | @@ -418,6 +418,6 @@ Construct( IFusionSoundPlayback *thiz, | |
7135 | thiz->SetDirection = IFusionSoundPlayback_Requestor_SetDirection; | |
7136 | thiz->SetDownmixLevels = IFusionSoundPlayback_Requestor_SetDownmixLevels; | |
7137 | ||
7138 | - return DFB_OK; | |
7139 | + return DR_OK; | |
7140 | } | |
7141 | ||
7142 | diff --git a/proxy/requestor/ifusionsoundstream_requestor.c b/proxy/requestor/ifusionsoundstream_requestor.c | |
7143 | index 7405fbc..755e9fa 100644 | |
7144 | --- a/proxy/requestor/ifusionsoundstream_requestor.c | |
7145 | +++ b/proxy/requestor/ifusionsoundstream_requestor.c | |
7146 | @@ -50,8 +50,8 @@ | |
7147 | ||
7148 | #include <ifusionsoundstream_dispatcher.h> | |
7149 | ||
7150 | -static DFBResult Probe(); | |
7151 | -static DFBResult Construct( IFusionSoundStream *thiz, | |
7152 | +static DirectResult Probe(); | |
7153 | +static DirectResult Construct( IFusionSoundStream *thiz, | |
7154 | VoodooManager *manager, | |
7155 | VoodooInstanceID instance, | |
7156 | void *arg ); | |
7157 | @@ -102,17 +102,17 @@ IFusionSoundStream_Requestor_Destruct( IFusionSoundStream *thiz ) | |
7158 | ||
7159 | /**************************************************************************************************/ | |
7160 | ||
7161 | -static DFBResult | |
7162 | +static DirectResult | |
7163 | IFusionSoundStream_Requestor_AddRef( IFusionSoundStream *thiz ) | |
7164 | { | |
7165 | DIRECT_INTERFACE_GET_DATA(IFusionSoundStream_Requestor) | |
7166 | ||
7167 | data->ref++; | |
7168 | ||
7169 | - return DFB_OK; | |
7170 | + return DR_OK; | |
7171 | } | |
7172 | ||
7173 | -static DFBResult | |
7174 | +static DirectResult | |
7175 | IFusionSoundStream_Requestor_Release( IFusionSoundStream *thiz ) | |
7176 | { | |
7177 | DIRECT_INTERFACE_GET_DATA(IFusionSoundStream_Requestor) | |
7178 | @@ -120,10 +120,10 @@ IFusionSoundStream_Requestor_Release( IFusionSoundStream *thiz ) | |
7179 | if (--data->ref == 0) | |
7180 | IFusionSoundStream_Requestor_Destruct( thiz ); | |
7181 | ||
7182 | - return DFB_OK; | |
7183 | + return DR_OK; | |
7184 | } | |
7185 | ||
7186 | -static DFBResult | |
7187 | +static DirectResult | |
7188 | IFusionSoundStream_Requestor_GetDescription( IFusionSoundStream *thiz, | |
7189 | FSStreamDescription *desc ) | |
7190 | { | |
7191 | @@ -133,7 +133,7 @@ IFusionSoundStream_Requestor_GetDescription( IFusionSoundStream *thiz, | |
7192 | DIRECT_INTERFACE_GET_DATA(IFusionSoundStream_Requestor) | |
7193 | ||
7194 | if (!desc) | |
7195 | - return DFB_INVARG; | |
7196 | + return DR_INVARG; | |
7197 | ||
7198 | ret = voodoo_manager_request( data->manager, data->instance, | |
7199 | IFUSIONSOUNDSTREAM_METHOD_ID_GetDescription, | |
7200 | @@ -143,7 +143,7 @@ IFusionSoundStream_Requestor_GetDescription( IFusionSoundStream *thiz, | |
7201 | return ret; | |
7202 | ||
7203 | ret = response->result; | |
7204 | - if (ret == DFB_OK) { | |
7205 | + if (ret == DR_OK) { | |
7206 | VoodooMessageParser parser; | |
7207 | ||
7208 | VOODOO_PARSER_BEGIN( parser, response ); | |
7209 | @@ -156,7 +156,7 @@ IFusionSoundStream_Requestor_GetDescription( IFusionSoundStream *thiz, | |
7210 | return ret; | |
7211 | } | |
7212 | ||
7213 | -static DFBResult | |
7214 | +static DirectResult | |
7215 | IFusionSoundStream_Requestor_Write( IFusionSoundStream *thiz, | |
7216 | const void *samples, | |
7217 | int length ) | |
7218 | @@ -168,7 +168,7 @@ IFusionSoundStream_Requestor_Write( IFusionSoundStream *thiz, | |
7219 | DIRECT_INTERFACE_GET_DATA(IFusionSoundStream_Requestor) | |
7220 | ||
7221 | if (!samples || length < 1) | |
7222 | - return DFB_INVARG; | |
7223 | + return DR_INVARG; | |
7224 | ||
7225 | src = (u8*) samples; | |
7226 | while (length) { | |
7227 | @@ -194,10 +194,10 @@ IFusionSoundStream_Requestor_Write( IFusionSoundStream *thiz, | |
7228 | length -= len; | |
7229 | } | |
7230 | ||
7231 | - return DFB_OK; | |
7232 | + return DR_OK; | |
7233 | } | |
7234 | ||
7235 | -static DFBResult | |
7236 | +static DirectResult | |
7237 | IFusionSoundStream_Requestor_Write_DPACK( IFusionSoundStream *thiz, | |
7238 | const void *samples, | |
7239 | int length ) | |
7240 | @@ -209,7 +209,7 @@ IFusionSoundStream_Requestor_Write_DPACK( IFusionSoundStream *thiz, | |
7241 | DIRECT_INTERFACE_GET_DATA(IFusionSoundStream_Requestor) | |
7242 | ||
7243 | if (!samples || length < 1) | |
7244 | - return DFB_INVARG; | |
7245 | + return DR_INVARG; | |
7246 | ||
7247 | src = (u8*) samples; | |
7248 | while (length) { | |
7249 | @@ -239,10 +239,10 @@ IFusionSoundStream_Requestor_Write_DPACK( IFusionSoundStream *thiz, | |
7250 | length -= len; | |
7251 | } | |
7252 | ||
7253 | - return DFB_OK; | |
7254 | + return DR_OK; | |
7255 | } | |
7256 | ||
7257 | -static DFBResult | |
7258 | +static DirectResult | |
7259 | IFusionSoundStream_Requestor_Wait( IFusionSoundStream *thiz, | |
7260 | int length ) | |
7261 | { | |
7262 | @@ -252,7 +252,7 @@ IFusionSoundStream_Requestor_Wait( IFusionSoundStream *thiz, | |
7263 | DIRECT_INTERFACE_GET_DATA(IFusionSoundStream_Requestor) | |
7264 | ||
7265 | if (length < 1 || length > data->frames) | |
7266 | - return DFB_INVARG; | |
7267 | + return DR_INVARG; | |
7268 | ||
7269 | ret = voodoo_manager_request( data->manager, data->instance, | |
7270 | IFUSIONSOUNDSTREAM_METHOD_ID_Wait, VREQ_RESPOND, &response, | |
7271 | @@ -268,13 +268,13 @@ IFusionSoundStream_Requestor_Wait( IFusionSoundStream *thiz, | |
7272 | return ret; | |
7273 | } | |
7274 | ||
7275 | -static DFBResult | |
7276 | +static DirectResult | |
7277 | IFusionSoundStream_Requestor_GetStatus( IFusionSoundStream *thiz, | |
7278 | int *ret_filled, | |
7279 | int *ret_total, | |
7280 | int *ret_read_pos, | |
7281 | int *ret_write_pos, | |
7282 | - DFBBoolean *ret_playing ) | |
7283 | + bool *ret_playing ) | |
7284 | { | |
7285 | DirectResult ret; | |
7286 | VoodooResponseMessage *response; | |
7287 | @@ -283,7 +283,7 @@ IFusionSoundStream_Requestor_GetStatus( IFusionSoundStream *thiz, | |
7288 | int total; | |
7289 | int read_pos; | |
7290 | int write_pos; | |
7291 | - DFBBoolean playing; | |
7292 | + bool playing; | |
7293 | ||
7294 | DIRECT_INTERFACE_GET_DATA(IFusionSoundStream_Requestor) | |
7295 | ||
7296 | @@ -327,7 +327,7 @@ IFusionSoundStream_Requestor_GetStatus( IFusionSoundStream *thiz, | |
7297 | return ret; | |
7298 | } | |
7299 | ||
7300 | -static DFBResult | |
7301 | +static DirectResult | |
7302 | IFusionSoundStream_Requestor_Flush( IFusionSoundStream *thiz ) | |
7303 | { | |
7304 | DirectResult ret; | |
7305 | @@ -348,7 +348,7 @@ IFusionSoundStream_Requestor_Flush( IFusionSoundStream *thiz ) | |
7306 | return ret; | |
7307 | } | |
7308 | ||
7309 | -static DFBResult | |
7310 | +static DirectResult | |
7311 | IFusionSoundStream_Requestor_Drop( IFusionSoundStream *thiz ) | |
7312 | { | |
7313 | DirectResult ret; | |
7314 | @@ -369,7 +369,7 @@ IFusionSoundStream_Requestor_Drop( IFusionSoundStream *thiz ) | |
7315 | return ret; | |
7316 | } | |
7317 | ||
7318 | -static DFBResult | |
7319 | +static DirectResult | |
7320 | IFusionSoundStream_Requestor_GetPresentationDelay( IFusionSoundStream *thiz, | |
7321 | int *delay ) | |
7322 | { | |
7323 | @@ -380,7 +380,7 @@ IFusionSoundStream_Requestor_GetPresentationDelay( IFusionSoundStream *thiz, | |
7324 | DIRECT_INTERFACE_GET_DATA(IFusionSoundStream_Requestor) | |
7325 | ||
7326 | if (!delay) | |
7327 | - return DFB_INVARG; | |
7328 | + return DR_INVARG; | |
7329 | ||
7330 | ret = voodoo_manager_request( data->manager, data->instance, | |
7331 | IFUSIONSOUNDSTREAM_METHOD_ID_GetPresentationDelay, VREQ_RESPOND, &response, | |
7332 | @@ -403,7 +403,7 @@ IFusionSoundStream_Requestor_GetPresentationDelay( IFusionSoundStream *thiz, | |
7333 | return ret; | |
7334 | } | |
7335 | ||
7336 | -static DFBResult | |
7337 | +static DirectResult | |
7338 | IFusionSoundStream_Requestor_GetPlayback( IFusionSoundStream *thiz, | |
7339 | IFusionSoundPlayback **ret_interface ) | |
7340 | { | |
7341 | @@ -414,7 +414,7 @@ IFusionSoundStream_Requestor_GetPlayback( IFusionSoundStream *thiz, | |
7342 | DIRECT_INTERFACE_GET_DATA(IFusionSoundStream_Requestor) | |
7343 | ||
7344 | if (!ret_interface) | |
7345 | - return DFB_INVARG; | |
7346 | + return DR_INVARG; | |
7347 | ||
7348 | ret = voodoo_manager_request( data->manager, data->instance, | |
7349 | IFUSIONSOUNDSTREAM_METHOD_ID_GetPlayback, VREQ_RESPOND, &response, | |
7350 | @@ -423,7 +423,7 @@ IFusionSoundStream_Requestor_GetPlayback( IFusionSoundStream *thiz, | |
7351 | return ret; | |
7352 | ||
7353 | ret = response->result; | |
7354 | - if (ret == DFB_OK) | |
7355 | + if (ret == DR_OK) | |
7356 | ret = voodoo_construct_requestor( data->manager, "IFusionSoundPlayback", | |
7357 | response->instance, NULL, &interface ); | |
7358 | ||
7359 | @@ -434,7 +434,7 @@ IFusionSoundStream_Requestor_GetPlayback( IFusionSoundStream *thiz, | |
7360 | return ret; | |
7361 | } | |
7362 | ||
7363 | -static DFBResult | |
7364 | +static DirectResult | |
7365 | IFusionSoundStream_Requestor_Access( IFusionSoundStream *thiz, | |
7366 | void **ret_data, | |
7367 | int *ret_avail ) | |
7368 | @@ -442,7 +442,7 @@ IFusionSoundStream_Requestor_Access( IFusionSoundStream *thiz, | |
7369 | DIRECT_INTERFACE_GET_DATA(IFusionSoundStream_Requestor) | |
7370 | ||
7371 | if (!ret_data || !ret_avail) | |
7372 | - return DFB_INVARG; | |
7373 | + return DR_INVARG; | |
7374 | ||
7375 | if (!data->buffer) | |
7376 | data->buffer = D_MALLOC( data->frames * data->bytes_per_frame ); | |
7377 | @@ -450,31 +450,31 @@ IFusionSoundStream_Requestor_Access( IFusionSoundStream *thiz, | |
7378 | *ret_data = data->buffer; | |
7379 | *ret_avail = data->buffer ? data->frames : 0; | |
7380 | ||
7381 | - return data->buffer ? DFB_OK : DFB_NOSYSTEMMEMORY; | |
7382 | + return data->buffer ? DR_OK : DR_NOLOCALMEMORY; | |
7383 | } | |
7384 | ||
7385 | -static DFBResult | |
7386 | +static DirectResult | |
7387 | IFusionSoundStream_Requestor_Commit( IFusionSoundStream *thiz, | |
7388 | int length ) | |
7389 | { | |
7390 | DIRECT_INTERFACE_GET_DATA(IFusionSoundStream_Requestor) | |
7391 | ||
7392 | if (length < 0 || length > data->frames) | |
7393 | - return DFB_INVARG; | |
7394 | + return DR_INVARG; | |
7395 | ||
7396 | if (length) | |
7397 | return thiz->Write( thiz, data->buffer, length ); | |
7398 | ||
7399 | - return DFB_OK; | |
7400 | + return DR_OK; | |
7401 | } | |
7402 | ||
7403 | /**************************************************************************************************/ | |
7404 | ||
7405 | -static DFBResult | |
7406 | +static DirectResult | |
7407 | Probe() | |
7408 | { | |
7409 | /* This implementation has to be loaded explicitly. */ | |
7410 | - return DFB_UNSUPPORTED; | |
7411 | + return DR_UNSUPPORTED; | |
7412 | } | |
7413 | ||
7414 | /* | |
7415 | @@ -482,7 +482,7 @@ Probe() | |
7416 | * | |
7417 | * Fills in function pointers and intializes data structure. | |
7418 | */ | |
7419 | -static DFBResult | |
7420 | +static DirectResult | |
7421 | Construct( IFusionSoundStream *thiz, | |
7422 | VoodooManager *manager, | |
7423 | VoodooInstanceID instance, | |
7424 | @@ -515,6 +515,6 @@ Construct( IFusionSoundStream *thiz, | |
7425 | thiz->Access = IFusionSoundStream_Requestor_Access; | |
7426 | thiz->Commit = IFusionSoundStream_Requestor_Commit; | |
7427 | ||
7428 | - return DFB_OK; | |
7429 | + return DR_OK; | |
7430 | } | |
7431 | ||
7432 | diff --git a/src/core/core_sound.c b/src/core/core_sound.c | |
7433 | index 449fe49..709732d 100644 | |
7434 | --- a/src/core/core_sound.c | |
7435 | +++ b/src/core/core_sound.c | |
7436 | @@ -149,14 +149,14 @@ static int fs_core_arena_shutdown ( FusionArena *arena, | |
7437 | ||
7438 | /******************************************************************************/ | |
7439 | ||
7440 | -static DFBResult fs_core_detach( CoreSound *core ); | |
7441 | +static DirectResult fs_core_detach( CoreSound *core ); | |
7442 | ||
7443 | /******************************************************************************/ | |
7444 | ||
7445 | static CoreSound *core_sound = NULL; | |
7446 | static pthread_mutex_t core_sound_lock = PTHREAD_MUTEX_INITIALIZER; | |
7447 | ||
7448 | -DFBResult | |
7449 | +DirectResult | |
7450 | fs_core_create( CoreSound **ret_core ) | |
7451 | { | |
7452 | int ret; | |
7453 | @@ -180,14 +180,14 @@ fs_core_create( CoreSound **ret_core ) | |
7454 | /* Unlock the core singleton mutex. */ | |
7455 | pthread_mutex_unlock( &core_sound_lock ); | |
7456 | ||
7457 | - return DFB_OK; | |
7458 | + return DR_OK; | |
7459 | } | |
7460 | ||
7461 | /* Allocate local core structure. */ | |
7462 | core = D_CALLOC( 1, sizeof(CoreSound) ); | |
7463 | if (!core) { | |
7464 | pthread_mutex_unlock( &core_sound_lock ); | |
7465 | - return DFB_NOSYSTEMMEMORY; | |
7466 | + return DR_NOLOCALMEMORY; | |
7467 | } | |
7468 | ||
7469 | ret = fusion_enter( fs_config->session, FUSIONSOUND_CORE_ABI, FER_ANY, &core->world ); | |
7470 | @@ -222,7 +222,7 @@ fs_core_create( CoreSound **ret_core ) | |
7471 | fusion_exit( core->world, false ); | |
7472 | D_FREE( core ); | |
7473 | pthread_mutex_unlock( &core_sound_lock ); | |
7474 | - return ret ? ret : DFB_FUSION; | |
7475 | + return ret ? ret : DR_FUSION; | |
7476 | } | |
7477 | ||
7478 | if (fs_config->deinit_check) | |
7479 | @@ -234,10 +234,10 @@ fs_core_create( CoreSound **ret_core ) | |
7480 | /* Unlock the core singleton mutex. */ | |
7481 | pthread_mutex_unlock( &core_sound_lock ); | |
7482 | ||
7483 | - return DFB_OK; | |
7484 | + return DR_OK; | |
7485 | } | |
7486 | ||
7487 | -DFBResult | |
7488 | +DirectResult | |
7489 | fs_core_destroy( CoreSound *core, bool emergency ) | |
7490 | { | |
7491 | D_ASSERT( core != NULL ); | |
7492 | @@ -253,7 +253,7 @@ fs_core_destroy( CoreSound *core, bool emergency ) | |
7493 | /* Unlock the core singleton mutex. */ | |
7494 | pthread_mutex_unlock( &core_sound_lock ); | |
7495 | ||
7496 | - return DFB_OK; | |
7497 | + return DR_OK; | |
7498 | } | |
7499 | ||
7500 | direct_signal_handler_remove( core->signal_handler ); | |
7501 | @@ -264,7 +264,7 @@ fs_core_destroy( CoreSound *core, bool emergency ) | |
7502 | /* Exit the FusionSound core arena. */ | |
7503 | if (fusion_arena_exit( core->arena, fs_core_arena_shutdown, | |
7504 | core->master ? NULL : fs_core_arena_leave, | |
7505 | - core, emergency, NULL ) == DFB_BUSY) | |
7506 | + core, emergency, NULL ) == DR_BUSY) | |
7507 | { | |
7508 | if (core->master) { | |
7509 | if (emergency) { | |
7510 | @@ -281,7 +281,7 @@ fs_core_destroy( CoreSound *core, bool emergency ) | |
7511 | ||
7512 | while (fusion_arena_exit( core->arena, fs_core_arena_shutdown, | |
7513 | core->master ? NULL : fs_core_arena_leave, | |
7514 | - core, emergency, NULL ) == DFB_BUSY) | |
7515 | + core, emergency, NULL ) == DR_BUSY) | |
7516 | { | |
7517 | D_ONCE( "waiting for FusionSound slaves to terminate" ); | |
7518 | usleep( 100000 ); | |
7519 | @@ -303,7 +303,7 @@ fs_core_destroy( CoreSound *core, bool emergency ) | |
7520 | /* Unlock the core singleton mutex. */ | |
7521 | pthread_mutex_unlock( &core_sound_lock ); | |
7522 | ||
7523 | - return DFB_OK; | |
7524 | + return DR_OK; | |
7525 | } | |
7526 | ||
7527 | CoreSoundBuffer * | |
7528 | @@ -370,7 +370,7 @@ fs_core_playlist_unlock( CoreSound *core ) | |
7529 | return fusion_skirmish_dismiss( &core->shared->playlist.lock ); | |
7530 | } | |
7531 | ||
7532 | -DFBResult | |
7533 | +DirectResult | |
7534 | fs_core_add_playback( CoreSound *core, | |
7535 | CorePlayback *playback ) | |
7536 | { | |
7537 | @@ -388,12 +388,12 @@ fs_core_add_playback( CoreSound *core, | |
7538 | /* Allocate playlist entry. */ | |
7539 | entry = SHCALLOC( shared->shmpool, 1, sizeof(CorePlaylistEntry) ); | |
7540 | if (!entry) | |
7541 | - return DFB_NOSYSTEMMEMORY; | |
7542 | + return DR_NOLOCALMEMORY; | |
7543 | ||
7544 | /* Link playback to playlist entry. */ | |
7545 | if (fs_playback_link( &entry->playback, playback )) { | |
7546 | SHFREE( shared->shmpool, entry ); | |
7547 | - return DFB_FUSION; | |
7548 | + return DR_FUSION; | |
7549 | } | |
7550 | ||
7551 | /* Add it to the playback list. */ | |
7552 | @@ -402,10 +402,10 @@ fs_core_add_playback( CoreSound *core, | |
7553 | /* Notify new playlist entry to the sound thread. */ | |
7554 | fusion_skirmish_notify( &shared->playlist.lock ); | |
7555 | ||
7556 | - return DFB_OK; | |
7557 | + return DR_OK; | |
7558 | } | |
7559 | ||
7560 | -DFBResult | |
7561 | +DirectResult | |
7562 | fs_core_remove_playback( CoreSound *core, | |
7563 | CorePlayback *playback ) | |
7564 | { | |
7565 | @@ -434,7 +434,7 @@ fs_core_remove_playback( CoreSound *core, | |
7566 | } | |
7567 | } | |
7568 | ||
7569 | - return DFB_OK; | |
7570 | + return DR_OK; | |
7571 | } | |
7572 | ||
7573 | int | |
7574 | @@ -482,11 +482,11 @@ fs_core_device_config( CoreSound *core ) | |
7575 | return &core->shared->config; | |
7576 | } | |
7577 | ||
7578 | -DFBResult | |
7579 | +DirectResult | |
7580 | fs_core_get_master_volume( CoreSound *core, float *level ) | |
7581 | { | |
7582 | CoreSoundShared *shared; | |
7583 | - DFBResult ret; | |
7584 | + DirectResult ret; | |
7585 | int retval; | |
7586 | ||
7587 | D_ASSERT( core != NULL ); | |
7588 | @@ -511,11 +511,11 @@ fs_core_get_master_volume( CoreSound *core, float *level ) | |
7589 | return ret; | |
7590 | } | |
7591 | ||
7592 | -DFBResult | |
7593 | +DirectResult | |
7594 | fs_core_set_master_volume( CoreSound *core, float level ) | |
7595 | { | |
7596 | CoreSoundShared *shared; | |
7597 | - DFBResult ret; | |
7598 | + DirectResult ret; | |
7599 | int retval; | |
7600 | ||
7601 | D_ASSERT( core != NULL ); | |
7602 | @@ -539,7 +539,7 @@ fs_core_set_master_volume( CoreSound *core, float level ) | |
7603 | return ret; | |
7604 | } | |
7605 | ||
7606 | -DFBResult | |
7607 | +DirectResult | |
7608 | fs_core_get_local_volume( CoreSound *core, float *level ) | |
7609 | { | |
7610 | D_ASSERT( core != NULL ); | |
7611 | @@ -551,7 +551,7 @@ fs_core_get_local_volume( CoreSound *core, float *level ) | |
7612 | ||
7613 | pthread_mutex_unlock( &core_sound_lock ); | |
7614 | ||
7615 | - return DFB_OK; | |
7616 | + return DR_OK; | |
7617 | } | |
7618 | ||
7619 | static bool | |
7620 | @@ -569,7 +569,7 @@ volume_callback( FusionObjectPool *pool, FusionObject *object, void *ctx ) | |
7621 | return true; | |
7622 | } | |
7623 | ||
7624 | -DFBResult | |
7625 | +DirectResult | |
7626 | fs_core_set_local_volume( CoreSound *core, float level ) | |
7627 | { | |
7628 | D_ASSERT( core != NULL ); | |
7629 | @@ -583,13 +583,13 @@ fs_core_set_local_volume( CoreSound *core, float level ) | |
7630 | ||
7631 | pthread_mutex_unlock( &core_sound_lock ); | |
7632 | ||
7633 | - return DFB_OK; | |
7634 | + return DR_OK; | |
7635 | } | |
7636 | ||
7637 | -DFBResult | |
7638 | +DirectResult | |
7639 | fs_core_suspend( CoreSound *core ) | |
7640 | { | |
7641 | - DFBResult ret; | |
7642 | + DirectResult ret; | |
7643 | int retval; | |
7644 | ||
7645 | D_ASSERT( core != NULL ); | |
7646 | @@ -603,10 +603,10 @@ fs_core_suspend( CoreSound *core ) | |
7647 | return ret; | |
7648 | } | |
7649 | ||
7650 | -DFBResult | |
7651 | +DirectResult | |
7652 | fs_core_resume( CoreSound *core ) | |
7653 | { | |
7654 | - DFBResult ret; | |
7655 | + DirectResult ret; | |
7656 | int retval; | |
7657 | ||
7658 | D_ASSERT( core != NULL ); | |
7659 | @@ -645,7 +645,7 @@ fs_core_signal_handler( int num, void *addr, void *ctx ) | |
7660 | ||
7661 | fs_core_destroy( core, true ); | |
7662 | ||
7663 | - return DFB_OK; | |
7664 | + return DR_OK; | |
7665 | } | |
7666 | ||
7667 | /******************************************************************************/ | |
7668 | @@ -878,7 +878,7 @@ sound_thread( DirectThread *thread, void *arg ) | |
7669 | } | |
7670 | ||
7671 | direct_list_foreach_safe (l, next, shared->playlist.entries) { | |
7672 | - DFBResult ret; | |
7673 | + DirectResult ret; | |
7674 | CorePlaylistEntry *entry = (CorePlaylistEntry *) l; | |
7675 | CorePlayback *playback = entry->playback; | |
7676 | int num; | |
7677 | @@ -996,41 +996,41 @@ core_call_handler( int caller, int call_arg, void *call_ptr, | |
7678 | switch (call_arg) { | |
7679 | case CSCID_GET_VOLUME: | |
7680 | if (core->suspended) { | |
7681 | - *retval = DFB_SUSPENDED; | |
7682 | + *retval = DR_SUSPENDED; | |
7683 | } | |
7684 | else { | |
7685 | if (!(fs_device_get_capabilities( core->device ) & DCF_VOLUME) || | |
7686 | - fs_device_get_volume( core->device, &volume ) != DFB_OK) | |
7687 | + fs_device_get_volume( core->device, &volume ) != DR_OK) | |
7688 | volume = fsf_to_float( shared->soft_volume ); | |
7689 | ||
7690 | *((float*)call_ptr) = volume; | |
7691 | ||
7692 | - *retval = DFB_OK; | |
7693 | + *retval = DR_OK; | |
7694 | } | |
7695 | break; | |
7696 | ||
7697 | case CSCID_SET_VOLUME: | |
7698 | if (core->suspended) { | |
7699 | - *retval = DFB_SUSPENDED; | |
7700 | + *retval = DR_SUSPENDED; | |
7701 | } | |
7702 | else { | |
7703 | volume = *((float*)call_ptr); | |
7704 | if (!(fs_device_get_capabilities( core->device ) & DCF_VOLUME) || | |
7705 | - fs_device_set_volume( core->device, volume ) != DFB_OK) | |
7706 | + fs_device_set_volume( core->device, volume ) != DR_OK) | |
7707 | shared->soft_volume = fsf_from_float( volume ); | |
7708 | else | |
7709 | shared->soft_volume = FSF_ONE; | |
7710 | ||
7711 | - *retval = DFB_OK; | |
7712 | + *retval = DR_OK; | |
7713 | } | |
7714 | break; | |
7715 | ||
7716 | case CSCID_SUSPEND: | |
7717 | if (core->suspended) { | |
7718 | - *retval = DFB_BUSY; | |
7719 | + *retval = DR_BUSY; | |
7720 | } | |
7721 | else { | |
7722 | - DFBResult ret; | |
7723 | + DirectResult ret; | |
7724 | ||
7725 | direct_thread_cancel( core->sound_thread ); | |
7726 | direct_thread_join( core->sound_thread ); | |
7727 | @@ -1047,16 +1047,16 @@ core_call_handler( int caller, int call_arg, void *call_ptr, | |
7728 | ||
7729 | core->suspended = true; | |
7730 | ||
7731 | - *retval = DFB_OK; | |
7732 | + *retval = DR_OK; | |
7733 | } | |
7734 | break; | |
7735 | ||
7736 | case CSCID_RESUME: | |
7737 | if (!core->suspended) { | |
7738 | - *retval = DFB_BUSY; | |
7739 | + *retval = DR_BUSY; | |
7740 | } | |
7741 | else { | |
7742 | - DFBResult ret; | |
7743 | + DirectResult ret; | |
7744 | ||
7745 | ret = fs_device_resume( core->device ); | |
7746 | if (ret) { | |
7747 | @@ -1068,7 +1068,7 @@ core_call_handler( int caller, int call_arg, void *call_ptr, | |
7748 | ||
7749 | core->suspended = false; | |
7750 | ||
7751 | - *retval = DFB_OK; | |
7752 | + *retval = DR_OK; | |
7753 | } | |
7754 | break; | |
7755 | ||
7756 | @@ -1080,11 +1080,11 @@ core_call_handler( int caller, int call_arg, void *call_ptr, | |
7757 | return FCHR_RETURN; | |
7758 | } | |
7759 | ||
7760 | -static DFBResult | |
7761 | +static DirectResult | |
7762 | fs_core_initialize( CoreSound *core ) | |
7763 | { | |
7764 | CoreSoundShared *shared = core->shared; | |
7765 | - DFBResult ret; | |
7766 | + DirectResult ret; | |
7767 | ||
7768 | /* Set default device configuration. */ | |
7769 | shared->config.mode = fs_config->channelmode; | |
7770 | @@ -1130,26 +1130,26 @@ fs_core_initialize( CoreSound *core ) | |
7771 | /* Start sound mixer. */ | |
7772 | core->sound_thread = direct_thread_create( DTT_OUTPUT, sound_thread, core, "Sound Mixer" ); | |
7773 | ||
7774 | - return DFB_OK; | |
7775 | + return DR_OK; | |
7776 | } | |
7777 | ||
7778 | -static DFBResult | |
7779 | +static DirectResult | |
7780 | fs_core_join( CoreSound *core ) | |
7781 | { | |
7782 | /* really nothing to be done here, yet ;) */ | |
7783 | ||
7784 | - return DFB_OK; | |
7785 | + return DR_OK; | |
7786 | } | |
7787 | ||
7788 | -static DFBResult | |
7789 | +static DirectResult | |
7790 | fs_core_leave( CoreSound *core ) | |
7791 | { | |
7792 | /* really nothing to be done here, yet ;) */ | |
7793 | ||
7794 | - return DFB_OK; | |
7795 | + return DR_OK; | |
7796 | } | |
7797 | ||
7798 | -static DFBResult | |
7799 | +static DirectResult | |
7800 | fs_core_shutdown( CoreSound *core, bool local ) | |
7801 | { | |
7802 | DirectLink *l, *next; | |
7803 | @@ -1204,10 +1204,10 @@ fs_core_shutdown( CoreSound *core, bool local ) | |
7804 | /* Release mixing buffer. */ | |
7805 | D_FREE( core->mixing_buffer ); | |
7806 | ||
7807 | - return DFB_OK; | |
7808 | + return DR_OK; | |
7809 | } | |
7810 | ||
7811 | -static DFBResult | |
7812 | +static DirectResult | |
7813 | fs_core_detach( CoreSound *core ) | |
7814 | { | |
7815 | int ret; | |
7816 | @@ -1226,7 +1226,7 @@ fs_core_detach( CoreSound *core ) | |
7817 | D_PERROR( "fork()" ); | |
7818 | fusion_kill( core->world, 0, SIGTERM, 5000 ); | |
7819 | fusion_kill( core->world, 0, SIGKILL, 2000 ); | |
7820 | - return DFB_FAILURE; | |
7821 | + return DR_FAILURE; | |
7822 | ||
7823 | case 0: | |
7824 | D_DEBUG( "FusionSound/Core: ... detached.\n" ); | |
7825 | @@ -1243,7 +1243,7 @@ fs_core_detach( CoreSound *core ) | |
7826 | break; | |
7827 | } | |
7828 | ||
7829 | - return DFB_OK; | |
7830 | + return DR_OK; | |
7831 | } | |
7832 | ||
7833 | ||
7834 | @@ -1253,7 +1253,7 @@ static int | |
7835 | fs_core_arena_initialize( FusionArena *arena, | |
7836 | void *ctx ) | |
7837 | { | |
7838 | - DFBResult ret; | |
7839 | + DirectResult ret; | |
7840 | CoreSound *core = ctx; | |
7841 | CoreSoundShared *shared; | |
7842 | FusionSHMPoolShared *pool; | |
7843 | @@ -1289,7 +1289,7 @@ fs_core_arena_initialize( FusionArena *arena, | |
7844 | /* Register shared data. */ | |
7845 | fusion_arena_add_shared_field( arena, "Core/Shared", shared ); | |
7846 | ||
7847 | - return DFB_OK; | |
7848 | + return DR_OK; | |
7849 | } | |
7850 | ||
7851 | static int | |
7852 | @@ -1297,7 +1297,7 @@ fs_core_arena_shutdown( FusionArena *arena, | |
7853 | void *ctx, | |
7854 | bool emergency) | |
7855 | { | |
7856 | - DFBResult ret; | |
7857 | + DirectResult ret; | |
7858 | CoreSound *core = ctx; | |
7859 | CoreSoundShared *shared; | |
7860 | FusionSHMPoolShared *pool; | |
7861 | @@ -1322,14 +1322,14 @@ fs_core_arena_shutdown( FusionArena *arena, | |
7862 | ||
7863 | fusion_shm_pool_destroy( core->world, pool ); | |
7864 | ||
7865 | - return DFB_OK; | |
7866 | + return DR_OK; | |
7867 | } | |
7868 | ||
7869 | static int | |
7870 | fs_core_arena_join( FusionArena *arena, | |
7871 | void *ctx ) | |
7872 | { | |
7873 | - DFBResult ret; | |
7874 | + DirectResult ret; | |
7875 | CoreSound *core = ctx; | |
7876 | CoreSoundShared *shared; | |
7877 | ||
7878 | @@ -1337,7 +1337,7 @@ fs_core_arena_join( FusionArena *arena, | |
7879 | ||
7880 | /* Get shared data. */ | |
7881 | if (fusion_arena_get_shared_field( arena, "Core/Shared", (void*)&shared )) | |
7882 | - return DFB_FUSION; | |
7883 | + return DR_FUSION; | |
7884 | ||
7885 | core->shared = shared; | |
7886 | ||
7887 | @@ -1346,7 +1346,7 @@ fs_core_arena_join( FusionArena *arena, | |
7888 | if (ret) | |
7889 | return ret; | |
7890 | ||
7891 | - return DFB_OK; | |
7892 | + return DR_OK; | |
7893 | } | |
7894 | ||
7895 | static int | |
7896 | @@ -1354,7 +1354,7 @@ fs_core_arena_leave( FusionArena *arena, | |
7897 | void *ctx, | |
7898 | bool emergency) | |
7899 | { | |
7900 | - DFBResult ret; | |
7901 | + DirectResult ret; | |
7902 | CoreSound *core = ctx; | |
7903 | ||
7904 | D_DEBUG( "FusionSound/Core: Leaving...\n" ); | |
7905 | @@ -1364,6 +1364,6 @@ fs_core_arena_leave( FusionArena *arena, | |
7906 | if (ret) | |
7907 | return ret; | |
7908 | ||
7909 | - return DFB_OK; | |
7910 | + return DR_OK; | |
7911 | } | |
7912 | ||
7913 | diff --git a/src/core/core_sound.h b/src/core/core_sound.h | |
7914 | index 496e710..490c74c 100644 | |
7915 | --- a/src/core/core_sound.h | |
7916 | +++ b/src/core/core_sound.h | |
7917 | @@ -40,8 +40,8 @@ | |
7918 | /* | |
7919 | * Core initialization and deinitialization | |
7920 | */ | |
7921 | -DFBResult fs_core_create ( CoreSound **ret_core ); | |
7922 | -DFBResult fs_core_destroy( CoreSound *core, bool emergency ); | |
7923 | +DirectResult fs_core_create ( CoreSound **ret_core ); | |
7924 | +DirectResult fs_core_destroy( CoreSound *core, bool emergency ); | |
7925 | ||
7926 | /* | |
7927 | * Object creation | |
7928 | @@ -52,12 +52,12 @@ CorePlayback *fs_core_create_playback( CoreSound *core ); | |
7929 | /* | |
7930 | * Object enumeration | |
7931 | */ | |
7932 | -DirectResult fs_core_enum_buffers ( CoreSound *core, | |
7933 | - FusionObjectCallback callback, | |
7934 | - void *ctx ); | |
7935 | -DirectResult fs_core_enum_playbacks ( CoreSound *core, | |
7936 | - FusionObjectCallback callback, | |
7937 | - void *ctx ); | |
7938 | +DirectResult fs_core_enum_buffers ( CoreSound *core, | |
7939 | + FusionObjectCallback callback, | |
7940 | + void *ctx ); | |
7941 | +DirectResult fs_core_enum_playbacks ( CoreSound *core, | |
7942 | + FusionObjectCallback callback, | |
7943 | + void *ctx ); | |
7944 | ||
7945 | /* | |
7946 | * Playback list management | |
7947 | @@ -65,11 +65,11 @@ DirectResult fs_core_enum_playbacks ( CoreSound *core, | |
7948 | DirectResult fs_core_playlist_lock ( CoreSound *core ); | |
7949 | DirectResult fs_core_playlist_unlock( CoreSound *core ); | |
7950 | ||
7951 | -DFBResult fs_core_add_playback ( CoreSound *core, | |
7952 | - CorePlayback *playback ); | |
7953 | +DirectResult fs_core_add_playback ( CoreSound *core, | |
7954 | + CorePlayback *playback ); | |
7955 | ||
7956 | -DFBResult fs_core_remove_playback( CoreSound *core, | |
7957 | - CorePlayback *playback ); | |
7958 | +DirectResult fs_core_remove_playback( CoreSound *core, | |
7959 | + CorePlayback *playback ); | |
7960 | ||
7961 | /* | |
7962 | * Returns the amount of audio data buffered by the device in ms. | |
7963 | @@ -99,32 +99,32 @@ CoreSoundDeviceConfig *fs_core_device_config( CoreSound *core ); | |
7964 | /* | |
7965 | * Returns the master volume. | |
7966 | */ | |
7967 | -DFBResult fs_core_get_master_volume( CoreSound *core, float *level ); | |
7968 | +DirectResult fs_core_get_master_volume( CoreSound *core, float *level ); | |
7969 | ||
7970 | /* | |
7971 | * Sets the master volume. | |
7972 | */ | |
7973 | -DFBResult fs_core_set_master_volume( CoreSound *core, float level ); | |
7974 | +DirectResult fs_core_set_master_volume( CoreSound *core, float level ); | |
7975 | ||
7976 | /* | |
7977 | * Returns the local volume. | |
7978 | */ | |
7979 | -DFBResult fs_core_get_local_volume( CoreSound *core, float *level ); | |
7980 | +DirectResult fs_core_get_local_volume( CoreSound *core, float *level ); | |
7981 | ||
7982 | /* | |
7983 | * Sets the local volume. | |
7984 | */ | |
7985 | -DFBResult fs_core_set_local_volume( CoreSound *core, float level ); | |
7986 | +DirectResult fs_core_set_local_volume( CoreSound *core, float level ); | |
7987 | ||
7988 | /* | |
7989 | * Suspends playback. | |
7990 | */ | |
7991 | -DFBResult fs_core_suspend( CoreSound *core ); | |
7992 | +DirectResult fs_core_suspend( CoreSound *core ); | |
7993 | ||
7994 | /* | |
7995 | * Resumes playback. | |
7996 | */ | |
7997 | -DFBResult fs_core_resume( CoreSound *core ); | |
7998 | +DirectResult fs_core_resume( CoreSound *core ); | |
7999 | ||
8000 | ||
8001 | #endif | |
8002 | diff --git a/src/core/playback.c b/src/core/playback.c | |
8003 | index 5d8a639..a0b0b18 100644 | |
8004 | --- a/src/core/playback.c | |
8005 | +++ b/src/core/playback.c | |
8006 | @@ -97,7 +97,7 @@ fs_playback_pool_create( const FusionWorld *world ) | |
8007 | ||
8008 | /******************************************************************************/ | |
8009 | ||
8010 | -DFBResult | |
8011 | +DirectResult | |
8012 | fs_playback_create( CoreSound *core, | |
8013 | CoreSoundBuffer *buffer, | |
8014 | bool notify, | |
8015 | @@ -115,12 +115,12 @@ fs_playback_create( CoreSound *core, | |
8016 | /* Create playback object. */ | |
8017 | playback = fs_core_create_playback( core ); | |
8018 | if (!playback) | |
8019 | - return DFB_FUSION; | |
8020 | + return DR_FUSION; | |
8021 | ||
8022 | /* Link buffer to playback object. */ | |
8023 | if (fs_buffer_link( &playback->buffer, buffer )) { | |
8024 | fusion_object_destroy( &playback->object ); | |
8025 | - return DFB_FUSION; | |
8026 | + return DR_FUSION; | |
8027 | } | |
8028 | ||
8029 | fusion_skirmish_init( &playback->lock, "FusionSound Playback", fs_core_world(core) ); | |
8030 | @@ -151,20 +151,20 @@ fs_playback_create( CoreSound *core, | |
8031 | /* Return playback object. */ | |
8032 | *ret_playback = playback; | |
8033 | ||
8034 | - return DFB_OK; | |
8035 | + return DR_OK; | |
8036 | } | |
8037 | ||
8038 | -DFBResult | |
8039 | +DirectResult | |
8040 | fs_playback_enable( CorePlayback *playback ) | |
8041 | { | |
8042 | - DFBResult ret = DFB_OK; | |
8043 | + DirectResult ret = DR_OK; | |
8044 | ||
8045 | D_ASSERT( playback != NULL ); | |
8046 | D_ASSERT( playback->buffer != NULL ); | |
8047 | ||
8048 | /* Lock playback. */ | |
8049 | if (fusion_skirmish_prevail( &playback->lock )) | |
8050 | - return DFB_FUSION; | |
8051 | + return DR_FUSION; | |
8052 | ||
8053 | /* Enable playback. */ | |
8054 | playback->disabled = false; | |
8055 | @@ -175,22 +175,22 @@ fs_playback_enable( CorePlayback *playback ) | |
8056 | return ret; | |
8057 | } | |
8058 | ||
8059 | -DFBResult | |
8060 | +DirectResult | |
8061 | fs_playback_start( CorePlayback *playback, bool enable ) | |
8062 | { | |
8063 | - DFBResult ret = DFB_OK; | |
8064 | + DirectResult ret = DR_OK; | |
8065 | ||
8066 | D_ASSERT( playback != NULL ); | |
8067 | D_ASSERT( playback->buffer != NULL ); | |
8068 | ||
8069 | /* Lock playlist. */ | |
8070 | if (fs_core_playlist_lock( playback->core )) | |
8071 | - return DFB_FUSION; | |
8072 | + return DR_FUSION; | |
8073 | ||
8074 | /* Lock playback. */ | |
8075 | if (fusion_skirmish_prevail( &playback->lock )) { | |
8076 | fs_core_playlist_unlock( playback->core ); | |
8077 | - return DFB_FUSION; | |
8078 | + return DR_FUSION; | |
8079 | } | |
8080 | ||
8081 | /* If the playback is disabled, it won't begin to play. */ | |
8082 | @@ -200,13 +200,13 @@ fs_playback_start( CorePlayback *playback, bool enable ) | |
8083 | /* Start the playback if it's not running already. */ | |
8084 | if (!playback->running) { | |
8085 | if (playback->disabled) { | |
8086 | - ret = DFB_TEMPUNAVAIL; | |
8087 | + ret = DR_TEMPUNAVAIL; | |
8088 | } | |
8089 | else { | |
8090 | ret = fs_core_add_playback( playback->core, playback ); | |
8091 | ||
8092 | /* Notify listeners about the start of the playback. */ | |
8093 | - if (ret == DFB_OK) | |
8094 | + if (ret == DR_OK) | |
8095 | fs_playback_notify( playback, CPNF_START, 0 ); | |
8096 | } | |
8097 | } | |
8098 | @@ -220,19 +220,19 @@ fs_playback_start( CorePlayback *playback, bool enable ) | |
8099 | return ret; | |
8100 | } | |
8101 | ||
8102 | -DFBResult | |
8103 | +DirectResult | |
8104 | fs_playback_stop( CorePlayback *playback, bool disable ) | |
8105 | { | |
8106 | D_ASSERT( playback != NULL ); | |
8107 | ||
8108 | /* Lock playlist. */ | |
8109 | if (fs_core_playlist_lock( playback->core )) | |
8110 | - return DFB_FUSION; | |
8111 | + return DR_FUSION; | |
8112 | ||
8113 | /* Lock playback. */ | |
8114 | if (fusion_skirmish_prevail( &playback->lock )) { | |
8115 | fs_core_playlist_unlock( playback->core ); | |
8116 | - return DFB_FUSION; | |
8117 | + return DR_FUSION; | |
8118 | } | |
8119 | ||
8120 | /* Stop the playback if it's running. */ | |
8121 | @@ -253,10 +253,10 @@ fs_playback_stop( CorePlayback *playback, bool disable ) | |
8122 | /* Unlock playlist. */ | |
8123 | fs_core_playlist_unlock( playback->core ); | |
8124 | ||
8125 | - return DFB_OK; | |
8126 | + return DR_OK; | |
8127 | } | |
8128 | ||
8129 | -DFBResult | |
8130 | +DirectResult | |
8131 | fs_playback_set_stop( CorePlayback *playback, | |
8132 | int stop ) | |
8133 | { | |
8134 | @@ -266,7 +266,7 @@ fs_playback_set_stop( CorePlayback *playback, | |
8135 | ||
8136 | /* Lock playback. */ | |
8137 | if (fusion_skirmish_prevail( &playback->lock )) | |
8138 | - return DFB_FUSION; | |
8139 | + return DR_FUSION; | |
8140 | ||
8141 | /* Adjust stop position. */ | |
8142 | playback->stop = stop; | |
8143 | @@ -274,10 +274,10 @@ fs_playback_set_stop( CorePlayback *playback, | |
8144 | /* Unlock playback. */ | |
8145 | fusion_skirmish_dismiss( &playback->lock ); | |
8146 | ||
8147 | - return DFB_OK; | |
8148 | + return DR_OK; | |
8149 | } | |
8150 | ||
8151 | -DFBResult | |
8152 | +DirectResult | |
8153 | fs_playback_set_position( CorePlayback *playback, | |
8154 | int position ) | |
8155 | { | |
8156 | @@ -288,7 +288,7 @@ fs_playback_set_position( CorePlayback *playback, | |
8157 | ||
8158 | /* Lock playback. */ | |
8159 | if (fusion_skirmish_prevail( &playback->lock )) | |
8160 | - return DFB_FUSION; | |
8161 | + return DR_FUSION; | |
8162 | ||
8163 | /* Adjust the playback position. */ | |
8164 | playback->position = position; | |
8165 | @@ -296,10 +296,10 @@ fs_playback_set_position( CorePlayback *playback, | |
8166 | /* Unlock playback. */ | |
8167 | fusion_skirmish_dismiss( &playback->lock ); | |
8168 | ||
8169 | - return DFB_OK; | |
8170 | + return DR_OK; | |
8171 | } | |
8172 | ||
8173 | -DFBResult | |
8174 | +DirectResult | |
8175 | fs_playback_set_downmix( CorePlayback *playback, | |
8176 | float center, | |
8177 | float rear ) | |
8178 | @@ -315,7 +315,7 @@ fs_playback_set_downmix( CorePlayback *playback, | |
8179 | ||
8180 | /* Lock playback. */ | |
8181 | if (fusion_skirmish_prevail( &playback->lock )) | |
8182 | - return DFB_FUSION; | |
8183 | + return DR_FUSION; | |
8184 | ||
8185 | buffer = playback->buffer; | |
8186 | config = fs_core_device_config( playback->core ); | |
8187 | @@ -335,10 +335,10 @@ fs_playback_set_downmix( CorePlayback *playback, | |
8188 | /* Unlock playback. */ | |
8189 | fusion_skirmish_dismiss( &playback->lock ); | |
8190 | ||
8191 | - return DFB_OK; | |
8192 | + return DR_OK; | |
8193 | } | |
8194 | ||
8195 | -DFBResult | |
8196 | +DirectResult | |
8197 | fs_playback_set_volume( CorePlayback *playback, | |
8198 | float levels[6] ) | |
8199 | { | |
8200 | @@ -352,7 +352,7 @@ fs_playback_set_volume( CorePlayback *playback, | |
8201 | ||
8202 | /* Lock playback. */ | |
8203 | if (fusion_skirmish_prevail( &playback->lock )) | |
8204 | - return DFB_FUSION; | |
8205 | + return DR_FUSION; | |
8206 | ||
8207 | /* Adjust volume. */ | |
8208 | for (i = 0; i < 6; i++) | |
8209 | @@ -370,10 +370,10 @@ fs_playback_set_volume( CorePlayback *playback, | |
8210 | /* Unlock playback. */ | |
8211 | fusion_skirmish_dismiss( &playback->lock ); | |
8212 | ||
8213 | - return DFB_OK; | |
8214 | + return DR_OK; | |
8215 | } | |
8216 | ||
8217 | -DFBResult | |
8218 | +DirectResult | |
8219 | fs_playback_set_local_volume( CorePlayback *playback, | |
8220 | float level ) | |
8221 | { | |
8222 | @@ -383,7 +383,7 @@ fs_playback_set_local_volume( CorePlayback *playback, | |
8223 | ||
8224 | /* Lock playback. */ | |
8225 | if (fusion_skirmish_prevail( &playback->lock )) | |
8226 | - return DFB_FUSION; | |
8227 | + return DR_FUSION; | |
8228 | ||
8229 | /* Set local volume level. */ | |
8230 | playback->volume = fsf_from_float( level ); | |
8231 | @@ -391,10 +391,10 @@ fs_playback_set_local_volume( CorePlayback *playback, | |
8232 | /* Unlock playback. */ | |
8233 | fusion_skirmish_dismiss( &playback->lock ); | |
8234 | ||
8235 | - return DFB_OK; | |
8236 | + return DR_OK; | |
8237 | } | |
8238 | ||
8239 | -DFBResult | |
8240 | +DirectResult | |
8241 | fs_playback_set_pitch( CorePlayback *playback, | |
8242 | int pitch ) | |
8243 | { | |
8244 | @@ -404,7 +404,7 @@ fs_playback_set_pitch( CorePlayback *playback, | |
8245 | ||
8246 | /* Lock playback. */ | |
8247 | if (fusion_skirmish_prevail( &playback->lock )) | |
8248 | - return DFB_FUSION; | |
8249 | + return DR_FUSION; | |
8250 | ||
8251 | /* Adjust pitch. */ | |
8252 | playback->pitch = pitch; | |
8253 | @@ -412,10 +412,10 @@ fs_playback_set_pitch( CorePlayback *playback, | |
8254 | /* Unlock playback. */ | |
8255 | fusion_skirmish_dismiss( &playback->lock ); | |
8256 | ||
8257 | - return DFB_OK; | |
8258 | + return DR_OK; | |
8259 | } | |
8260 | ||
8261 | -DFBResult | |
8262 | +DirectResult | |
8263 | fs_playback_get_status( CorePlayback *playback, | |
8264 | CorePlaybackStatus *ret_status, | |
8265 | int *ret_position ) | |
8266 | @@ -424,7 +424,7 @@ fs_playback_get_status( CorePlayback *playback, | |
8267 | ||
8268 | /* Lock playback. */ | |
8269 | if (fusion_skirmish_prevail( &playback->lock )) | |
8270 | - return DFB_FUSION; | |
8271 | + return DR_FUSION; | |
8272 | ||
8273 | /* Return status. */ | |
8274 | if (ret_status) { | |
8275 | @@ -447,12 +447,12 @@ fs_playback_get_status( CorePlayback *playback, | |
8276 | /* Unlock playback. */ | |
8277 | fusion_skirmish_dismiss( &playback->lock ); | |
8278 | ||
8279 | - return DFB_OK; | |
8280 | + return DR_OK; | |
8281 | } | |
8282 | ||
8283 | /******************************************************************************/ | |
8284 | ||
8285 | -DFBResult | |
8286 | +DirectResult | |
8287 | fs_playback_mixto( CorePlayback *playback, | |
8288 | __fsf *dest, | |
8289 | int dest_rate, | |
8290 | @@ -461,7 +461,7 @@ fs_playback_mixto( CorePlayback *playback, | |
8291 | __fsf volume, | |
8292 | int *ret_samples) | |
8293 | { | |
8294 | - DFBResult ret; | |
8295 | + DirectResult ret; | |
8296 | int pos; | |
8297 | int num; | |
8298 | __fsf *levels; | |
8299 | @@ -474,7 +474,7 @@ fs_playback_mixto( CorePlayback *playback, | |
8300 | ||
8301 | /* Lock playback. */ | |
8302 | if (fusion_skirmish_prevail( &playback->lock )) | |
8303 | - return DFB_FUSION; | |
8304 | + return DR_FUSION; | |
8305 | ||
8306 | if (volume != FSF_ONE || playback->volume != FSF_ONE) { | |
8307 | levels = alloca( 6 * sizeof(__fsf) ); | |
8308 | diff --git a/src/core/playback.h b/src/core/playback.h | |
8309 | index 6c5d05b..33cc652 100644 | |
8310 | --- a/src/core/playback.h | |
8311 | +++ b/src/core/playback.h | |
8312 | @@ -74,47 +74,47 @@ FusionObjectPool *fs_playback_pool_create( const FusionWorld *world ); | |
8313 | FUSION_OBJECT_METHODS( CorePlayback, fs_playback ) | |
8314 | ||
8315 | ||
8316 | -DFBResult fs_playback_create ( CoreSound *core, | |
8317 | +DirectResult fs_playback_create ( CoreSound *core, | |
8318 | CoreSoundBuffer *buffer, | |
8319 | bool notify, | |
8320 | CorePlayback **ret_playback ); | |
8321 | ||
8322 | -DFBResult fs_playback_enable ( CorePlayback *playback ); | |
8323 | +DirectResult fs_playback_enable ( CorePlayback *playback ); | |
8324 | ||
8325 | -DFBResult fs_playback_start ( CorePlayback *playback, | |
8326 | +DirectResult fs_playback_start ( CorePlayback *playback, | |
8327 | bool enable ); | |
8328 | ||
8329 | -DFBResult fs_playback_stop ( CorePlayback *playback, | |
8330 | +DirectResult fs_playback_stop ( CorePlayback *playback, | |
8331 | bool disable ); | |
8332 | ||
8333 | -DFBResult fs_playback_set_stop ( CorePlayback *playback, | |
8334 | +DirectResult fs_playback_set_stop ( CorePlayback *playback, | |
8335 | int stop ); | |
8336 | ||
8337 | -DFBResult fs_playback_set_position( CorePlayback *playback, | |
8338 | +DirectResult fs_playback_set_position( CorePlayback *playback, | |
8339 | int position ); | |
8340 | ||
8341 | /* Must call fs_playback_set_volume() after this. */ | |
8342 | -DFBResult fs_playback_set_downmix ( CorePlayback *playback, | |
8343 | +DirectResult fs_playback_set_downmix ( CorePlayback *playback, | |
8344 | float center, | |
8345 | float rear ); | |
8346 | ||
8347 | -DFBResult fs_playback_set_volume ( CorePlayback *playback, | |
8348 | +DirectResult fs_playback_set_volume ( CorePlayback *playback, | |
8349 | float levels[6] ); | |
8350 | ||
8351 | -DFBResult fs_playback_set_local_volume( CorePlayback *playback, | |
8352 | +DirectResult fs_playback_set_local_volume( CorePlayback *playback, | |
8353 | float level ); | |
8354 | ||
8355 | -DFBResult fs_playback_set_pitch ( CorePlayback *playback, | |
8356 | +DirectResult fs_playback_set_pitch ( CorePlayback *playback, | |
8357 | int pitch ); | |
8358 | ||
8359 | -DFBResult fs_playback_get_status ( CorePlayback *playback, | |
8360 | +DirectResult fs_playback_get_status ( CorePlayback *playback, | |
8361 | CorePlaybackStatus *ret_status, | |
8362 | int *ret_position ); | |
8363 | ||
8364 | /* | |
8365 | * Internally called by core_sound.c in the audio thread. | |
8366 | */ | |
8367 | -DFBResult fs_playback_mixto ( CorePlayback *playback, | |
8368 | +DirectResult fs_playback_mixto ( CorePlayback *playback, | |
8369 | __fsf *dest, | |
8370 | int dest_rate, | |
8371 | FSChannelMode dest_mode, | |
8372 | diff --git a/src/core/sound_buffer.c b/src/core/sound_buffer.c | |
8373 | index e4e2a0d..6fb6829 100644 | |
8374 | --- a/src/core/sound_buffer.c | |
8375 | +++ b/src/core/sound_buffer.c | |
8376 | @@ -66,7 +66,7 @@ fs_buffer_pool_create( const FusionWorld *world ) | |
8377 | ||
8378 | /******************************************************************************/ | |
8379 | ||
8380 | -DFBResult | |
8381 | +DirectResult | |
8382 | fs_buffer_create( CoreSound *core, | |
8383 | int length, | |
8384 | FSChannelMode mode, | |
8385 | @@ -96,12 +96,12 @@ fs_buffer_create( CoreSound *core, | |
8386 | ||
8387 | buffer = fs_core_create_buffer( core ); | |
8388 | if (!buffer) | |
8389 | - return DFB_FUSION; | |
8390 | + return DR_FUSION; | |
8391 | ||
8392 | buffer->data = SHMALLOC( pool, length * bytes * channels ); | |
8393 | if (!buffer->data) { | |
8394 | fusion_object_destroy( &buffer->object ); | |
8395 | - return DFB_NOSYSTEMMEMORY; | |
8396 | + return DR_NOLOCALMEMORY; | |
8397 | } | |
8398 | ||
8399 | buffer->length = length; | |
8400 | @@ -115,10 +115,10 @@ fs_buffer_create( CoreSound *core, | |
8401 | ||
8402 | *ret_buffer = buffer; | |
8403 | ||
8404 | - return DFB_OK; | |
8405 | + return DR_OK; | |
8406 | } | |
8407 | ||
8408 | -DFBResult | |
8409 | +DirectResult | |
8410 | fs_buffer_lock( CoreSoundBuffer *buffer, | |
8411 | int pos, | |
8412 | int length, | |
8413 | @@ -142,17 +142,17 @@ fs_buffer_lock( CoreSoundBuffer *buffer, | |
8414 | *ret_data = buffer->data + buffer->bytes * pos; | |
8415 | *ret_bytes = buffer->bytes * length; | |
8416 | ||
8417 | - return DFB_OK; | |
8418 | + return DR_OK; | |
8419 | } | |
8420 | ||
8421 | -DFBResult | |
8422 | +DirectResult | |
8423 | fs_buffer_unlock( CoreSoundBuffer *buffer ) | |
8424 | { | |
8425 | D_ASSERT( buffer != NULL ); | |
8426 | ||
8427 | D_DEBUG( "FusionSound/Core: %s (%p)\n", __FUNCTION__, buffer ); | |
8428 | ||
8429 | - return DFB_OK; | |
8430 | + return DR_OK; | |
8431 | } | |
8432 | ||
8433 | /******************************************************************************/ | |
8434 | @@ -299,7 +299,7 @@ static const SoundMXFunc MIX_RW[FS_NUM_SAMPLEFORMATS][FS_MAX_CHANNELS] = { | |
8435 | }; | |
8436 | ||
8437 | ||
8438 | -DFBResult | |
8439 | +DirectResult | |
8440 | fs_buffer_mixto( CoreSoundBuffer *buffer, | |
8441 | __fsf *dest, | |
8442 | int dest_rate, | |
8443 | @@ -405,6 +405,6 @@ fs_buffer_mixto( CoreSoundBuffer *buffer, | |
8444 | D_DEBUG( "FusionSound/Core: %s ... mixed %d (%d/%d).\n", | |
8445 | __FUNCTION__, ABS(num), len, max_frames ); | |
8446 | ||
8447 | - return last ? DFB_BUFFEREMPTY : DFB_OK; | |
8448 | + return last ? DR_BUFFEREMPTY : DR_OK; | |
8449 | } | |
8450 | ||
8451 | diff --git a/src/core/sound_buffer.h b/src/core/sound_buffer.h | |
8452 | index e107839..a23dcf7 100644 | |
8453 | --- a/src/core/sound_buffer.h | |
8454 | +++ b/src/core/sound_buffer.h | |
8455 | @@ -75,22 +75,22 @@ FusionObjectPool *fs_buffer_pool_create( const FusionWorld *world ); | |
8456 | FUSION_OBJECT_METHODS( CoreSoundBuffer, fs_buffer ) | |
8457 | ||
8458 | ||
8459 | -DFBResult fs_buffer_create( CoreSound *core, | |
8460 | +DirectResult fs_buffer_create( CoreSound *core, | |
8461 | int length, | |
8462 | FSChannelMode mode, | |
8463 | FSSampleFormat format, | |
8464 | int rate, | |
8465 | CoreSoundBuffer **ret_buffer ); | |
8466 | ||
8467 | -DFBResult fs_buffer_lock ( CoreSoundBuffer *buffer, | |
8468 | +DirectResult fs_buffer_lock ( CoreSoundBuffer *buffer, | |
8469 | int pos, | |
8470 | int length, | |
8471 | void **ret_data, | |
8472 | int *ret_bytes ); | |
8473 | ||
8474 | -DFBResult fs_buffer_unlock( CoreSoundBuffer *buffer ); | |
8475 | +DirectResult fs_buffer_unlock( CoreSoundBuffer *buffer ); | |
8476 | ||
8477 | -DFBResult fs_buffer_mixto ( CoreSoundBuffer *buffer, | |
8478 | +DirectResult fs_buffer_mixto ( CoreSoundBuffer *buffer, | |
8479 | __fsf *dest, | |
8480 | int dest_rate, | |
8481 | FSChannelMode dest_mode, | |
8482 | diff --git a/src/core/sound_device.c b/src/core/sound_device.c | |
8483 | index 3804e44..b841ae6 100644 | |
8484 | --- a/src/core/sound_device.c | |
8485 | +++ b/src/core/sound_device.c | |
8486 | @@ -54,12 +54,12 @@ struct __FS_CoreSoundDevice { | |
8487 | }; | |
8488 | ||
8489 | ||
8490 | -DFBResult | |
8491 | +DirectResult | |
8492 | fs_device_initialize( CoreSound *core, | |
8493 | CoreSoundDeviceConfig *config, | |
8494 | CoreSoundDevice **ret_device ) | |
8495 | { | |
8496 | - DFBResult ret; | |
8497 | + DirectResult ret; | |
8498 | CoreSoundDevice *device; | |
8499 | DirectLink *link; | |
8500 | ||
8501 | @@ -90,7 +90,7 @@ fs_device_initialize( CoreSound *core, | |
8502 | ||
8503 | if (!device->module && | |
8504 | (!fs_config->driver || !strcmp( module->name, fs_config->driver ))) { | |
8505 | - if (funcs->Probe() == DFB_OK) { | |
8506 | + if (funcs->Probe() == DR_OK) { | |
8507 | device->module = module; | |
8508 | device->funcs = funcs; | |
8509 | ||
8510 | @@ -112,7 +112,7 @@ fs_device_initialize( CoreSound *core, | |
8511 | } | |
8512 | ||
8513 | D_FREE( device ); | |
8514 | - return DFB_FAILURE; | |
8515 | + return DR_FAILURE; | |
8516 | } | |
8517 | ||
8518 | if (device->info.device_data_size) { | |
8519 | @@ -146,7 +146,7 @@ fs_device_initialize( CoreSound *core, | |
8520 | ||
8521 | *ret_device = device; | |
8522 | ||
8523 | - return DFB_OK; | |
8524 | + return DR_OK; | |
8525 | } | |
8526 | ||
8527 | void | |
8528 | @@ -168,7 +168,7 @@ fs_device_get_capabilities( CoreSoundDevice *device ) | |
8529 | return device->device_info.caps; | |
8530 | } | |
8531 | ||
8532 | -DFBResult | |
8533 | +DirectResult | |
8534 | fs_device_get_buffer( CoreSoundDevice *device, | |
8535 | u8 **addr, | |
8536 | unsigned int *avail ) | |
8537 | @@ -180,10 +180,10 @@ fs_device_get_buffer( CoreSoundDevice *device, | |
8538 | if (device->funcs) | |
8539 | return device->funcs->GetBuffer( device->device_data, addr, avail ); | |
8540 | ||
8541 | - return DFB_UNSUPPORTED; | |
8542 | + return DR_UNSUPPORTED; | |
8543 | } | |
8544 | ||
8545 | -DFBResult | |
8546 | +DirectResult | |
8547 | fs_device_commit_buffer( CoreSoundDevice *device, unsigned int frames ) | |
8548 | { | |
8549 | D_ASSERT( device != NULL ); | |
8550 | @@ -191,7 +191,7 @@ fs_device_commit_buffer( CoreSoundDevice *device, unsigned int frames ) | |
8551 | if (device->funcs) | |
8552 | return device->funcs->CommitBuffer( device->device_data, frames ); | |
8553 | ||
8554 | - return DFB_UNSUPPORTED; | |
8555 | + return DR_UNSUPPORTED; | |
8556 | } | |
8557 | ||
8558 | void | |
8559 | @@ -206,7 +206,7 @@ fs_device_get_output_delay( CoreSoundDevice *device, int *delay ) | |
8560 | *delay = 0; | |
8561 | } | |
8562 | ||
8563 | -DFBResult | |
8564 | +DirectResult | |
8565 | fs_device_get_volume( CoreSoundDevice *device, float *level ) | |
8566 | { | |
8567 | D_ASSERT( device != NULL ); | |
8568 | @@ -215,10 +215,10 @@ fs_device_get_volume( CoreSoundDevice *device, float *level ) | |
8569 | if (device->funcs) | |
8570 | return device->funcs->GetVolume( device->device_data, level ); | |
8571 | ||
8572 | - return DFB_UNSUPPORTED; | |
8573 | + return DR_UNSUPPORTED; | |
8574 | } | |
8575 | ||
8576 | -DFBResult | |
8577 | +DirectResult | |
8578 | fs_device_set_volume( CoreSoundDevice *device, float level ) | |
8579 | { | |
8580 | D_ASSERT( device != NULL ); | |
8581 | @@ -226,10 +226,10 @@ fs_device_set_volume( CoreSoundDevice *device, float level ) | |
8582 | if (device->funcs) | |
8583 | return device->funcs->SetVolume( device->device_data, level ); | |
8584 | ||
8585 | - return DFB_UNSUPPORTED; | |
8586 | + return DR_UNSUPPORTED; | |
8587 | } | |
8588 | ||
8589 | -DFBResult | |
8590 | +DirectResult | |
8591 | fs_device_suspend( CoreSoundDevice *device ) | |
8592 | { | |
8593 | D_ASSERT( device != NULL ); | |
8594 | @@ -237,10 +237,10 @@ fs_device_suspend( CoreSoundDevice *device ) | |
8595 | if (device->funcs) | |
8596 | return device->funcs->Suspend( device->device_data ); | |
8597 | ||
8598 | - return DFB_OK; | |
8599 | + return DR_OK; | |
8600 | } | |
8601 | ||
8602 | -DFBResult | |
8603 | +DirectResult | |
8604 | fs_device_resume( CoreSoundDevice *device ) | |
8605 | { | |
8606 | D_ASSERT( device != NULL ); | |
8607 | @@ -248,7 +248,7 @@ fs_device_resume( CoreSoundDevice *device ) | |
8608 | if (device->funcs) | |
8609 | return device->funcs->Resume( device->device_data ); | |
8610 | ||
8611 | - return DFB_OK; | |
8612 | + return DR_OK; | |
8613 | } | |
8614 | ||
8615 | void | |
8616 | diff --git a/src/core/sound_device.h b/src/core/sound_device.h | |
8617 | index 60a6f5f..9d7d9a2 100644 | |
8618 | --- a/src/core/sound_device.h | |
8619 | +++ b/src/core/sound_device.h | |
8620 | @@ -94,23 +94,23 @@ typedef struct { | |
8621 | ||
8622 | /* Device funcs. */ | |
8623 | typedef struct { | |
8624 | - DFBResult (*Probe) ( void ); | |
8625 | + DirectResult (*Probe) ( void ); | |
8626 | ||
8627 | /* Get device driver information. */ | |
8628 | void (*GetDriverInfo) ( SoundDriverInfo *info); | |
8629 | ||
8630 | /* Open the device, get device information and apply given configuration. */ | |
8631 | - DFBResult (*OpenDevice) ( void *device_data, | |
8632 | + DirectResult (*OpenDevice) ( void *device_data, | |
8633 | SoundDeviceInfo *device_info, | |
8634 | CoreSoundDeviceConfig *config ); | |
8635 | ||
8636 | /* Begin access to the ring buffer, return buffer pointer and available frames. */ | |
8637 | - DFBResult (*GetBuffer) ( void *device_data, | |
8638 | + DirectResult (*GetBuffer) ( void *device_data, | |
8639 | u8 **addr, | |
8640 | unsigned int *avail ); | |
8641 | ||
8642 | /* Finish access to the ring buffer, commit specified amout of frames. */ | |
8643 | - DFBResult (*CommitBuffer) ( void *device_data, | |
8644 | + DirectResult (*CommitBuffer) ( void *device_data, | |
8645 | unsigned int frames ); | |
8646 | ||
8647 | /* Get output delay in frames. */ | |
8648 | @@ -118,25 +118,25 @@ typedef struct { | |
8649 | int *delay ); | |
8650 | ||
8651 | /* Get volume level */ | |
8652 | - DFBResult (*GetVolume) ( void *device_data, | |
8653 | + DirectResult (*GetVolume) ( void *device_data, | |
8654 | float *level ); | |
8655 | ||
8656 | /* Set volume level */ | |
8657 | - DFBResult (*SetVolume) ( void *device_data, | |
8658 | + DirectResult (*SetVolume) ( void *device_data, | |
8659 | float level ); | |
8660 | ||
8661 | /* Suspend the device */ | |
8662 | - DFBResult (*Suspend) ( void *device_data ); | |
8663 | + DirectResult (*Suspend) ( void *device_data ); | |
8664 | ||
8665 | /* Resume the device */ | |
8666 | - DFBResult (*Resume) ( void *device_data ); | |
8667 | + DirectResult (*Resume) ( void *device_data ); | |
8668 | ||
8669 | /* Close device. */ | |
8670 | void (*CloseDevice) ( void *device_data ); | |
8671 | } SoundDriverFuncs; | |
8672 | ||
8673 | ||
8674 | -DFBResult fs_device_initialize( CoreSound *core, | |
8675 | +DirectResult fs_device_initialize( CoreSound *core, | |
8676 | CoreSoundDeviceConfig *config, | |
8677 | CoreSoundDevice **ret_device ); | |
8678 | void fs_device_shutdown ( CoreSoundDevice *device ); | |
8679 | @@ -147,20 +147,20 @@ void fs_device_get_description( CoreSoundDevice *device, | |
8680 | DeviceCapabilities | |
8681 | fs_device_get_capabilities( CoreSoundDevice *device ); | |
8682 | ||
8683 | -DFBResult fs_device_get_buffer( CoreSoundDevice *device, | |
8684 | +DirectResult fs_device_get_buffer( CoreSoundDevice *device, | |
8685 | u8 **addr, | |
8686 | unsigned int *avail ); | |
8687 | ||
8688 | -DFBResult fs_device_commit_buffer( CoreSoundDevice *device, unsigned int frames ); | |
8689 | +DirectResult fs_device_commit_buffer( CoreSoundDevice *device, unsigned int frames ); | |
8690 | ||
8691 | void fs_device_get_output_delay( CoreSoundDevice *device, int *delay ); | |
8692 | ||
8693 | -DFBResult fs_device_get_volume( CoreSoundDevice *device, float *level ); | |
8694 | +DirectResult fs_device_get_volume( CoreSoundDevice *device, float *level ); | |
8695 | ||
8696 | -DFBResult fs_device_set_volume( CoreSoundDevice *device, float level ); | |
8697 | +DirectResult fs_device_set_volume( CoreSoundDevice *device, float level ); | |
8698 | ||
8699 | -DFBResult fs_device_suspend( CoreSoundDevice *device ); | |
8700 | +DirectResult fs_device_suspend( CoreSoundDevice *device ); | |
8701 | ||
8702 | -DFBResult fs_device_resume( CoreSoundDevice *device ); | |
8703 | +DirectResult fs_device_resume( CoreSoundDevice *device ); | |
8704 | ||
8705 | #endif | |
8706 | diff --git a/src/core/sound_driver.h b/src/core/sound_driver.h | |
8707 | index 664ea80..49eb1e0 100644 | |
8708 | --- a/src/core/sound_driver.h | |
8709 | +++ b/src/core/sound_driver.h | |
8710 | @@ -33,39 +33,39 @@ | |
8711 | #include <core/sound_device.h> | |
8712 | ||
8713 | ||
8714 | -static DFBResult | |
8715 | +static DirectResult | |
8716 | device_probe( void ); | |
8717 | ||
8718 | static void | |
8719 | device_get_driver_info( SoundDriverInfo *info ); | |
8720 | ||
8721 | -static DFBResult | |
8722 | +static DirectResult | |
8723 | device_open( void *device_data, | |
8724 | SoundDeviceInfo *device_info, | |
8725 | CoreSoundDeviceConfig *config ); | |
8726 | ||
8727 | -static DFBResult | |
8728 | +static DirectResult | |
8729 | device_get_buffer( void *device_data, | |
8730 | u8 **addr, | |
8731 | unsigned int *avail ); | |
8732 | ||
8733 | -static DFBResult | |
8734 | +static DirectResult | |
8735 | device_commit_buffer( void *device_data, | |
8736 | unsigned int frames ); | |
8737 | ||
8738 | static void | |
8739 | device_get_output_delay( void *device_data, int *delay ); | |
8740 | ||
8741 | -static DFBResult | |
8742 | +static DirectResult | |
8743 | device_get_volume( void *device_data, float *level ); | |
8744 | ||
8745 | -static DFBResult | |
8746 | +static DirectResult | |
8747 | device_set_volume( void *device_data, float level ); | |
8748 | ||
8749 | -static DFBResult | |
8750 | +static DirectResult | |
8751 | device_suspend( void *device_data ); | |
8752 | ||
8753 | -static DFBResult | |
8754 | +static DirectResult | |
8755 | device_resume( void *device_data ); | |
8756 | ||
8757 | static void | |
8758 | diff --git a/src/fusionsound.c b/src/fusionsound.c | |
8759 | index 323b458..0cafa44 100644 | |
8760 | --- a/src/fusionsound.c | |
8761 | +++ b/src/fusionsound.c | |
8762 | @@ -49,7 +49,7 @@ IFusionSound *ifusionsound_singleton = NULL; | |
8763 | ||
8764 | /**************************************************************************************************/ | |
8765 | ||
8766 | -static DFBResult CreateRemote( const char *host, | |
8767 | +static DirectResult CreateRemote( const char *host, | |
8768 | int session, | |
8769 | IFusionSound **ret_interface ); | |
8770 | ||
8771 | @@ -91,27 +91,27 @@ FusionSoundUsageString( void ) | |
8772 | return fs_config_usage(); | |
8773 | } | |
8774 | ||
8775 | -DFBResult | |
8776 | +DirectResult | |
8777 | FusionSoundInit( int *argc, char **argv[] ) | |
8778 | { | |
8779 | return fs_config_init( argc, argv ); | |
8780 | } | |
8781 | ||
8782 | -DFBResult | |
8783 | +DirectResult | |
8784 | FusionSoundSetOption( const char *name, const char *value ) | |
8785 | { | |
8786 | if (fs_config == NULL) { | |
8787 | D_ERROR( "FusionSoundSetOption: FusionSoundInit has to be called first!\n" ); | |
8788 | - return DFB_INIT; | |
8789 | + return DR_INIT; | |
8790 | } | |
8791 | ||
8792 | if (ifusionsound_singleton) { | |
8793 | D_ERROR( "FusionSoundSetOption: FusionSoundCreate has already been called!\n" ); | |
8794 | - return DFB_INIT; | |
8795 | + return DR_INIT; | |
8796 | } | |
8797 | ||
8798 | if (!name) | |
8799 | - return DFB_INVARG; | |
8800 | + return DR_INVARG; | |
8801 | ||
8802 | return fs_config_set( name, value ); | |
8803 | } | |
8804 | @@ -119,20 +119,20 @@ FusionSoundSetOption( const char *name, const char *value ) | |
8805 | DirectResult | |
8806 | FusionSoundCreate( IFusionSound **ret_interface ) | |
8807 | { | |
8808 | - DFBResult ret; | |
8809 | + DirectResult ret; | |
8810 | ||
8811 | if (!fs_config) { | |
8812 | D_ERROR( "FusionSoundCreate: FusionSoundInit has to be called first!\n" ); | |
8813 | - return DFB_INIT; | |
8814 | + return DR_INIT; | |
8815 | } | |
8816 | ||
8817 | if (!ret_interface) | |
8818 | - return DFB_INVARG; | |
8819 | + return DR_INVARG; | |
8820 | ||
8821 | if (ifusionsound_singleton) { | |
8822 | ifusionsound_singleton->AddRef( ifusionsound_singleton ); | |
8823 | *ret_interface = ifusionsound_singleton; | |
8824 | - return DFB_OK; | |
8825 | + return DR_OK; | |
8826 | } | |
8827 | ||
8828 | if (!direct_config->quiet && fs_config->banner) { | |
8829 | @@ -152,7 +152,7 @@ FusionSoundCreate( IFusionSound **ret_interface ) | |
8830 | DIRECT_ALLOCATE_INTERFACE( ifusionsound_singleton, IFusionSound ); | |
8831 | ||
8832 | ret = IFusionSound_Construct( ifusionsound_singleton ); | |
8833 | - if (ret != DFB_OK) | |
8834 | + if (ret != DR_OK) | |
8835 | ifusionsound_singleton = NULL; | |
8836 | ||
8837 | *ret_interface = ifusionsound_singleton; | |
8838 | @@ -171,7 +171,7 @@ FusionSoundError( const char *msg, DirectResult error ) | |
8839 | return error; | |
8840 | } | |
8841 | ||
8842 | -DFBResult | |
8843 | +DirectResult | |
8844 | FusionSoundErrorFatal( const char *msg, DirectResult error ) | |
8845 | { | |
8846 | FusionSoundError( msg, error ); | |
8847 | @@ -187,10 +187,10 @@ FusionSoundErrorString( DirectResult error ) | |
8848 | ||
8849 | /**************************************************************************************************/ | |
8850 | ||
8851 | -static DFBResult | |
8852 | +static DirectResult | |
8853 | CreateRemote( const char *host, int session, IFusionSound **ret_interface ) | |
8854 | { | |
8855 | - DFBResult ret; | |
8856 | + DirectResult ret; | |
8857 | DirectInterfaceFuncs *funcs; | |
8858 | void *interface; | |
8859 | ||
8860 | @@ -211,5 +211,5 @@ CreateRemote( const char *host, int session, IFusionSound **ret_interface ) | |
8861 | ||
8862 | *ret_interface = interface; | |
8863 | ||
8864 | - return DFB_OK; | |
8865 | + return DR_OK; | |
8866 | } | |
8867 | diff --git a/src/ifusionsound.c b/src/ifusionsound.c | |
8868 | index 7822980..435d30c 100644 | |
8869 | --- a/src/ifusionsound.c | |
8870 | +++ b/src/ifusionsound.c | |
8871 | @@ -62,17 +62,17 @@ IFusionSound_Destruct( IFusionSound *thiz ) | |
8872 | ifusionsound_singleton = NULL; | |
8873 | } | |
8874 | ||
8875 | -static DFBResult | |
8876 | +static DirectResult | |
8877 | IFusionSound_AddRef( IFusionSound *thiz ) | |
8878 | { | |
8879 | DIRECT_INTERFACE_GET_DATA(IFusionSound) | |
8880 | ||
8881 | data->ref++; | |
8882 | ||
8883 | - return DFB_OK; | |
8884 | + return DR_OK; | |
8885 | } | |
8886 | ||
8887 | -static DFBResult | |
8888 | +static DirectResult | |
8889 | IFusionSound_Release( IFusionSound *thiz ) | |
8890 | { | |
8891 | DIRECT_INTERFACE_GET_DATA(IFusionSound) | |
8892 | @@ -80,29 +80,29 @@ IFusionSound_Release( IFusionSound *thiz ) | |
8893 | if (--data->ref == 0) | |
8894 | IFusionSound_Destruct( thiz ); | |
8895 | ||
8896 | - return DFB_OK; | |
8897 | + return DR_OK; | |
8898 | } | |
8899 | ||
8900 | -static DFBResult | |
8901 | +static DirectResult | |
8902 | IFusionSound_GetDeviceDescription( IFusionSound *thiz, | |
8903 | FSDeviceDescription *desc ) | |
8904 | { | |
8905 | DIRECT_INTERFACE_GET_DATA(IFusionSound) | |
8906 | ||
8907 | if (!desc) | |
8908 | - return DFB_INVARG; | |
8909 | + return DR_INVARG; | |
8910 | ||
8911 | *desc = *fs_core_device_description( data->core ); | |
8912 | ||
8913 | - return DFB_OK; | |
8914 | + return DR_OK; | |
8915 | } | |
8916 | ||
8917 | -static DFBResult | |
8918 | +static DirectResult | |
8919 | IFusionSound_CreateBuffer( IFusionSound *thiz, | |
8920 | const FSBufferDescription *desc, | |
8921 | IFusionSoundBuffer **ret_interface ) | |
8922 | { | |
8923 | - DFBResult ret; | |
8924 | + DirectResult ret; | |
8925 | CoreSoundDeviceConfig *config; | |
8926 | FSChannelMode mode; | |
8927 | FSSampleFormat format; | |
8928 | @@ -115,7 +115,7 @@ IFusionSound_CreateBuffer( IFusionSound *thiz, | |
8929 | DIRECT_INTERFACE_GET_DATA(IFusionSound) | |
8930 | ||
8931 | if (!desc || !ret_interface) | |
8932 | - return DFB_INVARG; | |
8933 | + return DR_INVARG; | |
8934 | ||
8935 | config = fs_core_device_config( data->core ); | |
8936 | mode = config->mode; | |
8937 | @@ -126,7 +126,7 @@ IFusionSound_CreateBuffer( IFusionSound *thiz, | |
8938 | flags = desc->flags; | |
8939 | ||
8940 | if (flags & ~FSBDF_ALL) | |
8941 | - return DFB_INVARG; | |
8942 | + return DR_INVARG; | |
8943 | ||
8944 | ||
8945 | if (flags & FSBDF_CHANNELMODE) { | |
8946 | @@ -150,7 +150,7 @@ IFusionSound_CreateBuffer( IFusionSound *thiz, | |
8947 | break; | |
8948 | ||
8949 | default: | |
8950 | - return DFB_INVARG; | |
8951 | + return DR_INVARG; | |
8952 | } | |
8953 | } | |
8954 | else if (flags & FSBDF_CHANNELS) { | |
8955 | @@ -160,7 +160,7 @@ IFusionSound_CreateBuffer( IFusionSound *thiz, | |
8956 | break; | |
8957 | ||
8958 | default: | |
8959 | - return DFB_INVARG; | |
8960 | + return DR_INVARG; | |
8961 | } | |
8962 | } | |
8963 | ||
8964 | @@ -175,13 +175,13 @@ IFusionSound_CreateBuffer( IFusionSound *thiz, | |
8965 | break; | |
8966 | ||
8967 | default: | |
8968 | - return DFB_INVARG; | |
8969 | + return DR_INVARG; | |
8970 | } | |
8971 | } | |
8972 | ||
8973 | if (flags & FSBDF_SAMPLERATE) { | |
8974 | if (desc->samplerate < 100) | |
8975 | - return DFB_UNSUPPORTED; | |
8976 | + return DR_UNSUPPORTED; | |
8977 | rate = desc->samplerate; | |
8978 | } | |
8979 | ||
8980 | @@ -189,10 +189,10 @@ IFusionSound_CreateBuffer( IFusionSound *thiz, | |
8981 | length = desc->length; | |
8982 | ||
8983 | if (length < 1) | |
8984 | - return DFB_INVARG; | |
8985 | + return DR_INVARG; | |
8986 | ||
8987 | if (length > FS_MAX_FRAMES) | |
8988 | - return DFB_LIMITEXCEEDED; | |
8989 | + return DR_LIMITEXCEEDED; | |
8990 | ||
8991 | ret = fs_buffer_create( data->core, length, mode, format, rate, &buffer ); | |
8992 | if (ret) | |
8993 | @@ -210,12 +210,12 @@ IFusionSound_CreateBuffer( IFusionSound *thiz, | |
8994 | return ret; | |
8995 | } | |
8996 | ||
8997 | -static DFBResult | |
8998 | +static DirectResult | |
8999 | IFusionSound_CreateStream( IFusionSound *thiz, | |
9000 | const FSStreamDescription *desc, | |
9001 | IFusionSoundStream **ret_interface ) | |
9002 | { | |
9003 | - DFBResult ret; | |
9004 | + DirectResult ret; | |
9005 | CoreSoundDeviceConfig *config; | |
9006 | FSChannelMode mode; | |
9007 | FSSampleFormat format; | |
9008 | @@ -229,7 +229,7 @@ IFusionSound_CreateStream( IFusionSound *thiz, | |
9009 | DIRECT_INTERFACE_GET_DATA(IFusionSound) | |
9010 | ||
9011 | if (!ret_interface) | |
9012 | - return DFB_INVARG; | |
9013 | + return DR_INVARG; | |
9014 | ||
9015 | config = fs_core_device_config( data->core ); | |
9016 | mode = config->mode; | |
9017 | @@ -242,7 +242,7 @@ IFusionSound_CreateStream( IFusionSound *thiz, | |
9018 | flags = desc->flags; | |
9019 | ||
9020 | if (flags & ~FSSDF_ALL) | |
9021 | - return DFB_INVARG; | |
9022 | + return DR_INVARG; | |
9023 | ||
9024 | if (flags & FSSDF_CHANNELMODE) { | |
9025 | switch (desc->channelmode) { | |
9026 | @@ -265,7 +265,7 @@ IFusionSound_CreateStream( IFusionSound *thiz, | |
9027 | break; | |
9028 | ||
9029 | default: | |
9030 | - return DFB_INVARG; | |
9031 | + return DR_INVARG; | |
9032 | } | |
9033 | } | |
9034 | else if (flags & FSSDF_CHANNELS) { | |
9035 | @@ -275,7 +275,7 @@ IFusionSound_CreateStream( IFusionSound *thiz, | |
9036 | break; | |
9037 | ||
9038 | default: | |
9039 | - return DFB_INVARG; | |
9040 | + return DR_INVARG; | |
9041 | } | |
9042 | } | |
9043 | ||
9044 | @@ -290,25 +290,25 @@ IFusionSound_CreateStream( IFusionSound *thiz, | |
9045 | break; | |
9046 | ||
9047 | default: | |
9048 | - return DFB_INVARG; | |
9049 | + return DR_INVARG; | |
9050 | } | |
9051 | } | |
9052 | ||
9053 | if (flags & FSSDF_SAMPLERATE) { | |
9054 | if (desc->samplerate < 100) | |
9055 | - return DFB_UNSUPPORTED; | |
9056 | + return DR_UNSUPPORTED; | |
9057 | rate = desc->samplerate; | |
9058 | } | |
9059 | ||
9060 | if (flags & FSSDF_BUFFERSIZE) { | |
9061 | if (desc->buffersize < 1) | |
9062 | - return DFB_INVARG; | |
9063 | + return DR_INVARG; | |
9064 | size = desc->buffersize; | |
9065 | } | |
9066 | ||
9067 | if (flags & FSSDF_PREBUFFER) { | |
9068 | if (desc->prebuffer >= size) | |
9069 | - return DFB_INVARG; | |
9070 | + return DR_INVARG; | |
9071 | prebuffer = desc->prebuffer; | |
9072 | } | |
9073 | } | |
9074 | @@ -318,7 +318,7 @@ IFusionSound_CreateStream( IFusionSound *thiz, | |
9075 | ||
9076 | /* Limit ring buffer size to five seconds. */ | |
9077 | if (size > rate * 5) | |
9078 | - return DFB_LIMITEXCEEDED; | |
9079 | + return DR_LIMITEXCEEDED; | |
9080 | ||
9081 | ret = fs_buffer_create( data->core, size, mode, format, rate, &buffer ); | |
9082 | if (ret) | |
9083 | @@ -336,7 +336,7 @@ IFusionSound_CreateStream( IFusionSound *thiz, | |
9084 | return ret; | |
9085 | } | |
9086 | ||
9087 | -static DFBResult | |
9088 | +static DirectResult | |
9089 | IFusionSound_CreateMusicProvider( IFusionSound *thiz, | |
9090 | const char *filename, | |
9091 | IFusionSoundMusicProvider **ret_interface ) | |
9092 | @@ -345,12 +345,12 @@ IFusionSound_CreateMusicProvider( IFusionSound *thiz, | |
9093 | ||
9094 | /* Check arguments */ | |
9095 | if (!ret_interface || !filename) | |
9096 | - return DFB_INVARG; | |
9097 | + return DR_INVARG; | |
9098 | ||
9099 | return IFusionSoundMusicProvider_Create( filename, ret_interface ); | |
9100 | } | |
9101 | ||
9102 | -static DFBResult | |
9103 | +static DirectResult | |
9104 | IFusionSound_GetMasterVolume( IFusionSound *thiz, | |
9105 | float *level ) | |
9106 | { | |
9107 | @@ -358,12 +358,12 @@ IFusionSound_GetMasterVolume( IFusionSound *thiz, | |
9108 | ||
9109 | /* Check arguments */ | |
9110 | if (!level) | |
9111 | - return DFB_INVARG; | |
9112 | + return DR_INVARG; | |
9113 | ||
9114 | return fs_core_get_master_volume( data->core, level ); | |
9115 | } | |
9116 | ||
9117 | -static DFBResult | |
9118 | +static DirectResult | |
9119 | IFusionSound_SetMasterVolume( IFusionSound *thiz, | |
9120 | float level ) | |
9121 | { | |
9122 | @@ -371,12 +371,12 @@ IFusionSound_SetMasterVolume( IFusionSound *thiz, | |
9123 | ||
9124 | /* Check arguments */ | |
9125 | if (level < 0.0f || level > 1.0f) | |
9126 | - return DFB_INVARG; | |
9127 | + return DR_INVARG; | |
9128 | ||
9129 | return fs_core_set_master_volume( data->core, level ); | |
9130 | } | |
9131 | ||
9132 | -static DFBResult | |
9133 | +static DirectResult | |
9134 | IFusionSound_GetLocalVolume( IFusionSound *thiz, | |
9135 | float *level ) | |
9136 | { | |
9137 | @@ -384,12 +384,12 @@ IFusionSound_GetLocalVolume( IFusionSound *thiz, | |
9138 | ||
9139 | /* Check arguments */ | |
9140 | if (!level) | |
9141 | - return DFB_INVARG; | |
9142 | + return DR_INVARG; | |
9143 | ||
9144 | return fs_core_get_local_volume( data->core, level ); | |
9145 | } | |
9146 | ||
9147 | -static DFBResult | |
9148 | +static DirectResult | |
9149 | IFusionSound_SetLocalVolume( IFusionSound *thiz, | |
9150 | float level ) | |
9151 | { | |
9152 | @@ -397,12 +397,12 @@ IFusionSound_SetLocalVolume( IFusionSound *thiz, | |
9153 | ||
9154 | /* Check arguments */ | |
9155 | if (level < 0.0f || level > 1.0f) | |
9156 | - return DFB_INVARG; | |
9157 | + return DR_INVARG; | |
9158 | ||
9159 | return fs_core_set_local_volume( data->core, level ); | |
9160 | } | |
9161 | ||
9162 | -static DFBResult | |
9163 | +static DirectResult | |
9164 | IFusionSound_Suspend( IFusionSound *thiz ) | |
9165 | { | |
9166 | DIRECT_INTERFACE_GET_DATA(IFusionSound) | |
9167 | @@ -410,7 +410,7 @@ IFusionSound_Suspend( IFusionSound *thiz ) | |
9168 | return fs_core_suspend( data->core ); | |
9169 | } | |
9170 | ||
9171 | -static DFBResult | |
9172 | +static DirectResult | |
9173 | IFusionSound_Resume( IFusionSound *thiz ) | |
9174 | { | |
9175 | DIRECT_INTERFACE_GET_DATA(IFusionSound) | |
9176 | @@ -419,10 +419,10 @@ IFusionSound_Resume( IFusionSound *thiz ) | |
9177 | } | |
9178 | ||
9179 | ||
9180 | -DFBResult | |
9181 | +DirectResult | |
9182 | IFusionSound_Construct( IFusionSound *thiz ) | |
9183 | { | |
9184 | - DFBResult ret; | |
9185 | + DirectResult ret; | |
9186 | ||
9187 | /* Allocate interface data. */ | |
9188 | DIRECT_ALLOCATE_INTERFACE_DATA( thiz, IFusionSound ); | |
9189 | @@ -454,5 +454,5 @@ IFusionSound_Construct( IFusionSound *thiz ) | |
9190 | thiz->Suspend = IFusionSound_Suspend; | |
9191 | thiz->Resume = IFusionSound_Resume; | |
9192 | ||
9193 | - return DFB_OK; | |
9194 | + return DR_OK; | |
9195 | } | |
9196 | diff --git a/src/ifusionsound.h b/src/ifusionsound.h | |
9197 | index d7c91cc..f19c3e0 100644 | |
9198 | --- a/src/ifusionsound.h | |
9199 | +++ b/src/ifusionsound.h | |
9200 | @@ -42,7 +42,7 @@ typedef struct { | |
9201 | } IFusionSound_data; | |
9202 | ||
9203 | ||
9204 | -DFBResult IFusionSound_Construct( IFusionSound *thiz ); | |
9205 | +DirectResult IFusionSound_Construct( IFusionSound *thiz ); | |
9206 | ||
9207 | extern IFusionSound *ifusionsound_singleton; | |
9208 | ||
9209 | diff --git a/src/ifusionsoundbuffer.c b/src/ifusionsoundbuffer.c | |
9210 | index 6cf3a58..d5047e6 100644 | |
9211 | --- a/src/ifusionsoundbuffer.c | |
9212 | +++ b/src/ifusionsoundbuffer.c | |
9213 | @@ -87,17 +87,17 @@ IFusionSoundBuffer_Destruct( IFusionSoundBuffer *thiz ) | |
9214 | DIRECT_DEALLOCATE_INTERFACE( thiz ); | |
9215 | } | |
9216 | ||
9217 | -static DFBResult | |
9218 | +static DirectResult | |
9219 | IFusionSoundBuffer_AddRef( IFusionSoundBuffer *thiz ) | |
9220 | { | |
9221 | DIRECT_INTERFACE_GET_DATA(IFusionSoundBuffer) | |
9222 | ||
9223 | data->ref++; | |
9224 | ||
9225 | - return DFB_OK; | |
9226 | + return DR_OK; | |
9227 | } | |
9228 | ||
9229 | -static DFBResult | |
9230 | +static DirectResult | |
9231 | IFusionSoundBuffer_Release( IFusionSoundBuffer *thiz ) | |
9232 | { | |
9233 | DIRECT_INTERFACE_GET_DATA(IFusionSoundBuffer) | |
9234 | @@ -105,18 +105,18 @@ IFusionSoundBuffer_Release( IFusionSoundBuffer *thiz ) | |
9235 | if (--data->ref == 0) | |
9236 | IFusionSoundBuffer_Destruct( thiz ); | |
9237 | ||
9238 | - return DFB_OK; | |
9239 | + return DR_OK; | |
9240 | } | |
9241 | ||
9242 | ||
9243 | -static DFBResult | |
9244 | +static DirectResult | |
9245 | IFusionSoundBuffer_GetDescription( IFusionSoundBuffer *thiz, | |
9246 | FSBufferDescription *desc ) | |
9247 | { | |
9248 | DIRECT_INTERFACE_GET_DATA(IFusionSoundBuffer) | |
9249 | ||
9250 | if (!desc) | |
9251 | - return DFB_INVARG; | |
9252 | + return DR_INVARG; | |
9253 | ||
9254 | desc->flags = FSBDF_CHANNELS | FSBDF_LENGTH | | |
9255 | FSBDF_SAMPLEFORMAT | FSBDF_SAMPLERATE | | |
9256 | @@ -128,40 +128,40 @@ IFusionSoundBuffer_GetDescription( IFusionSoundBuffer *thiz, | |
9257 | desc->samplerate = data->rate; | |
9258 | desc->channelmode = data->mode; | |
9259 | ||
9260 | - return DFB_OK; | |
9261 | + return DR_OK; | |
9262 | } | |
9263 | ||
9264 | -static DFBResult | |
9265 | +static DirectResult | |
9266 | IFusionSoundBuffer_SetPosition( IFusionSoundBuffer *thiz, | |
9267 | int position ) | |
9268 | { | |
9269 | DIRECT_INTERFACE_GET_DATA(IFusionSoundBuffer) | |
9270 | ||
9271 | if (position < 0 || position >= data->size) | |
9272 | - return DFB_INVARG; | |
9273 | + return DR_INVARG; | |
9274 | ||
9275 | data->pos = position; | |
9276 | ||
9277 | - return DFB_OK; | |
9278 | + return DR_OK; | |
9279 | } | |
9280 | ||
9281 | -static DFBResult | |
9282 | +static DirectResult | |
9283 | IFusionSoundBuffer_Lock( IFusionSoundBuffer *thiz, | |
9284 | void **ret_data, | |
9285 | int *ret_frames, | |
9286 | int *ret_bytes ) | |
9287 | { | |
9288 | - DFBResult ret; | |
9289 | + DirectResult ret; | |
9290 | void *lock_data; | |
9291 | int lock_bytes; | |
9292 | ||
9293 | DIRECT_INTERFACE_GET_DATA(IFusionSoundBuffer) | |
9294 | ||
9295 | if (!ret_data) | |
9296 | - return DFB_INVARG; | |
9297 | + return DR_INVARG; | |
9298 | ||
9299 | if (data->locked) | |
9300 | - return DFB_LOCKED; | |
9301 | + return DR_LOCKED; | |
9302 | ||
9303 | ret = fs_buffer_lock( data->buffer, data->pos, 0, &lock_data, &lock_bytes ); | |
9304 | if (ret) | |
9305 | @@ -177,35 +177,35 @@ IFusionSoundBuffer_Lock( IFusionSoundBuffer *thiz, | |
9306 | if (ret_bytes) | |
9307 | *ret_bytes = lock_bytes; | |
9308 | ||
9309 | - return DFB_OK; | |
9310 | + return DR_OK; | |
9311 | } | |
9312 | ||
9313 | -static DFBResult | |
9314 | +static DirectResult | |
9315 | IFusionSoundBuffer_Unlock( IFusionSoundBuffer *thiz ) | |
9316 | { | |
9317 | DIRECT_INTERFACE_GET_DATA(IFusionSoundBuffer) | |
9318 | ||
9319 | if (!data->locked) | |
9320 | - return DFB_OK; | |
9321 | + return DR_OK; | |
9322 | ||
9323 | fs_buffer_unlock( data->buffer ); | |
9324 | ||
9325 | data->locked = false; | |
9326 | ||
9327 | - return DFB_OK; | |
9328 | + return DR_OK; | |
9329 | } | |
9330 | ||
9331 | -static DFBResult | |
9332 | +static DirectResult | |
9333 | IFusionSoundBuffer_Play( IFusionSoundBuffer *thiz, | |
9334 | FSBufferPlayFlags flags ) | |
9335 | { | |
9336 | - DFBResult ret; | |
9337 | + DirectResult ret; | |
9338 | CorePlayback *playback; | |
9339 | ||
9340 | DIRECT_INTERFACE_GET_DATA(IFusionSoundBuffer) | |
9341 | ||
9342 | if (flags & ~FSPLAY_ALL) | |
9343 | - return DFB_INVARG; | |
9344 | + return DR_INVARG; | |
9345 | ||
9346 | /* Choose looping playback mode. */ | |
9347 | if (flags & FSPLAY_LOOPING) { | |
9348 | @@ -214,7 +214,7 @@ IFusionSoundBuffer_Play( IFusionSoundBuffer *thiz, | |
9349 | /* Return error if already running a looping playing. */ | |
9350 | if (data->looping) { | |
9351 | pthread_mutex_unlock( &data->lock ); | |
9352 | - return DFB_BUSY; | |
9353 | + return DR_BUSY; | |
9354 | } | |
9355 | ||
9356 | /* Create a playback object. */ | |
9357 | @@ -285,7 +285,7 @@ IFusionSoundBuffer_Play( IFusionSoundBuffer *thiz, | |
9358 | return ret; | |
9359 | } | |
9360 | ||
9361 | -static DFBResult | |
9362 | +static DirectResult | |
9363 | IFusionSoundBuffer_Stop( IFusionSoundBuffer *thiz ) | |
9364 | { | |
9365 | DIRECT_INTERFACE_GET_DATA(IFusionSoundBuffer) | |
9366 | @@ -302,21 +302,21 @@ IFusionSoundBuffer_Stop( IFusionSoundBuffer *thiz ) | |
9367 | ||
9368 | pthread_mutex_unlock( &data->lock ); | |
9369 | ||
9370 | - return DFB_OK; | |
9371 | + return DR_OK; | |
9372 | } | |
9373 | ||
9374 | -static DFBResult | |
9375 | +static DirectResult | |
9376 | IFusionSoundBuffer_CreatePlayback( IFusionSoundBuffer *thiz, | |
9377 | IFusionSoundPlayback **ret_interface ) | |
9378 | { | |
9379 | - DFBResult ret; | |
9380 | + DirectResult ret; | |
9381 | CorePlayback *playback; | |
9382 | IFusionSoundPlayback *interface; | |
9383 | ||
9384 | DIRECT_INTERFACE_GET_DATA(IFusionSoundBuffer) | |
9385 | ||
9386 | if (!ret_interface) | |
9387 | - return DFB_INVARG; | |
9388 | + return DR_INVARG; | |
9389 | ||
9390 | ret = fs_playback_create( data->core, data->buffer, true, &playback ); | |
9391 | if (ret) | |
9392 | @@ -338,7 +338,7 @@ IFusionSoundBuffer_CreatePlayback( IFusionSoundBuffer *thiz, | |
9393 | ||
9394 | /******/ | |
9395 | ||
9396 | -DFBResult | |
9397 | +DirectResult | |
9398 | IFusionSoundBuffer_Construct( IFusionSoundBuffer *thiz, | |
9399 | CoreSound *core, | |
9400 | CoreSoundBuffer *buffer, | |
9401 | @@ -353,7 +353,7 @@ IFusionSoundBuffer_Construct( IFusionSoundBuffer *thiz, | |
9402 | if (fs_buffer_ref( buffer )) { | |
9403 | DIRECT_DEALLOCATE_INTERFACE( thiz ); | |
9404 | ||
9405 | - return DFB_FUSION; | |
9406 | + return DR_FUSION; | |
9407 | } | |
9408 | ||
9409 | /* Initialize private data. */ | |
9410 | @@ -383,6 +383,6 @@ IFusionSoundBuffer_Construct( IFusionSoundBuffer *thiz, | |
9411 | ||
9412 | thiz->CreatePlayback = IFusionSoundBuffer_CreatePlayback; | |
9413 | ||
9414 | - return DFB_OK; | |
9415 | + return DR_OK; | |
9416 | } | |
9417 | ||
9418 | diff --git a/src/ifusionsoundbuffer.h b/src/ifusionsoundbuffer.h | |
9419 | index ee19b42..f0c4070 100644 | |
9420 | --- a/src/ifusionsoundbuffer.h | |
9421 | +++ b/src/ifusionsoundbuffer.h | |
9422 | @@ -34,7 +34,7 @@ | |
9423 | /* | |
9424 | * initializes interface struct and private data | |
9425 | */ | |
9426 | -DFBResult IFusionSoundBuffer_Construct( IFusionSoundBuffer *thiz, | |
9427 | +DirectResult IFusionSoundBuffer_Construct( IFusionSoundBuffer *thiz, | |
9428 | CoreSound *core, | |
9429 | CoreSoundBuffer *buffer, | |
9430 | int size, | |
9431 | diff --git a/src/ifusionsoundplayback.c b/src/ifusionsoundplayback.c | |
9432 | index 3729ddf..12f9adb 100644 | |
9433 | --- a/src/ifusionsoundplayback.c | |
9434 | +++ b/src/ifusionsoundplayback.c | |
9435 | @@ -63,7 +63,7 @@ typedef struct { | |
9436 | static ReactionResult IFusionSoundPlayback_React( const void *msg_data, | |
9437 | void *ctx ); | |
9438 | ||
9439 | -static DFBResult | |
9440 | +static DirectResult | |
9441 | IFusionSoundPlayback_UpdateVolume( IFusionSoundPlayback_data* data ); | |
9442 | ||
9443 | /******/ | |
9444 | @@ -88,17 +88,17 @@ IFusionSoundPlayback_Destruct( IFusionSoundPlayback *thiz ) | |
9445 | DIRECT_DEALLOCATE_INTERFACE( thiz ); | |
9446 | } | |
9447 | ||
9448 | -static DFBResult | |
9449 | +static DirectResult | |
9450 | IFusionSoundPlayback_AddRef( IFusionSoundPlayback *thiz ) | |
9451 | { | |
9452 | DIRECT_INTERFACE_GET_DATA(IFusionSoundPlayback) | |
9453 | ||
9454 | data->ref++; | |
9455 | ||
9456 | - return DFB_OK; | |
9457 | + return DR_OK; | |
9458 | } | |
9459 | ||
9460 | -static DFBResult | |
9461 | +static DirectResult | |
9462 | IFusionSoundPlayback_Release( IFusionSoundPlayback *thiz ) | |
9463 | { | |
9464 | DIRECT_INTERFACE_GET_DATA(IFusionSoundPlayback) | |
9465 | @@ -106,10 +106,10 @@ IFusionSoundPlayback_Release( IFusionSoundPlayback *thiz ) | |
9466 | if (--data->ref == 0) | |
9467 | IFusionSoundPlayback_Destruct( thiz ); | |
9468 | ||
9469 | - return DFB_OK; | |
9470 | + return DR_OK; | |
9471 | } | |
9472 | ||
9473 | -static DFBResult | |
9474 | +static DirectResult | |
9475 | IFusionSoundPlayback_Start( IFusionSoundPlayback *thiz, | |
9476 | int start, | |
9477 | int stop ) | |
9478 | @@ -120,13 +120,13 @@ IFusionSoundPlayback_Start( IFusionSoundPlayback *thiz, | |
9479 | __FUNCTION__, data->playback, start, stop ); | |
9480 | ||
9481 | if (data->stream) | |
9482 | - return DFB_UNSUPPORTED; | |
9483 | + return DR_UNSUPPORTED; | |
9484 | ||
9485 | if (start < 0 || start >= data->length) | |
9486 | - return DFB_INVARG; | |
9487 | + return DR_INVARG; | |
9488 | ||
9489 | if (stop >= data->length) | |
9490 | - return DFB_INVARG; | |
9491 | + return DR_INVARG; | |
9492 | ||
9493 | pthread_mutex_lock( &data->lock ); | |
9494 | ||
9495 | @@ -136,10 +136,10 @@ IFusionSoundPlayback_Start( IFusionSoundPlayback *thiz, | |
9496 | ||
9497 | pthread_mutex_unlock( &data->lock ); | |
9498 | ||
9499 | - return DFB_OK; | |
9500 | + return DR_OK; | |
9501 | } | |
9502 | ||
9503 | -static DFBResult | |
9504 | +static DirectResult | |
9505 | IFusionSoundPlayback_Stop( IFusionSoundPlayback *thiz ) | |
9506 | { | |
9507 | DIRECT_INTERFACE_GET_DATA(IFusionSoundPlayback) | |
9508 | @@ -149,7 +149,7 @@ IFusionSoundPlayback_Stop( IFusionSoundPlayback *thiz ) | |
9509 | return fs_playback_stop( data->playback, false ); | |
9510 | } | |
9511 | ||
9512 | -static DFBResult | |
9513 | +static DirectResult | |
9514 | IFusionSoundPlayback_Continue( IFusionSoundPlayback *thiz ) | |
9515 | { | |
9516 | DIRECT_INTERFACE_GET_DATA(IFusionSoundPlayback) | |
9517 | @@ -159,10 +159,10 @@ IFusionSoundPlayback_Continue( IFusionSoundPlayback *thiz ) | |
9518 | return fs_playback_start( data->playback, false ); | |
9519 | } | |
9520 | ||
9521 | -static DFBResult | |
9522 | +static DirectResult | |
9523 | IFusionSoundPlayback_Wait( IFusionSoundPlayback *thiz ) | |
9524 | { | |
9525 | - DFBResult ret; | |
9526 | + DirectResult ret; | |
9527 | ||
9528 | DIRECT_INTERFACE_GET_DATA(IFusionSoundPlayback) | |
9529 | ||
9530 | @@ -179,7 +179,7 @@ IFusionSoundPlayback_Wait( IFusionSoundPlayback *thiz ) | |
9531 | ||
9532 | if (status & CPS_PLAYING) { | |
9533 | if (status & CPS_LOOPING) { | |
9534 | - ret = DFB_UNSUPPORTED; | |
9535 | + ret = DR_UNSUPPORTED; | |
9536 | break; | |
9537 | } | |
9538 | else { | |
9539 | @@ -197,12 +197,12 @@ IFusionSoundPlayback_Wait( IFusionSoundPlayback *thiz ) | |
9540 | return ret; | |
9541 | } | |
9542 | ||
9543 | -static DFBResult | |
9544 | +static DirectResult | |
9545 | IFusionSoundPlayback_GetStatus( IFusionSoundPlayback *thiz, | |
9546 | - DFBBoolean *ret_playing, | |
9547 | + bool *ret_playing, | |
9548 | int *ret_position ) | |
9549 | { | |
9550 | - DFBResult ret; | |
9551 | + DirectResult ret; | |
9552 | CorePlaybackStatus status; | |
9553 | int position; | |
9554 | ||
9555 | @@ -215,15 +215,15 @@ IFusionSoundPlayback_GetStatus( IFusionSoundPlayback *thiz, | |
9556 | return ret; | |
9557 | ||
9558 | if (ret_playing) | |
9559 | - *ret_playing = (status & CPS_PLAYING) ? DFB_TRUE : DFB_FALSE; | |
9560 | + *ret_playing = !!(status & CPS_PLAYING); | |
9561 | ||
9562 | if (ret_position) | |
9563 | *ret_position = position; | |
9564 | ||
9565 | - return DFB_OK; | |
9566 | + return DR_OK; | |
9567 | } | |
9568 | ||
9569 | -static DFBResult | |
9570 | +static DirectResult | |
9571 | IFusionSoundPlayback_SetVolume( IFusionSoundPlayback *thiz, | |
9572 | float level ) | |
9573 | { | |
9574 | @@ -232,17 +232,17 @@ IFusionSoundPlayback_SetVolume( IFusionSoundPlayback *thiz, | |
9575 | D_DEBUG( "%s (%p, %.3f)\n", __FUNCTION__, data->playback, level ); | |
9576 | ||
9577 | if (level < 0.0f) | |
9578 | - return DFB_INVARG; | |
9579 | + return DR_INVARG; | |
9580 | ||
9581 | if (level > 64.0f) | |
9582 | - return DFB_UNSUPPORTED; | |
9583 | + return DR_UNSUPPORTED; | |
9584 | ||
9585 | data->volume = level; | |
9586 | ||
9587 | return IFusionSoundPlayback_UpdateVolume( data ); | |
9588 | } | |
9589 | ||
9590 | -static DFBResult | |
9591 | +static DirectResult | |
9592 | IFusionSoundPlayback_SetPan( IFusionSoundPlayback *thiz, | |
9593 | float value ) | |
9594 | { | |
9595 | @@ -251,14 +251,14 @@ IFusionSoundPlayback_SetPan( IFusionSoundPlayback *thiz, | |
9596 | D_DEBUG( "%s (%p, %.3f)\n", __FUNCTION__, data->playback, value ); | |
9597 | ||
9598 | if (value < -1.0f || value > 1.0f) | |
9599 | - return DFB_INVARG; | |
9600 | + return DR_INVARG; | |
9601 | ||
9602 | data->pan = value; | |
9603 | ||
9604 | return IFusionSoundPlayback_UpdateVolume( data ); | |
9605 | } | |
9606 | ||
9607 | -static DFBResult | |
9608 | +static DirectResult | |
9609 | IFusionSoundPlayback_SetPitch( IFusionSoundPlayback *thiz, | |
9610 | float value ) | |
9611 | { | |
9612 | @@ -267,19 +267,19 @@ IFusionSoundPlayback_SetPitch( IFusionSoundPlayback *thiz, | |
9613 | D_DEBUG( "%s (%p, %.3f)\n", __FUNCTION__, data->playback, value ); | |
9614 | ||
9615 | if (value < 0.0f) | |
9616 | - return DFB_INVARG; | |
9617 | + return DR_INVARG; | |
9618 | ||
9619 | if (value > 64.0f) | |
9620 | - return DFB_UNSUPPORTED; | |
9621 | + return DR_UNSUPPORTED; | |
9622 | ||
9623 | data->pitch = (value * FS_PITCH_ONE + 0.5f); | |
9624 | ||
9625 | fs_playback_set_pitch( data->playback, data->pitch*data->dir ); | |
9626 | ||
9627 | - return DFB_OK; | |
9628 | + return DR_OK; | |
9629 | } | |
9630 | ||
9631 | -static DFBResult | |
9632 | +static DirectResult | |
9633 | IFusionSoundPlayback_SetDirection( IFusionSoundPlayback *thiz, | |
9634 | FSPlaybackDirection direction ) | |
9635 | { | |
9636 | @@ -293,30 +293,30 @@ IFusionSoundPlayback_SetDirection( IFusionSoundPlayback *thiz, | |
9637 | data->dir = direction; | |
9638 | break; | |
9639 | default: | |
9640 | - return DFB_INVARG; | |
9641 | + return DR_INVARG; | |
9642 | } | |
9643 | ||
9644 | fs_playback_set_pitch( data->playback, data->pitch*data->dir ); | |
9645 | ||
9646 | - return DFB_OK; | |
9647 | + return DR_OK; | |
9648 | } | |
9649 | ||
9650 | -static DFBResult | |
9651 | +static DirectResult | |
9652 | IFusionSoundPlayback_SetDownmixLevels( IFusionSoundPlayback *thiz, | |
9653 | float center, | |
9654 | float rear ) | |
9655 | { | |
9656 | - DFBResult ret; | |
9657 | + DirectResult ret; | |
9658 | ||
9659 | DIRECT_INTERFACE_GET_DATA(IFusionSoundPlayback) | |
9660 | ||
9661 | D_DEBUG( "%s (%p, %.3f, %.3f)\n", __FUNCTION__, data->playback, center, rear ); | |
9662 | ||
9663 | if (center < 0.0f || center > 1.0f) | |
9664 | - return DFB_INVARG; | |
9665 | + return DR_INVARG; | |
9666 | ||
9667 | if (rear < 0.0f || rear > 1.0f) | |
9668 | - return DFB_INVARG; | |
9669 | + return DR_INVARG; | |
9670 | ||
9671 | ret = fs_playback_set_downmix( data->playback, center, rear ); | |
9672 | if (ret) | |
9673 | @@ -327,7 +327,7 @@ IFusionSoundPlayback_SetDownmixLevels( IFusionSoundPlayback *thiz, | |
9674 | ||
9675 | /******/ | |
9676 | ||
9677 | -DFBResult | |
9678 | +DirectResult | |
9679 | IFusionSoundPlayback_Construct( IFusionSoundPlayback *thiz, | |
9680 | CorePlayback *playback, | |
9681 | int length ) | |
9682 | @@ -338,7 +338,7 @@ IFusionSoundPlayback_Construct( IFusionSoundPlayback *thiz, | |
9683 | if (fs_playback_ref( playback )) { | |
9684 | DIRECT_DEALLOCATE_INTERFACE( thiz ); | |
9685 | ||
9686 | - return DFB_FUSION; | |
9687 | + return DR_FUSION; | |
9688 | } | |
9689 | ||
9690 | /* Attach our listener to the playback. */ | |
9691 | @@ -349,7 +349,7 @@ IFusionSoundPlayback_Construct( IFusionSoundPlayback *thiz, | |
9692 | ||
9693 | DIRECT_DEALLOCATE_INTERFACE( thiz ); | |
9694 | ||
9695 | - return DFB_FUSION; | |
9696 | + return DR_FUSION; | |
9697 | } | |
9698 | ||
9699 | /* Initialize private data. */ | |
9700 | @@ -382,7 +382,7 @@ IFusionSoundPlayback_Construct( IFusionSoundPlayback *thiz, | |
9701 | thiz->SetDirection = IFusionSoundPlayback_SetDirection; | |
9702 | thiz->SetDownmixLevels = IFusionSoundPlayback_SetDownmixLevels; | |
9703 | ||
9704 | - return DFB_OK; | |
9705 | + return DR_OK; | |
9706 | } | |
9707 | ||
9708 | /******/ | |
9709 | @@ -410,7 +410,7 @@ IFusionSoundPlayback_React( const void *msg_data, | |
9710 | return RS_OK; | |
9711 | } | |
9712 | ||
9713 | -static DFBResult | |
9714 | +static DirectResult | |
9715 | IFusionSoundPlayback_UpdateVolume( IFusionSoundPlayback_data* data ) | |
9716 | { | |
9717 | /* L R C Rl Rr LFE */ | |
9718 | diff --git a/src/ifusionsoundplayback.h b/src/ifusionsoundplayback.h | |
9719 | index db97441..90292d1 100644 | |
9720 | --- a/src/ifusionsoundplayback.h | |
9721 | +++ b/src/ifusionsoundplayback.h | |
9722 | @@ -34,7 +34,7 @@ | |
9723 | /* | |
9724 | * initializes interface struct and private data | |
9725 | */ | |
9726 | -DFBResult IFusionSoundPlayback_Construct( IFusionSoundPlayback *thiz, | |
9727 | +DirectResult IFusionSoundPlayback_Construct( IFusionSoundPlayback *thiz, | |
9728 | CorePlayback *playback, | |
9729 | int length ); | |
9730 | ||
9731 | diff --git a/src/ifusionsoundstream.c b/src/ifusionsoundstream.c | |
9732 | index 2ba94a9..6f9d987 100644 | |
9733 | --- a/src/ifusionsoundstream.c | |
9734 | +++ b/src/ifusionsoundstream.c | |
9735 | @@ -46,7 +46,7 @@ | |
9736 | ||
9737 | /******/ | |
9738 | ||
9739 | -static DFBResult IFusionSoundStream_FillBuffer( IFusionSoundStream_data *data, | |
9740 | +static DirectResult IFusionSoundStream_FillBuffer( IFusionSoundStream_data *data, | |
9741 | const void *sample_data, | |
9742 | int length, | |
9743 | int *ret_bytes ); | |
9744 | @@ -81,17 +81,17 @@ IFusionSoundStream_Destruct( IFusionSoundStream *thiz ) | |
9745 | DIRECT_DEALLOCATE_INTERFACE( thiz ); | |
9746 | } | |
9747 | ||
9748 | -static DFBResult | |
9749 | +static DirectResult | |
9750 | IFusionSoundStream_AddRef( IFusionSoundStream *thiz ) | |
9751 | { | |
9752 | DIRECT_INTERFACE_GET_DATA(IFusionSoundStream) | |
9753 | ||
9754 | data->ref++; | |
9755 | ||
9756 | - return DFB_OK; | |
9757 | + return DR_OK; | |
9758 | } | |
9759 | ||
9760 | -static DFBResult | |
9761 | +static DirectResult | |
9762 | IFusionSoundStream_Release( IFusionSoundStream *thiz ) | |
9763 | { | |
9764 | DIRECT_INTERFACE_GET_DATA(IFusionSoundStream) | |
9765 | @@ -99,18 +99,18 @@ IFusionSoundStream_Release( IFusionSoundStream *thiz ) | |
9766 | if (--data->ref == 0) | |
9767 | IFusionSoundStream_Destruct( thiz ); | |
9768 | ||
9769 | - return DFB_OK; | |
9770 | + return DR_OK; | |
9771 | } | |
9772 | ||
9773 | ||
9774 | -static DFBResult | |
9775 | +static DirectResult | |
9776 | IFusionSoundStream_GetDescription( IFusionSoundStream *thiz, | |
9777 | FSStreamDescription *desc ) | |
9778 | { | |
9779 | DIRECT_INTERFACE_GET_DATA(IFusionSoundStream) | |
9780 | ||
9781 | if (!desc) | |
9782 | - return DFB_INVARG; | |
9783 | + return DR_INVARG; | |
9784 | ||
9785 | desc->flags = FSSDF_BUFFERSIZE | FSSDF_CHANNELS | | |
9786 | FSSDF_SAMPLEFORMAT | FSSDF_SAMPLERATE | | |
9787 | @@ -122,10 +122,10 @@ IFusionSoundStream_GetDescription( IFusionSoundStream *thiz, | |
9788 | desc->prebuffer = data->prebuffer; | |
9789 | desc->channelmode = data->mode; | |
9790 | ||
9791 | - return DFB_OK; | |
9792 | + return DR_OK; | |
9793 | } | |
9794 | ||
9795 | -static DFBResult | |
9796 | +static DirectResult | |
9797 | IFusionSoundStream_Write( IFusionSoundStream *thiz, | |
9798 | const void *sample_data, | |
9799 | int length ) | |
9800 | @@ -133,14 +133,14 @@ IFusionSoundStream_Write( IFusionSoundStream *thiz, | |
9801 | DIRECT_INTERFACE_GET_DATA(IFusionSoundStream) | |
9802 | ||
9803 | if (!sample_data || length < 1) | |
9804 | - return DFB_INVARG; | |
9805 | + return DR_INVARG; | |
9806 | ||
9807 | pthread_mutex_lock( &data->lock ); | |
9808 | ||
9809 | data->pending = length; | |
9810 | ||
9811 | while (data->pending) { | |
9812 | - DFBResult ret; | |
9813 | + DirectResult ret; | |
9814 | int num; | |
9815 | int bytes; | |
9816 | ||
9817 | @@ -159,7 +159,7 @@ IFusionSoundStream_Write( IFusionSoundStream *thiz, | |
9818 | /* Drop could have been called while waiting */ | |
9819 | if (!data->pending) { | |
9820 | pthread_mutex_unlock( &data->lock ); | |
9821 | - return DFB_OK; | |
9822 | + return DR_OK; | |
9823 | } | |
9824 | } | |
9825 | ||
9826 | @@ -193,17 +193,17 @@ IFusionSoundStream_Write( IFusionSoundStream *thiz, | |
9827 | ||
9828 | pthread_mutex_unlock( &data->lock ); | |
9829 | ||
9830 | - return DFB_OK; | |
9831 | + return DR_OK; | |
9832 | } | |
9833 | ||
9834 | -static DFBResult | |
9835 | +static DirectResult | |
9836 | IFusionSoundStream_Wait( IFusionSoundStream *thiz, | |
9837 | int length ) | |
9838 | { | |
9839 | DIRECT_INTERFACE_GET_DATA(IFusionSoundStream) | |
9840 | ||
9841 | if (length < 0 || length > data->size) | |
9842 | - return DFB_INVARG; | |
9843 | + return DR_INVARG; | |
9844 | ||
9845 | pthread_mutex_lock( &data->lock ); | |
9846 | ||
9847 | @@ -227,16 +227,16 @@ IFusionSoundStream_Wait( IFusionSoundStream *thiz, | |
9848 | ||
9849 | pthread_mutex_unlock( &data->lock ); | |
9850 | ||
9851 | - return DFB_OK; | |
9852 | + return DR_OK; | |
9853 | } | |
9854 | ||
9855 | -static DFBResult | |
9856 | +static DirectResult | |
9857 | IFusionSoundStream_GetStatus( IFusionSoundStream *thiz, | |
9858 | int *filled, | |
9859 | int *total, | |
9860 | int *read_position, | |
9861 | int *write_position, | |
9862 | - DFBBoolean *playing ) | |
9863 | + bool *playing ) | |
9864 | { | |
9865 | DIRECT_INTERFACE_GET_DATA(IFusionSoundStream) | |
9866 | ||
9867 | @@ -259,10 +259,10 @@ IFusionSoundStream_GetStatus( IFusionSoundStream *thiz, | |
9868 | ||
9869 | pthread_mutex_unlock( &data->lock ); | |
9870 | ||
9871 | - return DFB_OK; | |
9872 | + return DR_OK; | |
9873 | } | |
9874 | ||
9875 | -static DFBResult | |
9876 | +static DirectResult | |
9877 | IFusionSoundStream_Flush( IFusionSoundStream *thiz ) | |
9878 | { | |
9879 | DIRECT_INTERFACE_GET_DATA(IFusionSoundStream) | |
9880 | @@ -284,10 +284,10 @@ IFusionSoundStream_Flush( IFusionSoundStream *thiz ) | |
9881 | ||
9882 | pthread_mutex_unlock( &data->lock ); | |
9883 | ||
9884 | - return DFB_OK; | |
9885 | + return DR_OK; | |
9886 | } | |
9887 | ||
9888 | -static DFBResult | |
9889 | +static DirectResult | |
9890 | IFusionSoundStream_Drop( IFusionSoundStream *thiz ) | |
9891 | { | |
9892 | DIRECT_INTERFACE_GET_DATA(IFusionSoundStream) | |
9893 | @@ -302,17 +302,17 @@ IFusionSoundStream_Drop( IFusionSoundStream *thiz ) | |
9894 | ||
9895 | pthread_mutex_unlock( &data->lock ); | |
9896 | ||
9897 | - return DFB_OK; | |
9898 | + return DR_OK; | |
9899 | } | |
9900 | ||
9901 | -static DFBResult | |
9902 | +static DirectResult | |
9903 | IFusionSoundStream_GetPresentationDelay( IFusionSoundStream *thiz, | |
9904 | int *delay ) | |
9905 | { | |
9906 | DIRECT_INTERFACE_GET_DATA(IFusionSoundStream) | |
9907 | ||
9908 | if (!delay) | |
9909 | - return DFB_INVARG; | |
9910 | + return DR_INVARG; | |
9911 | ||
9912 | pthread_mutex_lock( &data->lock ); | |
9913 | ||
9914 | @@ -321,21 +321,21 @@ IFusionSoundStream_GetPresentationDelay( IFusionSoundStream *thiz, | |
9915 | ||
9916 | pthread_mutex_unlock( &data->lock ); | |
9917 | ||
9918 | - return DFB_OK; | |
9919 | + return DR_OK; | |
9920 | } | |
9921 | ||
9922 | -static DFBResult | |
9923 | +static DirectResult | |
9924 | IFusionSoundStream_GetPlayback( IFusionSoundStream *thiz, | |
9925 | IFusionSoundPlayback **ret_interface ) | |
9926 | { | |
9927 | DIRECT_INTERFACE_GET_DATA(IFusionSoundStream) | |
9928 | ||
9929 | if (!ret_interface) | |
9930 | - return DFB_INVARG; | |
9931 | + return DR_INVARG; | |
9932 | ||
9933 | if (!data->iplayback) { | |
9934 | IFusionSoundPlayback *interface; | |
9935 | - DFBResult ret; | |
9936 | + DirectResult ret; | |
9937 | ||
9938 | DIRECT_ALLOCATE_INTERFACE( interface, IFusionSoundPlayback ); | |
9939 | ||
9940 | @@ -352,22 +352,22 @@ IFusionSoundStream_GetPlayback( IFusionSoundStream *thiz, | |
9941 | ||
9942 | *ret_interface = data->iplayback; | |
9943 | ||
9944 | - return DFB_OK; | |
9945 | + return DR_OK; | |
9946 | } | |
9947 | ||
9948 | -static DFBResult | |
9949 | +static DirectResult | |
9950 | IFusionSoundStream_Access( IFusionSoundStream *thiz, | |
9951 | void **ret_data, | |
9952 | int *ret_avail ) | |
9953 | { | |
9954 | - DFBResult ret; | |
9955 | + DirectResult ret; | |
9956 | int num; | |
9957 | int bytes; | |
9958 | ||
9959 | DIRECT_INTERFACE_GET_DATA(IFusionSoundStream) | |
9960 | ||
9961 | if (!ret_data || !ret_avail) | |
9962 | - return DFB_INVARG; | |
9963 | + return DR_INVARG; | |
9964 | ||
9965 | pthread_mutex_lock( &data->lock ); | |
9966 | ||
9967 | @@ -398,22 +398,22 @@ IFusionSoundStream_Access( IFusionSoundStream *thiz, | |
9968 | return ret; | |
9969 | } | |
9970 | ||
9971 | -static DFBResult | |
9972 | +static DirectResult | |
9973 | IFusionSoundStream_Commit( IFusionSoundStream *thiz, | |
9974 | int length ) | |
9975 | { | |
9976 | - DFBResult ret; | |
9977 | + DirectResult ret; | |
9978 | ||
9979 | DIRECT_INTERFACE_GET_DATA(IFusionSoundStream) | |
9980 | ||
9981 | if (length < 0) | |
9982 | - return DFB_INVARG; | |
9983 | + return DR_INVARG; | |
9984 | ||
9985 | pthread_mutex_lock( &data->lock ); | |
9986 | ||
9987 | if (length > data->size - data->filled) { | |
9988 | pthread_mutex_unlock( &data->lock ); | |
9989 | - return DFB_INVARG; | |
9990 | + return DR_INVARG; | |
9991 | } | |
9992 | ||
9993 | D_DEBUG( "%s: length %d, filled %d/%d (%splaying)\n", | |
9994 | @@ -453,13 +453,13 @@ IFusionSoundStream_Commit( IFusionSoundStream *thiz, | |
9995 | ||
9996 | pthread_mutex_unlock( &data->lock ); | |
9997 | ||
9998 | - return DFB_OK; | |
9999 | + return DR_OK; | |
10000 | } | |
10001 | ||
10002 | ||
10003 | /******/ | |
10004 | ||
10005 | -DFBResult | |
10006 | +DirectResult | |
10007 | IFusionSoundStream_Construct( IFusionSoundStream *thiz, | |
10008 | CoreSound *core, | |
10009 | CoreSoundBuffer *buffer, | |
10010 | @@ -469,14 +469,14 @@ IFusionSoundStream_Construct( IFusionSoundStream *thiz, | |
10011 | int rate, | |
10012 | int prebuffer ) | |
10013 | { | |
10014 | - DFBResult ret; | |
10015 | + DirectResult ret; | |
10016 | CorePlayback *playback; | |
10017 | ||
10018 | DIRECT_ALLOCATE_INTERFACE_DATA(thiz, IFusionSoundStream) | |
10019 | ||
10020 | /* Increase reference counter of the buffer. */ | |
10021 | if (fs_buffer_ref( buffer )) { | |
10022 | - ret = DFB_FUSION; | |
10023 | + ret = DR_FUSION; | |
10024 | goto error_ref; | |
10025 | } | |
10026 | ||
10027 | @@ -487,7 +487,7 @@ IFusionSoundStream_Construct( IFusionSoundStream *thiz, | |
10028 | ||
10029 | /* Attach our listener to the playback object. */ | |
10030 | if (fs_playback_attach( playback, IFusionSoundStream_React, data, &data->reaction )) { | |
10031 | - ret = DFB_FUSION; | |
10032 | + ret = DR_FUSION; | |
10033 | goto error_attach; | |
10034 | } | |
10035 | ||
10036 | @@ -528,7 +528,7 @@ IFusionSoundStream_Construct( IFusionSoundStream *thiz, | |
10037 | thiz->Access = IFusionSoundStream_Access; | |
10038 | thiz->Commit = IFusionSoundStream_Commit; | |
10039 | ||
10040 | - return DFB_OK; | |
10041 | + return DR_OK; | |
10042 | ||
10043 | error_attach: | |
10044 | fs_playback_unref( playback ); | |
10045 | @@ -544,13 +544,13 @@ error_ref: | |
10046 | ||
10047 | /******/ | |
10048 | ||
10049 | -static DFBResult | |
10050 | +static DirectResult | |
10051 | IFusionSoundStream_FillBuffer( IFusionSoundStream_data *data, | |
10052 | const void *sample_data, | |
10053 | int length, | |
10054 | int *ret_bytes ) | |
10055 | { | |
10056 | - DFBResult ret; | |
10057 | + DirectResult ret; | |
10058 | void *lock_data; | |
10059 | int lock_bytes; | |
10060 | int offset = 0; | |
10061 | @@ -597,7 +597,7 @@ IFusionSoundStream_FillBuffer( IFusionSoundStream_data *data, | |
10062 | if (ret_bytes) | |
10063 | *ret_bytes = offset; | |
10064 | ||
10065 | - return DFB_OK; | |
10066 | + return DR_OK; | |
10067 | } | |
10068 | ||
10069 | static ReactionResult | |
10070 | diff --git a/src/ifusionsoundstream.h b/src/ifusionsoundstream.h | |
10071 | index eb3c193..fd43aff 100644 | |
10072 | --- a/src/ifusionsoundstream.h | |
10073 | +++ b/src/ifusionsoundstream.h | |
10074 | @@ -62,7 +62,7 @@ typedef struct { | |
10075 | /* | |
10076 | * initializes interface struct and private data | |
10077 | */ | |
10078 | -DFBResult IFusionSoundStream_Construct( IFusionSoundStream *thiz, | |
10079 | +DirectResult IFusionSoundStream_Construct( IFusionSoundStream *thiz, | |
10080 | CoreSound *core, | |
10081 | CoreSoundBuffer *buffer, | |
10082 | int size, | |
10083 | diff --git a/src/media/ifusionsoundmusicprovider.c b/src/media/ifusionsoundmusicprovider.c | |
10084 | index af87e05..9ea5c26 100644 | |
10085 | --- a/src/media/ifusionsoundmusicprovider.c | |
10086 | +++ b/src/media/ifusionsoundmusicprovider.c | |
10087 | @@ -38,40 +38,40 @@ | |
10088 | #include <media/ifusionsoundmusicprovider.h> | |
10089 | ||
10090 | ||
10091 | -static DFBResult | |
10092 | +static DirectResult | |
10093 | IFusionSoundMusicProvider_AddRef( IFusionSoundMusicProvider *thiz ) | |
10094 | { | |
10095 | - return DFB_UNIMPLEMENTED; | |
10096 | + return DR_UNIMPLEMENTED; | |
10097 | } | |
10098 | ||
10099 | -static DFBResult | |
10100 | +static DirectResult | |
10101 | IFusionSoundMusicProvider_Release( IFusionSoundMusicProvider *thiz ) | |
10102 | { | |
10103 | - return DFB_UNIMPLEMENTED; | |
10104 | + return DR_UNIMPLEMENTED; | |
10105 | } | |
10106 | ||
10107 | -static DFBResult | |
10108 | +static DirectResult | |
10109 | IFusionSoundMusicProvider_GetCapabilities( IFusionSoundMusicProvider *thiz, | |
10110 | FSMusicProviderCapabilities *caps ) | |
10111 | { | |
10112 | if (!caps) | |
10113 | - return DFB_INVARG; | |
10114 | + return DR_INVARG; | |
10115 | ||
10116 | *caps = FMCAPS_BASIC; | |
10117 | ||
10118 | - return DFB_UNIMPLEMENTED; | |
10119 | + return DR_UNIMPLEMENTED; | |
10120 | } | |
10121 | ||
10122 | -static DFBResult | |
10123 | +static DirectResult | |
10124 | IFusionSoundMusicProvider_EnumTracks( IFusionSoundMusicProvider *thiz, | |
10125 | FSTrackCallback callback, | |
10126 | void *callbackdata ) | |
10127 | { | |
10128 | FSTrackDescription desc; | |
10129 | - DFBResult ret; | |
10130 | + DirectResult ret; | |
10131 | ||
10132 | if (!callback) | |
10133 | - return DFB_INVARG; | |
10134 | + return DR_INVARG; | |
10135 | ||
10136 | ret = thiz->GetTrackDescription( thiz, &desc ); | |
10137 | if (ret) | |
10138 | @@ -79,145 +79,145 @@ IFusionSoundMusicProvider_EnumTracks( IFusionSoundMusicProvider *thiz, | |
10139 | ||
10140 | callback( 0, desc, callbackdata ); | |
10141 | ||
10142 | - return DFB_OK; | |
10143 | + return DR_OK; | |
10144 | } | |
10145 | ||
10146 | -static DFBResult | |
10147 | +static DirectResult | |
10148 | IFusionSoundMusicProvider_GetTrackID( IFusionSoundMusicProvider *thiz, | |
10149 | FSTrackID *ret_track_id ) | |
10150 | { | |
10151 | if (!ret_track_id) | |
10152 | - return DFB_INVARG; | |
10153 | + return DR_INVARG; | |
10154 | ||
10155 | *ret_track_id = 0; | |
10156 | ||
10157 | - return DFB_OK; | |
10158 | + return DR_OK; | |
10159 | } | |
10160 | ||
10161 | -static DFBResult | |
10162 | +static DirectResult | |
10163 | IFusionSoundMusicProvider_GetTrackDescription( IFusionSoundMusicProvider *thiz, | |
10164 | FSTrackDescription *desc ) | |
10165 | { | |
10166 | if (!desc) | |
10167 | - return DFB_INVARG; | |
10168 | + return DR_INVARG; | |
10169 | ||
10170 | memset( desc, 0, sizeof(FSTrackDescription) ); | |
10171 | ||
10172 | - return DFB_UNIMPLEMENTED; | |
10173 | + return DR_UNIMPLEMENTED; | |
10174 | } | |
10175 | ||
10176 | -static DFBResult | |
10177 | +static DirectResult | |
10178 | IFusionSoundMusicProvider_GetStreamDescription( IFusionSoundMusicProvider *thiz, | |
10179 | FSStreamDescription *desc ) | |
10180 | { | |
10181 | if (!desc) | |
10182 | - return DFB_INVARG; | |
10183 | + return DR_INVARG; | |
10184 | ||
10185 | desc->flags = FSSDF_NONE; | |
10186 | ||
10187 | - return DFB_UNIMPLEMENTED; | |
10188 | + return DR_UNIMPLEMENTED; | |
10189 | } | |
10190 | ||
10191 | -static DFBResult | |
10192 | +static DirectResult | |
10193 | IFusionSoundMusicProvider_GetBufferDescription( IFusionSoundMusicProvider *thiz, | |
10194 | FSBufferDescription *desc ) | |
10195 | { | |
10196 | if (!desc) | |
10197 | - return DFB_INVARG; | |
10198 | + return DR_INVARG; | |
10199 | ||
10200 | desc->flags = FSBDF_NONE; | |
10201 | ||
10202 | - return DFB_UNIMPLEMENTED; | |
10203 | + return DR_UNIMPLEMENTED; | |
10204 | } | |
10205 | ||
10206 | -static DFBResult | |
10207 | +static DirectResult | |
10208 | IFusionSoundMusicProvider_SelectTrack( IFusionSoundMusicProvider *thiz, | |
10209 | FSTrackID track_id ) | |
10210 | { | |
10211 | if (track_id != 0) | |
10212 | - return DFB_UNSUPPORTED; | |
10213 | + return DR_UNSUPPORTED; | |
10214 | ||
10215 | - return DFB_OK; | |
10216 | + return DR_OK; | |
10217 | } | |
10218 | ||
10219 | -static DFBResult | |
10220 | +static DirectResult | |
10221 | IFusionSoundMusicProvider_PlayToStream( IFusionSoundMusicProvider *thiz, | |
10222 | IFusionSoundStream *destination ) | |
10223 | { | |
10224 | - return DFB_UNIMPLEMENTED; | |
10225 | + return DR_UNIMPLEMENTED; | |
10226 | } | |
10227 | ||
10228 | -static DFBResult | |
10229 | +static DirectResult | |
10230 | IFusionSoundMusicProvider_PlayToBuffer( IFusionSoundMusicProvider *thiz, | |
10231 | IFusionSoundBuffer *destination, | |
10232 | FMBufferCallback callback, | |
10233 | void *ctx ) | |
10234 | { | |
10235 | - return DFB_UNIMPLEMENTED; | |
10236 | + return DR_UNIMPLEMENTED; | |
10237 | } | |
10238 | ||
10239 | -static DFBResult | |
10240 | +static DirectResult | |
10241 | IFusionSoundMusicProvider_Stop( IFusionSoundMusicProvider *thiz ) | |
10242 | { | |
10243 | - return DFB_UNIMPLEMENTED; | |
10244 | + return DR_UNIMPLEMENTED; | |
10245 | } | |
10246 | ||
10247 | -static DFBResult | |
10248 | +static DirectResult | |
10249 | IFusionSoundMusicProvider_GetStatus( IFusionSoundMusicProvider *thiz, | |
10250 | FSMusicProviderStatus *status ) | |
10251 | { | |
10252 | if (!status) | |
10253 | - return DFB_INVARG; | |
10254 | + return DR_INVARG; | |
10255 | ||
10256 | *status = FMSTATE_UNKNOWN; | |
10257 | ||
10258 | - return DFB_UNIMPLEMENTED; | |
10259 | + return DR_UNIMPLEMENTED; | |
10260 | } | |
10261 | ||
10262 | -static DFBResult | |
10263 | +static DirectResult | |
10264 | IFusionSoundMusicProvider_SeekTo( IFusionSoundMusicProvider *thiz, | |
10265 | double seconds ) | |
10266 | { | |
10267 | - return DFB_UNIMPLEMENTED; | |
10268 | + return DR_UNIMPLEMENTED; | |
10269 | } | |
10270 | ||
10271 | -static DFBResult | |
10272 | +static DirectResult | |
10273 | IFusionSoundMusicProvider_GetPos( IFusionSoundMusicProvider *thiz, | |
10274 | double *seconds ) | |
10275 | { | |
10276 | if (!seconds) | |
10277 | - return DFB_INVARG; | |
10278 | + return DR_INVARG; | |
10279 | ||
10280 | *seconds = 0.0; | |
10281 | ||
10282 | - return DFB_UNIMPLEMENTED; | |
10283 | + return DR_UNIMPLEMENTED; | |
10284 | } | |
10285 | ||
10286 | -static DFBResult | |
10287 | +static DirectResult | |
10288 | IFusionSoundMusicProvider_GetLength( IFusionSoundMusicProvider *thiz, | |
10289 | double *seconds ) | |
10290 | { | |
10291 | if (!seconds) | |
10292 | - return DFB_INVARG; | |
10293 | + return DR_INVARG; | |
10294 | ||
10295 | *seconds = 0.0; | |
10296 | ||
10297 | - return DFB_UNIMPLEMENTED; | |
10298 | + return DR_UNIMPLEMENTED; | |
10299 | } | |
10300 | ||
10301 | -static DFBResult | |
10302 | +static DirectResult | |
10303 | IFusionSoundMusicProvider_SetPlaybackFlags( IFusionSoundMusicProvider *thiz, | |
10304 | FSMusicProviderPlaybackFlags flags ) | |
10305 | { | |
10306 | - return DFB_UNIMPLEMENTED; | |
10307 | + return DR_UNIMPLEMENTED; | |
10308 | } | |
10309 | ||
10310 | -static DFBResult | |
10311 | +static DirectResult | |
10312 | IFusionSoundMusicProvider_WaitStatus( IFusionSoundMusicProvider *thiz, | |
10313 | FSMusicProviderStatus mask, | |
10314 | unsigned int timeout ) | |
10315 | { | |
10316 | - return DFB_UNIMPLEMENTED; | |
10317 | + return DR_UNIMPLEMENTED; | |
10318 | } | |
10319 | ||
10320 | static void | |
10321 | @@ -244,11 +244,11 @@ IFusionSoundMusicProvider_Construct( IFusionSoundMusicProvider *thiz ) | |
10322 | } | |
10323 | ||
10324 | ||
10325 | -DFBResult | |
10326 | +DirectResult | |
10327 | IFusionSoundMusicProvider_Create( const char *filename, | |
10328 | IFusionSoundMusicProvider **interface ) | |
10329 | { | |
10330 | - DFBResult ret; | |
10331 | + DirectResult ret; | |
10332 | DirectInterfaceFuncs *funcs = NULL; | |
10333 | IFusionSoundMusicProvider *musicprovider; | |
10334 | IFusionSoundMusicProvider_ProbeContext ctx; | |
10335 | diff --git a/src/media/ifusionsoundmusicprovider.h b/src/media/ifusionsoundmusicprovider.h | |
10336 | index a18d08f..94408a7 100644 | |
10337 | --- a/src/media/ifusionsoundmusicprovider.h | |
10338 | +++ b/src/media/ifusionsoundmusicprovider.h | |
10339 | @@ -43,7 +43,7 @@ typedef struct { | |
10340 | } IFusionSoundMusicProvider_ProbeContext; | |
10341 | ||
10342 | ||
10343 | -DFBResult IFusionSoundMusicProvider_Create( const char *filename, | |
10344 | +DirectResult IFusionSoundMusicProvider_Create( const char *filename, | |
10345 | IFusionSoundMusicProvider **interface ); | |
10346 | ||
10347 | #endif | |
10348 | diff --git a/src/misc/sound_conf.c b/src/misc/sound_conf.c | |
10349 | index b998730..6af2762 100644 | |
10350 | --- a/src/misc/sound_conf.c | |
10351 | +++ b/src/misc/sound_conf.c | |
10352 | @@ -139,7 +139,7 @@ parse_modestring( const char *mode ) | |
10353 | } | |
10354 | ||
10355 | ||
10356 | -static DFBResult | |
10357 | +static DirectResult | |
10358 | parse_args( const char *args ) | |
10359 | { | |
10360 | char *buf = alloca( strlen(args) + 1 ); | |
10361 | @@ -147,7 +147,7 @@ parse_args( const char *args ) | |
10362 | strcpy( buf, args ); | |
10363 | ||
10364 | while (buf && buf[0]) { | |
10365 | - DFBResult ret; | |
10366 | + DirectResult ret; | |
10367 | char *value; | |
10368 | char *next; | |
10369 | ||
10370 | @@ -164,9 +164,9 @@ parse_args( const char *args ) | |
10371 | ||
10372 | ret = fs_config_set( buf, value ); | |
10373 | switch (ret) { | |
10374 | - case DFB_OK: | |
10375 | + case DR_OK: | |
10376 | break; | |
10377 | - case DFB_UNSUPPORTED: | |
10378 | + case DR_UNSUPPORTED: | |
10379 | D_ERROR( "FusionSound/Config: Unknown option '%s'!\n", buf ); | |
10380 | break; | |
10381 | default: | |
10382 | @@ -176,7 +176,7 @@ parse_args( const char *args ) | |
10383 | buf = next; | |
10384 | } | |
10385 | ||
10386 | - return DFB_OK; | |
10387 | + return DR_OK; | |
10388 | } | |
10389 | ||
10390 | static void | |
10391 | @@ -203,7 +203,7 @@ fs_config_usage( void ) | |
10392 | return config_usage; | |
10393 | } | |
10394 | ||
10395 | -DFBResult | |
10396 | +DirectResult | |
10397 | fs_config_set( const char *name, const char *value ) | |
10398 | { | |
10399 | if (!strcmp( name, "driver" )) { | |
10400 | @@ -214,7 +214,7 @@ fs_config_set( const char *name, const char *value ) | |
10401 | } | |
10402 | else { | |
10403 | D_ERROR( "FusionSound/Config '%s': No value specified!\n", name ); | |
10404 | - return DFB_INVARG; | |
10405 | + return DR_INVARG; | |
10406 | } | |
10407 | } | |
10408 | else if (!strcmp( name, "device" )) { | |
10409 | @@ -225,7 +225,7 @@ fs_config_set( const char *name, const char *value ) | |
10410 | } | |
10411 | else { | |
10412 | D_ERROR( "FusionSound/Config '%s': No value specified!\n", name ); | |
10413 | - return DFB_INVARG; | |
10414 | + return DR_INVARG; | |
10415 | } | |
10416 | } | |
10417 | else if (!strcmp( name, "channels" )) { | |
10418 | @@ -234,18 +234,18 @@ fs_config_set( const char *name, const char *value ) | |
10419 | ||
10420 | if (sscanf( value, "%d", &channels ) < 1) { | |
10421 | D_ERROR( "FusionSound/Config '%s': Could not parse value!\n", name ); | |
10422 | - return DFB_INVARG; | |
10423 | + return DR_INVARG; | |
10424 | } | |
10425 | else if (channels < 1 || channels > FS_MAX_CHANNELS) { | |
10426 | D_ERROR( "FusionSound/Config '%s': Unsupported value '%d'!\n", name, channels ); | |
10427 | - return DFB_INVARG; | |
10428 | + return DR_INVARG; | |
10429 | } | |
10430 | ||
10431 | fs_config->channelmode = fs_mode_for_channels( channels ); | |
10432 | } | |
10433 | else { | |
10434 | D_ERROR( "FusionSound/Config '%s': No value specified!\n", name ); | |
10435 | - return DFB_INVARG; | |
10436 | + return DR_INVARG; | |
10437 | } | |
10438 | } | |
10439 | else if (!strcmp( name, "channelmode" )) { | |
10440 | @@ -255,14 +255,14 @@ fs_config_set( const char *name, const char *value ) | |
10441 | mode = parse_modestring( value ); | |
10442 | if (mode == FSCM_UNKNOWN) { | |
10443 | D_ERROR( "FusionSound/Config '%s': Could not parse value!\n", name ); | |
10444 | - return DFB_INVARG; | |
10445 | + return DR_INVARG; | |
10446 | } | |
10447 | ||
10448 | fs_config->channelmode = mode; | |
10449 | } | |
10450 | else { | |
10451 | D_ERROR( "FusionSound/Config '%s': No value specified!\n", name ); | |
10452 | - return DFB_INVARG; | |
10453 | + return DR_INVARG; | |
10454 | } | |
10455 | } | |
10456 | else if (!strcmp( name, "sampleformat" )) { | |
10457 | @@ -272,14 +272,14 @@ fs_config_set( const char *name, const char *value ) | |
10458 | format = parse_sampleformat( value ); | |
10459 | if (format == FSSF_UNKNOWN) { | |
10460 | D_ERROR( "FusionSound/Config '%s': Could not parse value!\n", name ); | |
10461 | - return DFB_INVARG; | |
10462 | + return DR_INVARG; | |
10463 | } | |
10464 | ||
10465 | fs_config->sampleformat = format; | |
10466 | } | |
10467 | else { | |
10468 | D_ERROR( "FusionSound/Config '%s': No format specified!\n", name ); | |
10469 | - return DFB_INVARG; | |
10470 | + return DR_INVARG; | |
10471 | } | |
10472 | } | |
10473 | else if (!strcmp( name, "samplerate" )) { | |
10474 | @@ -289,18 +289,18 @@ fs_config_set( const char *name, const char *value ) | |
10475 | if (sscanf( value, "%d", &rate ) < 1) { | |
10476 | D_ERROR( "FusionSound/Config 'samplerate': " | |
10477 | "Could not parse value!\n" ); | |
10478 | - return DFB_INVARG; | |
10479 | + return DR_INVARG; | |
10480 | } | |
10481 | else if (rate < 1) { | |
10482 | D_ERROR( "FusionSound/Config '%s': Unsupported value '%d'!\n", name, rate ); | |
10483 | - return DFB_INVARG; | |
10484 | + return DR_INVARG; | |
10485 | } | |
10486 | ||
10487 | fs_config->samplerate = rate; | |
10488 | } | |
10489 | else { | |
10490 | D_ERROR( "FusionSound/Config '%s': No value specified!\n", name ); | |
10491 | - return DFB_INVARG; | |
10492 | + return DR_INVARG; | |
10493 | } | |
10494 | } | |
10495 | else if (!strcmp( name, "buffertime" )) { | |
10496 | @@ -310,18 +310,18 @@ fs_config_set( const char *name, const char *value ) | |
10497 | if (sscanf( value, "%d", &time ) < 1) { | |
10498 | D_ERROR( "FusionSound/Config 'buffertime': " | |
10499 | "Could not parse value!\n" ); | |
10500 | - return DFB_INVARG; | |
10501 | + return DR_INVARG; | |
10502 | } | |
10503 | else if (time < 1 || time > 5000) { | |
10504 | D_ERROR( "FusionSound/Config '%s': Unsupported value '%d'!\n", name, time ); | |
10505 | - return DFB_INVARG; | |
10506 | + return DR_INVARG; | |
10507 | } | |
10508 | ||
10509 | fs_config->buffertime = time; | |
10510 | } | |
10511 | else { | |
10512 | D_ERROR( "FusionSound/Config '%s': No value specified!\n", name ); | |
10513 | - return DFB_INVARG; | |
10514 | + return DR_INVARG; | |
10515 | } | |
10516 | } | |
10517 | else if (!strcmp( name, "session" )) { | |
10518 | @@ -330,14 +330,14 @@ fs_config_set( const char *name, const char *value ) | |
10519 | ||
10520 | if (sscanf( value, "%d", &session ) < 1) { | |
10521 | D_ERROR( "FusionSound/Config '%s': Could not parse value!\n", name ); | |
10522 | - return DFB_INVARG; | |
10523 | + return DR_INVARG; | |
10524 | } | |
10525 | ||
10526 | fs_config->session = session; | |
10527 | } | |
10528 | else { | |
10529 | D_ERROR( "FusionSound/Config '%s': No value specified!\n", name ); | |
10530 | - return DFB_INVARG; | |
10531 | + return DR_INVARG; | |
10532 | } | |
10533 | } | |
10534 | else if (!strcmp (name, "remote" )) { | |
10535 | @@ -348,7 +348,7 @@ fs_config_set( const char *name, const char *value ) | |
10536 | if (sscanf( value, "%127s:%d", host, &session ) < 1) { | |
10537 | D_ERROR( "FusionSound/Config '%s': " | |
10538 | "Could not parse value (format is <host>[:<session>])!\n", name ); | |
10539 | - return DFB_INVARG; | |
10540 | + return DR_INVARG; | |
10541 | } | |
10542 | ||
10543 | if (fs_config->remote.host) | |
10544 | @@ -359,7 +359,7 @@ fs_config_set( const char *name, const char *value ) | |
10545 | } | |
10546 | else { | |
10547 | D_ERROR( "FusionSound/Config '%s': No value specified!\n", name ); | |
10548 | - return DFB_INVARG; | |
10549 | + return DR_INVARG; | |
10550 | } | |
10551 | } | |
10552 | else if (!strcmp( name, "remote-compression" )) { | |
10553 | @@ -372,12 +372,12 @@ fs_config_set( const char *name, const char *value ) | |
10554 | } | |
10555 | else { | |
10556 | D_ERROR( "FusionSound/Config '%s': Unsupported value '%s'!\n", name, value ); | |
10557 | - return DFB_INVARG; | |
10558 | + return DR_INVARG; | |
10559 | } | |
10560 | } | |
10561 | else { | |
10562 | D_ERROR( "FusionSound/Config '%s': No value specified!\n", name ); | |
10563 | - return DFB_INVARG; | |
10564 | + return DR_INVARG; | |
10565 | } | |
10566 | } | |
10567 | else if (!strcmp( name, "banner" )) { | |
10568 | @@ -411,15 +411,15 @@ fs_config_set( const char *name, const char *value ) | |
10569 | fs_config->dma = false; | |
10570 | } | |
10571 | else if (fusion_config_set( name, value ) && direct_config_set( name, value )) | |
10572 | - return DFB_UNSUPPORTED; | |
10573 | + return DR_UNSUPPORTED; | |
10574 | ||
10575 | - return DFB_OK; | |
10576 | + return DR_OK; | |
10577 | } | |
10578 | ||
10579 | -static DFBResult | |
10580 | +static DirectResult | |
10581 | fs_config_read( const char *filename ) | |
10582 | { | |
10583 | - DFBResult ret = DFB_OK; | |
10584 | + DirectResult ret = DR_OK; | |
10585 | char line[400]; | |
10586 | FILE *f; | |
10587 | ||
10588 | @@ -427,7 +427,7 @@ fs_config_read( const char *filename ) | |
10589 | if (!f) { | |
10590 | D_DEBUG( "FusionSound/Config: " | |
10591 | "Unable to open config file `%s'!\n", filename ); | |
10592 | - return DFB_IO; | |
10593 | + return DR_IO; | |
10594 | } else { | |
10595 | D_INFO( "FusionSound/Config: " | |
10596 | "Parsing config file '%s'.\n", filename ); | |
10597 | @@ -449,7 +449,7 @@ fs_config_read( const char *filename ) | |
10598 | ||
10599 | ret = fs_config_set( name, value ); | |
10600 | if (ret) { | |
10601 | - if (ret == DFB_UNSUPPORTED) | |
10602 | + if (ret == DR_UNSUPPORTED) | |
10603 | D_ERROR( "FusionSound/Config: In config file `%s': " | |
10604 | "Invalid option `%s'!\n", filename, name ); | |
10605 | break; | |
10606 | @@ -461,22 +461,22 @@ fs_config_read( const char *filename ) | |
10607 | return ret; | |
10608 | } | |
10609 | ||
10610 | -DFBResult | |
10611 | +DirectResult | |
10612 | fs_config_init( int *argc, char **argv[] ) | |
10613 | { | |
10614 | - DFBResult ret; | |
10615 | + DirectResult ret; | |
10616 | char *home = getenv( "HOME" ); | |
10617 | char *prog = NULL; | |
10618 | char *fsargs; | |
10619 | ||
10620 | if (fs_config) | |
10621 | - return DFB_OK; | |
10622 | + return DR_OK; | |
10623 | ||
10624 | config_allocate(); | |
10625 | ||
10626 | /* Read system settings. */ | |
10627 | ret = fs_config_read( SYSCONFDIR"/fusionsoundrc" ); | |
10628 | - if (ret && ret != DFB_IO) | |
10629 | + if (ret && ret != DR_IO) | |
10630 | return ret; | |
10631 | ||
10632 | /* Read user settings. */ | |
10633 | @@ -487,7 +487,7 @@ fs_config_init( int *argc, char **argv[] ) | |
10634 | snprintf( buf, len, "%s/.fusionsoundrc", home ); | |
10635 | ||
10636 | ret = fs_config_read( buf ); | |
10637 | - if (ret && ret != DFB_IO) | |
10638 | + if (ret && ret != DR_IO) | |
10639 | return ret; | |
10640 | } | |
10641 | ||
10642 | @@ -509,7 +509,7 @@ fs_config_init( int *argc, char **argv[] ) | |
10643 | snprintf( buf, len, SYSCONFDIR"/fusionsoundrc.%s", prog ); | |
10644 | ||
10645 | ret = fs_config_read( buf ); | |
10646 | - if (ret && ret != DFB_IO) | |
10647 | + if (ret && ret != DR_IO) | |
10648 | return ret; | |
10649 | } | |
10650 | ||
10651 | @@ -521,7 +521,7 @@ fs_config_init( int *argc, char **argv[] ) | |
10652 | snprintf( buf, len, "%s/.fusionsoundrc.%s", home, prog ); | |
10653 | ||
10654 | ret = fs_config_read( buf ); | |
10655 | - if (ret && ret != DFB_IO) | |
10656 | + if (ret && ret != DR_IO) | |
10657 | return ret; | |
10658 | } | |
10659 | ||
10660 | @@ -573,5 +573,5 @@ fs_config_init( int *argc, char **argv[] ) | |
10661 | } | |
10662 | } | |
10663 | ||
10664 | - return DFB_OK; | |
10665 | + return DR_OK; | |
10666 | } | |
10667 | diff --git a/src/misc/sound_conf.h b/src/misc/sound_conf.h | |
10668 | index 232966f..e4291b0 100644 | |
10669 | --- a/src/misc/sound_conf.h | |
10670 | +++ b/src/misc/sound_conf.h | |
10671 | @@ -69,12 +69,12 @@ extern FSConfig *fs_config; | |
10672 | * for overrides. Options identified as FusionSound options are stripped out | |
10673 | * of the array. | |
10674 | */ | |
10675 | -DFBResult fs_config_init( int *argc, char **argv[] ); | |
10676 | +DirectResult fs_config_init( int *argc, char **argv[] ); | |
10677 | ||
10678 | /* | |
10679 | * Set indiviual option. Used by config_init(), and FusionSoundSetOption() | |
10680 | */ | |
10681 | -DFBResult fs_config_set( const char *name, const char *value ); | |
10682 | +DirectResult fs_config_set( const char *name, const char *value ); | |
10683 | ||
10684 | const char *fs_config_usage( void ); | |
10685 | ||
10686 | diff --git a/tools/fsdump.c b/tools/fsdump.c | |
10687 | index 3c15afd..53e6a3d 100644 | |
10688 | --- a/tools/fsdump.c | |
10689 | +++ b/tools/fsdump.c | |
10690 | @@ -57,10 +57,10 @@ | |
10691 | static IFusionSound *fsound = NULL; | |
10692 | ||
10693 | ||
10694 | -static DFBResult | |
10695 | +static DirectResult | |
10696 | init_fusionsound( int *argc, char **argv[] ) | |
10697 | { | |
10698 | - DFBResult ret; | |
10699 | + DirectResult ret; | |
10700 | ||
10701 | /* Initialize FusionSound. */ | |
10702 | ret = FusionSoundInit( argc, argv ); | |
10703 | @@ -72,7 +72,7 @@ init_fusionsound( int *argc, char **argv[] ) | |
10704 | if (ret) | |
10705 | return FusionSoundError( "FusionSoundCreate", ret ); | |
10706 | ||
10707 | - return DFB_OK; | |
10708 | + return DR_OK; | |
10709 | } | |
10710 | ||
10711 | static void | |
10712 | @@ -156,7 +156,7 @@ dump_buffers( CoreSound *core ) | |
10713 | int | |
10714 | main( int argc, char *argv[] ) | |
10715 | { | |
10716 | - DFBResult ret; | |
10717 | + DirectResult ret; | |
10718 | long long millis; | |
10719 | long int seconds, minutes, hours, days; | |
10720 | IFusionSound_data *data; | |
10721 | diff --git a/tools/fsmaster.c b/tools/fsmaster.c | |
10722 | index f552f02..82875ab 100644 | |
10723 | --- a/tools/fsmaster.c | |
10724 | +++ b/tools/fsmaster.c | |
10725 | @@ -42,7 +42,7 @@ | |
10726 | int | |
10727 | main( int argc, char *argv[] ) | |
10728 | { | |
10729 | - DFBResult ret; | |
10730 | + DirectResult ret; | |
10731 | IFusionSound *sound; | |
10732 | ||
10733 | ret = FusionSoundInit( &argc, &argv ); | |
10734 | diff --git a/tools/fsplay.c b/tools/fsplay.c | |
10735 | index 8f83281..3a5692e 100644 | |
10736 | --- a/tools/fsplay.c | |
10737 | +++ b/tools/fsplay.c | |
10738 | @@ -187,7 +187,7 @@ parse_options( int argc, char **argv ) | |
10739 | usage( argv[0] ); | |
10740 | } | |
10741 | ||
10742 | -static DFBEnumerationResult | |
10743 | +static DirectEnumerationResult | |
10744 | track_add_callback( FSTrackID id, FSTrackDescription desc, void *ctx ) | |
10745 | { | |
10746 | Media *media = ctx; | |
10747 | @@ -202,18 +202,18 @@ track_add_callback( FSTrackID id, FSTrackDescription desc, void *ctx ) | |
10748 | track = D_MALLOC( sizeof(MediaTrack) ); | |
10749 | if (!track) { | |
10750 | D_OOM(); | |
10751 | - return DFENUM_CANCEL; | |
10752 | + return DENUM_CANCEL; | |
10753 | } | |
10754 | track->id = id; | |
10755 | direct_list_append( (DirectLink**)&media->tracks, &track->link ); | |
10756 | ||
10757 | - return DFENUM_OK; | |
10758 | + return DENUM_OK; | |
10759 | } | |
10760 | ||
10761 | static int | |
10762 | playback_run( IFusionSoundMusicProvider *provider, Media *media ) | |
10763 | { | |
10764 | - DFBResult ret; | |
10765 | + DirectResult ret; | |
10766 | FSMusicProviderStatus status = FMSTATE_UNKNOWN; | |
10767 | FSStreamDescription s_dsc; | |
10768 | FSTrackDescription t_dsc; | |
10769 | @@ -468,8 +468,8 @@ playback_run( IFusionSoundMusicProvider *provider, Media *media ) | |
10770 | int | |
10771 | main( int argc, char **argv ) | |
10772 | { | |
10773 | - DFBResult ret; | |
10774 | - Media *media; | |
10775 | + DirectResult ret; | |
10776 | + Media *media; | |
10777 | ||
10778 | ret = FusionSoundInit( &argc, &argv ); | |
10779 | if (ret) | |
10780 | diff --git a/tools/fsproxy.c b/tools/fsproxy.c | |
10781 | index b01bd80..c3418fc 100644 | |
10782 | --- a/tools/fsproxy.c | |
10783 | +++ b/tools/fsproxy.c | |
10784 | @@ -49,17 +49,17 @@ | |
10785 | ||
10786 | /*****************************************************************************/ | |
10787 | ||
10788 | -static DFBBoolean parse_command_line( int argc, char *argv[] ); | |
10789 | -static DFBResult server_run(); | |
10790 | +static bool parse_command_line( int argc, char *argv[] ); | |
10791 | +static DirectResult server_run(); | |
10792 | ||
10793 | -static DFBBoolean keep_alive = DFB_FALSE; | |
10794 | +static bool keep_alive; | |
10795 | ||
10796 | /*****************************************************************************/ | |
10797 | ||
10798 | int | |
10799 | main( int argc, char *argv[] ) | |
10800 | { | |
10801 | - DFBResult ret; | |
10802 | + DirectResult ret; | |
10803 | ||
10804 | /* Initialize FusionSound including command line parsing. */ | |
10805 | ret = FusionSoundInit( &argc, &argv ); | |
10806 | @@ -109,7 +109,7 @@ ConstructDispatcher( VoodooServer *server, | |
10807 | ||
10808 | *ret_instance = instance; | |
10809 | ||
10810 | - return DFB_OK; | |
10811 | + return DR_OK; | |
10812 | } | |
10813 | ||
10814 | /*****************************************************************************/ | |
10815 | @@ -130,7 +130,7 @@ usage( const char *progname ) | |
10816 | FUSIONSOUND_VERSION, progname ); | |
10817 | } | |
10818 | ||
10819 | -static DFBBoolean | |
10820 | +static bool | |
10821 | parse_command_line( int argc, char *argv[] ) | |
10822 | { | |
10823 | int i; | |
10824 | @@ -138,28 +138,28 @@ parse_command_line( int argc, char *argv[] ) | |
10825 | for (i = 1; i < argc; i++) { | |
10826 | if (!strcmp( argv[i], "-h" ) || !strcmp( argv[i], "--help" )) { | |
10827 | usage( argv[0] ); | |
10828 | - return DFB_FALSE; | |
10829 | + return DR_FALSE; | |
10830 | } | |
10831 | else if (!strcmp( argv[i], "-v" ) || !strcmp( argv[i], "--version" )) { | |
10832 | puts( FUSIONSOUND_VERSION ); | |
10833 | exit( 0 ); | |
10834 | } | |
10835 | else if (!strcmp( argv[i], "-k" ) || !strcmp( argv[i], "--keep-alive" )) { | |
10836 | - keep_alive = DFB_TRUE; | |
10837 | + keep_alive = DR_TRUE; | |
10838 | } | |
10839 | else { | |
10840 | fprintf( stderr, "Unsupported option '%s'!\n", argv[i] ); | |
10841 | - return DFB_FALSE; | |
10842 | + return DR_FALSE; | |
10843 | } | |
10844 | } | |
10845 | ||
10846 | - return DFB_TRUE; | |
10847 | + return DR_TRUE; | |
10848 | } | |
10849 | ||
10850 | -static DFBResult | |
10851 | +static DirectResult | |
10852 | server_run() | |
10853 | { | |
10854 | - DFBResult ret; | |
10855 | + DirectResult ret; | |
10856 | VoodooServer *server; | |
10857 | ||
10858 | ret = voodoo_server_create( &server ); | |
10859 | @@ -185,6 +185,6 @@ server_run() | |
10860 | ||
10861 | voodoo_server_destroy( server ); | |
10862 | ||
10863 | - return DFB_OK; | |
10864 | + return DR_OK; | |
10865 | } | |
10866 | ||
10867 | diff --git a/tools/fsvolume.c b/tools/fsvolume.c | |
10868 | index 239de9a..bb8a54b 100644 | |
10869 | --- a/tools/fsvolume.c | |
10870 | +++ b/tools/fsvolume.c | |
10871 | @@ -60,7 +60,7 @@ usage( const char *progname ) | |
10872 | int | |
10873 | main( int argc, char **argv ) | |
10874 | { | |
10875 | - DFBResult ret; | |
10876 | + DirectResult ret; | |
10877 | IFusionSound *sound; | |
10878 | float volume = 0.0f; | |
10879 | ||
10880 | From: Claudio Ciccani <klan@directfb.org> | |
10881 | Date: Fri, 29 Feb 2008 15:09:07 +0000 (+0100) | |
10882 | Subject: Fixed types conversion. | |
10883 | X-Git-Url: http://git.directfb.org/?p=core%2FFusionSound.git;a=commitdiff_plain;h=e70270e44777ca1b3f0edafbdc5b92d19a1067c4 | |
10884 | ||
10885 | Fixed types conversion. | |
10886 | --- | |
10887 | ||
10888 | diff --git a/examples/loader.c b/examples/loader.c | |
10889 | index eb4b0ff..1509658 100644 | |
10890 | --- a/examples/loader.c | |
10891 | +++ b/examples/loader.c | |
10892 | @@ -104,7 +104,7 @@ load_sample (IFusionSound *sound, const char *filename) | |
10893 | return NULL; | |
10894 | } | |
10895 | ||
10896 | - while (DR_TRUE) { | |
10897 | + while (1) { | |
10898 | char magic[4]; | |
10899 | ||
10900 | len = read_chunk_header (fd, magic); | |
10901 | @@ -168,7 +168,7 @@ load_sample (IFusionSound *sound, const char *filename) | |
10902 | desc.sampleformat = (fmt.bitspersample == 8) ? FSSF_U8 : FSSF_S16; | |
10903 | desc.samplerate = fmt.frequency; | |
10904 | ||
10905 | - while (DR_TRUE) { | |
10906 | + while (1) { | |
10907 | char magic[4]; | |
10908 | ||
10909 | len = read_chunk_header (fd, magic); | |
10910 | diff --git a/examples/music.c b/examples/music.c | |
10911 | index c30c462..fa00ebd 100644 | |
10912 | --- a/examples/music.c | |
10913 | +++ b/examples/music.c | |
10914 | @@ -63,7 +63,7 @@ track_display_callback( FSTrackID id, FSTrackDescription desc, void *ctx ) | |
10915 | *desc.artist ? desc.artist : "Unknown", | |
10916 | *desc.title ? desc.title : "Unknown" ); | |
10917 | ||
10918 | - return DFENUM_OK; | |
10919 | + return DENUM_OK; | |
10920 | } | |
10921 | ||
10922 | static DirectEnumerationResult | |
10923 | @@ -80,7 +80,7 @@ track_playback_callback( FSTrackID id, FSTrackDescription desc, void *ctx ) | |
10924 | ret = provider->SelectTrack( provider, id ); | |
10925 | if (ret) { | |
10926 | FusionSoundError( "IFusionSoundMusicProvider::SelectTrack", ret ); | |
10927 | - return DFENUM_OK; | |
10928 | + return DENUM_OK; | |
10929 | } | |
10930 | ||
10931 | provider->GetStreamDescription( provider, &s_dsc ); | |
10932 | @@ -105,7 +105,7 @@ track_playback_callback( FSTrackID id, FSTrackDescription desc, void *ctx ) | |
10933 | ret = sound->CreateStream( sound, &s_dsc, &stream ); | |
10934 | if (ret) { | |
10935 | FusionSoundError( "IFusionSound::CreateStream", ret ); | |
10936 | - return DFENUM_CANCEL; | |
10937 | + return DENUM_CANCEL; | |
10938 | } | |
10939 | stream->GetDescription( stream, &s_dsc ); | |
10940 | stream->GetPlayback( stream, &playback ); | |
10941 | @@ -121,7 +121,7 @@ track_playback_callback( FSTrackID id, FSTrackDescription desc, void *ctx ) | |
10942 | ret = provider->PlayToStream( provider, stream ); | |
10943 | if (ret) { | |
10944 | FusionSoundError( "IFusionSoundMusicProvider::PlayTo", ret ); | |
10945 | - return DFENUM_CANCEL; | |
10946 | + return DENUM_CANCEL; | |
10947 | } | |
10948 | ||
10949 | /* Update track's description. */ | |
10950 | @@ -202,7 +202,7 @@ track_playback_callback( FSTrackID id, FSTrackDescription desc, void *ctx ) | |
10951 | case 'q': | |
10952 | case 'Q': | |
10953 | case '\033': // Escape | |
10954 | - return DFENUM_CANCEL; | |
10955 | + return DENUM_CANCEL; | |
10956 | default: | |
10957 | break; | |
10958 | } | |
10959 | @@ -214,7 +214,7 @@ track_playback_callback( FSTrackID id, FSTrackDescription desc, void *ctx ) | |
10960 | ||
10961 | printf( "\n" ); | |
10962 | ||
10963 | - return DFENUM_OK; | |
10964 | + return DENUM_OK; | |
10965 | } | |
10966 | ||
10967 | int | |
10968 | diff --git a/interfaces/IFusionSoundMusicProvider/ifusionsoundmusicprovider_cdda.c b/interfaces/IFusionSoundMusicProvider/ifusionsoundmusicprovider_cdda.c | |
10969 | index 20603a6..e5e0465 100644 | |
10970 | --- a/interfaces/IFusionSoundMusicProvider/ifusionsoundmusicprovider_cdda.c | |
10971 | +++ b/interfaces/IFusionSoundMusicProvider/ifusionsoundmusicprovider_cdda.c | |
10972 | @@ -714,7 +714,7 @@ IFusionSoundMusicProvider_CDDA_EnumTracks( IFusionSoundMusicProvider *thiz, | |
10973 | direct_snputs( desc.encoding, "PCM 16 bit", FS_TRACK_DESC_ENCODING_LENGTH ); | |
10974 | desc.bitrate = CD_FRAMES_PER_SECOND * CD_BYTES_PER_FRAME * 8; | |
10975 | ||
10976 | - if (callback( i, desc, callbackdata ) != DFENUM_OK) | |
10977 | + if (callback( i, desc, callbackdata )) | |
10978 | break; | |
10979 | } | |
10980 | ||
10981 | diff --git a/proxy/requestor/ifusionsoundplayback_requestor.c b/proxy/requestor/ifusionsoundplayback_requestor.c | |
10982 | index 4dca795..75f3ba1 100644 | |
10983 | --- a/proxy/requestor/ifusionsoundplayback_requestor.c | |
10984 | +++ b/proxy/requestor/ifusionsoundplayback_requestor.c | |
10985 | @@ -204,7 +204,7 @@ IFusionSoundPlayback_Requestor_GetStatus( IFusionSoundPlayback *thiz, | |
10986 | { | |
10987 | DirectResult ret; | |
10988 | VoodooResponseMessage *response; | |
10989 | - bool playing = DR_FALSE; | |
10990 | + bool playing = false; | |
10991 | int position = 0; | |
10992 | ||
10993 | DIRECT_INTERFACE_GET_DATA(IFusionSoundPlayback_Requestor) | |
10994 | diff --git a/tools/fsproxy.c b/tools/fsproxy.c | |
10995 | index c3418fc..ad16f74 100644 | |
10996 | --- a/tools/fsproxy.c | |
10997 | +++ b/tools/fsproxy.c | |
10998 | @@ -138,22 +138,22 @@ parse_command_line( int argc, char *argv[] ) | |
10999 | for (i = 1; i < argc; i++) { | |
11000 | if (!strcmp( argv[i], "-h" ) || !strcmp( argv[i], "--help" )) { | |
11001 | usage( argv[0] ); | |
11002 | - return DR_FALSE; | |
11003 | + return false; | |
11004 | } | |
11005 | else if (!strcmp( argv[i], "-v" ) || !strcmp( argv[i], "--version" )) { | |
11006 | puts( FUSIONSOUND_VERSION ); | |
11007 | exit( 0 ); | |
11008 | } | |
11009 | else if (!strcmp( argv[i], "-k" ) || !strcmp( argv[i], "--keep-alive" )) { | |
11010 | - keep_alive = DR_TRUE; | |
11011 | + keep_alive = true; | |
11012 | } | |
11013 | else { | |
11014 | fprintf( stderr, "Unsupported option '%s'!\n", argv[i] ); | |
11015 | - return DR_FALSE; | |
11016 | + return false; | |
11017 | } | |
11018 | } | |
11019 | ||
11020 | - return DR_TRUE; | |
11021 | + return true; | |
11022 | } | |
11023 | ||
11024 | static DirectResult |