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
6 [fusionsound] Follow API changes, removing remaining dependencies on <directfb.h>.
9 diff --git a/drivers/alsa.c b/drivers/alsa.c
10 index 6b685d7..53c35a8 100644
13 @@ -108,7 +108,7 @@ alsa_device_get_devname( const CoreSoundDeviceConfig *config )
19 alsa_device_set_configuration( snd_pcm_t *handle,
20 CoreSoundDeviceConfig *config )
22 @@ -124,7 +124,7 @@ alsa_device_set_configuration( snd_pcm_t *handle,
24 if (snd_pcm_hw_params_any( handle, params ) < 0) {
25 D_ERROR( "FusionSound/Device/Alsa: couldn't get hw params!\n" );
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 " : "" );
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;
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;
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;
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;
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;
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;
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,
88 if (snd_pcm_prepare( handle ) < 0) {
89 D_ERROR( "FusionSound/Device/Alsa: couldn't prepare stream!\n" );
100 alsa_device_getset_volume( float *get, float *set )
102 - DFBResult ret = DFB_OK;
103 + DirectResult ret = DR_OK;
105 snd_mixer_selem_id_t *sid;
106 snd_mixer_elem_t *elem;
109 if (snd_mixer_open( &mixer, 0 ) < 0)
113 if (snd_mixer_attach( mixer, fs_config->device ? : "default" ) < 0) {
114 snd_mixer_close( mixer );
115 - return DFB_FAILURE;
119 if (snd_mixer_selem_register( mixer, NULL, NULL ) < 0) {
120 snd_mixer_close( mixer );
121 - return DFB_FAILURE;
125 if (snd_mixer_load( mixer ) < 0) {
126 snd_mixer_close( mixer );
127 - return DFB_FAILURE;
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 );
135 snd_mixer_close( mixer );
136 - return DFB_UNSUPPORTED;
137 + return DR_UNSUPPORTED;
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;
144 if (snd_mixer_selem_set_playback_volume_all( elem, vol ) < 0)
145 - ret = DFB_UNSUPPORTED;
146 + ret = DR_UNSUPPORTED;
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;
154 *get = (float)(vol - min) / (float)(max - min);
156 @@ -257,7 +257,7 @@ alsa_device_getset_volume( float *get, float *set )
157 /******************************************************************************/
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 );
173 - return DFB_UNSUPPORTED;
174 + return DR_UNSUPPORTED;
178 @@ -296,7 +296,7 @@ device_get_driver_info( SoundDriverInfo *info )
179 info->device_data_size = sizeof(AlsaDeviceData);
184 device_open( void *device_data,
185 SoundDeviceInfo *device_info,
186 CoreSoundDeviceConfig *config )
187 @@ -305,18 +305,18 @@ device_open( void *device_data,
190 snd_ctl_card_info_t *info;
194 dev = fs_config->device ? : alsa_device_get_devname( config );
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 );
202 if (snd_pcm_nonblock( data->handle, 0 ) < 0) {
203 D_ERROR( "FusionSound/Device/Alsa: couldn't disable non-blocking mode!\n" );
209 @@ -357,7 +357,7 @@ device_open( void *device_data,
210 D_INFO( "FusionSound/Device/ALSA: DMA enabled.\n" );
218 @@ -382,7 +382,7 @@ try_recover( snd_pcm_t *handle, int err )
224 device_get_buffer( void *device_data, u8 **addr, unsigned int *avail )
226 AlsaDeviceData *data = device_data;
227 @@ -403,7 +403,7 @@ device_get_buffer( void *device_data, u8 **addr, unsigned int *avail )
229 D_ERROR( "FusionSound/Device/ALSA: snd_pcm_avail_update() failed: %s\n",
231 - return DFB_FAILURE;
236 @@ -417,7 +417,7 @@ device_get_buffer( void *device_data, u8 **addr, unsigned int *avail )
238 D_ERROR( "FusionSound/Device/ALSA: snd_pcm_avail_update() failed: %s\n",
240 - return DFB_FAILURE;
245 @@ -429,7 +429,7 @@ device_get_buffer( void *device_data, u8 **addr, unsigned int *avail )
247 D_ERROR( "FusionSound/Device/ALSA: snd_pcm_mmap_begin() failed: %s\n",
249 - return DFB_FAILURE;
254 @@ -441,10 +441,10 @@ device_get_buffer( void *device_data, u8 **addr, unsigned int *avail )
264 device_commit_buffer( void *device_data, unsigned int frames )
266 AlsaDeviceData *data = device_data;
267 @@ -460,7 +460,7 @@ device_commit_buffer( void *device_data, unsigned int frames )
269 D_ERROR( "FusionSound/Device/ALSA: snd_pcm_writei() failed: %s\n",
271 - return DFB_FAILURE;
276 @@ -475,7 +475,7 @@ device_commit_buffer( void *device_data, unsigned int frames )
278 D_ERROR( "FusionSound/Device/ALSA: snd_pcm_mmap_commit() failed: %s\n",
280 - return DFB_FAILURE;
285 @@ -483,7 +483,7 @@ device_commit_buffer( void *device_data, unsigned int frames )
294 @@ -496,19 +496,19 @@ device_get_output_delay( void *device_data, int *delay )
300 device_get_volume( void *device_data, float *level )
302 return alsa_device_getset_volume( level, NULL );
307 device_set_volume( void *device_data, float level )
309 return alsa_device_getset_volume( NULL, &level );
314 device_suspend( void *device_data )
316 AlsaDeviceData *data = device_data;
317 @@ -517,21 +517,21 @@ device_suspend( void *device_data )
318 snd_pcm_close( data->handle );
327 device_resume( void *device_data )
329 AlsaDeviceData *data = device_data;
334 dev = fs_config->device ? : alsa_device_get_devname( data->config );
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 );
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
347 @@ -124,7 +124,7 @@ oss2fs_format( int format )
353 oss_device_set_configuration( int fd, CoreSoundDeviceConfig *config )
356 @@ -137,7 +137,7 @@ oss_device_set_configuration( int fd, CoreSoundDeviceConfig *config )
358 fmt = fs2oss_format( config->format );
360 - return DFB_UNSUPPORTED;
361 + return DR_UNSUPPORTED;
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;
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;
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;
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;
398 config->buffersize = buffersize;
404 /******************************************************************************/
411 @@ -195,17 +195,17 @@ device_probe( void )
418 /* issue a generic ioctl to test the device */
419 if (ioctl( fd, SNDCTL_DSP_GETFMTS, &fmt ) < 0) {
421 - return DFB_UNSUPPORTED;
422 + return DR_UNSUPPORTED;
432 @@ -233,7 +233,7 @@ device_get_driver_info( SoundDriverInfo *info )
433 info->device_data_size = sizeof(OSSDeviceData);
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;
448 /* open sound device in non-blocking mode */
449 if (fs_config->device) {
450 @@ -254,7 +254,7 @@ device_open( void *device_data,
453 D_ERROR( "FusionSound/Device/OSS: Couldn't open output device!\n" );
458 /* reset to blocking mode */
459 @@ -303,10 +303,10 @@ device_open( void *device_data,
469 device_get_buffer( void *device_data, u8 **addr, unsigned int *avail )
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;
482 device_commit_buffer( void *device_data, unsigned int frames )
484 OSSDeviceData *data = device_data;
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 );
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;
504 device_get_volume( void *device_data, float *level )
507 @@ -354,22 +354,22 @@ device_get_volume( void *device_data, float *level )
509 fd = direct_try_open( "/dev/mixer", "/dev/sound/mixer", O_RDONLY, false );
514 if (ioctl( fd, SOUND_MIXER_READ_PCM, &vol ) < 0) {
515 D_PERROR( "FusionSound/Device/OSS: couldn't get volume level!\n" );
517 - return DFB_FAILURE;
523 *level = (float)((vol & 0xff) + ((vol >> 8) & 0xff)) / 200.0f;
531 device_set_volume( void *device_data, float level )
534 @@ -377,22 +377,22 @@ device_set_volume( void *device_data, float level )
536 fd = direct_try_open( "/dev/mixer", "/dev/sound/mixer", O_RDONLY, false );
541 vol = level * 100.0f;
543 if (ioctl( fd, SOUND_MIXER_WRITE_PCM, &vol ) < 0) {
544 D_PERROR( "FusionSound/Device/OSS: couldn't set volume level!\n" );
546 - return DFB_FAILURE;
558 device_suspend( void *device_data )
560 OSSDeviceData *data = device_data;
561 @@ -401,21 +401,21 @@ device_suspend( void *device_data )
571 device_resume( void *device_data )
573 OSSDeviceData *data = device_data;
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 );
581 D_ERROR( "FusionSound/Device/OSS: Couldn't reopen output device!\n" );
586 ret = oss_device_set_configuration( data->fd, data->config );
587 @@ -427,7 +427,7 @@ device_resume( void *device_data )
589 fcntl( data->fd, F_SETFD, FD_CLOEXEC );
596 diff --git a/drivers/wave.c b/drivers/wave.c
597 index f33a44d..a13514f 100644
600 @@ -85,7 +85,7 @@ typedef struct {
601 /******************************************************************************/
609 @@ -93,7 +93,7 @@ device_probe( void )
611 /* load only when requested */
612 if (!fs_config->driver)
613 - return DFB_UNSUPPORTED;
614 + return DR_UNSUPPORTED;
616 if (fs_config->device) {
617 snprintf( path, sizeof(path), "%s", fs_config->device );
618 @@ -105,11 +105,11 @@ device_probe( void )
620 fd = open( path, O_WRONLY | O_CREAT | O_NOCTTY | O_NONBLOCK, 0644 );
622 - return DFB_UNSUPPORTED;
623 + return DR_UNSUPPORTED;
632 @@ -137,7 +137,7 @@ device_get_driver_info( SoundDriverInfo *info )
633 info->device_data_size = sizeof(WaveDeviceData);
638 device_open( void *device_data,
639 SoundDeviceInfo *device_info,
640 CoreSoundDeviceConfig *config )
641 @@ -147,7 +147,7 @@ device_open( void *device_data,
644 if (config->format == FSSF_FLOAT)
645 - return DFB_UNSUPPORTED;
646 + return DR_UNSUPPORTED;
648 if (fs_config->device) {
649 snprintf( path, sizeof(path), "%s", fs_config->device );
650 @@ -161,7 +161,7 @@ device_open( void *device_data,
652 D_ERROR( "FusionSound/Device/Wave: "
653 "couldn't open '%s' for writing!\n", path );
658 /* close file descriptor on exec */
659 @@ -222,16 +222,16 @@ device_open( void *device_data,
661 if (write( data->fd, &header, sizeof(header) ) < sizeof(header)) {
662 D_ERROR( "FusionSound/Device/Wave: write error!\n" );
667 data->bits = FS_BITS_PER_SAMPLE(config->format);
668 data->channels = FS_CHANNELS_FOR_MODE(config->mode);
676 device_get_buffer( void *device_data, u8 **addr, unsigned int *avail )
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;
689 device_commit_buffer( void *device_data, unsigned int frames )
691 WaveDeviceData *data = device_data;
692 @@ -274,7 +274,7 @@ device_commit_buffer( void *device_data, unsigned int frames )
694 write( data->fd, buf, frames * data->channels * data->bits >> 3 );
701 @@ -283,19 +283,19 @@ device_get_output_delay( void *device_data, int *delay )
707 device_get_volume( void *device_data, float *level )
709 - return DFB_UNSUPPORTED;
710 + return DR_UNSUPPORTED;
715 device_set_volume( void *device_data, float level )
717 - return DFB_UNSUPPORTED;
718 + return DR_UNSUPPORTED;
723 device_suspend( void *device_data )
725 WaveDeviceData *data = device_data;
726 @@ -306,10 +306,10 @@ device_suspend( void *device_data )
736 device_resume( void *device_data )
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 );
742 D_ERROR( "FusionSound/Device/Wave: couldn't reopen '%s'!\n", path );
747 fcntl( data->fd, F_SETFD, FD_CLOEXEC );
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,
765 IFusionSoundPlayback *playback;
767 ret = buffer->CreatePlayback (buffer, &playback);
768 @@ -48,7 +48,7 @@ prepare_test( IFusionSoundBuffer *buffer,
772 - DFBResult ret = (x); \
773 + DirectResult ret = (x); \
775 fprintf( stderr, "FAILED!\n\n" ); \
776 FusionSoundError (#x, ret); \
777 @@ -191,7 +191,7 @@ do_playback_tests (IFusionSoundBuffer *buffer)
779 int main (int argc, char *argv[])
784 IFusionSoundBuffer *buffer;
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)
796 read_file_header (int fd)
800 if (read (fd, buf, 12) < 12) {
801 fprintf (stderr, "Could not read at least 12 bytes!\n");
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;
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;
823 @@ -85,7 +85,7 @@ read_chunk_header (int fd, char *magic)
825 load_sample (IFusionSound *sound, const char *filename)
830 FSBufferDescription desc;
831 IFusionSoundBuffer *buffer;
832 @@ -104,7 +104,7 @@ load_sample (IFusionSound *sound, const char *filename)
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;
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 )
858 -static DFBEnumerationResult
859 +static DirectEnumerationResult
860 track_display_callback( FSTrackID id, FSTrackDescription desc, void *ctx )
862 printf( " Track %2d: %s - %s\n", id,
863 @@ -66,10 +66,10 @@ track_display_callback( FSTrackID id, FSTrackDescription desc, void *ctx )
867 -static DFBEnumerationResult
868 +static DirectEnumerationResult
869 track_playback_callback( FSTrackID id, FSTrackDescription desc, void *ctx )
873 FSMusicProviderStatus status = FMSTATE_UNKNOWN;
875 static int flags = FMPLAY_NOFX;
876 @@ -220,7 +220,7 @@ track_playback_callback( FSTrackID id, FSTrackDescription desc, void *ctx )
878 main( int argc, char *argv[] )
883 ret = FusionSoundInit( &argc, &argv );
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 )
896 ret = sound->CreateMusicProvider( sound, file, &provider );
898 @@ -68,7 +68,7 @@ main( int argc, char **argv )
901 IFusionSoundBuffer *buffer;
905 ret = FusionSoundInit( &argc, &argv );
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;
917 create_playback( const char *filename )
922 ret = FusionSoundCreate( &sound );
924 @@ -53,13 +53,13 @@ create_playback( const char *filename )
927 playback->Start( playback, 0, -1 );
933 sound->Release( sound );
935 - return DFB_FAILURE;
940 @@ -101,17 +101,17 @@ slider_update( LiteSlider *slider, float pos, void *ctx )
942 button_pressed( LiteButton *button, void *ctx )
944 - static DFBBoolean stopped;
945 + static bool stopped;
948 playback->Continue( playback );
950 - stopped = DFB_FALSE;
954 playback->Stop( playback );
956 - stopped = DFB_TRUE;
961 @@ -119,7 +119,7 @@ int
962 main (int argc, char *argv[])
968 LiteSlider *slider[5];
969 LiteButton *playbutton;
970 @@ -195,7 +195,7 @@ main (int argc, char *argv[])
971 lite_set_window_opacity( window, 0xff );
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) {
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 )
987 - if (buffer->Lock( buffer, &data, 0, 0 ) != DFB_OK)
988 + if (buffer->Lock( buffer, &data, 0, 0 ) != DR_OK)
992 @@ -79,21 +79,21 @@ buffer_callback( int len, void *ctx )
998 create_playback( const char *filename )
1000 FSBufferDescription b_desc;
1001 FSStreamDescription s_desc;
1005 err = FusionSoundCreate( &sound );
1006 - if (err != DFB_OK) {
1007 + if (err != DR_OK) {
1008 FusionSoundError( "FusionSoundCreate() failed", err );
1012 err = sound->CreateMusicProvider( sound, filename, &provider );
1013 - if (err != DFB_OK) {
1014 + if (err != DR_OK) {
1015 FusionSoundError( "CreateMusicProvider() failed", err );
1018 @@ -111,25 +111,25 @@ create_playback( const char *filename )
1019 s_desc.channels = 2;
1021 err = sound->CreateStream( sound, &s_desc, &stream );
1022 - if (err != DFB_OK) {
1023 + if (err != DR_OK) {
1024 FusionSoundError( "CreateStream() failed", err );
1028 err = sound->CreateBuffer( sound, &b_desc, &buffer );
1029 - if (err != DFB_OK) {
1030 + if (err != DR_OK) {
1031 FusionSoundError( "CreateBuffer() failed", err );
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 );
1048 @@ -148,11 +148,11 @@ destroy_playback( void )
1050 main( int argc, char **argv )
1056 err = DirectFBInit( &argc, &argv );
1057 - if (err != DFB_OK)
1059 DirectFBErrorFatal( "DirectFBInit() failed", err );
1062 @@ -161,7 +161,7 @@ main( int argc, char **argv )
1065 err = FusionSoundInit( &argc, &argv );
1066 - if (err != DFB_OK)
1068 FusionSoundErrorFatal( "FusionSoundInit() failed", err );
1070 /* initialize LiTE */
1071 @@ -184,7 +184,7 @@ main( int argc, char **argv )
1072 lite_set_window_opacity( window, 0xff );
1074 /* initialize FusionSound and load track */
1075 - if (create_playback( argv[1] ) != DFB_OK) {
1076 + if (create_playback( argv[1] ) != DR_OK) {
1078 lite_destroy_window( window );
1080 @@ -192,12 +192,12 @@ main( int argc, char **argv )
1084 - while (lite_window_event_loop( window, 20 ) == DFB_TIMEOUT) {
1085 + while (lite_window_event_loop( window, 20 ) == DR_TIMEOUT) {
1088 /* check if playback is finished */
1089 err = provider->GetPos( provider, &pos );
1090 - if (err == DFB_EOF)
1091 + if (err == DR_EOF)
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
1101 int main (int argc, char *argv[])
1105 IFusionSound *sound;
1106 IFusionSoundBuffer *buffer;
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
1114 feed_stream (IFusionSoundStream *stream)
1121 @@ -49,7 +49,7 @@ feed_stream (IFusionSoundStream *stream)
1123 main (int argc, char *argv[])
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
1135 #ifndef __FUSIONSOUND_H__
1136 #define __FUSIONSOUND_H__
1138 -#include <directfb.h>
1139 +#include <direct/interface.h>
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.
1147 -DFBResult FusionSoundInit(
1148 - int *argc, /* pointer to main()'s argc */
1149 - char *(*argv[]) /* pointer to main()'s argv */
1151 +DirectResult FusionSoundInit(
1152 + int *argc, /* pointer to main()'s argc */
1153 + char *(*argv[]) /* pointer to main()'s argv */
1157 * Sets configuration parameters supported on command line and in config file.
1158 * Can only be called before FusionSoundCreate but after FusionSoundInit.
1160 -DFBResult FusionSoundSetOption(
1164 +DirectResult FusionSoundSetOption(
1170 * Creates the super interface.
1172 -DFBResult FusionSoundCreate(
1173 - IFusionSound **ret_interface /* pointer to the created interface */
1175 +DirectResult FusionSoundCreate(
1176 + IFusionSound **ret_interface /* pointer to the created interface */
1180 * Print a description of the result code along with an
1181 * optional message that is put in front with a colon.
1183 -DFBResult FusionSoundError(
1184 - const char *msg, /* optional message */
1185 - DFBResult result /* result code to interpret */
1187 +DirectResult FusionSoundError(
1188 + const char *msg, /* optional message */
1189 + DirectResult result /* result code to interpret */
1193 * Behaves like FusionSoundError, but shuts down the calling application.
1195 -DFBResult FusionSoundErrorFatal(
1196 - const char *msg, /* optional message */
1197 - DFBResult result /* result code to interpret */
1199 +DirectResult FusionSoundErrorFatal(
1200 + const char *msg, /* optional message */
1201 + DirectResult result /* result code to interpret */
1205 * Returns a string describing 'result'.
1207 const char *FusionSoundErrorString(
1210 + DirectResult result
1214 * Retrieves information about supported command-line flags in the
1215 @@ -423,7 +423,7 @@ typedef struct {
1217 * Called for each track provided by a music provider.
1219 -typedef DFBEnumerationResult (*FSTrackCallback) (
1220 +typedef DirectEnumerationResult (*FSTrackCallback) (
1222 FSTrackDescription desc,
1224 @@ -456,7 +456,7 @@ DEFINE_INTERFACE( IFusionSound,
1226 * Get a description of the sound device.
1228 - DFBResult (*GetDeviceDescription) (
1229 + DirectResult (*GetDeviceDescription) (
1231 FSDeviceDescription *ret_desc
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.
1237 - DFBResult (*CreateBuffer) (
1238 + DirectResult (*CreateBuffer) (
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.
1246 - DFBResult (*CreateStream) (
1247 + DirectResult (*CreateStream) (
1249 const FSStreamDescription *desc,
1250 IFusionSoundStream **interface
1251 @@ -494,7 +494,7 @@ DEFINE_INTERFACE( IFusionSound,
1253 * Create a music provider.
1255 - DFBResult (*CreateMusicProvider) (
1256 + DirectResult (*CreateMusicProvider) (
1258 const char *filename,
1259 IFusionSoundMusicProvider **interface
1260 @@ -510,7 +510,7 @@ DEFINE_INTERFACE( IFusionSound,
1262 * See also <i>SetMasterVolume()</i>.
1264 - DFBResult (*GetMasterVolume) (
1265 + DirectResult (*GetMasterVolume) (
1269 @@ -523,7 +523,7 @@ DEFINE_INTERFACE( IFusionSound,
1271 * See also <i>GetMasterVolume()</i>.
1273 - DFBResult (*SetMasterVolume) (
1274 + DirectResult (*SetMasterVolume) (
1278 @@ -536,7 +536,7 @@ DEFINE_INTERFACE( IFusionSound,
1280 * See also <i>SetLocalVolume()</i>.
1282 - DFBResult (*GetLocalVolume) (
1283 + DirectResult (*GetLocalVolume) (
1287 @@ -550,7 +550,7 @@ DEFINE_INTERFACE( IFusionSound,
1289 * See also <i>GetLocalVolume()</i>.
1291 - DFBResult (*SetLocalVolume) (
1292 + DirectResult (*SetLocalVolume) (
1296 @@ -564,7 +564,7 @@ DEFINE_INTERFACE( IFusionSound,
1297 * No other calls to FusionSound are allowed until <i>Resume()</i>
1300 - DFBResult (*Suspend) (
1301 + DirectResult (*Suspend) (
1305 @@ -573,7 +573,7 @@ DEFINE_INTERFACE( IFusionSound,
1307 * Only to be called after <i>Suspend()</i>.
1309 - DFBResult (*Resume) (
1310 + DirectResult (*Resume) (
1314 @@ -622,7 +622,7 @@ DEFINE_INTERFACE( IFusionSoundBuffer,
1316 * Get a description of the buffer.
1318 - DFBResult (*GetDescription) (
1319 + DirectResult (*GetDescription) (
1320 IFusionSoundBuffer *thiz,
1321 FSBufferDescription *ret_desc
1323 @@ -636,7 +636,7 @@ DEFINE_INTERFACE( IFusionSoundBuffer,
1324 * Set the buffer position indicator (in frames)
1325 * affecting subsequent playback and lock for access.
1327 - DFBResult (*SetPosition) (
1328 + DirectResult (*SetPosition) (
1329 IFusionSoundBuffer *thiz,
1332 @@ -652,7 +652,7 @@ DEFINE_INTERFACE( IFusionSoundBuffer,
1334 * See also <i>SetPosition()</i>.
1336 - DFBResult (*Lock) (
1337 + DirectResult (*Lock) (
1338 IFusionSoundBuffer *thiz,
1341 @@ -662,7 +662,7 @@ DEFINE_INTERFACE( IFusionSoundBuffer,
1345 - DFBResult (*Unlock) (
1346 + DirectResult (*Unlock) (
1347 IFusionSoundBuffer *thiz
1350 @@ -679,7 +679,7 @@ DEFINE_INTERFACE( IFusionSoundBuffer,
1352 * See also <i>CreatePlayback()</i>.
1354 - DFBResult (*Play) (
1355 + DirectResult (*Play) (
1356 IFusionSoundBuffer *thiz,
1357 FSBufferPlayFlags flags
1359 @@ -692,7 +692,7 @@ DEFINE_INTERFACE( IFusionSoundBuffer,
1361 * See also <i>CreatePlayback()</i>.
1363 - DFBResult (*Stop) (
1364 + DirectResult (*Stop) (
1365 IFusionSoundBuffer *thiz
1368 @@ -704,7 +704,7 @@ DEFINE_INTERFACE( IFusionSoundBuffer,
1370 * Each playback instance represents one concurrent playback of the buffer.
1372 - DFBResult (*CreatePlayback) (
1373 + DirectResult (*CreatePlayback) (
1374 IFusionSoundBuffer *thiz,
1375 IFusionSoundPlayback **interface
1377 @@ -739,7 +739,7 @@ DEFINE_INTERFACE( IFusionSoundStream,
1379 * Get a description of the stream.
1381 - DFBResult (*GetDescription) (
1382 + DirectResult (*GetDescription) (
1383 IFusionSoundStream *thiz,
1384 FSStreamDescription *ret_desc
1386 @@ -758,7 +758,7 @@ DEFINE_INTERFACE( IFusionSoundStream,
1388 * If this method returns successfully, all data has been written.
1390 - DFBResult (*Write) (
1391 + DirectResult (*Write) (
1392 IFusionSoundStream *thiz,
1395 @@ -772,7 +772,7 @@ DEFINE_INTERFACE( IFusionSoundStream,
1397 * Specifying a <b>length</b> of zero waits until playback has finished.
1399 - DFBResult (*Wait) (
1400 + DirectResult (*Wait) (
1401 IFusionSoundStream *thiz,
1404 @@ -787,13 +787,13 @@ DEFINE_INTERFACE( IFusionSoundStream,
1406 * Simply pass NULL for values that are not of interest.
1408 - DFBResult (*GetStatus) (
1409 + DirectResult (*GetStatus) (
1410 IFusionSoundStream *thiz,
1414 int *write_position,
1415 - DFBBoolean *playing
1420 @@ -802,7 +802,7 @@ DEFINE_INTERFACE( IFusionSoundStream,
1421 * This method stops the playback immediately and
1422 * discards any buffered data.
1424 - DFBResult (*Flush) (
1425 + DirectResult (*Flush) (
1426 IFusionSoundStream *thiz
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.
1433 - DFBResult (*Drop) (
1434 + DirectResult (*Drop) (
1435 IFusionSoundStream *thiz
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.
1442 - DFBResult (*GetPresentationDelay) (
1443 + DirectResult (*GetPresentationDelay) (
1444 IFusionSoundStream *thiz,
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.
1451 - DFBResult (*GetPlayback) (
1452 + DirectResult (*GetPlayback) (
1453 IFusionSoundStream *thiz,
1454 IFusionSoundPlayback **interface
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.
1460 - DFBResult (*Access) (
1461 + DirectResult (*Access) (
1462 IFusionSoundStream *thiz,
1465 @@ -876,7 +876,7 @@ DEFINE_INTERFACE( IFusionSoundStream,
1467 * Commit <b>length</b> frames of data written upon previous <i>Access()</i>.
1469 - DFBResult (*Commit) (
1470 + DirectResult (*Commit) (
1471 IFusionSoundStream *thiz,
1474 @@ -928,7 +928,7 @@ DEFINE_INTERFACE( IFusionSoundPlayback,
1476 * This method can be used for seeking if the playback is already running.
1478 - DFBResult (*Start) (
1479 + DirectResult (*Start) (
1480 IFusionSoundPlayback *thiz,
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>.
1487 - DFBResult (*Stop) (
1488 + DirectResult (*Stop) (
1489 IFusionSoundPlayback *thiz
1492 @@ -963,7 +963,7 @@ DEFINE_INTERFACE( IFusionSoundPlayback,
1493 * <i>IFusionSoundBuffer::Play()</i>, but rejects multiple concurrent
1496 - DFBResult (*Continue) (
1497 + DirectResult (*Continue) (
1498 IFusionSoundPlayback *thiz
1501 @@ -975,7 +975,7 @@ DEFINE_INTERFACE( IFusionSoundPlayback,
1502 * If the playback is in looping mode the method returns immediately
1505 - DFBResult (*Wait) (
1506 + DirectResult (*Wait) (
1507 IFusionSoundPlayback *thiz
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.
1514 - DFBResult (*GetStatus) (
1515 + DirectResult (*GetStatus) (
1516 IFusionSoundPlayback *thiz,
1517 - DFBBoolean *running,
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.
1526 - DFBResult (*SetVolume) (
1527 + DirectResult (*SetVolume) (
1528 IFusionSoundPlayback *thiz,
1531 @@ -1015,7 +1015,7 @@ DEFINE_INTERFACE( IFusionSoundPlayback,
1533 * The <b>value</b> ranges from -1.0f (left) to 1.0f (right).
1535 - DFBResult (*SetPan) (
1536 + DirectResult (*SetPan) (
1537 IFusionSoundPlayback *thiz,
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.
1544 - DFBResult (*SetPitch) (
1545 + DirectResult (*SetPitch) (
1546 IFusionSoundPlayback *thiz,
1549 @@ -1034,7 +1034,7 @@ DEFINE_INTERFACE( IFusionSoundPlayback,
1551 * Set the direction of the playback.
1553 - DFBResult (*SetDirection) (
1554 + DirectResult (*SetDirection) (
1555 IFusionSoundPlayback *thiz,
1556 FSPlaybackDirection direction
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.
1562 - DFBResult (*SetDownmixLevels) (
1563 + DirectResult (*SetDownmixLevels) (
1564 IFusionSoundPlayback *thiz,
1567 @@ -1077,7 +1077,7 @@ DEFINE_INTERFACE( IFusionSoundMusicProvider,
1568 * Retrieve information about the music provider's
1571 - DFBResult (*GetCapabilities) (
1572 + DirectResult (*GetCapabilities) (
1573 IFusionSoundMusicProvider *thiz,
1574 FSMusicProviderCapabilities *ret_caps
1576 @@ -1090,7 +1090,7 @@ DEFINE_INTERFACE( IFusionSoundMusicProvider,
1577 * used to select a track for playback using
1578 * IFusionSoundMusicProvider::SelectTrack().
1580 - DFBResult (*EnumTracks) (
1581 + DirectResult (*EnumTracks) (
1582 IFusionSoundMusicProvider *thiz,
1583 FSTrackCallback callback,
1585 @@ -1099,7 +1099,7 @@ DEFINE_INTERFACE( IFusionSoundMusicProvider,
1587 * Get the unique ID of the current track.
1589 - DFBResult (*GetTrackID) (
1590 + DirectResult (*GetTrackID) (
1591 IFusionSoundMusicProvider *thiz,
1592 FSTrackID *ret_track_id
1594 @@ -1107,7 +1107,7 @@ DEFINE_INTERFACE( IFusionSoundMusicProvider,
1596 * Get a description of the current track.
1598 - DFBResult (*GetTrackDescription) (
1599 + DirectResult (*GetTrackDescription) (
1600 IFusionSoundMusicProvider *thiz,
1601 FSTrackDescription *ret_desc
1603 @@ -1116,7 +1116,7 @@ DEFINE_INTERFACE( IFusionSoundMusicProvider,
1604 * Get a stream description that best matches the music
1605 * contained in the file.
1607 - DFBResult (*GetStreamDescription) (
1608 + DirectResult (*GetStreamDescription) (
1609 IFusionSoundMusicProvider *thiz,
1610 FSStreamDescription *ret_desc
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.
1616 - DFBResult (*GetBufferDescription) (
1617 + DirectResult (*GetBufferDescription) (
1618 IFusionSoundMusicProvider *thiz,
1619 FSBufferDescription *ret_desc
1621 @@ -1138,7 +1138,7 @@ DEFINE_INTERFACE( IFusionSoundMusicProvider,
1623 * Select a track by its unique ID.
1625 - DFBResult (*SelectTrack) (
1626 + DirectResult (*SelectTrack) (
1627 IFusionSoundMusicProvider *thiz,
1630 @@ -1147,7 +1147,7 @@ DEFINE_INTERFACE( IFusionSoundMusicProvider,
1631 * Play selected track rendering it into
1632 * the destination stream.
1634 - DFBResult (*PlayToStream) (
1635 + DirectResult (*PlayToStream) (
1636 IFusionSoundMusicProvider *thiz,
1637 IFusionSoundStream *destination
1639 @@ -1162,7 +1162,7 @@ DEFINE_INTERFACE( IFusionSoundMusicProvider,
1640 * samples per channels actually written
1641 * to the destination buffer.
1643 - DFBResult (*PlayToBuffer) (
1644 + DirectResult (*PlayToBuffer) (
1645 IFusionSoundMusicProvider *thiz,
1646 IFusionSoundBuffer *destination,
1647 FMBufferCallback callback,
1648 @@ -1172,14 +1172,14 @@ DEFINE_INTERFACE( IFusionSoundMusicProvider,
1652 - DFBResult (*Stop) (
1653 + DirectResult (*Stop) (
1654 IFusionSoundMusicProvider *thiz
1658 * Get playback status.
1660 - DFBResult (*GetStatus) (
1661 + DirectResult (*GetStatus) (
1662 IFusionSoundMusicProvider *thiz,
1663 FSMusicProviderStatus *ret_status
1665 @@ -1189,7 +1189,7 @@ DEFINE_INTERFACE( IFusionSoundMusicProvider,
1667 * Seeks to a position within the current track.
1669 - DFBResult (*SeekTo) (
1670 + DirectResult (*SeekTo) (
1671 IFusionSoundMusicProvider *thiz,
1674 @@ -1197,7 +1197,7 @@ DEFINE_INTERFACE( IFusionSoundMusicProvider,
1676 * Gets current position within the current track.
1678 - DFBResult (*GetPos) (
1679 + DirectResult (*GetPos) (
1680 IFusionSoundMusicProvider *thiz,
1683 @@ -1205,7 +1205,7 @@ DEFINE_INTERFACE( IFusionSoundMusicProvider,
1685 * Gets the length of the current track.
1687 - DFBResult (*GetLength) (
1688 + DirectResult (*GetLength) (
1689 IFusionSoundMusicProvider *thiz,
1692 @@ -1215,7 +1215,7 @@ DEFINE_INTERFACE( IFusionSoundMusicProvider,
1694 * Set the flags controlling playback.
1696 - DFBResult (*SetPlaybackFlags) (
1697 + DirectResult (*SetPlaybackFlags) (
1698 IFusionSoundMusicProvider *thiz,
1699 FSMusicProviderPlaybackFlags flags
1701 @@ -1228,7 +1228,7 @@ DEFINE_INTERFACE( IFusionSoundMusicProvider,
1702 * if the specified <b>timeout</b> in milliseconds
1703 * is non-zero, until timeout expires.
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
1715 #include <direct/interface.h>
1718 -static DFBResult Probe( void *arg );
1719 +static DirectResult Probe( void *arg );
1721 -static DFBResult Construct( IFusionSound *thiz, void *arg );
1722 +static DirectResult Construct( IFusionSound *thiz, void *arg );
1724 #include <direct/interface_implementation.h>
1726 @@ -47,17 +47,17 @@ DIRECT_INTERFACE_IMPLEMENTATION( IFusionSound, default )
1728 /* exported symbols */
1731 +static DirectResult
1739 +static DirectResult
1740 Construct( IFusionSound *thiz,
1746 ret = FusionSoundInit( NULL, NULL );
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
1753 #include <direct/thread.h>
1754 #include <direct/util.h>
1757 +static DirectResult
1758 Probe( IFusionSoundMusicProvider_ProbeContext *ctx );
1761 +static DirectResult
1762 Construct( IFusionSoundMusicProvider *thiz,
1763 const char *filename,
1764 DirectStream *stream );
1765 @@ -116,21 +116,21 @@ typedef struct {
1767 #include <linux/cdrom.h>
1770 +static DirectResult
1771 cdda_probe( int fd )
1773 struct cdrom_tochdr tochdr;
1775 if (ioctl( fd, CDROM_DRIVE_STATUS, CDSL_CURRENT ) != CDS_DISC_OK)
1776 - return DFB_UNSUPPORTED;
1777 + return DR_UNSUPPORTED;
1779 if (ioctl( fd, CDROMREADTOCHDR, &tochdr ) < 0)
1780 - return DFB_UNSUPPORTED;
1781 + return DR_UNSUPPORTED;
1788 +static DirectResult
1789 cdda_build_tracklits( int fd, struct cdda_track **ret_tracks,
1790 unsigned int *ret_num )
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" );
1800 ms.addr_format = CDROM_LBA;
1801 if (ioctl( fd, CDROMMULTISESSION, &ms ) == -1) {
1802 D_PERROR( "IFusionSoundMusicProvide_CDDA: "
1803 "ioctl( CDROMMULTISESSION ) failed!\n" );
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" );
1817 /* skip data tracks */
1818 @@ -190,7 +190,7 @@ cdda_build_tracklits( int fd, struct cdda_track **ret_tracks,
1820 if (total_tracks < 1) {
1822 - return DFB_FAILURE;
1823 + return DR_FAILURE;
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" );
1836 @@ -221,7 +221,7 @@ cdda_build_tracklits( int fd, struct cdda_track **ret_tracks,
1837 *ret_tracks = tracks;
1838 *ret_num = total_tracks;
1845 @@ -246,18 +246,18 @@ cdda_read_audio( int fd, u8 *buf, int pos, int len )
1847 #include <sys/cdio.h>
1850 +static DirectResult
1851 cdda_probe( int fd )
1853 struct ioc_toc_header tochdr;
1855 if (ioctl( fd, CDIOREADTOCHEADER, &tochdr ) < 0)
1856 - return DFB_UNSUPPORTED;
1857 + return DR_UNSUPPORTED;
1864 +static DirectResult
1865 cdda_build_tracklits( int fd, struct cdda_track **ret_tracks,
1866 unsigned int *ret_num )
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" );
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" );
1885 /* skip data tracks */
1886 @@ -309,7 +309,7 @@ cdda_build_tracklits( int fd, struct cdda_track **ret_tracks,
1888 if (total_tracks < 1) {
1890 - return DFB_FAILURE;
1891 + return DR_FAILURE;
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" );
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;
1913 @@ -359,18 +359,18 @@ cdda_read_audio( int fd, u8 *buf, int pos, int len )
1918 +static DirectResult
1919 cdda_probe( int fd )
1921 D_WARN( "unsupported system" );
1922 - return DFB_UNSUPPORTED;
1923 + return DR_UNSUPPORTED;
1927 +static DirectResult
1928 cdda_build_tracklits( int fd, struct cdda_track **ret_tracks,
1929 unsigned int *ret_num )
1931 - return DFB_UNSUPPORTED;
1932 + return DR_UNSUPPORTED;
1936 @@ -648,17 +648,17 @@ IFusionSoundMusicProvider_CDDA_Destruct( IFusionSoundMusicProvider *thiz )
1937 DIRECT_DEALLOCATE_INTERFACE( thiz );
1941 +static DirectResult
1942 IFusionSoundMusicProvider_CDDA_AddRef( IFusionSoundMusicProvider *thiz )
1944 DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_CDDA )
1953 +static DirectResult
1954 IFusionSoundMusicProvider_CDDA_Release( IFusionSoundMusicProvider *thiz )
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 );
1966 +static DirectResult
1967 IFusionSoundMusicProvider_CDDA_GetCapabilities( IFusionSoundMusicProvider *thiz,
1968 FSMusicProviderCapabilities *caps )
1970 DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_CDDA )
1973 - return DFB_INVARG;
1976 *caps = FMCAPS_BASIC | FMCAPS_SEEK;
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 )
1991 - return DFB_INVARG;
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,
2005 +static DirectResult
2006 IFusionSoundMusicProvider_CDDA_GetTrackID( IFusionSoundMusicProvider *thiz,
2007 FSTrackID *ret_track_id )
2009 DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_CDDA )
2012 - return DFB_INVARG;
2015 *ret_track_id = data->current_track;
2022 +static DirectResult
2023 IFusionSoundMusicProvider_CDDA_GetTrackDescription( IFusionSoundMusicProvider *thiz,
2024 FSTrackDescription *desc )
2026 @@ -744,7 +744,7 @@ IFusionSoundMusicProvider_CDDA_GetTrackDescription( IFusionSoundMusicProvider *t
2027 DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_CDDA )
2030 - return DFB_INVARG;
2033 memset( desc, 0, sizeof(FSTrackDescription) );
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;
2044 +static DirectResult
2045 IFusionSoundMusicProvider_CDDA_GetStreamDescription( IFusionSoundMusicProvider *thiz,
2046 FSStreamDescription *desc )
2048 DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_CDDA )
2051 - return DFB_INVARG;
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;
2065 +static DirectResult
2066 IFusionSoundMusicProvider_CDDA_GetBufferDescription( IFusionSoundMusicProvider *thiz,
2067 FSBufferDescription *desc )
2069 @@ -794,7 +794,7 @@ IFusionSoundMusicProvider_CDDA_GetBufferDescription( IFusionSoundMusicProvider *
2070 DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_CDDA )
2073 - return DFB_INVARG;
2076 track = &data->tracks[data->current_track];
2078 @@ -807,23 +807,23 @@ IFusionSoundMusicProvider_CDDA_GetBufferDescription( IFusionSoundMusicProvider *
2079 if (desc->length > FS_MAX_FRAMES)
2080 desc->length = FS_MAX_FRAMES;
2087 +static DirectResult
2088 IFusionSoundMusicProvider_CDDA_SelectTrack( IFusionSoundMusicProvider *thiz,
2089 FSTrackID track_id )
2091 DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_CDDA )
2093 if (track_id > data->total_tracks)
2094 - return DFB_INVARG;
2097 pthread_mutex_lock( &data->lock );
2098 data->current_track = track_id;
2099 pthread_mutex_unlock( &data->lock );
2106 @@ -914,7 +914,7 @@ CDDAStreamThread( DirectThread *thread, void *ctx )
2111 +static DirectResult
2112 IFusionSoundMusicProvider_CDDA_PlayToStream( IFusionSoundMusicProvider *thiz,
2113 IFusionSoundStream *destination )
2115 @@ -924,17 +924,17 @@ IFusionSoundMusicProvider_CDDA_PlayToStream( IFusionSoundMusicProvider *thiz,
2116 DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_CDDA )
2119 - return DFB_INVARG;
2122 destination->GetDescription( destination, &desc );
2124 /* check whether destination samplerate is supported */
2125 if (desc.samplerate != 44100)
2126 - return DFB_UNSUPPORTED;
2127 + return DR_UNSUPPORTED;
2129 /* check whether number of channels is supported */
2130 if (desc.channels > 2)
2131 - return DFB_UNSUPPORTED;
2132 + return DR_UNSUPPORTED;
2134 /* check whether destination format is supported */
2135 switch (desc.sampleformat) {
2136 @@ -945,12 +945,12 @@ IFusionSoundMusicProvider_CDDA_PlayToStream( IFusionSoundMusicProvider *thiz,
2140 - return DFB_UNSUPPORTED;
2141 + return DR_UNSUPPORTED;
2144 /* check destination buffer size */
2145 if (desc.buffersize < CD_BYTES_PER_FRAME/4)
2146 - return DFB_UNSUPPORTED;
2147 + return DR_UNSUPPORTED;
2149 pthread_mutex_lock( &data->lock );
2151 @@ -985,7 +985,7 @@ IFusionSoundMusicProvider_CDDA_PlayToStream( IFusionSoundMusicProvider *thiz,
2153 pthread_mutex_unlock( &data->lock );
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;
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 )
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 )
2182 - return DFB_INVARG;
2185 destination->GetDescription( destination, &desc );
2187 /* check whether destination samplerate is supported */
2188 if (desc.samplerate != 44100)
2189 - return DFB_UNSUPPORTED;
2190 + return DR_UNSUPPORTED;
2192 /* check whether number of channels is supported */
2193 if (desc.channels > 2)
2194 - return DFB_UNSUPPORTED;
2195 + return DR_UNSUPPORTED;
2197 /* check whether destination format is supported */
2198 switch (desc.sampleformat) {
2199 @@ -1106,12 +1106,12 @@ IFusionSoundMusicProvider_CDDA_PlayToBuffer( IFusionSoundMusicProvider *thiz,
2203 - return DFB_UNSUPPORTED;
2204 + return DR_UNSUPPORTED;
2207 /* check destination buffer size */
2208 if (desc.length < CD_BYTES_PER_FRAME/4)
2209 - return DFB_UNSUPPORTED;
2210 + return DR_UNSUPPORTED;
2212 pthread_mutex_lock( &data->lock );
2214 @@ -1148,10 +1148,10 @@ IFusionSoundMusicProvider_CDDA_PlayToBuffer( IFusionSoundMusicProvider *thiz,
2216 pthread_mutex_unlock( &data->lock );
2223 +static DirectResult
2224 IFusionSoundMusicProvider_CDDA_Stop( IFusionSoundMusicProvider *thiz )
2226 DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_CDDA )
2227 @@ -1164,24 +1164,24 @@ IFusionSoundMusicProvider_CDDA_Stop( IFusionSoundMusicProvider *thiz )
2229 pthread_mutex_unlock( &data->lock );
2236 +static DirectResult
2237 IFusionSoundMusicProvider_CDDA_GetStatus( IFusionSoundMusicProvider *thiz,
2238 FSMusicProviderStatus *status )
2240 DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_CDDA )
2243 - return DFB_INVARG;
2246 *status = data->status;
2253 +static DirectResult
2254 IFusionSoundMusicProvider_CDDA_SeekTo( IFusionSoundMusicProvider *thiz,
2257 @@ -1191,22 +1191,22 @@ IFusionSoundMusicProvider_CDDA_SeekTo( IFusionSoundMusicProvider *thiz,
2258 DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_CDDA )
2261 - return DFB_INVARG;
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;
2270 pthread_mutex_lock( &data->lock );
2271 track->frame = frame;
2272 data->seeked = true;
2273 pthread_mutex_unlock( &data->lock );
2280 +static DirectResult
2281 IFusionSoundMusicProvider_CDDA_GetPos( IFusionSoundMusicProvider *thiz,
2284 @@ -1215,15 +1215,15 @@ IFusionSoundMusicProvider_CDDA_GetPos( IFusionSoundMusicProvider *thiz,
2285 DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_CDDA )
2288 - return DFB_INVARG;
2291 track = &data->tracks[data->current_track];
2292 *seconds = (double)track->frame / CD_FRAMES_PER_SECOND;
2299 +static DirectResult
2300 IFusionSoundMusicProvider_CDDA_GetLength( IFusionSoundMusicProvider *thiz,
2303 @@ -1232,29 +1232,29 @@ IFusionSoundMusicProvider_CDDA_GetLength( IFusionSoundMusicProvider *thiz,
2304 DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_CDDA )
2307 - return DFB_INVARG;
2310 track = &data->tracks[data->current_track];
2311 *seconds = (double)track->length / CD_FRAMES_PER_SECOND;
2318 +static DirectResult
2319 IFusionSoundMusicProvider_CDDA_SetPlaybackFlags( IFusionSoundMusicProvider *thiz,
2320 FSMusicProviderPlaybackFlags flags )
2322 DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_CDDA )
2324 if (flags & ~FMPLAY_LOOPING)
2325 - return DFB_UNSUPPORTED;
2326 + return DR_UNSUPPORTED;
2328 data->flags = flags;
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 )
2342 if (!mask || mask & ~FMSTATE_ALL)
2343 - return DFB_INVARG;
2348 @@ -1274,18 +1274,18 @@ IFusionSoundMusicProvider_CDDA_WaitStatus( IFusionSoundMusicProvider *thiz,
2350 #ifdef HAVE_PTHREAD_MUTEX_TIMEDLOCK
2351 if (pthread_mutex_timedlock( &data->lock, &t ))
2352 - return DFB_TIMEOUT;
2353 + return DR_TIMEOUT;
2355 while (pthread_mutex_trylock( &data->lock )) {
2357 if (direct_clock_get_abs_micros() >= s)
2358 - return DFB_TIMEOUT;
2359 + return DR_TIMEOUT;
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;
2370 @@ -1298,23 +1298,23 @@ IFusionSoundMusicProvider_CDDA_WaitStatus( IFusionSoundMusicProvider *thiz,
2372 pthread_mutex_unlock( &data->lock );
2378 /* exported symbols */
2381 +static DirectResult
2382 Probe( IFusionSoundMusicProvider_ProbeContext *ctx )
2384 return cdda_probe( direct_stream_fileno( ctx->stream ) );
2388 +static DirectResult
2389 Construct( IFusionSoundMusicProvider *thiz,
2390 const char *filename,
2391 DirectStream *stream )
2396 DIRECT_ALLOCATE_INTERFACE_DATA( thiz, IFusionSoundMusicProvider_CDDA )
2398 @@ -1324,7 +1324,7 @@ Construct( IFusionSoundMusicProvider *thiz,
2399 data->fd = dup( direct_stream_fileno( stream ) );
2401 IFusionSoundMusicProvider_CDDA_Destruct( thiz );
2406 /* reset to blocking mode */
2407 @@ -1332,7 +1332,7 @@ Construct( IFusionSoundMusicProvider *thiz,
2408 fcntl( data->fd, F_GETFL ) & ~O_NONBLOCK );
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 );
2416 @@ -1364,6 +1364,6 @@ Construct( IFusionSoundMusicProvider *thiz,
2417 thiz->SetPlaybackFlags = IFusionSoundMusicProvider_CDDA_SetPlaybackFlags;
2418 thiz->WaitStatus = IFusionSoundMusicProvider_CDDA_WaitStatus;
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
2429 #include <avcodec.h>
2430 #include <avformat.h>
2433 +static DirectResult
2434 Probe( IFusionSoundMusicProvider_ProbeContext *ctx );
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 );
2445 - return (ret == DFB_EOF) ? 0 : -1;
2446 + return (ret == DR_EOF) ? 0 : -1;
2450 @@ -147,11 +147,11 @@ av_seek_callback( void *opaque, offset_t offset, int whence )
2451 ret = direct_stream_seek( data->stream, pos-offset );
2454 - ret = DFB_UNSUPPORTED;
2455 + ret = DR_UNSUPPORTED;
2459 - if (ret != DFB_OK)
2463 return direct_stream_offset( data->stream );
2464 @@ -435,17 +435,17 @@ IFusionSoundMusicProvider_FFmpeg_Destruct( IFusionSoundMusicProvider *thiz )
2465 DIRECT_DEALLOCATE_INTERFACE( thiz );
2469 +static DirectResult
2470 IFusionSoundMusicProvider_FFmpeg_AddRef( IFusionSoundMusicProvider *thiz )
2472 DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_FFmpeg )
2481 +static DirectResult
2482 IFusionSoundMusicProvider_FFmpeg_Release( IFusionSoundMusicProvider *thiz )
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 );
2494 +static DirectResult
2495 IFusionSoundMusicProvider_FFmpeg_GetCapabilities( IFusionSoundMusicProvider *thiz,
2496 FSMusicProviderCapabilities *caps )
2498 DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_FFmpeg )
2501 - return DFB_INVARG;
2504 *caps = FMCAPS_BASIC;
2505 if (direct_stream_seekable( data->stream ))
2506 *caps |= FMCAPS_SEEK;
2513 +static DirectResult
2514 IFusionSoundMusicProvider_FFmpeg_GetTrackDescription( IFusionSoundMusicProvider *thiz,
2515 FSTrackDescription *desc )
2517 DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_FFmpeg )
2520 - return DFB_INVARG;
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;
2534 +static DirectResult
2535 IFusionSoundMusicProvider_FFmpeg_GetStreamDescription( IFusionSoundMusicProvider *thiz,
2536 FSStreamDescription *desc )
2538 DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_FFmpeg )
2541 - return DFB_INVARG;
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;
2555 +static DirectResult
2556 IFusionSoundMusicProvider_FFmpeg_GetBufferDescription( IFusionSoundMusicProvider *thiz,
2557 FSBufferDescription *desc )
2559 DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_FFmpeg )
2562 - return DFB_INVARG;
2565 desc->flags = FSBDF_SAMPLERATE | FSBDF_CHANNELS |
2566 FSBDF_SAMPLEFORMAT | FSBDF_LENGTH;
2567 @@ -531,7 +531,7 @@ IFusionSoundMusicProvider_FFmpeg_GetBufferDescription( IFusionSoundMusicProvider
2569 desc->length = MIN((s64)data->ctx->duration*desc->samplerate/AV_TIME_BASE, FS_MAX_FRAMES);
2576 @@ -644,7 +644,7 @@ FFmpegStreamThread( DirectThread *thread, void *ctx )
2581 +static DirectResult
2582 IFusionSoundMusicProvider_FFmpeg_PlayToStream( IFusionSoundMusicProvider *thiz,
2583 IFusionSoundStream *destination )
2585 @@ -653,16 +653,16 @@ IFusionSoundMusicProvider_FFmpeg_PlayToStream( IFusionSoundMusicProvider *thiz,
2586 DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_FFmpeg )
2589 - return DFB_INVARG;
2592 if (data->dest.stream == destination)
2596 destination->GetDescription( destination, &desc );
2598 /* check whether destination samplerate is supported */
2599 if (desc.samplerate != data->codec->sample_rate)
2600 - return DFB_UNSUPPORTED;
2601 + return DR_UNSUPPORTED;
2603 /* check whether destination format is supported */
2604 switch (desc.sampleformat) {
2605 @@ -673,7 +673,7 @@ IFusionSoundMusicProvider_FFmpeg_PlayToStream( IFusionSoundMusicProvider *thiz,
2609 - return DFB_UNSUPPORTED;
2610 + return DR_UNSUPPORTED;
2613 /* check whether destination mode is supported */
2614 @@ -693,7 +693,7 @@ IFusionSoundMusicProvider_FFmpeg_PlayToStream( IFusionSoundMusicProvider *thiz,
2615 case FSCM_SURROUND51:
2618 - return DFB_UNSUPPORTED;
2619 + return DR_UNSUPPORTED;
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;
2630 data->finished = false;
2632 @@ -712,7 +712,7 @@ IFusionSoundMusicProvider_FFmpeg_PlayToStream( IFusionSoundMusicProvider *thiz,
2633 data->buf = D_MALLOC( AVCODEC_MAX_AUDIO_FRAME_SIZE );
2635 pthread_mutex_unlock( &data->lock );
2636 - return DFB_NOSYSTEMMEMORY;
2637 + return DR_NOLOCALMEMORY;
2641 @@ -730,7 +730,7 @@ IFusionSoundMusicProvider_FFmpeg_PlayToStream( IFusionSoundMusicProvider *thiz,
2643 pthread_mutex_unlock( &data->lock );
2650 @@ -860,7 +860,7 @@ FFmpegBufferThread( DirectThread *thread, void *ctx )
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 )
2663 - return DFB_INVARG;
2666 if (data->dest.buffer == destination)
2670 destination->GetDescription( destination, &desc );
2672 /* check whether destination samplerate is supported */
2673 if (desc.samplerate != data->codec->sample_rate)
2674 - return DFB_UNSUPPORTED;
2675 + return DR_UNSUPPORTED;
2677 /* check whether destination format is supported */
2678 switch (desc.sampleformat) {
2679 @@ -891,7 +891,7 @@ IFusionSoundMusicProvider_FFmpeg_PlayToBuffer( IFusionSoundMusicProvider *thiz,
2683 - return DFB_UNSUPPORTED;
2684 + return DR_UNSUPPORTED;
2687 /* check whether destination mode is supported */
2688 @@ -911,7 +911,7 @@ IFusionSoundMusicProvider_FFmpeg_PlayToBuffer( IFusionSoundMusicProvider *thiz,
2689 case FSCM_SURROUND51:
2692 - return DFB_UNSUPPORTED;
2693 + return DR_UNSUPPORTED;
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;
2704 data->finished = false;
2706 @@ -930,7 +930,7 @@ IFusionSoundMusicProvider_FFmpeg_PlayToBuffer( IFusionSoundMusicProvider *thiz,
2707 data->buf = D_MALLOC( AVCODEC_MAX_AUDIO_FRAME_SIZE );
2709 pthread_mutex_unlock( &data->lock );
2710 - return DFB_NOSYSTEMMEMORY;
2711 + return DR_NOLOCALMEMORY;
2715 @@ -951,10 +951,10 @@ IFusionSoundMusicProvider_FFmpeg_PlayToBuffer( IFusionSoundMusicProvider *thiz,
2717 pthread_mutex_unlock( &data->lock );
2724 +static DirectResult
2725 IFusionSoundMusicProvider_FFmpeg_Stop( IFusionSoundMusicProvider *thiz )
2727 DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_FFmpeg )
2728 @@ -967,41 +967,41 @@ IFusionSoundMusicProvider_FFmpeg_Stop( IFusionSoundMusicProvider *thiz )
2730 pthread_mutex_unlock( &data->lock );
2737 +static DirectResult
2738 IFusionSoundMusicProvider_FFmpeg_GetStatus( IFusionSoundMusicProvider *thiz,
2739 FSMusicProviderStatus *status )
2741 DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_FFmpeg )
2744 - return DFB_INVARG;
2747 *status = data->status;
2754 +static DirectResult
2755 IFusionSoundMusicProvider_FFmpeg_SeekTo( IFusionSoundMusicProvider *thiz,
2762 DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_FFmpeg )
2765 - return DFB_INVARG;
2768 if (!direct_stream_seekable( data->stream ))
2769 - return DFB_UNSUPPORTED;
2770 + return DR_UNSUPPORTED;
2772 time = seconds * AV_TIME_BASE;
2773 if (data->ctx->duration != AV_NOPTS_VALUE && time > data->ctx->duration)
2777 pthread_mutex_lock( &data->lock );
2779 @@ -1010,10 +1010,10 @@ IFusionSoundMusicProvider_FFmpeg_SeekTo( IFusionSoundMusicProvider *thiz,
2780 data->seeked = true;
2781 data->finished = false;
2787 - ret = DFB_FAILURE;
2791 pthread_mutex_unlock( &data->lock );
2792 @@ -1021,7 +1021,7 @@ IFusionSoundMusicProvider_FFmpeg_SeekTo( IFusionSoundMusicProvider *thiz,
2797 +static DirectResult
2798 IFusionSoundMusicProvider_FFmpeg_GetPos( IFusionSoundMusicProvider *thiz,
2801 @@ -1030,7 +1030,7 @@ IFusionSoundMusicProvider_FFmpeg_GetPos( IFusionSoundMusicProvider *thiz,
2802 DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_FFmpeg )
2805 - return DFB_INVARG;
2809 if (data->dest.stream) {
2810 @@ -1042,43 +1042,43 @@ IFusionSoundMusicProvider_FFmpeg_GetPos( IFusionSoundMusicProvider *thiz,
2812 *seconds = (double)pos / AV_TIME_BASE;
2819 +static DirectResult
2820 IFusionSoundMusicProvider_FFmpeg_GetLength( IFusionSoundMusicProvider *thiz,
2823 DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_FFmpeg )
2826 - return DFB_INVARG;
2829 if (data->ctx->duration > 0) {
2830 *seconds = (double)data->ctx->duration / AV_TIME_BASE;
2837 - return DFB_UNSUPPORTED;
2838 + return DR_UNSUPPORTED;
2842 +static DirectResult
2843 IFusionSoundMusicProvider_FFmpeg_SetPlaybackFlags( IFusionSoundMusicProvider *thiz,
2844 FSMusicProviderPlaybackFlags flags )
2846 DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_FFmpeg )
2848 if (flags & ~FMPLAY_LOOPING)
2849 - return DFB_UNSUPPORTED;
2850 + return DR_UNSUPPORTED;
2852 data->flags = flags;
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 )
2866 if (!mask || mask & ~FMSTATE_ALL)
2867 - return DFB_INVARG;
2872 @@ -1098,18 +1098,18 @@ IFusionSoundMusicProvider_FFmpeg_WaitStatus( IFusionSoundMusicProvider *thiz,
2874 #ifdef HAVE_PTHREAD_MUTEX_TIMEDLOCK
2875 if (pthread_mutex_timedlock( &data->lock, &t ))
2876 - return DFB_TIMEOUT;
2877 + return DR_TIMEOUT;
2879 while (pthread_mutex_trylock( &data->lock )) {
2881 if (direct_clock_get_abs_micros() >= s)
2882 - return DFB_TIMEOUT;
2883 + return DR_TIMEOUT;
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;
2894 @@ -1122,12 +1122,12 @@ IFusionSoundMusicProvider_FFmpeg_WaitStatus( IFusionSoundMusicProvider *thiz,
2896 pthread_mutex_unlock( &data->lock );
2902 /*****************************************************************************/
2905 +static DirectResult
2906 Probe( IFusionSoundMusicProvider_ProbeContext *ctx )
2909 @@ -1146,13 +1146,13 @@ Probe( IFusionSoundMusicProvider_ProbeContext *ctx )
2910 !strcmp( format->name, "aac" ) ||
2911 !strcmp( format->name, "ac3" ) ||
2912 !strcmp( format->name, "flac" ))
2917 - return DFB_UNSUPPORTED;
2918 + return DR_UNSUPPORTED;
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 );
2929 IFusionSoundMusicProvider_FFmpeg_Destruct( thiz );
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 );
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;
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;
2957 for (i = 0; i < data->ctx->nb_streams; i++) {
2958 @@ -1217,7 +1217,7 @@ Construct( IFusionSoundMusicProvider *thiz,
2960 D_ERROR( "IFusionSoundMusicProvider_FFmpeg: couldn't find audio stream!\n" );
2961 IFusionSoundMusicProvider_FFmpeg_Destruct( thiz );
2962 - return DFB_FAILURE;
2963 + return DR_FAILURE;
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;
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;
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
2992 +static DirectResult
2993 Probe( IFusionSoundMusicProvider_ProbeContext *ctx );
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 );
3005 +static DirectResult
3006 IFusionSoundMusicProvider_Mad_AddRef( IFusionSoundMusicProvider *thiz )
3008 DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_Mad )
3017 +static DirectResult
3018 IFusionSoundMusicProvider_Mad_Release( IFusionSoundMusicProvider *thiz )
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 );
3030 +static DirectResult
3031 IFusionSoundMusicProvider_Mad_GetCapabilities( IFusionSoundMusicProvider *thiz,
3032 FSMusicProviderCapabilities *caps )
3034 DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_Mad )
3037 - return DFB_INVARG;
3040 *caps = FMCAPS_BASIC | FMCAPS_HALFRATE;
3041 if (direct_stream_seekable( data->s ))
3042 *caps |= FMCAPS_SEEK;
3049 +static DirectResult
3050 IFusionSoundMusicProvider_Mad_GetTrackDescription( IFusionSoundMusicProvider *thiz,
3051 FSTrackDescription *desc )
3053 DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_Mad )
3056 - return DFB_INVARG;
3066 +static DirectResult
3067 IFusionSoundMusicProvider_Mad_GetStreamDescription( IFusionSoundMusicProvider *thiz,
3068 FSStreamDescription *desc )
3070 DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_Mad )
3073 - return DFB_INVARG;
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;
3087 +static DirectResult
3088 IFusionSoundMusicProvider_Mad_GetBufferDescription( IFusionSoundMusicProvider *thiz,
3089 FSBufferDescription *desc )
3091 DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_Mad )
3094 - return DFB_INVARG;
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);
3108 @@ -529,7 +529,7 @@ MadStreamThread( DirectThread *thread, void *ctx )
3109 direct_stream_wait( data->s, data->read_size, NULL );
3111 while (data->status == FMSTATE_PLAY) {
3112 - DFBResult ret = DFB_OK;
3113 + DirectResult ret = DR_OK;
3114 unsigned int len = data->read_size;
3116 struct timeval tv = { 0, 500 };
3117 @@ -554,7 +554,7 @@ MadStreamThread( DirectThread *thread, void *ctx )
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 )
3130 - if (ret == DFB_EOF) {
3131 + if (ret == DR_EOF) {
3132 if (data->flags & FMPLAY_LOOPING) {
3133 direct_stream_seek( data->s, 0 );
3135 @@ -616,7 +616,7 @@ MadStreamThread( DirectThread *thread, void *ctx )
3140 +static DirectResult
3141 IFusionSoundMusicProvider_Mad_PlayToStream( IFusionSoundMusicProvider *thiz,
3142 IFusionSoundStream *destination )
3144 @@ -625,21 +625,21 @@ IFusionSoundMusicProvider_Mad_PlayToStream( IFusionSoundMusicProvider *thiz,
3145 DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_Mad )
3148 - return DFB_INVARG;
3151 if (data->dest.stream == destination)
3155 destination->GetDescription( destination, &desc );
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;
3163 /* check whether number of channels is supported */
3164 if (desc.channels > 6)
3165 - return DFB_UNSUPPORTED;
3166 + return DR_UNSUPPORTED;
3168 /* check whether destination format is supported */
3169 switch (desc.sampleformat) {
3170 @@ -650,7 +650,7 @@ IFusionSoundMusicProvider_Mad_PlayToStream( IFusionSoundMusicProvider *thiz,
3174 - return DFB_UNSUPPORTED;
3175 + return DR_UNSUPPORTED;
3178 pthread_mutex_lock( &data->lock );
3179 @@ -691,7 +691,7 @@ IFusionSoundMusicProvider_Mad_PlayToStream( IFusionSoundMusicProvider *thiz,
3181 pthread_mutex_unlock( &data->lock );
3188 @@ -709,7 +709,7 @@ MadBufferThread( DirectThread *thread, void *ctx )
3189 direct_stream_wait( data->s, data->read_size, NULL );
3191 while (data->status == FMSTATE_PLAY) {
3192 - DFBResult ret = DFB_OK;
3193 + DirectResult ret = DR_OK;
3194 unsigned int len = data->read_size;
3196 struct timeval tv = { 0, 500 };
3197 @@ -732,7 +732,7 @@ MadBufferThread( DirectThread *thread, void *ctx )
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 )
3210 - if (ret == DFB_EOF) {
3211 + if (ret == DR_EOF) {
3212 if (data->flags & FMPLAY_LOOPING) {
3213 direct_stream_seek( data->s, 0 );
3215 @@ -778,7 +778,7 @@ MadBufferThread( DirectThread *thread, void *ctx )
3216 mad_synth_frame( &data->synth, &data->frame );
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" );
3224 @@ -814,7 +814,7 @@ MadBufferThread( DirectThread *thread, void *ctx )
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 )
3237 - return DFB_INVARG;
3240 if (data->dest.buffer == destination)
3244 destination->GetDescription( destination, &desc );
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;
3252 /* check whether number of channels is supported */
3253 if (desc.channels > 6)
3254 - return DFB_UNSUPPORTED;
3255 + return DR_UNSUPPORTED;
3257 /* check whether destination format is supported */
3258 switch (desc.sampleformat) {
3259 @@ -850,7 +850,7 @@ IFusionSoundMusicProvider_Mad_PlayToBuffer( IFusionSoundMusicProvider *thiz,
3263 - return DFB_UNSUPPORTED;
3264 + return DR_UNSUPPORTED;
3267 pthread_mutex_lock( &data->lock );
3268 @@ -895,10 +895,10 @@ IFusionSoundMusicProvider_Mad_PlayToBuffer( IFusionSoundMusicProvider *thiz,
3270 pthread_mutex_unlock( &data->lock );
3277 +static DirectResult
3278 IFusionSoundMusicProvider_Mad_Stop( IFusionSoundMusicProvider *thiz )
3280 DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_Mad )
3281 @@ -911,35 +911,35 @@ IFusionSoundMusicProvider_Mad_Stop( IFusionSoundMusicProvider *thiz )
3283 pthread_mutex_unlock( &data->lock );
3290 +static DirectResult
3291 IFusionSoundMusicProvider_Mad_GetStatus( IFusionSoundMusicProvider *thiz,
3292 FSMusicProviderStatus *status )
3294 DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_Mad )
3297 - return DFB_INVARG;
3300 *status = data->status;
3307 +static DirectResult
3308 IFusionSoundMusicProvider_Mad_SeekTo( IFusionSoundMusicProvider *thiz,
3311 - DFBResult ret = DFB_FAILURE;
3312 + DirectResult ret = DR_FAILURE;
3316 DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_Mad )
3319 - return DFB_INVARG;
3322 pthread_mutex_lock( &data->lock );
3324 @@ -947,7 +947,7 @@ IFusionSoundMusicProvider_Mad_SeekTo( IFusionSoundMusicProvider *thiz,
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;
3333 @@ -958,7 +958,7 @@ IFusionSoundMusicProvider_Mad_SeekTo( IFusionSoundMusicProvider *thiz,
3338 +static DirectResult
3339 IFusionSoundMusicProvider_Mad_GetPos( IFusionSoundMusicProvider *thiz,
3342 @@ -968,10 +968,10 @@ IFusionSoundMusicProvider_Mad_GetPos( IFusionSoundMusicProvider *thiz,
3343 DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_Mad )
3346 - return DFB_INVARG;
3349 if (!data->desc.bitrate)
3350 - return DFB_UNSUPPORTED;
3351 + return DR_UNSUPPORTED;
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;
3364 +static DirectResult
3365 IFusionSoundMusicProvider_Mad_GetLength( IFusionSoundMusicProvider *thiz,
3368 DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_Mad )
3371 - return DFB_INVARG;
3374 *seconds = data->length;
3381 +static DirectResult
3382 IFusionSoundMusicProvider_Mad_SetPlaybackFlags( IFusionSoundMusicProvider *thiz,
3383 FSMusicProviderPlaybackFlags flags )
3385 DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_Mad )
3387 if (flags & ~FMPLAY_LOOPING)
3388 - return DFB_UNSUPPORTED;
3389 + return DR_UNSUPPORTED;
3391 if (flags & FMPLAY_LOOPING && !direct_stream_seekable( data->s ))
3392 - return DFB_UNSUPPORTED;
3393 + return DR_UNSUPPORTED;
3395 data->flags = flags;
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 )
3409 if (!mask || mask & ~FMSTATE_ALL)
3410 - return DFB_INVARG;
3415 @@ -1036,18 +1036,18 @@ IFusionSoundMusicProvider_Mad_WaitStatus( IFusionSoundMusicProvider *thiz,
3417 #ifdef HAVE_PTHREAD_MUTEX_TIMEDLOCK
3418 if (pthread_mutex_timedlock( &data->lock, &t ))
3419 - return DFB_TIMEOUT;
3420 + return DR_TIMEOUT;
3422 while (pthread_mutex_trylock( &data->lock )) {
3424 if (direct_clock_get_abs_micros() >= s)
3425 - return DFB_TIMEOUT;
3426 + return DR_TIMEOUT;
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;
3437 @@ -1060,38 +1060,38 @@ IFusionSoundMusicProvider_Mad_WaitStatus( IFusionSoundMusicProvider *thiz,
3439 pthread_mutex_unlock( &data->lock );
3445 /* exported symbols */
3448 +static DirectResult
3449 Probe( IFusionSoundMusicProvider_ProbeContext *ctx )
3453 if (ctx->mimetype && !strcmp( ctx->mimetype, "audio/mpeg" ))
3457 ext = strrchr( ctx->filename, '.' );
3459 if (!strcasecmp( ext, ".mp1" ) ||
3460 !strcasecmp( ext, ".mp2" ) ||
3461 !strcasecmp( ext, ".mp3" ))
3466 /* Detect by contents ? */
3468 - return DFB_UNSUPPORTED;
3469 + return DR_UNSUPPORTED;
3473 +static DirectResult
3474 Construct( IFusionSoundMusicProvider *thiz,
3475 const char *filename,
3476 DirectStream *stream )
3481 unsigned int pos = 0;
3483 @@ -1149,7 +1149,7 @@ Construct( IFusionSoundMusicProvider *thiz,
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;
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;
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
3505 #include <direct/util.h>
3509 +static DirectResult
3510 Probe( IFusionSoundMusicProvider_ProbeContext *ctx );
3513 +static DirectResult
3514 Construct( IFusionSoundMusicProvider *thiz,
3515 const char *filename,
3516 DirectStream *stream );
3517 @@ -94,7 +94,7 @@ typedef struct {
3519 /*****************************************************************************/
3522 +static DirectResult
3523 add_media( FSTrackID id,
3526 @@ -124,7 +124,7 @@ add_media( FSTrackID id,
3528 direct_list_append( (DirectLink**)playlist, &entry->link );
3535 @@ -703,17 +703,17 @@ IFusionSoundMusicProvider_Playlist_Destruct( IFusionSoundMusicProvider *thiz )
3536 DIRECT_DEALLOCATE_INTERFACE( thiz );
3540 +static DirectResult
3541 IFusionSoundMusicProvider_Playlist_AddRef( IFusionSoundMusicProvider *thiz )
3543 DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_Playlist )
3552 +static DirectResult
3553 IFusionSoundMusicProvider_Playlist_Release( IFusionSoundMusicProvider *thiz )
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 );
3565 +static DirectResult
3566 IFusionSoundMusicProvider_Playlist_GetCapabilities( IFusionSoundMusicProvider *thiz,
3567 FSMusicProviderCapabilities *caps )
3569 @@ -733,10 +733,10 @@ IFusionSoundMusicProvider_Playlist_GetCapabilities( IFusionSoundMusicProvider
3570 if (data->selected->provider)
3571 return data->selected->provider->GetCapabilities( data->selected->provider, caps );
3573 - return DFB_UNSUPPORTED;
3574 + return DR_UNSUPPORTED;
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 )
3586 - return DFB_INVARG;
3589 direct_list_foreach_safe (entry, tmp, data->playlist) {
3590 FSTrackDescription desc;
3591 @@ -768,27 +768,27 @@ IFusionSoundMusicProvider_Playlist_EnumTracks( IFusionSoundMusicProvider *thiz,
3594 if (callback( entry->id, desc, callbackdata ))
3595 - return DFB_INTERRUPTED;
3596 + return DR_INTERRUPTED;
3604 +static DirectResult
3605 IFusionSoundMusicProvider_Playlist_GetTrackID( IFusionSoundMusicProvider *thiz,
3606 FSTrackID *track_id )
3608 DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_Playlist )
3611 - return DFB_INVARG;
3614 *track_id = data->selected->id;
3621 +static DirectResult
3622 IFusionSoundMusicProvider_Playlist_GetTrackDescription( IFusionSoundMusicProvider *thiz,
3623 FSTrackDescription *desc )
3625 @@ -797,7 +797,7 @@ IFusionSoundMusicProvider_Playlist_GetTrackDescription( IFusionSoundMusicProvide
3626 DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_Playlist )
3629 - return DFB_INVARG;
3632 entry = data->selected;
3634 @@ -817,10 +817,10 @@ IFusionSoundMusicProvider_Playlist_GetTrackDescription( IFusionSoundMusicProvide
3635 direct_snputs( desc->album, entry->album, sizeof(desc->album) );
3643 +static DirectResult
3644 IFusionSoundMusicProvider_Playlist_GetStreamDescription( IFusionSoundMusicProvider *thiz,
3645 FSStreamDescription *desc )
3647 @@ -829,10 +829,10 @@ IFusionSoundMusicProvider_Playlist_GetStreamDescription( IFusionSoundMusicProvid
3648 if (data->selected->provider)
3649 return data->selected->provider->GetStreamDescription( data->selected->provider, desc );
3651 - return DFB_UNSUPPORTED;
3652 + return DR_UNSUPPORTED;
3656 +static DirectResult
3657 IFusionSoundMusicProvider_Playlist_GetBufferDescription( IFusionSoundMusicProvider *thiz,
3658 FSBufferDescription *desc )
3660 @@ -841,10 +841,10 @@ IFusionSoundMusicProvider_Playlist_GetBufferDescription( IFusionSoundMusicProvid
3661 if (data->selected->provider)
3662 return data->selected->provider->GetBufferDescription( data->selected->provider, desc );
3664 - return DFB_UNSUPPORTED;
3665 + return DR_UNSUPPORTED;
3669 +static DirectResult
3670 IFusionSoundMusicProvider_Playlist_SelectTrack( IFusionSoundMusicProvider *thiz,
3671 FSTrackID track_id )
3673 @@ -854,7 +854,7 @@ IFusionSoundMusicProvider_Playlist_SelectTrack( IFusionSoundMusicProvider *thiz,
3675 direct_list_foreach (entry, data->playlist) {
3676 IFusionSoundMusicProvider *provider;
3680 if (entry->id != track_id)
3682 @@ -886,17 +886,17 @@ IFusionSoundMusicProvider_Playlist_SelectTrack( IFusionSoundMusicProvider *thiz,
3684 entry->provider = provider;
3690 - return DFB_ITEMNOTFOUND;
3691 + return DR_ITEMNOTFOUND;
3695 +static DirectResult
3696 IFusionSoundMusicProvider_Playlist_PlayToStream( IFusionSoundMusicProvider *thiz,
3697 IFusionSoundStream *destination )
3699 - DFBResult ret = DFB_UNSUPPORTED;
3700 + DirectResult ret = DR_UNSUPPORTED;
3702 DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_Playlist )
3704 @@ -911,7 +911,7 @@ IFusionSoundMusicProvider_Playlist_PlayToStream( IFusionSoundMusicProvider *thiz
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;
3713 @@ -920,13 +920,13 @@ IFusionSoundMusicProvider_Playlist_PlayToStream( IFusionSoundMusicProvider *thiz
3718 +static DirectResult
3719 IFusionSoundMusicProvider_Playlist_PlayToBuffer( IFusionSoundMusicProvider *thiz,
3720 IFusionSoundBuffer *destination,
3721 FMBufferCallback callback,
3724 - DFBResult ret = DFB_UNSUPPORTED;
3725 + DirectResult ret = DR_UNSUPPORTED;
3727 DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_Playlist )
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
3743 +static DirectResult
3744 IFusionSoundMusicProvider_Playlist_Stop( IFusionSoundMusicProvider *thiz )
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 );
3751 - return DFB_UNSUPPORTED;
3752 + return DR_UNSUPPORTED;
3756 +static DirectResult
3757 IFusionSoundMusicProvider_Playlist_GetStatus( IFusionSoundMusicProvider *thiz,
3758 FSMusicProviderStatus *status )
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 );
3764 - return DFB_UNSUPPORTED;
3765 + return DR_UNSUPPORTED;
3769 +static DirectResult
3770 IFusionSoundMusicProvider_Playlist_SeekTo( IFusionSoundMusicProvider *thiz,
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 );
3777 - return DFB_UNSUPPORTED;
3778 + return DR_UNSUPPORTED;
3782 +static DirectResult
3783 IFusionSoundMusicProvider_Playlist_GetPos( IFusionSoundMusicProvider *thiz,
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 );
3790 - return DFB_UNSUPPORTED;
3791 + return DR_UNSUPPORTED;
3795 +static DirectResult
3796 IFusionSoundMusicProvider_Playlist_GetLength( IFusionSoundMusicProvider *thiz,
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 );
3803 - return DFB_UNSUPPORTED;
3804 + return DR_UNSUPPORTED;
3808 +static DirectResult
3809 IFusionSoundMusicProvider_Playlist_SetPlaybackFlags( IFusionSoundMusicProvider *thiz,
3810 FSMusicProviderPlaybackFlags flags )
3812 @@ -1032,10 +1032,10 @@ IFusionSoundMusicProvider_Playlist_SetPlaybackFlags( IFusionSoundMusicProvider
3813 if (data->selected->provider)
3814 return data->selected->provider->SetPlaybackFlags( data->selected->provider, flags );
3816 - return DFB_UNSUPPORTED;
3817 + return DR_UNSUPPORTED;
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 );
3829 - return DFB_UNSUPPORTED;
3830 + return DR_UNSUPPORTED;
3833 /* exported symbols */
3836 +static DirectResult
3837 Probe( IFusionSoundMusicProvider_ProbeContext *ctx )
3839 if (get_playlist_type( ctx->mimetype, ctx->filename,
3840 (const char*)ctx->header, sizeof(ctx->header) ))
3844 - return DFB_UNSUPPORTED;
3845 + return DR_UNSUPPORTED;
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 )) {
3856 DIRECT_DEALLOCATE_INTERFACE( thiz );
3862 @@ -1110,7 +1110,7 @@ Construct( IFusionSoundMusicProvider *thiz,
3865 DIRECT_DEALLOCATE_INTERFACE( thiz );
3871 @@ -1143,7 +1143,7 @@ Construct( IFusionSoundMusicProvider *thiz,
3873 if (!data->playlist) {
3874 DIRECT_DEALLOCATE_INTERFACE( thiz );
3875 - return DFB_FAILURE;
3876 + return DR_FAILURE;
3879 /* initialize function pointers */
3880 @@ -1169,5 +1169,5 @@ Construct( IFusionSoundMusicProvider *thiz,
3881 /* select first media */
3882 thiz->SelectTrack( thiz, data->playlist->id );
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
3893 #include <timidity.h>
3896 +static DirectResult
3897 Probe( IFusionSoundMusicProvider_ProbeContext *ctx );
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 );
3909 +static DirectResult
3910 IFusionSoundMusicProvider_Timidity_AddRef( IFusionSoundMusicProvider *thiz )
3912 DIRECT_INTERFACE_GET_DATA (IFusionSoundMusicProvider_Timidity)
3922 +static DirectResult
3923 IFusionSoundMusicProvider_Timidity_Release( IFusionSoundMusicProvider *thiz )
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 );
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)
3943 - return DFB_INVARG;
3946 *caps = FMCAPS_BASIC | FMCAPS_SEEK | FMCAPS_RESAMPLE;
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)
3961 - return DFB_INVARG;
3964 memset( desc, 0, sizeof(FSTrackDescription) );
3965 snprintf( desc->encoding, FS_TRACK_DESC_ENCODING_LENGTH, "MIDI" );
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)
3980 - return DFB_INVARG;
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;
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)
4002 - return DFB_INVARG;
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;
4016 @@ -326,7 +326,7 @@ TimidityStreamThread( DirectThread *thread, void *ctx )
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)
4029 - return DFB_INVARG;
4032 destination->GetDescription( destination, &desc );
4034 if (desc.channels > 2)
4035 - return DFB_UNSUPPORTED;
4036 + return DR_UNSUPPORTED;
4038 switch (desc.sampleformat) {
4043 - return DFB_UNSUPPORTED;
4044 + return DR_UNSUPPORTED;
4047 pthread_mutex_lock( &data->lock );
4048 @@ -362,7 +362,7 @@ IFusionSoundMusicProvider_Timidity_PlayToStream(
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;
4056 options.rate = desc.samplerate;
4057 @@ -377,7 +377,7 @@ IFusionSoundMusicProvider_Timidity_PlayToStream(
4059 D_ERROR( "IFusionSoundMusicProvider_Timidity: couldn't load song!\n" );
4060 pthread_mutex_unlock( &data->lock );
4061 - return DFB_FAILURE;
4062 + return DR_FAILURE;
4065 data->song_length = mid_song_get_total_time( data->song );
4066 @@ -405,7 +405,7 @@ IFusionSoundMusicProvider_Timidity_PlayToStream(
4068 pthread_mutex_unlock( &data->lock );
4075 @@ -435,7 +435,7 @@ TimidityBufferThread( DirectThread *thread, void *ctx )
4077 data->song_pos = mid_song_get_time( data->song );
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 )
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)
4097 - return DFB_INVARG;
4100 destination->GetDescription( destination, &desc );
4102 if (desc.channels > 2)
4103 - return DFB_UNSUPPORTED;
4104 + return DR_UNSUPPORTED;
4106 switch (desc.sampleformat) {
4111 - return DFB_UNSUPPORTED;
4112 + return DR_UNSUPPORTED;
4115 pthread_mutex_lock( &data->lock );
4116 @@ -509,7 +509,7 @@ IFusionSoundMusicProvider_Timidity_PlayToBuffer(
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;
4124 options.rate = desc.samplerate;
4125 @@ -524,7 +524,7 @@ IFusionSoundMusicProvider_Timidity_PlayToBuffer(
4127 D_ERROR( "IFusionSoundMusicProvider_Timidity: couldn't load song!\n" );
4128 pthread_mutex_unlock( &data->lock );
4129 - return DFB_FAILURE;
4130 + return DR_FAILURE;
4133 data->song_length = mid_song_get_total_time( data->song );
4134 @@ -553,10 +553,10 @@ IFusionSoundMusicProvider_Timidity_PlayToBuffer(
4136 pthread_mutex_unlock( &data->lock );
4143 +static DirectResult
4144 IFusionSoundMusicProvider_Timidity_Stop( IFusionSoundMusicProvider *thiz )
4146 DIRECT_INTERFACE_GET_DATA (IFusionSoundMusicProvider_Timidity)
4147 @@ -569,31 +569,31 @@ IFusionSoundMusicProvider_Timidity_Stop( IFusionSoundMusicProvider *thiz )
4149 pthread_mutex_unlock( &data->lock );
4156 +static DirectResult
4157 IFusionSoundMusicProvider_Timidity_GetStatus( IFusionSoundMusicProvider *thiz,
4158 FSMusicProviderStatus *status )
4160 DIRECT_INTERFACE_GET_DATA (IFusionSoundMusicProvider_Timidity)
4163 - return DFB_INVARG;
4166 *status = data->status;
4173 +static DirectResult
4174 IFusionSoundMusicProvider_Timidity_SeekTo( IFusionSoundMusicProvider *thiz,
4177 DIRECT_INTERFACE_GET_DATA (IFusionSoundMusicProvider_Timidity)
4180 - return DFB_INVARG;
4183 pthread_mutex_lock( &data->lock );
4185 @@ -603,38 +603,38 @@ IFusionSoundMusicProvider_Timidity_SeekTo( IFusionSoundMusicProvider *thiz,
4187 pthread_mutex_unlock( &data->lock );
4194 +static DirectResult
4195 IFusionSoundMusicProvider_Timidity_GetPos( IFusionSoundMusicProvider *thiz,
4198 DIRECT_INTERFACE_GET_DATA (IFusionSoundMusicProvider_Timidity)
4201 - return DFB_INVARG;
4204 *seconds = (double)data->song_pos / 1000.0;
4211 +static DirectResult
4212 IFusionSoundMusicProvider_Timidity_GetLength( IFusionSoundMusicProvider *thiz,
4215 DIRECT_INTERFACE_GET_DATA (IFusionSoundMusicProvider_Timidity)
4218 - return DFB_INVARG;
4221 *seconds = (double)data->song_length / 1000.0;
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)
4235 if (flags & ~FMPLAY_LOOPING)
4236 - return DFB_UNSUPPORTED;
4237 + return DR_UNSUPPORTED;
4239 data->flags = flags;
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 )
4253 if (!mask || mask & ~FMSTATE_ALL)
4254 - return DFB_INVARG;
4259 @@ -669,18 +669,18 @@ IFusionSoundMusicProvider_Timidity_WaitStatus( IFusionSoundMusicProvider *thiz,
4261 #ifdef HAVE_PTHREAD_MUTEX_TIMEDLOCK
4262 if (pthread_mutex_timedlock( &data->lock, &t ))
4263 - return DFB_TIMEOUT;
4264 + return DR_TIMEOUT;
4266 while (pthread_mutex_trylock( &data->lock )) {
4268 if (direct_clock_get_abs_micros() >= s)
4269 - return DFB_TIMEOUT;
4270 + return DR_TIMEOUT;
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;
4281 @@ -693,22 +693,22 @@ IFusionSoundMusicProvider_Timidity_WaitStatus( IFusionSoundMusicProvider *thiz,
4283 pthread_mutex_unlock( &data->lock );
4290 /* exported symbols */
4293 +static DirectResult
4294 Probe( IFusionSoundMusicProvider_ProbeContext *ctx )
4296 if (!memcmp( ctx->header, "MThd", 4 ))
4300 - return DFB_UNSUPPORTED;
4301 + return DR_UNSUPPORTED;
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 );
4318 @@ -751,5 +751,5 @@ Construct( IFusionSoundMusicProvider *thiz,
4319 thiz->SetPlaybackFlags = IFusionSoundMusicProvider_Timidity_SetPlaybackFlags;
4320 thiz->WaitStatus = IFusionSoundMusicProvider_Timidity_WaitStatus;
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
4330 # include <vorbis/vorbisfile.h>
4334 +static DirectResult
4335 Probe( IFusionSoundMusicProvider_ProbeContext *ctx );
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 )
4344 memset( dst+length, 0, total-length );
4346 - return (ret == DFB_EOF) ? 0 : -1;
4347 + return (ret == DR_EOF) ? 0 : -1;
4351 @@ -456,7 +456,7 @@ ov_seek_callback( void *ctx, ogg_int64_t offset, int whence )
4353 DirectStream *stream = ctx;
4354 unsigned int pos = 0;
4355 - DirectResult ret = DFB_UNSUPPORTED;
4356 + DirectResult ret = DR_UNSUPPORTED;
4358 if (!direct_stream_seekable( stream ) || direct_stream_remote( stream ))
4360 @@ -560,17 +560,17 @@ IFusionSoundMusicProvider_Vorbis_Destruct( IFusionSoundMusicProvider *thiz )
4361 DIRECT_DEALLOCATE_INTERFACE( thiz );
4365 +static DirectResult
4366 IFusionSoundMusicProvider_Vorbis_AddRef( IFusionSoundMusicProvider *thiz )
4368 DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_Vorbis )
4377 +static DirectResult
4378 IFusionSoundMusicProvider_Vorbis_Release( IFusionSoundMusicProvider *thiz )
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 );
4390 +static DirectResult
4391 IFusionSoundMusicProvider_Vorbis_GetCapabilities( IFusionSoundMusicProvider *thiz,
4392 FSMusicProviderCapabilities *caps )
4394 DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_Vorbis )
4397 - return DFB_INVARG;
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;
4411 @@ -685,28 +685,28 @@ vorbis_get_metadata( OggVorbis_File *vf,
4412 desc->replaygain_album = vorbis_compute_gain( album_gain, album_peak );
4416 +static DirectResult
4417 IFusionSoundMusicProvider_Vorbis_GetTrackDescription( IFusionSoundMusicProvider *thiz,
4418 FSTrackDescription *desc )
4420 DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_Vorbis )
4423 - return DFB_INVARG;
4426 vorbis_get_metadata( &data->vf, desc );
4433 +static DirectResult
4434 IFusionSoundMusicProvider_Vorbis_GetStreamDescription( IFusionSoundMusicProvider *thiz,
4435 FSStreamDescription *desc )
4437 DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_Vorbis )
4440 - return DFB_INVARG;
4443 desc->flags = FSSDF_SAMPLERATE | FSSDF_CHANNELS |
4444 FSSDF_SAMPLEFORMAT | FSSDF_BUFFERSIZE;
4445 @@ -719,17 +719,17 @@ IFusionSoundMusicProvider_Vorbis_GetStreamDescription( IFusionSoundMusicProvider
4447 desc->buffersize = desc->samplerate/8;
4454 +static DirectResult
4455 IFusionSoundMusicProvider_Vorbis_GetBufferDescription( IFusionSoundMusicProvider *thiz,
4456 FSBufferDescription *desc )
4458 DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_Vorbis )
4461 - return DFB_INVARG;
4464 desc->flags = FSBDF_SAMPLERATE | FSBDF_CHANNELS |
4465 FSBDF_SAMPLEFORMAT | FSBDF_LENGTH;
4466 @@ -742,7 +742,7 @@ IFusionSoundMusicProvider_Vorbis_GetBufferDescription( IFusionSoundMusicProvider
4468 desc->length = MIN(ov_pcm_total( &data->vf, -1 ), FS_MAX_FRAMES);
4475 @@ -818,7 +818,7 @@ VorbisStreamThread( DirectThread *thread, void *ctx )
4480 +static DirectResult
4481 IFusionSoundMusicProvider_Vorbis_PlayToStream( IFusionSoundMusicProvider *thiz,
4482 IFusionSoundStream *destination )
4484 @@ -827,21 +827,21 @@ IFusionSoundMusicProvider_Vorbis_PlayToStream( IFusionSoundMusicProvider *thiz,
4485 DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_Vorbis )
4488 - return DFB_INVARG;
4491 if (data->dest.stream == destination)
4495 destination->GetDescription( destination, &desc );
4497 /* check if destination samplerate is supported */
4499 if (desc.samplerate != data->info->rate)
4500 - return DFB_UNSUPPORTED;
4501 + return DR_UNSUPPORTED;
4503 if (desc.samplerate != data->info->rate &&
4504 desc.samplerate != data->info->rate/2)
4505 - return DFB_UNSUPPORTED;
4506 + return DR_UNSUPPORTED;
4509 /* check if destination format is supported */
4510 @@ -853,7 +853,7 @@ IFusionSoundMusicProvider_Vorbis_PlayToStream( IFusionSoundMusicProvider *thiz,
4514 - return DFB_UNSUPPORTED;
4515 + return DR_UNSUPPORTED;
4518 /* check if destination mode is supported */
4519 @@ -873,7 +873,7 @@ IFusionSoundMusicProvider_Vorbis_PlayToStream( IFusionSoundMusicProvider *thiz,
4520 case FSCM_SURROUND51:
4523 - return DFB_UNSUPPORTED;
4524 + return DR_UNSUPPORTED;
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;
4536 ov_halfrate( &data->vf, 0 );
4537 @@ -915,7 +915,7 @@ IFusionSoundMusicProvider_Vorbis_PlayToStream( IFusionSoundMusicProvider *thiz,
4539 pthread_mutex_unlock( &data->lock );
4546 @@ -947,7 +947,7 @@ VorbisBufferThread( DirectThread *thread, void *ctx )
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 )
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 )
4568 - return DFB_INVARG;
4571 if (data->dest.buffer == destination)
4575 destination->GetDescription( destination, &desc );
4577 /* check if destination samplerate is supported */
4579 if (desc.samplerate != data->info->rate)
4580 - return DFB_UNSUPPORTED;
4581 + return DR_UNSUPPORTED;
4583 if (desc.samplerate != data->info->rate &&
4584 desc.samplerate != data->info->rate/2)
4585 - return DFB_UNSUPPORTED;
4586 + return DR_UNSUPPORTED;
4589 /* check if destination format is supported */
4590 @@ -1042,7 +1042,7 @@ IFusionSoundMusicProvider_Vorbis_PlayToBuffer( IFusionSoundMusicProvider *thiz,
4594 - return DFB_UNSUPPORTED;
4595 + return DR_UNSUPPORTED;
4598 /* check if destination mode is supported */
4599 @@ -1062,7 +1062,7 @@ IFusionSoundMusicProvider_Vorbis_PlayToBuffer( IFusionSoundMusicProvider *thiz,
4600 case FSCM_SURROUND51:
4603 - return DFB_UNSUPPORTED;
4604 + return DR_UNSUPPORTED;
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;
4616 ov_halfrate( &data->vf, 0 );
4617 @@ -1108,10 +1108,10 @@ IFusionSoundMusicProvider_Vorbis_PlayToBuffer( IFusionSoundMusicProvider *thiz,
4619 pthread_mutex_unlock( &data->lock );
4626 +static DirectResult
4627 IFusionSoundMusicProvider_Vorbis_Stop( IFusionSoundMusicProvider *thiz )
4629 DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_Vorbis )
4630 @@ -1124,33 +1124,33 @@ IFusionSoundMusicProvider_Vorbis_Stop( IFusionSoundMusicProvider *thiz )
4632 pthread_mutex_unlock( &data->lock );
4639 +static DirectResult
4640 IFusionSoundMusicProvider_Vorbis_GetStatus( IFusionSoundMusicProvider *thiz,
4641 FSMusicProviderStatus *status )
4643 DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_Vorbis )
4646 - return DFB_INVARG;
4649 *status = data->status;
4656 +static DirectResult
4657 IFusionSoundMusicProvider_Vorbis_SeekTo( IFusionSoundMusicProvider *thiz,
4660 - DFBResult ret = DFB_OK;
4661 + DirectResult ret = DR_OK;
4663 DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_Vorbis )
4666 - return DFB_INVARG;
4669 pthread_mutex_lock( &data->lock );
4671 @@ -1158,7 +1158,7 @@ IFusionSoundMusicProvider_Vorbis_SeekTo( IFusionSoundMusicProvider *thiz,
4674 if (!data->info->bitrate_nominal)
4675 - return DFB_UNSUPPORTED;
4676 + return DR_UNSUPPORTED;
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,
4683 if (ov_time_seek( &data->vf, seconds ))
4684 - ret = DFB_FAILURE;
4688 - if (ret == DFB_OK) {
4689 + if (ret == DR_OK) {
4690 data->seeked = true;
4691 data->finished = false;
4693 @@ -1181,14 +1181,14 @@ IFusionSoundMusicProvider_Vorbis_SeekTo( IFusionSoundMusicProvider *thiz,
4698 +static DirectResult
4699 IFusionSoundMusicProvider_Vorbis_GetPos( IFusionSoundMusicProvider *thiz,
4702 DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_Vorbis )
4705 - return DFB_INVARG;
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 );
4719 +static DirectResult
4720 IFusionSoundMusicProvider_Vorbis_GetLength( IFusionSoundMusicProvider *thiz,
4723 @@ -1208,7 +1208,7 @@ IFusionSoundMusicProvider_Vorbis_GetLength( IFusionSoundMusicProvider *thiz,
4724 DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_Vorbis )
4727 - return DFB_INVARG;
4731 length = (double)ov_time_total( &data->vf, -1 ) / 1000.0;
4732 @@ -1224,27 +1224,27 @@ IFusionSoundMusicProvider_Vorbis_GetLength( IFusionSoundMusicProvider *thiz,
4741 +static DirectResult
4742 IFusionSoundMusicProvider_Vorbis_SetPlaybackFlags( IFusionSoundMusicProvider *thiz,
4743 FSMusicProviderPlaybackFlags flags )
4745 DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_Vorbis )
4747 if (flags & ~FMPLAY_LOOPING)
4748 - return DFB_UNSUPPORTED;
4749 + return DR_UNSUPPORTED;
4751 if (flags & FMPLAY_LOOPING && !direct_stream_seekable( data->stream ))
4752 - return DFB_UNSUPPORTED;
4753 + return DR_UNSUPPORTED;
4755 data->flags = flags;
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)
4769 if (!mask || mask & ~FMSTATE_ALL)
4770 - return DFB_INVARG;
4775 @@ -1264,18 +1264,18 @@ IFusionSoundMusicProvider_Vorbis_WaitStatus( IFusionSoundMusicProvider *thiz,
4777 #ifdef HAVE_PTHREAD_MUTEX_TIMEDLOCK
4778 if (pthread_mutex_timedlock( &data->lock, &t ))
4779 - return DFB_TIMEOUT;
4780 + return DR_TIMEOUT;
4782 while (pthread_mutex_trylock( &data->lock )) {
4784 if (direct_clock_get_abs_micros() >= s)
4785 - return DFB_TIMEOUT;
4786 + return DR_TIMEOUT;
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;
4797 @@ -1288,23 +1288,23 @@ IFusionSoundMusicProvider_Vorbis_WaitStatus( IFusionSoundMusicProvider *thiz,
4799 pthread_mutex_unlock( &data->lock );
4806 /* exported symbols */
4809 +static DirectResult
4810 Probe( IFusionSoundMusicProvider_ProbeContext *ctx )
4812 if (!memcmp( &ctx->header[0], "OggS", 4 ) &&
4813 !memcmp( &ctx->header[29], "vorbis", 6 ))
4817 - return DFB_UNSUPPORTED;
4818 + return DR_UNSUPPORTED;
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;
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;
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;
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
4857 #include <misc/sound_util.h>
4861 +static DirectResult
4862 Probe( IFusionSoundMusicProvider_ProbeContext *ctx );
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 );
4874 +static DirectResult
4875 IFusionSoundMusicProvider_Wave_AddRef( IFusionSoundMusicProvider *thiz )
4877 DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_Wave )
4886 +static DirectResult
4887 IFusionSoundMusicProvider_Wave_Release( IFusionSoundMusicProvider *thiz )
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 );
4899 +static DirectResult
4900 IFusionSoundMusicProvider_Wave_GetCapabilities( IFusionSoundMusicProvider *thiz,
4901 FSMusicProviderCapabilities *caps )
4903 DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_Wave )
4906 - return DFB_INVARG;
4909 if (direct_stream_seekable( data->stream ))
4910 *caps = FMCAPS_BASIC | FMCAPS_SEEK;
4912 *caps = FMCAPS_BASIC;
4919 +static DirectResult
4920 IFusionSoundMusicProvider_Wave_GetTrackDescription( IFusionSoundMusicProvider *thiz,
4921 FSTrackDescription *desc )
4923 DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_Wave )
4926 - return DFB_INVARG;
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);
4940 +static DirectResult
4941 IFusionSoundMusicProvider_Wave_GetStreamDescription( IFusionSoundMusicProvider *thiz,
4942 FSStreamDescription *desc )
4944 DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_Wave )
4947 - return DFB_INVARG;
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;
4961 +static DirectResult
4962 IFusionSoundMusicProvider_Wave_GetBufferDescription( IFusionSoundMusicProvider *thiz,
4963 FSBufferDescription *desc )
4965 DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_Wave )
4968 - return DFB_INVARG;
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;
4982 @@ -472,7 +472,7 @@ WaveStreamThread( DirectThread *thread, void *ctx )
4983 void *src = data->src_buffer;
4985 while (data->status == FMSTATE_PLAY) {
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 )
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;
5000 @@ -513,7 +513,7 @@ WaveStreamThread( DirectThread *thread, void *ctx )
5004 - if (ret == DFB_EOF) {
5005 + if (ret == DR_EOF) {
5006 if (data->flags & FMPLAY_LOOPING) {
5007 direct_stream_seek( data->stream, data->headsize );
5009 @@ -556,7 +556,7 @@ WaveStreamThread( DirectThread *thread, void *ctx )
5014 +static DirectResult
5015 IFusionSoundMusicProvider_Wave_PlayToStream( IFusionSoundMusicProvider *thiz,
5016 IFusionSoundStream *destination )
5018 @@ -566,16 +566,16 @@ IFusionSoundMusicProvider_Wave_PlayToStream( IFusionSoundMusicProvider *thiz,
5019 DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_Wave )
5022 - return DFB_INVARG;
5025 if (data->dest.stream == destination)
5029 destination->GetDescription( destination, &desc );
5031 /* check if destination samplerate is supported */
5032 if (desc.samplerate != data->samplerate)
5033 - return DFB_UNSUPPORTED;
5034 + return DR_UNSUPPORTED;
5036 /* check if destination format is supported */
5037 switch (desc.sampleformat) {
5038 @@ -586,7 +586,7 @@ IFusionSoundMusicProvider_Wave_PlayToStream( IFusionSoundMusicProvider *thiz,
5042 - return DFB_UNSUPPORTED;
5043 + return DR_UNSUPPORTED;
5046 /* check if destination mode is supported */
5047 @@ -606,7 +606,7 @@ IFusionSoundMusicProvider_Wave_PlayToStream( IFusionSoundMusicProvider *thiz,
5048 case FSCM_SURROUND51:
5051 - return DFB_UNSUPPORTED;
5052 + return DR_UNSUPPORTED;
5055 pthread_mutex_lock( &data->lock );
5056 @@ -646,7 +646,7 @@ IFusionSoundMusicProvider_Wave_PlayToStream( IFusionSoundMusicProvider *thiz,
5058 pthread_mutex_unlock( &data->lock );
5065 @@ -659,7 +659,7 @@ WaveBufferThread( DirectThread *thread, void *ctx )
5066 size_t count = data->dest.length * data->framesize;
5068 while (data->status == FMSTATE_PLAY) {
5073 unsigned int len = 0;
5074 @@ -673,7 +673,7 @@ WaveBufferThread( DirectThread *thread, void *ctx )
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 )
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 );
5091 if (!data->src_buffer)
5092 buffer->Unlock( buffer );
5095 - if (ret == DFB_EOF) {
5096 + if (ret == DR_EOF) {
5097 if (data->flags & FMPLAY_LOOPING) {
5098 direct_stream_seek( data->stream, data->headsize );
5100 @@ -714,7 +714,7 @@ WaveBufferThread( DirectThread *thread, void *ctx )
5102 if (data->src_buffer) {
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!" );
5109 @@ -753,7 +753,7 @@ WaveBufferThread( DirectThread *thread, void *ctx )
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 )
5122 - return DFB_INVARG;
5125 if (data->dest.buffer == destination)
5129 destination->GetDescription( destination, &desc );
5131 /* check if destination samplerate is supported */
5132 if (desc.samplerate != data->samplerate)
5133 - return DFB_UNSUPPORTED;
5134 + return DR_UNSUPPORTED;
5136 /* check if destination format is supported */
5137 switch (desc.sampleformat) {
5138 @@ -784,7 +784,7 @@ IFusionSoundMusicProvider_Wave_PlayToBuffer( IFusionSoundMusicProvider *thiz,
5142 - return DFB_UNSUPPORTED;
5143 + return DR_UNSUPPORTED;
5146 /* check if destination mode is supported */
5147 @@ -804,7 +804,7 @@ IFusionSoundMusicProvider_Wave_PlayToBuffer( IFusionSoundMusicProvider *thiz,
5148 case FSCM_SURROUND51:
5151 - return DFB_UNSUPPORTED;
5152 + return DR_UNSUPPORTED;
5155 pthread_mutex_lock( &data->lock );
5156 @@ -846,10 +846,10 @@ IFusionSoundMusicProvider_Wave_PlayToBuffer( IFusionSoundMusicProvider *thiz,
5158 pthread_mutex_unlock( &data->lock );
5165 +static DirectResult
5166 IFusionSoundMusicProvider_Wave_Stop( IFusionSoundMusicProvider *thiz )
5168 DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_Wave )
5169 @@ -862,44 +862,44 @@ IFusionSoundMusicProvider_Wave_Stop( IFusionSoundMusicProvider *thiz )
5171 pthread_mutex_unlock( &data->lock );
5178 +static DirectResult
5179 IFusionSoundMusicProvider_Wave_GetStatus( IFusionSoundMusicProvider *thiz,
5180 FSMusicProviderStatus *status )
5182 DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_Wave )
5185 - return DFB_INVARG;
5188 *status = data->status;
5195 +static DirectResult
5196 IFusionSoundMusicProvider_Wave_SeekTo( IFusionSoundMusicProvider *thiz,
5203 DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_Wave )
5206 - return DFB_INVARG;
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;
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;
5223 @@ -908,53 +908,53 @@ IFusionSoundMusicProvider_Wave_SeekTo( IFusionSoundMusicProvider *thiz,
5228 +static DirectResult
5229 IFusionSoundMusicProvider_Wave_GetPos( IFusionSoundMusicProvider *thiz,
5232 DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_Wave )
5235 - return DFB_INVARG;
5238 *seconds = (double) direct_stream_offset( data->stream ) /
5239 (double)(data->samplerate * data->framesize);
5246 +static DirectResult
5247 IFusionSoundMusicProvider_Wave_GetLength( IFusionSoundMusicProvider *thiz,
5250 DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_Wave )
5253 - return DFB_INVARG;
5256 *seconds = data->length;
5263 +static DirectResult
5264 IFusionSoundMusicProvider_Wave_SetPlaybackFlags( IFusionSoundMusicProvider *thiz,
5265 FSMusicProviderPlaybackFlags flags )
5267 DIRECT_INTERFACE_GET_DATA( IFusionSoundMusicProvider_Wave )
5269 if (flags & ~FMPLAY_LOOPING)
5270 - return DFB_UNSUPPORTED;
5271 + return DR_UNSUPPORTED;
5273 if (flags & FMPLAY_LOOPING && !direct_stream_seekable( data->stream ))
5274 - return DFB_UNSUPPORTED;
5275 + return DR_UNSUPPORTED;
5277 data->flags = flags;
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 )
5291 if (!mask || mask & ~FMSTATE_ALL)
5292 - return DFB_INVARG;
5297 @@ -974,18 +974,18 @@ IFusionSoundMusicProvider_Wave_WaitStatus( IFusionSoundMusicProvider *thiz,
5299 #ifdef HAVE_PTHREAD_MUTEX_TIMEDLOCK
5300 if (pthread_mutex_timedlock( &data->lock, &t ))
5301 - return DFB_TIMEOUT;
5302 + return DR_TIMEOUT;
5304 while (pthread_mutex_trylock( &data->lock )) {
5306 if (direct_clock_get_abs_micros() >= s)
5307 - return DFB_TIMEOUT;
5308 + return DR_TIMEOUT;
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;
5319 @@ -998,12 +998,12 @@ IFusionSoundMusicProvider_Wave_WaitStatus( IFusionSoundMusicProvider *thiz,
5321 pthread_mutex_unlock( &data->lock );
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;\
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
5414 if (fmt_len > sizeof(fmt)) {
5415 @@ -1139,27 +1139,27 @@ parse_headers( DirectStream *stream, u32 *ret_samplerate,
5423 /* exported symbols */
5426 +static DirectResult
5427 Probe( IFusionSoundMusicProvider_ProbeContext *ctx )
5429 if (!memcmp( ctx->header+0, "RIFF", 4 ) &&
5430 !memcmp( ctx->header+8, "WAVEfmt ", 8 ))
5434 - return DFB_UNSUPPORTED;
5435 + return DR_UNSUPPORTED;
5439 +static DirectResult
5440 Construct( IFusionSoundMusicProvider *thiz,
5441 const char *filename,
5442 DirectStream *stream )
5449 @@ -1193,7 +1193,7 @@ Construct( IFusionSoundMusicProvider *thiz,
5451 D_BUG( "unexpected sample format" );
5452 IFusionSoundMusicProvider_Wave_Destruct( thiz );
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;
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
5472 #include "ifusionsound_dispatcher.h"
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 );
5481 @@ -80,17 +80,17 @@ IFusionSound_Dispatcher_Destruct( IFusionSound *thiz )
5483 /***********************************************************************************************/
5486 +static DirectResult
5487 IFusionSound_Dispatcher_AddRef( IFusionSound *thiz )
5489 DIRECT_INTERFACE_GET_DATA(IFusionSound_Dispatcher)
5498 +static DirectResult
5499 IFusionSound_Dispatcher_Release( IFusionSound *thiz )
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 );
5511 +static DirectResult
5512 IFusionSound_Dispatcher_GetDeviceDescription( IFusionSound *thiz,
5513 FSDeviceDescription *desc )
5515 DIRECT_INTERFACE_GET_DATA(IFusionSound_Dispatcher)
5517 - return DFB_UNIMPLEMENTED;
5518 + return DR_UNIMPLEMENTED;
5522 +static DirectResult
5523 IFusionSound_Dispatcher_CreateBuffer( IFusionSound *thiz,
5524 const FSBufferDescription *desc,
5525 IFusionSoundBuffer **ret_interface )
5527 DIRECT_INTERFACE_GET_DATA(IFusionSound_Dispatcher)
5529 - return DFB_UNIMPLEMENTED;
5530 + return DR_UNIMPLEMENTED;
5534 +static DirectResult
5535 IFusionSound_Dispatcher_CreateStream( IFusionSound *thiz,
5536 const FSStreamDescription *desc,
5537 IFusionSoundStream **ret_interface )
5539 DIRECT_INTERFACE_GET_DATA(IFusionSound_Dispatcher)
5541 - return DFB_UNIMPLEMENTED;
5542 + return DR_UNIMPLEMENTED;
5546 +static DirectResult
5547 IFusionSound_Dispatcher_CreateMusicProvider( IFusionSound *thiz,
5548 const char *filename,
5549 IFusionSoundMusicProvider **ret_interface )
5551 DIRECT_INTERFACE_GET_DATA(IFusionSound_Dispatcher)
5553 - return DFB_UNIMPLEMENTED;
5554 + return DR_UNIMPLEMENTED;
5558 +static DirectResult
5559 IFusionSound_Dispatcher_GetMasterVolume( IFusionSound *thiz,
5562 DIRECT_INTERFACE_GET_DATA(IFusionSound_Dispatcher)
5564 - return DFB_UNIMPLEMENTED;
5565 + return DR_UNIMPLEMENTED;
5569 +static DirectResult
5570 IFusionSound_Dispatcher_SetMasterVolume( IFusionSound *thiz,
5573 DIRECT_INTERFACE_GET_DATA(IFusionSound_Dispatcher)
5575 - return DFB_UNIMPLEMENTED;
5576 + return DR_UNIMPLEMENTED;
5580 +static DirectResult
5581 IFusionSound_Dispatcher_GetLocalVolume( IFusionSound *thiz,
5584 DIRECT_INTERFACE_GET_DATA(IFusionSound_Dispatcher)
5586 - return DFB_UNIMPLEMENTED;
5587 + return DR_UNIMPLEMENTED;
5591 +static DirectResult
5592 IFusionSound_Dispatcher_SetLocalVolume( IFusionSound *thiz,
5595 DIRECT_INTERFACE_GET_DATA(IFusionSound_Dispatcher)
5597 - return DFB_UNIMPLEMENTED;
5598 + return DR_UNIMPLEMENTED;
5602 +static DirectResult
5603 IFusionSound_Dispatcher_Suspend( IFusionSound *thiz )
5605 DIRECT_INTERFACE_GET_DATA(IFusionSound_Dispatcher)
5607 - return DFB_UNIMPLEMENTED;
5608 + return DR_UNIMPLEMENTED;
5612 +static DirectResult
5613 IFusionSound_Dispatcher_Resume( IFusionSound *thiz )
5615 DIRECT_INTERFACE_GET_DATA(IFusionSound_Dispatcher)
5617 - return DFB_UNIMPLEMENTED;
5618 + return DR_UNIMPLEMENTED;
5621 /**************************************************************************************************/
5622 @@ -208,7 +208,7 @@ Dispatch_GetDeviceDescription( IFusionSound *thiz, IFusionSound *real,
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,
5631 @@ -244,7 +244,7 @@ Dispatch_CreateBuffer( IFusionSound *thiz, IFusionSound *real,
5634 return voodoo_manager_respond( manager, msg->header.serial,
5637 VMBT_DATA, sizeof(FSBufferDescription), &dsc,
5640 @@ -280,7 +280,7 @@ Dispatch_CreateStream( IFusionSound *thiz, IFusionSound *real,
5643 return voodoo_manager_respond( manager, msg->header.serial,
5646 VMBT_DATA, sizeof(FSStreamDescription), &dsc,
5649 @@ -313,7 +313,7 @@ Dispatch_CreateMusicProvider( IFusionSound *thiz, IFusionSound *real,
5652 return voodoo_manager_respond( manager, msg->header.serial,
5658 @@ -452,18 +452,18 @@ Dispatch( void *dispatcher, void *real, VoodooManager *manager, VoodooRequestMes
5659 HANDLE_CASE(Resume);
5662 - return DFB_NOSUCHMETHOD;
5663 + return DR_NOSUCHMETHOD;
5668 /**************************************************************************************************/
5671 +static DirectResult
5674 /* This implementation has to be loaded explicitly. */
5675 - return DFB_UNSUPPORTED;
5676 + return DR_UNSUPPORTED;
5680 @@ -471,10 +471,10 @@ Probe()
5682 * Fills in function pointers and intializes data structure.
5685 +static DirectResult
5686 Construct( IFusionSound *thiz, VoodooManager *manager, VoodooInstanceID *ret_instance )
5691 VoodooInstanceID instance;
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;
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
5707 #include <ifusionsoundbuffer_dispatcher.h>
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 )
5718 /***********************************************************************************************/
5721 +static DirectResult
5722 IFusionSoundBuffer_Dispatcher_AddRef( IFusionSoundBuffer *thiz )
5724 DIRECT_INTERFACE_GET_DATA(IFusionSoundBuffer_Dispatcher)
5733 +static DirectResult
5734 IFusionSoundBuffer_Dispatcher_Release( IFusionSoundBuffer *thiz )
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 );
5747 +static DirectResult
5748 IFusionSoundBuffer_Dispatcher_GetDescription( IFusionSoundBuffer *thiz,
5749 FSBufferDescription *desc )
5751 DIRECT_INTERFACE_GET_DATA(IFusionSoundBuffer_Dispatcher)
5753 - return DFB_UNIMPLEMENTED;
5754 + return DR_UNIMPLEMENTED;
5758 +static DirectResult
5759 IFusionSoundBuffer_Dispatcher_SetPosition( IFusionSoundBuffer *thiz,
5762 DIRECT_INTERFACE_GET_DATA(IFusionSoundBuffer_Dispatcher)
5764 - return DFB_UNIMPLEMENTED;
5765 + return DR_UNIMPLEMENTED;
5769 +static DirectResult
5770 IFusionSoundBuffer_Dispatcher_Lock( IFusionSoundBuffer *thiz,
5773 @@ -134,41 +134,41 @@ IFusionSoundBuffer_Dispatcher_Lock( IFusionSoundBuffer *thiz,
5775 DIRECT_INTERFACE_GET_DATA(IFusionSoundBuffer_Dispatcher)
5777 - return DFB_UNIMPLEMENTED;
5778 + return DR_UNIMPLEMENTED;
5782 +static DirectResult
5783 IFusionSoundBuffer_Dispatcher_Unlock( IFusionSoundBuffer *thiz )
5785 DIRECT_INTERFACE_GET_DATA(IFusionSoundBuffer_Dispatcher)
5787 - return DFB_UNIMPLEMENTED;
5788 + return DR_UNIMPLEMENTED;
5792 +static DirectResult
5793 IFusionSoundBuffer_Dispatcher_Play( IFusionSoundBuffer *thiz,
5794 FSBufferPlayFlags flags )
5796 DIRECT_INTERFACE_GET_DATA(IFusionSoundBuffer_Dispatcher)
5798 - return DFB_UNIMPLEMENTED;
5799 + return DR_UNIMPLEMENTED;
5803 +static DirectResult
5804 IFusionSoundBuffer_Dispatcher_Stop( IFusionSoundBuffer *thiz )
5806 DIRECT_INTERFACE_GET_DATA(IFusionSoundBuffer_Dispatcher)
5808 - return DFB_UNIMPLEMENTED;
5809 + return DR_UNIMPLEMENTED;
5813 +static DirectResult
5814 IFusionSoundBuffer_Dispatcher_CreatePlayback( IFusionSoundBuffer *thiz,
5815 IFusionSoundPlayback **ret_interface )
5817 DIRECT_INTERFACE_GET_DATA(IFusionSoundBuffer_Dispatcher)
5819 - return DFB_UNIMPLEMENTED;
5820 + return DR_UNIMPLEMENTED;
5823 /***********************************************************************************************/
5824 @@ -187,7 +187,7 @@ Dispatch_GetDescription( IFusionSoundBuffer *thiz, IFusionSoundBuffer *real,
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,
5833 @@ -220,7 +220,7 @@ Dispatch_Lock( IFusionSoundBuffer *thiz, IFusionSoundBuffer *real,
5834 DIRECT_INTERFACE_GET_DATA(IFusionSoundBuffer_Dispatcher)
5836 /* Nothing to do. */
5842 @@ -251,7 +251,7 @@ Dispatch_Unlock( IFusionSoundBuffer *thiz, IFusionSoundBuffer *real,
5843 real->Unlock( real );
5845 return voodoo_manager_respond( manager, msg->header.serial,
5846 - DFB_OK, VOODOO_INSTANCE_NONE,
5847 + DR_OK, VOODOO_INSTANCE_NONE,
5851 @@ -283,7 +283,7 @@ Dispatch_Unlock_DPACK( IFusionSoundBuffer *thiz, IFusionSoundBuffer *real,
5852 real->Unlock( real );
5854 return voodoo_manager_respond( manager, msg->header.serial,
5855 - DFB_OK, VOODOO_INSTANCE_NONE,
5856 + DR_OK, VOODOO_INSTANCE_NONE,
5860 @@ -345,7 +345,7 @@ Dispatch_CreatePlayback( IFusionSoundBuffer *thiz, IFusionSoundBuffer *real,
5863 return voodoo_manager_respond( manager, msg->header.serial,
5869 @@ -374,18 +374,18 @@ Dispatch( void *dispatcher, void *real, VoodooManager *manager, VoodooRequestMes
5870 HANDLE_CASE(CreatePlayback);
5873 - return DFB_NOSUCHMETHOD;
5874 + return DR_NOSUCHMETHOD;
5879 /**************************************************************************************************/
5882 +static DirectResult
5885 /* This implementation has to be loaded explicitly. */
5886 - return DFB_UNSUPPORTED;
5887 + return DR_UNSUPPORTED;
5891 @@ -393,7 +393,7 @@ Probe()
5893 * Fills in function pointers and intializes data structure.
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 )
5906 VoodooInstanceID instance;
5907 FSBufferDescription dsc;
5909 @@ -434,7 +434,7 @@ Construct( IFusionSoundBuffer *thiz,
5910 thiz->Stop = IFusionSoundBuffer_Dispatcher_Stop;
5911 thiz->CreatePlayback = IFusionSoundBuffer_Dispatcher_CreatePlayback;
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
5924 #include <ifusionsoundplayback_dispatcher.h>
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 )
5935 /***********************************************************************************************/
5938 +static DirectResult
5939 IFusionSoundPlayback_Dispatcher_AddRef( IFusionSoundPlayback *thiz )
5941 DIRECT_INTERFACE_GET_DATA(IFusionSoundPlayback_Dispatcher)
5950 +static DirectResult
5951 IFusionSoundPlayback_Dispatcher_Release( IFusionSoundPlayback *thiz )
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 );
5963 +static DirectResult
5964 IFusionSoundPlayback_Dispatcher_Start( IFusionSoundPlayback *thiz,
5968 DIRECT_INTERFACE_GET_DATA(IFusionSoundPlayback_Dispatcher)
5970 - return DFB_UNIMPLEMENTED;
5971 + return DR_UNIMPLEMENTED;
5975 +static DirectResult
5976 IFusionSoundPlayback_Dispatcher_Stop( IFusionSoundPlayback *thiz )
5978 DIRECT_INTERFACE_GET_DATA(IFusionSoundPlayback_Dispatcher)
5980 - return DFB_UNIMPLEMENTED;
5981 + return DR_UNIMPLEMENTED;
5985 +static DirectResult
5986 IFusionSoundPlayback_Dispatcher_Continue( IFusionSoundPlayback *thiz )
5988 DIRECT_INTERFACE_GET_DATA(IFusionSoundPlayback_Dispatcher)
5990 - return DFB_UNIMPLEMENTED;
5991 + return DR_UNIMPLEMENTED;
5995 +static DirectResult
5996 IFusionSoundPlayback_Dispatcher_Wait( IFusionSoundPlayback *thiz )
5998 DIRECT_INTERFACE_GET_DATA(IFusionSoundPlayback_Dispatcher)
6000 - return DFB_UNIMPLEMENTED;
6001 + return DR_UNIMPLEMENTED;
6005 +static DirectResult
6006 IFusionSoundPlayback_Dispatcher_GetStatus( IFusionSoundPlayback *thiz,
6007 - DFBBoolean *ret_playing,
6008 + bool *ret_playing,
6011 DIRECT_INTERFACE_GET_DATA(IFusionSoundPlayback_Dispatcher)
6013 - return DFB_UNIMPLEMENTED;
6014 + return DR_UNIMPLEMENTED;
6018 +static DirectResult
6019 IFusionSoundPlayback_Dispatcher_SetVolume( IFusionSoundPlayback *thiz,
6022 DIRECT_INTERFACE_GET_DATA(IFusionSoundPlayback_Dispatcher)
6024 - return DFB_UNIMPLEMENTED;
6025 + return DR_UNIMPLEMENTED;
6029 +static DirectResult
6030 IFusionSoundPlayback_Dispatcher_SetPan( IFusionSoundPlayback *thiz,
6033 DIRECT_INTERFACE_GET_DATA(IFusionSoundPlayback_Dispatcher)
6035 - return DFB_UNIMPLEMENTED;
6036 + return DR_UNIMPLEMENTED;
6040 +static DirectResult
6041 IFusionSoundPlayback_Dispatcher_SetPitch( IFusionSoundPlayback *thiz,
6044 DIRECT_INTERFACE_GET_DATA(IFusionSoundPlayback_Dispatcher)
6046 - return DFB_UNIMPLEMENTED;
6047 + return DR_UNIMPLEMENTED;
6051 +static DirectResult
6052 IFusionSoundPlayback_Dispatcher_SetDirection( IFusionSoundPlayback *thiz,
6053 FSPlaybackDirection direction )
6055 DIRECT_INTERFACE_GET_DATA(IFusionSoundPlayback_Dispatcher)
6057 - return DFB_UNIMPLEMENTED;
6058 + return DR_UNIMPLEMENTED;
6062 +static DirectResult
6063 IFusionSoundPlayback_Dispatcher_SetDownmixLevels( IFusionSoundPlayback *thiz,
6067 DIRECT_INTERFACE_GET_DATA(IFusionSoundPlayback_Dispatcher)
6069 - return DFB_UNIMPLEMENTED;
6070 + return DR_UNIMPLEMENTED;
6073 /**************************************************************************************************/
6074 @@ -266,7 +266,7 @@ Dispatch_GetStatus( IFusionSoundPlayback *thiz, IFusionSoundPlayback *real,
6075 VoodooManager *manager, VoodooRequestMessage *msg )
6078 - DFBBoolean playing;
6082 DIRECT_INTERFACE_GET_DATA(IFusionSoundPlayback_Dispatcher)
6083 @@ -276,7 +276,7 @@ Dispatch_GetStatus( IFusionSoundPlayback *thiz, IFusionSoundPlayback *real,
6086 return voodoo_manager_respond( manager, msg->header.serial,
6087 - DFB_OK, VOODOO_INSTANCE_NONE,
6088 + DR_OK, VOODOO_INSTANCE_NONE,
6092 @@ -418,18 +418,18 @@ Dispatch( void *dispatcher, void *real, VoodooManager *manager, VoodooRequestMes
6093 HANDLE_CASE(SetDownmixLevels);
6096 - return DFB_NOSUCHMETHOD;
6097 + return DR_NOSUCHMETHOD;
6102 /**************************************************************************************************/
6105 +static DirectResult
6108 /* This implementation has to be loaded explicitly. */
6109 - return DFB_UNSUPPORTED;
6110 + return DR_UNSUPPORTED;
6114 @@ -437,7 +437,7 @@ Probe()
6116 * Fills in function pointers and intializes data structure.
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 )
6129 VoodooInstanceID instance;
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;
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
6146 #include <ifusionsoundstream_dispatcher.h>
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 )
6157 /***********************************************************************************************/
6160 +static DirectResult
6161 IFusionSoundStream_Dispatcher_AddRef( IFusionSoundStream *thiz )
6163 DIRECT_INTERFACE_GET_DATA(IFusionSoundStream_Dispatcher)
6172 +static DirectResult
6173 IFusionSoundStream_Dispatcher_Release( IFusionSoundStream *thiz )
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 );
6185 +static DirectResult
6186 IFusionSoundStream_Dispatcher_GetDescription( IFusionSoundStream *thiz,
6187 FSStreamDescription *desc )
6189 DIRECT_INTERFACE_GET_DATA(IFusionSoundStream_Dispatcher)
6191 - return DFB_UNIMPLEMENTED;
6192 + return DR_UNIMPLEMENTED;
6196 +static DirectResult
6197 IFusionSoundStream_Dispatcher_Write( IFusionSoundStream *thiz,
6198 const void *sample_data,
6201 DIRECT_INTERFACE_GET_DATA(IFusionSoundStream_Dispatcher)
6203 - return DFB_UNIMPLEMENTED;
6204 + return DR_UNIMPLEMENTED;
6208 +static DirectResult
6209 IFusionSoundStream_Dispatcher_Wait( IFusionSoundStream *thiz,
6212 DIRECT_INTERFACE_GET_DATA(IFusionSoundStream_Dispatcher)
6214 - return DFB_UNIMPLEMENTED;
6215 + return DR_UNIMPLEMENTED;
6219 +static DirectResult
6220 IFusionSoundStream_Dispatcher_GetStatus( IFusionSoundStream *thiz,
6224 int *write_position,
6225 - DFBBoolean *playing )
6228 DIRECT_INTERFACE_GET_DATA(IFusionSoundStream_Dispatcher)
6230 - return DFB_UNIMPLEMENTED;
6231 + return DR_UNIMPLEMENTED;
6235 +static DirectResult
6236 IFusionSoundStream_Dispatcher_Flush( IFusionSoundStream *thiz )
6238 DIRECT_INTERFACE_GET_DATA(IFusionSoundStream_Dispatcher)
6240 - return DFB_UNIMPLEMENTED;
6241 + return DR_UNIMPLEMENTED;
6245 +static DirectResult
6246 IFusionSoundStream_Dispatcher_Drop( IFusionSoundStream *thiz )
6248 DIRECT_INTERFACE_GET_DATA(IFusionSoundStream_Dispatcher)
6250 - return DFB_UNIMPLEMENTED;
6251 + return DR_UNIMPLEMENTED;
6255 +static DirectResult
6256 IFusionSoundStream_Dispatcher_GetPresentationDelay( IFusionSoundStream *thiz,
6259 DIRECT_INTERFACE_GET_DATA(IFusionSoundStream_Dispatcher)
6261 - return DFB_UNIMPLEMENTED;
6262 + return DR_UNIMPLEMENTED;
6266 +static DirectResult
6267 IFusionSoundStream_Dispatcher_GetPlayback( IFusionSoundStream *thiz,
6268 IFusionSoundPlayback **ret_interface )
6270 DIRECT_INTERFACE_GET_DATA(IFusionSoundStream_Dispatcher)
6272 - return DFB_UNIMPLEMENTED;
6273 + return DR_UNIMPLEMENTED;
6277 +static DirectResult
6278 IFusionSoundStream_Dispatcher_Access( IFusionSoundStream *thiz,
6282 DIRECT_INTERFACE_GET_DATA(IFusionSoundStream_Dispatcher)
6284 - return DFB_UNIMPLEMENTED;
6285 + return DR_UNIMPLEMENTED;
6289 +static DirectResult
6290 IFusionSoundStream_Dispatcher_Commit( IFusionSoundStream *thiz,
6293 DIRECT_INTERFACE_GET_DATA(IFusionSoundStream_Dispatcher)
6295 - return DFB_UNIMPLEMENTED;
6296 + return DR_UNIMPLEMENTED;
6299 /**************************************************************************************************/
6300 @@ -217,7 +217,7 @@ Dispatch_GetDescription( IFusionSoundStream *thiz, IFusionSoundStream *real,
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,
6309 @@ -303,7 +303,7 @@ Dispatch_GetStatus( IFusionSoundStream *thiz, IFusionSoundStream *real,
6313 - DFBBoolean playing;
6316 DIRECT_INTERFACE_GET_DATA(IFusionSoundStream_Dispatcher)
6318 @@ -388,7 +388,7 @@ Dispatch_GetPlayback( IFusionSoundStream *thiz, IFusionSoundStream *real,
6321 return voodoo_manager_respond( manager, msg->header.serial,
6327 @@ -398,7 +398,7 @@ Dispatch_Access( IFusionSoundStream *thiz, IFusionSoundStream *real,
6331 - return DFB_UNIMPLEMENTED;
6332 + return DR_UNIMPLEMENTED;
6336 @@ -407,7 +407,7 @@ Dispatch_Commit( IFusionSoundStream *thiz, IFusionSoundStream *real,
6340 - return DFB_UNIMPLEMENTED;
6341 + return DR_UNIMPLEMENTED;
6344 #define HANDLE_CASE(name) \
6345 @@ -441,18 +441,18 @@ Dispatch( void *dispatcher, void *real, VoodooManager *manager, VoodooRequestMes
6346 HANDLE_CASE(Commit);
6349 - return DFB_NOSUCHMETHOD;
6350 + return DR_NOSUCHMETHOD;
6355 /**************************************************************************************************/
6358 +static DirectResult
6361 /* This implementation has to be loaded explicitly. */
6362 - return DFB_UNSUPPORTED;
6363 + return DR_UNSUPPORTED;
6367 @@ -460,7 +460,7 @@ Probe()
6369 * Fills in function pointers and intializes data structure.
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 )
6382 VoodooInstanceID instance;
6383 FSStreamDescription dsc;
6385 @@ -504,6 +504,6 @@ Construct( IFusionSoundStream *thiz,
6386 thiz->Access = IFusionSoundStream_Dispatcher_Access;
6387 thiz->Commit = IFusionSoundStream_Dispatcher_Commit;
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
6399 #include <ifusionsound_dispatcher.h>
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 );
6406 #include <direct/interface_implementation.h>
6408 @@ -82,17 +82,17 @@ IFusionSound_Requestor_Destruct( IFusionSound *thiz )
6410 /**************************************************************************************************/
6413 +static DirectResult
6414 IFusionSound_Requestor_AddRef( IFusionSound *thiz )
6416 DIRECT_INTERFACE_GET_DATA(IFusionSound_Requestor)
6425 +static DirectResult
6426 IFusionSound_Requestor_Release( IFusionSound *thiz )
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 );
6438 +static DirectResult
6439 IFusionSound_Requestor_GetDeviceDescription( IFusionSound *thiz,
6440 FSDeviceDescription *desc )
6442 @@ -120,7 +120,7 @@ IFusionSound_Requestor_GetDeviceDescription( IFusionSound *thiz,
6445 ret = response->result;
6446 - if (ret == DFB_OK) {
6447 + if (ret == DR_OK) {
6448 VoodooMessageParser parser;
6450 VOODOO_PARSER_BEGIN( parser, response );
6451 @@ -133,7 +133,7 @@ IFusionSound_Requestor_GetDeviceDescription( IFusionSound *thiz,
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)
6463 if (!desc || !ret_interface)
6464 - return DFB_INVARG;
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,
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,
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)
6491 - return DFB_INVARG;
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,
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,
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)
6517 if (!filename || !ret_interface)
6518 - return DFB_INVARG;
6521 ret = voodoo_manager_request( data->manager, data->instance,
6522 IFUSIONSOUND_METHOD_ID_CreateMusicProvider,
6523 @@ -237,7 +237,7 @@ IFusionSound_Requestor_CreateMusicProvider( IFusionSound *thiz,
6526 ret = response->result;
6527 - if (ret == DFB_OK)
6529 ret = voodoo_construct_requestor( data->manager, "IFusionSoundMusicProvider",
6530 response->instance, NULL, &interface );
6532 @@ -251,13 +251,13 @@ IFusionSound_Requestor_CreateMusicProvider( IFusionSound *thiz,
6534 /* Check arguments */
6535 if (!filename || !ret_interface)
6536 - return DFB_INVARG;
6539 return IFusionSoundMusicProvider_Create( filename, ret_interface );
6544 +static DirectResult
6545 IFusionSound_Requestor_GetMasterVolume( IFusionSound *thiz,
6548 @@ -268,7 +268,7 @@ IFusionSound_Requestor_GetMasterVolume( IFusionSound *thiz,
6549 DIRECT_INTERFACE_GET_DATA(IFusionSound_Requestor)
6552 - return DFB_INVARG;
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,
6562 +static DirectResult
6563 IFusionSound_Requestor_SetMasterVolume( IFusionSound *thiz,
6566 @@ -314,7 +314,7 @@ IFusionSound_Requestor_SetMasterVolume( IFusionSound *thiz,
6571 +static DirectResult
6572 IFusionSound_Requestor_GetLocalVolume( IFusionSound *thiz,
6575 @@ -325,7 +325,7 @@ IFusionSound_Requestor_GetLocalVolume( IFusionSound *thiz,
6576 DIRECT_INTERFACE_GET_DATA(IFusionSound_Requestor)
6579 - return DFB_INVARG;
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,
6589 +static DirectResult
6590 IFusionSound_Requestor_SetLocalVolume( IFusionSound *thiz,
6593 @@ -371,7 +371,7 @@ IFusionSound_Requestor_SetLocalVolume( IFusionSound *thiz,
6598 +static DirectResult
6599 IFusionSound_Requestor_Suspend( IFusionSound *thiz )
6602 @@ -392,7 +392,7 @@ IFusionSound_Requestor_Suspend( IFusionSound *thiz )
6607 +static DirectResult
6608 IFusionSound_Requestor_Resume( IFusionSound *thiz )
6611 @@ -415,11 +415,11 @@ IFusionSound_Requestor_Resume( IFusionSound *thiz )
6613 /**************************************************************************************************/
6616 +static DirectResult
6619 /* This implementation has to be loaded explicitly. */
6620 - return DFB_UNSUPPORTED;
6621 + return DR_UNSUPPORTED;
6625 @@ -427,10 +427,10 @@ Probe()
6627 * Fills in function pointers and intializes data structure.
6630 +static DirectResult
6631 Construct( IFusionSound *thiz, const char *host, int session )
6636 DIRECT_ALLOCATE_INTERFACE_DATA(thiz, IFusionSound_Requestor)
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;
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
6653 #include <ifusionsoundbuffer_dispatcher.h>
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,
6662 @@ -106,17 +106,17 @@ IFusionSoundBuffer_Requestor_Destruct( IFusionSoundBuffer *thiz )
6664 /**************************************************************************************************/
6667 +static DirectResult
6668 IFusionSoundBuffer_Requestor_AddRef( IFusionSoundBuffer *thiz )
6670 DIRECT_INTERFACE_GET_DATA(IFusionSoundBuffer_Requestor)
6674 - return DFB_UNIMPLEMENTED;
6675 + return DR_UNIMPLEMENTED;
6679 +static DirectResult
6680 IFusionSoundBuffer_Requestor_Release( IFusionSoundBuffer *thiz )
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 );
6687 - return DFB_UNIMPLEMENTED;
6688 + return DR_UNIMPLEMENTED;
6693 +static DirectResult
6694 IFusionSoundBuffer_Requestor_GetDescription( IFusionSoundBuffer *thiz,
6695 FSBufferDescription *desc )
6697 @@ -138,7 +138,7 @@ IFusionSoundBuffer_Requestor_GetDescription( IFusionSoundBuffer *thiz,
6698 DIRECT_INTERFACE_GET_DATA(IFusionSoundBuffer_Requestor)
6701 - return DFB_INVARG;
6704 ret = voodoo_manager_request( data->manager, data->instance,
6705 IFUSIONSOUNDBUFFER_METHOD_ID_GetDescription,
6706 @@ -148,7 +148,7 @@ IFusionSoundBuffer_Requestor_GetDescription( IFusionSoundBuffer *thiz,
6709 ret = response->result;
6710 - if (ret == DFB_OK) {
6711 + if (ret == DR_OK) {
6712 VoodooMessageParser parser;
6714 VOODOO_PARSER_BEGIN( parser, response );
6715 @@ -161,7 +161,7 @@ IFusionSoundBuffer_Requestor_GetDescription( IFusionSoundBuffer *thiz,
6720 +static DirectResult
6721 IFusionSoundBuffer_Requestor_SetPosition( IFusionSoundBuffer *thiz,
6724 @@ -171,7 +171,7 @@ IFusionSoundBuffer_Requestor_SetPosition( IFusionSoundBuffer *thiz,
6725 DIRECT_INTERFACE_GET_DATA(IFusionSoundBuffer_Requestor)
6727 if (position < 0 || position >= data->frames)
6728 - return DFB_INVARG;
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,
6736 ret = response->result;
6737 - if (ret == DFB_OK)
6739 data->position = position;
6741 voodoo_manager_finish_request( data->manager, response );
6742 @@ -189,7 +189,7 @@ IFusionSoundBuffer_Requestor_SetPosition( IFusionSoundBuffer *thiz,
6747 +static DirectResult
6748 IFusionSoundBuffer_Requestor_Lock( IFusionSoundBuffer *thiz,
6751 @@ -198,10 +198,10 @@ IFusionSoundBuffer_Requestor_Lock( IFusionSoundBuffer *thiz,
6752 DIRECT_INTERFACE_GET_DATA(IFusionSoundBuffer_Requestor)
6755 - return DFB_INVARG;
6759 - return DFB_LOCKED;
6762 *ret_data = data->buffer;
6764 @@ -213,10 +213,10 @@ IFusionSoundBuffer_Requestor_Lock( IFusionSoundBuffer *thiz,
6766 data->locked = true;
6773 +static DirectResult
6774 IFusionSoundBuffer_Requestor_Unlock( IFusionSoundBuffer *thiz )
6777 @@ -228,7 +228,7 @@ IFusionSoundBuffer_Requestor_Unlock( IFusionSoundBuffer *thiz )
6778 DIRECT_INTERFACE_GET_DATA(IFusionSoundBuffer_Requestor)
6784 src = data->buffer + data->position * data->bytes_per_frame;
6786 @@ -259,10 +259,10 @@ IFusionSoundBuffer_Requestor_Unlock( IFusionSoundBuffer *thiz )
6788 data->locked = false;
6795 +static DirectResult
6796 IFusionSoundBuffer_Requestor_Unlock_DPACK( IFusionSoundBuffer *thiz )
6799 @@ -274,7 +274,7 @@ IFusionSoundBuffer_Requestor_Unlock_DPACK( IFusionSoundBuffer *thiz )
6800 DIRECT_INTERFACE_GET_DATA(IFusionSoundBuffer_Requestor)
6806 src = data->buffer + data->position * data->bytes_per_frame;
6808 @@ -309,10 +309,10 @@ IFusionSoundBuffer_Requestor_Unlock_DPACK( IFusionSoundBuffer *thiz )
6810 data->locked = false;
6817 +static DirectResult
6818 IFusionSoundBuffer_Requestor_Play( IFusionSoundBuffer *thiz,
6819 FSBufferPlayFlags flags )
6821 @@ -322,7 +322,7 @@ IFusionSoundBuffer_Requestor_Play( IFusionSoundBuffer *thiz,
6822 DIRECT_INTERFACE_GET_DATA(IFusionSoundBuffer_Requestor)
6824 if (flags & ~FSPLAY_ALL)
6825 - return DFB_INVARG;
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,
6835 +static DirectResult
6836 IFusionSoundBuffer_Requestor_Stop( IFusionSoundBuffer *thiz )
6839 @@ -359,7 +359,7 @@ IFusionSoundBuffer_Requestor_Stop( IFusionSoundBuffer *thiz )
6844 +static DirectResult
6845 IFusionSoundBuffer_Requestor_CreatePlayback( IFusionSoundBuffer *thiz,
6846 IFusionSoundPlayback **ret_interface )
6848 @@ -370,7 +370,7 @@ IFusionSoundBuffer_Requestor_CreatePlayback( IFusionSoundBuffer *thiz,
6849 DIRECT_INTERFACE_GET_DATA(IFusionSoundBuffer_Requestor)
6852 - return DFB_INVARG;
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,
6860 ret = response->result;
6861 - if (ret == DFB_OK)
6863 ret = voodoo_construct_requestor( data->manager, "IFusionSoundPlayback",
6864 response->instance, NULL, &interface );
6866 @@ -392,11 +392,11 @@ IFusionSoundBuffer_Requestor_CreatePlayback( IFusionSoundBuffer *thiz,
6868 /**************************************************************************************************/
6871 +static DirectResult
6874 /* This implementation has to be loaded explicitly. */
6875 - return DFB_UNSUPPORTED;
6876 + return DR_UNSUPPORTED;
6880 @@ -404,7 +404,7 @@ Probe()
6882 * Fills in function pointers and intializes data structure.
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;
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
6904 #include <ifusionsoundplayback_dispatcher.h>
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,
6913 @@ -84,17 +84,17 @@ IFusionSoundPlayback_Requestor_Destruct( IFusionSoundPlayback *thiz )
6915 /**************************************************************************************************/
6918 +static DirectResult
6919 IFusionSoundPlayback_Requestor_AddRef( IFusionSoundPlayback *thiz )
6921 DIRECT_INTERFACE_GET_DATA(IFusionSoundPlayback_Requestor)
6930 +static DirectResult
6931 IFusionSoundPlayback_Requestor_Release( IFusionSoundPlayback *thiz )
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 );
6943 +static DirectResult
6944 IFusionSoundPlayback_Requestor_Start( IFusionSoundPlayback *thiz,
6947 @@ -116,7 +116,7 @@ IFusionSoundPlayback_Requestor_Start( IFusionSoundPlayback *thiz,
6948 DIRECT_INTERFACE_GET_DATA(IFusionSoundPlayback_Requestor)
6951 - return DFB_INVARG;
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,
6961 +static DirectResult
6962 IFusionSoundPlayback_Requestor_Stop( IFusionSoundPlayback *thiz )
6965 @@ -155,7 +155,7 @@ IFusionSoundPlayback_Requestor_Stop( IFusionSoundPlayback *thiz )
6970 +static DirectResult
6971 IFusionSoundPlayback_Requestor_Continue( IFusionSoundPlayback *thiz )
6974 @@ -176,7 +176,7 @@ IFusionSoundPlayback_Requestor_Continue( IFusionSoundPlayback *thiz )
6979 +static DirectResult
6980 IFusionSoundPlayback_Requestor_Wait( IFusionSoundPlayback *thiz )
6983 @@ -197,20 +197,20 @@ IFusionSoundPlayback_Requestor_Wait( IFusionSoundPlayback *thiz )
6988 +static DirectResult
6989 IFusionSoundPlayback_Requestor_GetStatus( IFusionSoundPlayback *thiz,
6990 - DFBBoolean *ret_playing,
6991 + bool *ret_playing,
6995 VoodooResponseMessage *response;
6996 - DFBBoolean playing = DFB_FALSE;
6997 + bool playing = DR_FALSE;
7000 DIRECT_INTERFACE_GET_DATA(IFusionSoundPlayback_Requestor)
7002 if (!ret_playing && !ret_position)
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,
7011 ret = response->result;
7012 - if (ret == DFB_OK) {
7013 + if (ret == DR_OK) {
7014 VoodooMessageParser parser;
7016 VOODOO_PARSER_BEGIN( parser, response );
7017 @@ -239,7 +239,7 @@ IFusionSoundPlayback_Requestor_GetStatus( IFusionSoundPlayback *thiz,
7022 +static DirectResult
7023 IFusionSoundPlayback_Requestor_SetVolume( IFusionSoundPlayback *thiz,
7026 @@ -249,7 +249,7 @@ IFusionSoundPlayback_Requestor_SetVolume( IFusionSoundPlayback *thiz,
7027 DIRECT_INTERFACE_GET_DATA(IFusionSoundPlayback_Requestor)
7029 if (level < 0.0f || level > 64.f)
7030 - return DFB_INVARG;
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,
7040 +static DirectResult
7041 IFusionSoundPlayback_Requestor_SetPan( IFusionSoundPlayback *thiz,
7044 @@ -275,7 +275,7 @@ IFusionSoundPlayback_Requestor_SetPan( IFusionSoundPlayback *thiz,
7045 DIRECT_INTERFACE_GET_DATA(IFusionSoundPlayback_Requestor)
7047 if (value < -1.0f || value > 1.0f)
7048 - return DFB_INVARG;
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,
7058 +static DirectResult
7059 IFusionSoundPlayback_Requestor_SetPitch( IFusionSoundPlayback *thiz,
7062 @@ -301,7 +301,7 @@ IFusionSoundPlayback_Requestor_SetPitch( IFusionSoundPlayback *thiz,
7063 DIRECT_INTERFACE_GET_DATA(IFusionSoundPlayback_Requestor)
7065 if (value < 0.0f || value > 64.0f)
7066 - return DFB_INVARG;
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,
7076 +static DirectResult
7077 IFusionSoundPlayback_Requestor_SetDirection( IFusionSoundPlayback *thiz,
7078 FSPlaybackDirection direction )
7080 @@ -331,7 +331,7 @@ IFusionSoundPlayback_Requestor_SetDirection( IFusionSoundPlayback *thiz,
7084 - return DFB_INVARG;
7088 ret = voodoo_manager_request( data->manager, data->instance,
7089 @@ -348,7 +348,7 @@ IFusionSoundPlayback_Requestor_SetDirection( IFusionSoundPlayback *thiz,
7094 +static DirectResult
7095 IFusionSoundPlayback_Requestor_SetDownmixLevels( IFusionSoundPlayback *thiz,
7098 @@ -359,10 +359,10 @@ IFusionSoundPlayback_Requestor_SetDownmixLevels( IFusionSoundPlayback *thiz,
7099 DIRECT_INTERFACE_GET_DATA(IFusionSoundPlayback_Requestor)
7101 if (center < 0.0f || center > 1.0f)
7102 - return DFB_INVARG;
7105 if (rear < 0.0f || rear > 1.0f)
7106 - return DFB_INVARG;
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,
7113 /**************************************************************************************************/
7116 +static DirectResult
7119 /* This implementation has to be loaded explicitly. */
7120 - return DFB_UNSUPPORTED;
7121 + return DR_UNSUPPORTED;
7125 @@ -393,7 +393,7 @@ Probe()
7127 * Fills in function pointers and intializes data structure.
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;
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
7148 #include <ifusionsoundstream_dispatcher.h>
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,
7157 @@ -102,17 +102,17 @@ IFusionSoundStream_Requestor_Destruct( IFusionSoundStream *thiz )
7159 /**************************************************************************************************/
7162 +static DirectResult
7163 IFusionSoundStream_Requestor_AddRef( IFusionSoundStream *thiz )
7165 DIRECT_INTERFACE_GET_DATA(IFusionSoundStream_Requestor)
7174 +static DirectResult
7175 IFusionSoundStream_Requestor_Release( IFusionSoundStream *thiz )
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 );
7187 +static DirectResult
7188 IFusionSoundStream_Requestor_GetDescription( IFusionSoundStream *thiz,
7189 FSStreamDescription *desc )
7191 @@ -133,7 +133,7 @@ IFusionSoundStream_Requestor_GetDescription( IFusionSoundStream *thiz,
7192 DIRECT_INTERFACE_GET_DATA(IFusionSoundStream_Requestor)
7195 - return DFB_INVARG;
7198 ret = voodoo_manager_request( data->manager, data->instance,
7199 IFUSIONSOUNDSTREAM_METHOD_ID_GetDescription,
7200 @@ -143,7 +143,7 @@ IFusionSoundStream_Requestor_GetDescription( IFusionSoundStream *thiz,
7203 ret = response->result;
7204 - if (ret == DFB_OK) {
7205 + if (ret == DR_OK) {
7206 VoodooMessageParser parser;
7208 VOODOO_PARSER_BEGIN( parser, response );
7209 @@ -156,7 +156,7 @@ IFusionSoundStream_Requestor_GetDescription( IFusionSoundStream *thiz,
7214 +static DirectResult
7215 IFusionSoundStream_Requestor_Write( IFusionSoundStream *thiz,
7216 const void *samples,
7218 @@ -168,7 +168,7 @@ IFusionSoundStream_Requestor_Write( IFusionSoundStream *thiz,
7219 DIRECT_INTERFACE_GET_DATA(IFusionSoundStream_Requestor)
7221 if (!samples || length < 1)
7222 - return DFB_INVARG;
7225 src = (u8*) samples;
7227 @@ -194,10 +194,10 @@ IFusionSoundStream_Requestor_Write( IFusionSoundStream *thiz,
7236 +static DirectResult
7237 IFusionSoundStream_Requestor_Write_DPACK( IFusionSoundStream *thiz,
7238 const void *samples,
7240 @@ -209,7 +209,7 @@ IFusionSoundStream_Requestor_Write_DPACK( IFusionSoundStream *thiz,
7241 DIRECT_INTERFACE_GET_DATA(IFusionSoundStream_Requestor)
7243 if (!samples || length < 1)
7244 - return DFB_INVARG;
7247 src = (u8*) samples;
7249 @@ -239,10 +239,10 @@ IFusionSoundStream_Requestor_Write_DPACK( IFusionSoundStream *thiz,
7258 +static DirectResult
7259 IFusionSoundStream_Requestor_Wait( IFusionSoundStream *thiz,
7262 @@ -252,7 +252,7 @@ IFusionSoundStream_Requestor_Wait( IFusionSoundStream *thiz,
7263 DIRECT_INTERFACE_GET_DATA(IFusionSoundStream_Requestor)
7265 if (length < 1 || length > data->frames)
7266 - return DFB_INVARG;
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,
7276 +static DirectResult
7277 IFusionSoundStream_Requestor_GetStatus( IFusionSoundStream *thiz,
7282 - DFBBoolean *ret_playing )
7283 + bool *ret_playing )
7286 VoodooResponseMessage *response;
7287 @@ -283,7 +283,7 @@ IFusionSoundStream_Requestor_GetStatus( IFusionSoundStream *thiz,
7291 - DFBBoolean playing;
7294 DIRECT_INTERFACE_GET_DATA(IFusionSoundStream_Requestor)
7296 @@ -327,7 +327,7 @@ IFusionSoundStream_Requestor_GetStatus( IFusionSoundStream *thiz,
7301 +static DirectResult
7302 IFusionSoundStream_Requestor_Flush( IFusionSoundStream *thiz )
7305 @@ -348,7 +348,7 @@ IFusionSoundStream_Requestor_Flush( IFusionSoundStream *thiz )
7310 +static DirectResult
7311 IFusionSoundStream_Requestor_Drop( IFusionSoundStream *thiz )
7314 @@ -369,7 +369,7 @@ IFusionSoundStream_Requestor_Drop( IFusionSoundStream *thiz )
7319 +static DirectResult
7320 IFusionSoundStream_Requestor_GetPresentationDelay( IFusionSoundStream *thiz,
7323 @@ -380,7 +380,7 @@ IFusionSoundStream_Requestor_GetPresentationDelay( IFusionSoundStream *thiz,
7324 DIRECT_INTERFACE_GET_DATA(IFusionSoundStream_Requestor)
7327 - return DFB_INVARG;
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,
7337 +static DirectResult
7338 IFusionSoundStream_Requestor_GetPlayback( IFusionSoundStream *thiz,
7339 IFusionSoundPlayback **ret_interface )
7341 @@ -414,7 +414,7 @@ IFusionSoundStream_Requestor_GetPlayback( IFusionSoundStream *thiz,
7342 DIRECT_INTERFACE_GET_DATA(IFusionSoundStream_Requestor)
7345 - return DFB_INVARG;
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,
7353 ret = response->result;
7354 - if (ret == DFB_OK)
7356 ret = voodoo_construct_requestor( data->manager, "IFusionSoundPlayback",
7357 response->instance, NULL, &interface );
7359 @@ -434,7 +434,7 @@ IFusionSoundStream_Requestor_GetPlayback( IFusionSoundStream *thiz,
7364 +static DirectResult
7365 IFusionSoundStream_Requestor_Access( IFusionSoundStream *thiz,
7368 @@ -442,7 +442,7 @@ IFusionSoundStream_Requestor_Access( IFusionSoundStream *thiz,
7369 DIRECT_INTERFACE_GET_DATA(IFusionSoundStream_Requestor)
7371 if (!ret_data || !ret_avail)
7372 - return DFB_INVARG;
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;
7381 - return data->buffer ? DFB_OK : DFB_NOSYSTEMMEMORY;
7382 + return data->buffer ? DR_OK : DR_NOLOCALMEMORY;
7386 +static DirectResult
7387 IFusionSoundStream_Requestor_Commit( IFusionSoundStream *thiz,
7390 DIRECT_INTERFACE_GET_DATA(IFusionSoundStream_Requestor)
7392 if (length < 0 || length > data->frames)
7393 - return DFB_INVARG;
7397 return thiz->Write( thiz, data->buffer, length );
7403 /**************************************************************************************************/
7406 +static DirectResult
7409 /* This implementation has to be loaded explicitly. */
7410 - return DFB_UNSUPPORTED;
7411 + return DR_UNSUPPORTED;
7415 @@ -482,7 +482,7 @@ Probe()
7417 * Fills in function pointers and intializes data structure.
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;
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,
7438 /******************************************************************************/
7440 -static DFBResult fs_core_detach( CoreSound *core );
7441 +static DirectResult fs_core_detach( CoreSound *core );
7443 /******************************************************************************/
7445 static CoreSound *core_sound = NULL;
7446 static pthread_mutex_t core_sound_lock = PTHREAD_MUTEX_INITIALIZER;
7450 fs_core_create( CoreSound **ret_core )
7453 @@ -180,14 +180,14 @@ fs_core_create( CoreSound **ret_core )
7454 /* Unlock the core singleton mutex. */
7455 pthread_mutex_unlock( &core_sound_lock );
7461 /* Allocate local core structure. */
7462 core = D_CALLOC( 1, sizeof(CoreSound) );
7464 pthread_mutex_unlock( &core_sound_lock );
7465 - return DFB_NOSYSTEMMEMORY;
7466 + return DR_NOLOCALMEMORY;
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 );
7473 pthread_mutex_unlock( &core_sound_lock );
7474 - return ret ? ret : DFB_FUSION;
7475 + return ret ? ret : DR_FUSION;
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 );
7489 fs_core_destroy( CoreSound *core, bool emergency )
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 );
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)
7510 @@ -281,7 +281,7 @@ fs_core_destroy( CoreSound *core, bool emergency )
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)
7517 D_ONCE( "waiting for FusionSound slaves to terminate" );
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 );
7528 @@ -370,7 +370,7 @@ fs_core_playlist_unlock( CoreSound *core )
7529 return fusion_skirmish_dismiss( &core->shared->playlist.lock );
7534 fs_core_add_playback( CoreSound *core,
7535 CorePlayback *playback )
7537 @@ -388,12 +388,12 @@ fs_core_add_playback( CoreSound *core,
7538 /* Allocate playlist entry. */
7539 entry = SHCALLOC( shared->shmpool, 1, sizeof(CorePlaylistEntry) );
7541 - return DFB_NOSYSTEMMEMORY;
7542 + return DR_NOLOCALMEMORY;
7544 /* Link playback to playlist entry. */
7545 if (fs_playback_link( &entry->playback, playback )) {
7546 SHFREE( shared->shmpool, entry );
7547 - return DFB_FUSION;
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 );
7562 fs_core_remove_playback( CoreSound *core,
7563 CorePlayback *playback )
7565 @@ -434,7 +434,7 @@ fs_core_remove_playback( CoreSound *core,
7574 @@ -482,11 +482,11 @@ fs_core_device_config( CoreSound *core )
7575 return &core->shared->config;
7580 fs_core_get_master_volume( CoreSound *core, float *level )
7582 CoreSoundShared *shared;
7587 D_ASSERT( core != NULL );
7588 @@ -511,11 +511,11 @@ fs_core_get_master_volume( CoreSound *core, float *level )
7594 fs_core_set_master_volume( CoreSound *core, float level )
7596 CoreSoundShared *shared;
7601 D_ASSERT( core != NULL );
7602 @@ -539,7 +539,7 @@ fs_core_set_master_volume( CoreSound *core, float level )
7608 fs_core_get_local_volume( CoreSound *core, float *level )
7610 D_ASSERT( core != NULL );
7611 @@ -551,7 +551,7 @@ fs_core_get_local_volume( CoreSound *core, float *level )
7613 pthread_mutex_unlock( &core_sound_lock );
7620 @@ -569,7 +569,7 @@ volume_callback( FusionObjectPool *pool, FusionObject *object, void *ctx )
7626 fs_core_set_local_volume( CoreSound *core, float level )
7628 D_ASSERT( core != NULL );
7629 @@ -583,13 +583,13 @@ fs_core_set_local_volume( CoreSound *core, float level )
7631 pthread_mutex_unlock( &core_sound_lock );
7639 fs_core_suspend( CoreSound *core )
7645 D_ASSERT( core != NULL );
7646 @@ -603,10 +603,10 @@ fs_core_suspend( CoreSound *core )
7652 fs_core_resume( CoreSound *core )
7658 D_ASSERT( core != NULL );
7659 @@ -645,7 +645,7 @@ fs_core_signal_handler( int num, void *addr, void *ctx )
7661 fs_core_destroy( core, true );
7667 /******************************************************************************/
7668 @@ -878,7 +878,7 @@ sound_thread( DirectThread *thread, void *arg )
7671 direct_list_foreach_safe (l, next, shared->playlist.entries) {
7674 CorePlaylistEntry *entry = (CorePlaylistEntry *) l;
7675 CorePlayback *playback = entry->playback;
7677 @@ -996,41 +996,41 @@ core_call_handler( int caller, int call_arg, void *call_ptr,
7679 case CSCID_GET_VOLUME:
7680 if (core->suspended) {
7681 - *retval = DFB_SUSPENDED;
7682 + *retval = DR_SUSPENDED;
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 );
7690 *((float*)call_ptr) = volume;
7697 case CSCID_SET_VOLUME:
7698 if (core->suspended) {
7699 - *retval = DFB_SUSPENDED;
7700 + *retval = DR_SUSPENDED;
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 );
7709 shared->soft_volume = FSF_ONE;
7717 if (core->suspended) {
7718 - *retval = DFB_BUSY;
7719 + *retval = DR_BUSY;
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,
7729 core->suspended = true;
7737 if (!core->suspended) {
7738 - *retval = DFB_BUSY;
7739 + *retval = DR_BUSY;
7745 ret = fs_device_resume( core->device );
7747 @@ -1068,7 +1068,7 @@ core_call_handler( int caller, int call_arg, void *call_ptr,
7749 core->suspended = false;
7756 @@ -1080,11 +1080,11 @@ core_call_handler( int caller, int call_arg, void *call_ptr,
7761 +static DirectResult
7762 fs_core_initialize( CoreSound *core )
7764 CoreSoundShared *shared = core->shared;
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" );
7779 +static DirectResult
7780 fs_core_join( CoreSound *core )
7782 /* really nothing to be done here, yet ;) */
7789 +static DirectResult
7790 fs_core_leave( CoreSound *core )
7792 /* really nothing to be done here, yet ;) */
7799 +static DirectResult
7800 fs_core_shutdown( CoreSound *core, bool local )
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 );
7812 +static DirectResult
7813 fs_core_detach( CoreSound *core )
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;
7824 D_DEBUG( "FusionSound/Core: ... detached.\n" );
7825 @@ -1243,7 +1243,7 @@ fs_core_detach( CoreSound *core )
7834 @@ -1253,7 +1253,7 @@ static int
7835 fs_core_arena_initialize( FusionArena *arena,
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 );
7852 @@ -1297,7 +1297,7 @@ fs_core_arena_shutdown( FusionArena *arena,
7858 CoreSound *core = ctx;
7859 CoreSoundShared *shared;
7860 FusionSHMPoolShared *pool;
7861 @@ -1322,14 +1322,14 @@ fs_core_arena_shutdown( FusionArena *arena,
7863 fusion_shm_pool_destroy( core->world, pool );
7870 fs_core_arena_join( FusionArena *arena,
7875 CoreSound *core = ctx;
7876 CoreSoundShared *shared;
7878 @@ -1337,7 +1337,7 @@ fs_core_arena_join( FusionArena *arena,
7880 /* Get shared data. */
7881 if (fusion_arena_get_shared_field( arena, "Core/Shared", (void*)&shared ))
7882 - return DFB_FUSION;
7885 core->shared = shared;
7887 @@ -1346,7 +1346,7 @@ fs_core_arena_join( FusionArena *arena,
7896 @@ -1354,7 +1354,7 @@ fs_core_arena_leave( FusionArena *arena,
7902 CoreSound *core = ctx;
7904 D_DEBUG( "FusionSound/Core: Leaving...\n" );
7905 @@ -1364,6 +1364,6 @@ fs_core_arena_leave( FusionArena *arena,
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
7919 * Core initialization and deinitialization
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 );
7928 @@ -52,12 +52,12 @@ CorePlayback *fs_core_create_playback( CoreSound *core );
7930 * Object enumeration
7932 -DirectResult fs_core_enum_buffers ( CoreSound *core,
7933 - FusionObjectCallback callback,
7935 -DirectResult fs_core_enum_playbacks ( CoreSound *core,
7936 - FusionObjectCallback callback,
7938 +DirectResult fs_core_enum_buffers ( CoreSound *core,
7939 + FusionObjectCallback callback,
7941 +DirectResult fs_core_enum_playbacks ( CoreSound *core,
7942 + FusionObjectCallback callback,
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 );
7951 -DFBResult fs_core_add_playback ( CoreSound *core,
7952 - CorePlayback *playback );
7953 +DirectResult fs_core_add_playback ( CoreSound *core,
7954 + CorePlayback *playback );
7956 -DFBResult fs_core_remove_playback( CoreSound *core,
7957 - CorePlayback *playback );
7958 +DirectResult fs_core_remove_playback( CoreSound *core,
7959 + CorePlayback *playback );
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 );
7965 * Returns the master volume.
7967 -DFBResult fs_core_get_master_volume( CoreSound *core, float *level );
7968 +DirectResult fs_core_get_master_volume( CoreSound *core, float *level );
7971 * Sets the master volume.
7973 -DFBResult fs_core_set_master_volume( CoreSound *core, float level );
7974 +DirectResult fs_core_set_master_volume( CoreSound *core, float level );
7977 * Returns the local volume.
7979 -DFBResult fs_core_get_local_volume( CoreSound *core, float *level );
7980 +DirectResult fs_core_get_local_volume( CoreSound *core, float *level );
7983 * Sets the local volume.
7985 -DFBResult fs_core_set_local_volume( CoreSound *core, float level );
7986 +DirectResult fs_core_set_local_volume( CoreSound *core, float level );
7989 * Suspends playback.
7991 -DFBResult fs_core_suspend( CoreSound *core );
7992 +DirectResult fs_core_suspend( CoreSound *core );
7997 -DFBResult fs_core_resume( CoreSound *core );
7998 +DirectResult fs_core_resume( CoreSound *core );
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 )
8008 /******************************************************************************/
8012 fs_playback_create( CoreSound *core,
8013 CoreSoundBuffer *buffer,
8015 @@ -115,12 +115,12 @@ fs_playback_create( CoreSound *core,
8016 /* Create playback object. */
8017 playback = fs_core_create_playback( core );
8019 - return DFB_FUSION;
8022 /* Link buffer to playback object. */
8023 if (fs_buffer_link( &playback->buffer, buffer )) {
8024 fusion_object_destroy( &playback->object );
8025 - return DFB_FUSION;
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;
8040 fs_playback_enable( CorePlayback *playback )
8042 - DFBResult ret = DFB_OK;
8043 + DirectResult ret = DR_OK;
8045 D_ASSERT( playback != NULL );
8046 D_ASSERT( playback->buffer != NULL );
8048 /* Lock playback. */
8049 if (fusion_skirmish_prevail( &playback->lock ))
8050 - return DFB_FUSION;
8053 /* Enable playback. */
8054 playback->disabled = false;
8055 @@ -175,22 +175,22 @@ fs_playback_enable( CorePlayback *playback )
8061 fs_playback_start( CorePlayback *playback, bool enable )
8063 - DFBResult ret = DFB_OK;
8064 + DirectResult ret = DR_OK;
8066 D_ASSERT( playback != NULL );
8067 D_ASSERT( playback->buffer != NULL );
8069 /* Lock playlist. */
8070 if (fs_core_playlist_lock( playback->core ))
8071 - return DFB_FUSION;
8074 /* Lock playback. */
8075 if (fusion_skirmish_prevail( &playback->lock )) {
8076 fs_core_playlist_unlock( playback->core );
8077 - return DFB_FUSION;
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;
8090 ret = fs_core_add_playback( playback->core, playback );
8092 /* Notify listeners about the start of the playback. */
8093 - if (ret == DFB_OK)
8095 fs_playback_notify( playback, CPNF_START, 0 );
8098 @@ -220,19 +220,19 @@ fs_playback_start( CorePlayback *playback, bool enable )
8104 fs_playback_stop( CorePlayback *playback, bool disable )
8106 D_ASSERT( playback != NULL );
8108 /* Lock playlist. */
8109 if (fs_core_playlist_lock( playback->core ))
8110 - return DFB_FUSION;
8113 /* Lock playback. */
8114 if (fusion_skirmish_prevail( &playback->lock )) {
8115 fs_core_playlist_unlock( playback->core );
8116 - return DFB_FUSION;
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 );
8131 fs_playback_set_stop( CorePlayback *playback,
8134 @@ -266,7 +266,7 @@ fs_playback_set_stop( CorePlayback *playback,
8136 /* Lock playback. */
8137 if (fusion_skirmish_prevail( &playback->lock ))
8138 - return DFB_FUSION;
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 );
8153 fs_playback_set_position( CorePlayback *playback,
8156 @@ -288,7 +288,7 @@ fs_playback_set_position( CorePlayback *playback,
8158 /* Lock playback. */
8159 if (fusion_skirmish_prevail( &playback->lock ))
8160 - return DFB_FUSION;
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 );
8175 fs_playback_set_downmix( CorePlayback *playback,
8178 @@ -315,7 +315,7 @@ fs_playback_set_downmix( CorePlayback *playback,
8180 /* Lock playback. */
8181 if (fusion_skirmish_prevail( &playback->lock ))
8182 - return DFB_FUSION;
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 );
8197 fs_playback_set_volume( CorePlayback *playback,
8200 @@ -352,7 +352,7 @@ fs_playback_set_volume( CorePlayback *playback,
8202 /* Lock playback. */
8203 if (fusion_skirmish_prevail( &playback->lock ))
8204 - return DFB_FUSION;
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 );
8219 fs_playback_set_local_volume( CorePlayback *playback,
8222 @@ -383,7 +383,7 @@ fs_playback_set_local_volume( CorePlayback *playback,
8224 /* Lock playback. */
8225 if (fusion_skirmish_prevail( &playback->lock ))
8226 - return DFB_FUSION;
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 );
8241 fs_playback_set_pitch( CorePlayback *playback,
8244 @@ -404,7 +404,7 @@ fs_playback_set_pitch( CorePlayback *playback,
8246 /* Lock playback. */
8247 if (fusion_skirmish_prevail( &playback->lock ))
8248 - return DFB_FUSION;
8252 playback->pitch = pitch;
8253 @@ -412,10 +412,10 @@ fs_playback_set_pitch( CorePlayback *playback,
8254 /* Unlock playback. */
8255 fusion_skirmish_dismiss( &playback->lock );
8263 fs_playback_get_status( CorePlayback *playback,
8264 CorePlaybackStatus *ret_status,
8266 @@ -424,7 +424,7 @@ fs_playback_get_status( CorePlayback *playback,
8268 /* Lock playback. */
8269 if (fusion_skirmish_prevail( &playback->lock ))
8270 - return DFB_FUSION;
8273 /* Return status. */
8275 @@ -447,12 +447,12 @@ fs_playback_get_status( CorePlayback *playback,
8276 /* Unlock playback. */
8277 fusion_skirmish_dismiss( &playback->lock );
8283 /******************************************************************************/
8287 fs_playback_mixto( CorePlayback *playback,
8290 @@ -461,7 +461,7 @@ fs_playback_mixto( CorePlayback *playback,
8299 @@ -474,7 +474,7 @@ fs_playback_mixto( CorePlayback *playback,
8301 /* Lock playback. */
8302 if (fusion_skirmish_prevail( &playback->lock ))
8303 - return DFB_FUSION;
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 )
8316 -DFBResult fs_playback_create ( CoreSound *core,
8317 +DirectResult fs_playback_create ( CoreSound *core,
8318 CoreSoundBuffer *buffer,
8320 CorePlayback **ret_playback );
8322 -DFBResult fs_playback_enable ( CorePlayback *playback );
8323 +DirectResult fs_playback_enable ( CorePlayback *playback );
8325 -DFBResult fs_playback_start ( CorePlayback *playback,
8326 +DirectResult fs_playback_start ( CorePlayback *playback,
8329 -DFBResult fs_playback_stop ( CorePlayback *playback,
8330 +DirectResult fs_playback_stop ( CorePlayback *playback,
8333 -DFBResult fs_playback_set_stop ( CorePlayback *playback,
8334 +DirectResult fs_playback_set_stop ( CorePlayback *playback,
8337 -DFBResult fs_playback_set_position( CorePlayback *playback,
8338 +DirectResult fs_playback_set_position( CorePlayback *playback,
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,
8347 -DFBResult fs_playback_set_volume ( CorePlayback *playback,
8348 +DirectResult fs_playback_set_volume ( CorePlayback *playback,
8351 -DFBResult fs_playback_set_local_volume( CorePlayback *playback,
8352 +DirectResult fs_playback_set_local_volume( CorePlayback *playback,
8355 -DFBResult fs_playback_set_pitch ( CorePlayback *playback,
8356 +DirectResult fs_playback_set_pitch ( CorePlayback *playback,
8359 -DFBResult fs_playback_get_status ( CorePlayback *playback,
8360 +DirectResult fs_playback_get_status ( CorePlayback *playback,
8361 CorePlaybackStatus *ret_status,
8362 int *ret_position );
8365 * Internally called by core_sound.c in the audio thread.
8367 -DFBResult fs_playback_mixto ( CorePlayback *playback,
8368 +DirectResult fs_playback_mixto ( CorePlayback *playback,
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 )
8378 /******************************************************************************/
8382 fs_buffer_create( CoreSound *core,
8385 @@ -96,12 +96,12 @@ fs_buffer_create( CoreSound *core,
8387 buffer = fs_core_create_buffer( core );
8389 - return DFB_FUSION;
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;
8399 buffer->length = length;
8400 @@ -115,10 +115,10 @@ fs_buffer_create( CoreSound *core,
8402 *ret_buffer = buffer;
8410 fs_buffer_lock( CoreSoundBuffer *buffer,
8413 @@ -142,17 +142,17 @@ fs_buffer_lock( CoreSoundBuffer *buffer,
8414 *ret_data = buffer->data + buffer->bytes * pos;
8415 *ret_bytes = buffer->bytes * length;
8423 fs_buffer_unlock( CoreSoundBuffer *buffer )
8425 D_ASSERT( buffer != NULL );
8427 D_DEBUG( "FusionSound/Core: %s (%p)\n", __FUNCTION__, buffer );
8433 /******************************************************************************/
8434 @@ -299,7 +299,7 @@ static const SoundMXFunc MIX_RW[FS_NUM_SAMPLEFORMATS][FS_MAX_CHANNELS] = {
8440 fs_buffer_mixto( CoreSoundBuffer *buffer,
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 );
8447 - return last ? DFB_BUFFEREMPTY : DFB_OK;
8448 + return last ? DR_BUFFEREMPTY : DR_OK;
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 )
8459 -DFBResult fs_buffer_create( CoreSound *core,
8460 +DirectResult fs_buffer_create( CoreSound *core,
8463 FSSampleFormat format,
8465 CoreSoundBuffer **ret_buffer );
8467 -DFBResult fs_buffer_lock ( CoreSoundBuffer *buffer,
8468 +DirectResult fs_buffer_lock ( CoreSoundBuffer *buffer,
8474 -DFBResult fs_buffer_unlock( CoreSoundBuffer *buffer );
8475 +DirectResult fs_buffer_unlock( CoreSoundBuffer *buffer );
8477 -DFBResult fs_buffer_mixto ( CoreSoundBuffer *buffer,
8478 +DirectResult fs_buffer_mixto ( CoreSoundBuffer *buffer,
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 {
8492 fs_device_initialize( CoreSound *core,
8493 CoreSoundDeviceConfig *config,
8494 CoreSoundDevice **ret_device )
8498 CoreSoundDevice *device;
8501 @@ -90,7 +90,7 @@ fs_device_initialize( CoreSound *core,
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;
8510 @@ -112,7 +112,7 @@ fs_device_initialize( CoreSound *core,
8514 - return DFB_FAILURE;
8515 + return DR_FAILURE;
8518 if (device->info.device_data_size) {
8519 @@ -146,7 +146,7 @@ fs_device_initialize( CoreSound *core,
8521 *ret_device = device;
8528 @@ -168,7 +168,7 @@ fs_device_get_capabilities( CoreSoundDevice *device )
8529 return device->device_info.caps;
8534 fs_device_get_buffer( CoreSoundDevice *device,
8536 unsigned int *avail )
8537 @@ -180,10 +180,10 @@ fs_device_get_buffer( CoreSoundDevice *device,
8539 return device->funcs->GetBuffer( device->device_data, addr, avail );
8541 - return DFB_UNSUPPORTED;
8542 + return DR_UNSUPPORTED;
8547 fs_device_commit_buffer( CoreSoundDevice *device, unsigned int frames )
8549 D_ASSERT( device != NULL );
8550 @@ -191,7 +191,7 @@ fs_device_commit_buffer( CoreSoundDevice *device, unsigned int frames )
8552 return device->funcs->CommitBuffer( device->device_data, frames );
8554 - return DFB_UNSUPPORTED;
8555 + return DR_UNSUPPORTED;
8559 @@ -206,7 +206,7 @@ fs_device_get_output_delay( CoreSoundDevice *device, int *delay )
8565 fs_device_get_volume( CoreSoundDevice *device, float *level )
8567 D_ASSERT( device != NULL );
8568 @@ -215,10 +215,10 @@ fs_device_get_volume( CoreSoundDevice *device, float *level )
8570 return device->funcs->GetVolume( device->device_data, level );
8572 - return DFB_UNSUPPORTED;
8573 + return DR_UNSUPPORTED;
8578 fs_device_set_volume( CoreSoundDevice *device, float level )
8580 D_ASSERT( device != NULL );
8581 @@ -226,10 +226,10 @@ fs_device_set_volume( CoreSoundDevice *device, float level )
8583 return device->funcs->SetVolume( device->device_data, level );
8585 - return DFB_UNSUPPORTED;
8586 + return DR_UNSUPPORTED;
8591 fs_device_suspend( CoreSoundDevice *device )
8593 D_ASSERT( device != NULL );
8594 @@ -237,10 +237,10 @@ fs_device_suspend( CoreSoundDevice *device )
8596 return device->funcs->Suspend( device->device_data );
8604 fs_device_resume( CoreSoundDevice *device )
8606 D_ASSERT( device != NULL );
8607 @@ -248,7 +248,7 @@ fs_device_resume( CoreSoundDevice *device )
8609 return device->funcs->Resume( device->device_data );
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 {
8624 - DFBResult (*Probe) ( void );
8625 + DirectResult (*Probe) ( void );
8627 /* Get device driver information. */
8628 void (*GetDriverInfo) ( SoundDriverInfo *info);
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 );
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,
8640 unsigned int *avail );
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 );
8647 /* Get output delay in frames. */
8648 @@ -118,25 +118,25 @@ typedef struct {
8651 /* Get volume level */
8652 - DFBResult (*GetVolume) ( void *device_data,
8653 + DirectResult (*GetVolume) ( void *device_data,
8656 /* Set volume level */
8657 - DFBResult (*SetVolume) ( void *device_data,
8658 + DirectResult (*SetVolume) ( void *device_data,
8661 /* Suspend the device */
8662 - DFBResult (*Suspend) ( void *device_data );
8663 + DirectResult (*Suspend) ( void *device_data );
8665 /* Resume the device */
8666 - DFBResult (*Resume) ( void *device_data );
8667 + DirectResult (*Resume) ( void *device_data );
8670 void (*CloseDevice) ( void *device_data );
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,
8681 fs_device_get_capabilities( CoreSoundDevice *device );
8683 -DFBResult fs_device_get_buffer( CoreSoundDevice *device,
8684 +DirectResult fs_device_get_buffer( CoreSoundDevice *device,
8686 unsigned int *avail );
8688 -DFBResult fs_device_commit_buffer( CoreSoundDevice *device, unsigned int frames );
8689 +DirectResult fs_device_commit_buffer( CoreSoundDevice *device, unsigned int frames );
8691 void fs_device_get_output_delay( CoreSoundDevice *device, int *delay );
8693 -DFBResult fs_device_get_volume( CoreSoundDevice *device, float *level );
8694 +DirectResult fs_device_get_volume( CoreSoundDevice *device, float *level );
8696 -DFBResult fs_device_set_volume( CoreSoundDevice *device, float level );
8697 +DirectResult fs_device_set_volume( CoreSoundDevice *device, float level );
8699 -DFBResult fs_device_suspend( CoreSoundDevice *device );
8700 +DirectResult fs_device_suspend( CoreSoundDevice *device );
8702 -DFBResult fs_device_resume( CoreSoundDevice *device );
8703 +DirectResult fs_device_resume( CoreSoundDevice *device );
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
8711 #include <core/sound_device.h>
8715 +static DirectResult
8716 device_probe( void );
8719 device_get_driver_info( SoundDriverInfo *info );
8722 +static DirectResult
8723 device_open( void *device_data,
8724 SoundDeviceInfo *device_info,
8725 CoreSoundDeviceConfig *config );
8728 +static DirectResult
8729 device_get_buffer( void *device_data,
8731 unsigned int *avail );
8734 +static DirectResult
8735 device_commit_buffer( void *device_data,
8736 unsigned int frames );
8739 device_get_output_delay( void *device_data, int *delay );
8742 +static DirectResult
8743 device_get_volume( void *device_data, float *level );
8746 +static DirectResult
8747 device_set_volume( void *device_data, float level );
8750 +static DirectResult
8751 device_suspend( void *device_data );
8754 +static DirectResult
8755 device_resume( void *device_data );
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;
8764 /**************************************************************************************************/
8766 -static DFBResult CreateRemote( const char *host,
8767 +static DirectResult CreateRemote( const char *host,
8769 IFusionSound **ret_interface );
8771 @@ -91,27 +91,27 @@ FusionSoundUsageString( void )
8772 return fs_config_usage();
8777 FusionSoundInit( int *argc, char **argv[] )
8779 return fs_config_init( argc, argv );
8784 FusionSoundSetOption( const char *name, const char *value )
8786 if (fs_config == NULL) {
8787 D_ERROR( "FusionSoundSetOption: FusionSoundInit has to be called first!\n" );
8792 if (ifusionsound_singleton) {
8793 D_ERROR( "FusionSoundSetOption: FusionSoundCreate has already been called!\n" );
8799 - return DFB_INVARG;
8802 return fs_config_set( name, value );
8804 @@ -119,20 +119,20 @@ FusionSoundSetOption( const char *name, const char *value )
8806 FusionSoundCreate( IFusionSound **ret_interface )
8812 D_ERROR( "FusionSoundCreate: FusionSoundInit has to be called first!\n" );
8818 - return DFB_INVARG;
8821 if (ifusionsound_singleton) {
8822 ifusionsound_singleton->AddRef( ifusionsound_singleton );
8823 *ret_interface = ifusionsound_singleton;
8828 if (!direct_config->quiet && fs_config->banner) {
8829 @@ -152,7 +152,7 @@ FusionSoundCreate( IFusionSound **ret_interface )
8830 DIRECT_ALLOCATE_INTERFACE( ifusionsound_singleton, IFusionSound );
8832 ret = IFusionSound_Construct( ifusionsound_singleton );
8833 - if (ret != DFB_OK)
8835 ifusionsound_singleton = NULL;
8837 *ret_interface = ifusionsound_singleton;
8838 @@ -171,7 +171,7 @@ FusionSoundError( const char *msg, DirectResult error )
8844 FusionSoundErrorFatal( const char *msg, DirectResult error )
8846 FusionSoundError( msg, error );
8847 @@ -187,10 +187,10 @@ FusionSoundErrorString( DirectResult error )
8849 /**************************************************************************************************/
8852 +static DirectResult
8853 CreateRemote( const char *host, int session, IFusionSound **ret_interface )
8857 DirectInterfaceFuncs *funcs;
8860 @@ -211,5 +211,5 @@ CreateRemote( const char *host, int session, IFusionSound **ret_interface )
8862 *ret_interface = interface;
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;
8876 +static DirectResult
8877 IFusionSound_AddRef( IFusionSound *thiz )
8879 DIRECT_INTERFACE_GET_DATA(IFusionSound)
8888 +static DirectResult
8889 IFusionSound_Release( IFusionSound *thiz )
8891 DIRECT_INTERFACE_GET_DATA(IFusionSound)
8892 @@ -80,29 +80,29 @@ IFusionSound_Release( IFusionSound *thiz )
8893 if (--data->ref == 0)
8894 IFusionSound_Destruct( thiz );
8901 +static DirectResult
8902 IFusionSound_GetDeviceDescription( IFusionSound *thiz,
8903 FSDeviceDescription *desc )
8905 DIRECT_INTERFACE_GET_DATA(IFusionSound)
8908 - return DFB_INVARG;
8911 *desc = *fs_core_device_description( data->core );
8918 +static DirectResult
8919 IFusionSound_CreateBuffer( IFusionSound *thiz,
8920 const FSBufferDescription *desc,
8921 IFusionSoundBuffer **ret_interface )
8925 CoreSoundDeviceConfig *config;
8927 FSSampleFormat format;
8928 @@ -115,7 +115,7 @@ IFusionSound_CreateBuffer( IFusionSound *thiz,
8929 DIRECT_INTERFACE_GET_DATA(IFusionSound)
8931 if (!desc || !ret_interface)
8932 - return DFB_INVARG;
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;
8940 if (flags & ~FSBDF_ALL)
8941 - return DFB_INVARG;
8945 if (flags & FSBDF_CHANNELMODE) {
8946 @@ -150,7 +150,7 @@ IFusionSound_CreateBuffer( IFusionSound *thiz,
8950 - return DFB_INVARG;
8954 else if (flags & FSBDF_CHANNELS) {
8955 @@ -160,7 +160,7 @@ IFusionSound_CreateBuffer( IFusionSound *thiz,
8959 - return DFB_INVARG;
8964 @@ -175,13 +175,13 @@ IFusionSound_CreateBuffer( IFusionSound *thiz,
8968 - return DFB_INVARG;
8973 if (flags & FSBDF_SAMPLERATE) {
8974 if (desc->samplerate < 100)
8975 - return DFB_UNSUPPORTED;
8976 + return DR_UNSUPPORTED;
8977 rate = desc->samplerate;
8980 @@ -189,10 +189,10 @@ IFusionSound_CreateBuffer( IFusionSound *thiz,
8981 length = desc->length;
8984 - return DFB_INVARG;
8987 if (length > FS_MAX_FRAMES)
8988 - return DFB_LIMITEXCEEDED;
8989 + return DR_LIMITEXCEEDED;
8991 ret = fs_buffer_create( data->core, length, mode, format, rate, &buffer );
8993 @@ -210,12 +210,12 @@ IFusionSound_CreateBuffer( IFusionSound *thiz,
8998 +static DirectResult
8999 IFusionSound_CreateStream( IFusionSound *thiz,
9000 const FSStreamDescription *desc,
9001 IFusionSoundStream **ret_interface )
9005 CoreSoundDeviceConfig *config;
9007 FSSampleFormat format;
9008 @@ -229,7 +229,7 @@ IFusionSound_CreateStream( IFusionSound *thiz,
9009 DIRECT_INTERFACE_GET_DATA(IFusionSound)
9012 - return DFB_INVARG;
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;
9020 if (flags & ~FSSDF_ALL)
9021 - return DFB_INVARG;
9024 if (flags & FSSDF_CHANNELMODE) {
9025 switch (desc->channelmode) {
9026 @@ -265,7 +265,7 @@ IFusionSound_CreateStream( IFusionSound *thiz,
9030 - return DFB_INVARG;
9034 else if (flags & FSSDF_CHANNELS) {
9035 @@ -275,7 +275,7 @@ IFusionSound_CreateStream( IFusionSound *thiz,
9039 - return DFB_INVARG;
9044 @@ -290,25 +290,25 @@ IFusionSound_CreateStream( IFusionSound *thiz,
9048 - return DFB_INVARG;
9053 if (flags & FSSDF_SAMPLERATE) {
9054 if (desc->samplerate < 100)
9055 - return DFB_UNSUPPORTED;
9056 + return DR_UNSUPPORTED;
9057 rate = desc->samplerate;
9060 if (flags & FSSDF_BUFFERSIZE) {
9061 if (desc->buffersize < 1)
9062 - return DFB_INVARG;
9064 size = desc->buffersize;
9067 if (flags & FSSDF_PREBUFFER) {
9068 if (desc->prebuffer >= size)
9069 - return DFB_INVARG;
9071 prebuffer = desc->prebuffer;
9074 @@ -318,7 +318,7 @@ IFusionSound_CreateStream( IFusionSound *thiz,
9076 /* Limit ring buffer size to five seconds. */
9077 if (size > rate * 5)
9078 - return DFB_LIMITEXCEEDED;
9079 + return DR_LIMITEXCEEDED;
9081 ret = fs_buffer_create( data->core, size, mode, format, rate, &buffer );
9083 @@ -336,7 +336,7 @@ IFusionSound_CreateStream( IFusionSound *thiz,
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,
9094 /* Check arguments */
9095 if (!ret_interface || !filename)
9096 - return DFB_INVARG;
9099 return IFusionSoundMusicProvider_Create( filename, ret_interface );
9103 +static DirectResult
9104 IFusionSound_GetMasterVolume( IFusionSound *thiz,
9107 @@ -358,12 +358,12 @@ IFusionSound_GetMasterVolume( IFusionSound *thiz,
9109 /* Check arguments */
9111 - return DFB_INVARG;
9114 return fs_core_get_master_volume( data->core, level );
9118 +static DirectResult
9119 IFusionSound_SetMasterVolume( IFusionSound *thiz,
9122 @@ -371,12 +371,12 @@ IFusionSound_SetMasterVolume( IFusionSound *thiz,
9124 /* Check arguments */
9125 if (level < 0.0f || level > 1.0f)
9126 - return DFB_INVARG;
9129 return fs_core_set_master_volume( data->core, level );
9133 +static DirectResult
9134 IFusionSound_GetLocalVolume( IFusionSound *thiz,
9137 @@ -384,12 +384,12 @@ IFusionSound_GetLocalVolume( IFusionSound *thiz,
9139 /* Check arguments */
9141 - return DFB_INVARG;
9144 return fs_core_get_local_volume( data->core, level );
9148 +static DirectResult
9149 IFusionSound_SetLocalVolume( IFusionSound *thiz,
9152 @@ -397,12 +397,12 @@ IFusionSound_SetLocalVolume( IFusionSound *thiz,
9154 /* Check arguments */
9155 if (level < 0.0f || level > 1.0f)
9156 - return DFB_INVARG;
9159 return fs_core_set_local_volume( data->core, level );
9163 +static DirectResult
9164 IFusionSound_Suspend( IFusionSound *thiz )
9166 DIRECT_INTERFACE_GET_DATA(IFusionSound)
9167 @@ -410,7 +410,7 @@ IFusionSound_Suspend( IFusionSound *thiz )
9168 return fs_core_suspend( data->core );
9172 +static DirectResult
9173 IFusionSound_Resume( IFusionSound *thiz )
9175 DIRECT_INTERFACE_GET_DATA(IFusionSound)
9176 @@ -419,10 +419,10 @@ IFusionSound_Resume( IFusionSound *thiz )
9182 IFusionSound_Construct( IFusionSound *thiz )
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;
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;
9204 -DFBResult IFusionSound_Construct( IFusionSound *thiz );
9205 +DirectResult IFusionSound_Construct( IFusionSound *thiz );
9207 extern IFusionSound *ifusionsound_singleton;
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 );
9218 +static DirectResult
9219 IFusionSoundBuffer_AddRef( IFusionSoundBuffer *thiz )
9221 DIRECT_INTERFACE_GET_DATA(IFusionSoundBuffer)
9230 +static DirectResult
9231 IFusionSoundBuffer_Release( IFusionSoundBuffer *thiz )
9233 DIRECT_INTERFACE_GET_DATA(IFusionSoundBuffer)
9234 @@ -105,18 +105,18 @@ IFusionSoundBuffer_Release( IFusionSoundBuffer *thiz )
9235 if (--data->ref == 0)
9236 IFusionSoundBuffer_Destruct( thiz );
9244 +static DirectResult
9245 IFusionSoundBuffer_GetDescription( IFusionSoundBuffer *thiz,
9246 FSBufferDescription *desc )
9248 DIRECT_INTERFACE_GET_DATA(IFusionSoundBuffer)
9251 - return DFB_INVARG;
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;
9265 +static DirectResult
9266 IFusionSoundBuffer_SetPosition( IFusionSoundBuffer *thiz,
9269 DIRECT_INTERFACE_GET_DATA(IFusionSoundBuffer)
9271 if (position < 0 || position >= data->size)
9272 - return DFB_INVARG;
9275 data->pos = position;
9282 +static DirectResult
9283 IFusionSoundBuffer_Lock( IFusionSoundBuffer *thiz,
9293 DIRECT_INTERFACE_GET_DATA(IFusionSoundBuffer)
9296 - return DFB_INVARG;
9300 - return DFB_LOCKED;
9303 ret = fs_buffer_lock( data->buffer, data->pos, 0, &lock_data, &lock_bytes );
9305 @@ -177,35 +177,35 @@ IFusionSoundBuffer_Lock( IFusionSoundBuffer *thiz,
9307 *ret_bytes = lock_bytes;
9314 +static DirectResult
9315 IFusionSoundBuffer_Unlock( IFusionSoundBuffer *thiz )
9317 DIRECT_INTERFACE_GET_DATA(IFusionSoundBuffer)
9323 fs_buffer_unlock( data->buffer );
9325 data->locked = false;
9332 +static DirectResult
9333 IFusionSoundBuffer_Play( IFusionSoundBuffer *thiz,
9334 FSBufferPlayFlags flags )
9338 CorePlayback *playback;
9340 DIRECT_INTERFACE_GET_DATA(IFusionSoundBuffer)
9342 if (flags & ~FSPLAY_ALL)
9343 - return DFB_INVARG;
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 );
9356 /* Create a playback object. */
9357 @@ -285,7 +285,7 @@ IFusionSoundBuffer_Play( IFusionSoundBuffer *thiz,
9362 +static DirectResult
9363 IFusionSoundBuffer_Stop( IFusionSoundBuffer *thiz )
9365 DIRECT_INTERFACE_GET_DATA(IFusionSoundBuffer)
9366 @@ -302,21 +302,21 @@ IFusionSoundBuffer_Stop( IFusionSoundBuffer *thiz )
9368 pthread_mutex_unlock( &data->lock );
9375 +static DirectResult
9376 IFusionSoundBuffer_CreatePlayback( IFusionSoundBuffer *thiz,
9377 IFusionSoundPlayback **ret_interface )
9381 CorePlayback *playback;
9382 IFusionSoundPlayback *interface;
9384 DIRECT_INTERFACE_GET_DATA(IFusionSoundBuffer)
9387 - return DFB_INVARG;
9390 ret = fs_playback_create( data->core, data->buffer, true, &playback );
9392 @@ -338,7 +338,7 @@ IFusionSoundBuffer_CreatePlayback( IFusionSoundBuffer *thiz,
9398 IFusionSoundBuffer_Construct( IFusionSoundBuffer *thiz,
9400 CoreSoundBuffer *buffer,
9401 @@ -353,7 +353,7 @@ IFusionSoundBuffer_Construct( IFusionSoundBuffer *thiz,
9402 if (fs_buffer_ref( buffer )) {
9403 DIRECT_DEALLOCATE_INTERFACE( thiz );
9405 - return DFB_FUSION;
9409 /* Initialize private data. */
9410 @@ -383,6 +383,6 @@ IFusionSoundBuffer_Construct( IFusionSoundBuffer *thiz,
9412 thiz->CreatePlayback = IFusionSoundBuffer_CreatePlayback;
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
9424 * initializes interface struct and private data
9426 -DFBResult IFusionSoundBuffer_Construct( IFusionSoundBuffer *thiz,
9427 +DirectResult IFusionSoundBuffer_Construct( IFusionSoundBuffer *thiz,
9429 CoreSoundBuffer *buffer,
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,
9440 +static DirectResult
9441 IFusionSoundPlayback_UpdateVolume( IFusionSoundPlayback_data* data );
9444 @@ -88,17 +88,17 @@ IFusionSoundPlayback_Destruct( IFusionSoundPlayback *thiz )
9445 DIRECT_DEALLOCATE_INTERFACE( thiz );
9449 +static DirectResult
9450 IFusionSoundPlayback_AddRef( IFusionSoundPlayback *thiz )
9452 DIRECT_INTERFACE_GET_DATA(IFusionSoundPlayback)
9461 +static DirectResult
9462 IFusionSoundPlayback_Release( IFusionSoundPlayback *thiz )
9464 DIRECT_INTERFACE_GET_DATA(IFusionSoundPlayback)
9465 @@ -106,10 +106,10 @@ IFusionSoundPlayback_Release( IFusionSoundPlayback *thiz )
9466 if (--data->ref == 0)
9467 IFusionSoundPlayback_Destruct( thiz );
9474 +static DirectResult
9475 IFusionSoundPlayback_Start( IFusionSoundPlayback *thiz,
9478 @@ -120,13 +120,13 @@ IFusionSoundPlayback_Start( IFusionSoundPlayback *thiz,
9479 __FUNCTION__, data->playback, start, stop );
9482 - return DFB_UNSUPPORTED;
9483 + return DR_UNSUPPORTED;
9485 if (start < 0 || start >= data->length)
9486 - return DFB_INVARG;
9489 if (stop >= data->length)
9490 - return DFB_INVARG;
9493 pthread_mutex_lock( &data->lock );
9495 @@ -136,10 +136,10 @@ IFusionSoundPlayback_Start( IFusionSoundPlayback *thiz,
9497 pthread_mutex_unlock( &data->lock );
9504 +static DirectResult
9505 IFusionSoundPlayback_Stop( IFusionSoundPlayback *thiz )
9507 DIRECT_INTERFACE_GET_DATA(IFusionSoundPlayback)
9508 @@ -149,7 +149,7 @@ IFusionSoundPlayback_Stop( IFusionSoundPlayback *thiz )
9509 return fs_playback_stop( data->playback, false );
9513 +static DirectResult
9514 IFusionSoundPlayback_Continue( IFusionSoundPlayback *thiz )
9516 DIRECT_INTERFACE_GET_DATA(IFusionSoundPlayback)
9517 @@ -159,10 +159,10 @@ IFusionSoundPlayback_Continue( IFusionSoundPlayback *thiz )
9518 return fs_playback_start( data->playback, false );
9522 +static DirectResult
9523 IFusionSoundPlayback_Wait( IFusionSoundPlayback *thiz )
9528 DIRECT_INTERFACE_GET_DATA(IFusionSoundPlayback)
9530 @@ -179,7 +179,7 @@ IFusionSoundPlayback_Wait( IFusionSoundPlayback *thiz )
9532 if (status & CPS_PLAYING) {
9533 if (status & CPS_LOOPING) {
9534 - ret = DFB_UNSUPPORTED;
9535 + ret = DR_UNSUPPORTED;
9539 @@ -197,12 +197,12 @@ IFusionSoundPlayback_Wait( IFusionSoundPlayback *thiz )
9544 +static DirectResult
9545 IFusionSoundPlayback_GetStatus( IFusionSoundPlayback *thiz,
9546 - DFBBoolean *ret_playing,
9547 + bool *ret_playing,
9552 CorePlaybackStatus status;
9555 @@ -215,15 +215,15 @@ IFusionSoundPlayback_GetStatus( IFusionSoundPlayback *thiz,
9559 - *ret_playing = (status & CPS_PLAYING) ? DFB_TRUE : DFB_FALSE;
9560 + *ret_playing = !!(status & CPS_PLAYING);
9563 *ret_position = position;
9570 +static DirectResult
9571 IFusionSoundPlayback_SetVolume( IFusionSoundPlayback *thiz,
9574 @@ -232,17 +232,17 @@ IFusionSoundPlayback_SetVolume( IFusionSoundPlayback *thiz,
9575 D_DEBUG( "%s (%p, %.3f)\n", __FUNCTION__, data->playback, level );
9578 - return DFB_INVARG;
9582 - return DFB_UNSUPPORTED;
9583 + return DR_UNSUPPORTED;
9585 data->volume = level;
9587 return IFusionSoundPlayback_UpdateVolume( data );
9591 +static DirectResult
9592 IFusionSoundPlayback_SetPan( IFusionSoundPlayback *thiz,
9595 @@ -251,14 +251,14 @@ IFusionSoundPlayback_SetPan( IFusionSoundPlayback *thiz,
9596 D_DEBUG( "%s (%p, %.3f)\n", __FUNCTION__, data->playback, value );
9598 if (value < -1.0f || value > 1.0f)
9599 - return DFB_INVARG;
9604 return IFusionSoundPlayback_UpdateVolume( data );
9608 +static DirectResult
9609 IFusionSoundPlayback_SetPitch( IFusionSoundPlayback *thiz,
9612 @@ -267,19 +267,19 @@ IFusionSoundPlayback_SetPitch( IFusionSoundPlayback *thiz,
9613 D_DEBUG( "%s (%p, %.3f)\n", __FUNCTION__, data->playback, value );
9616 - return DFB_INVARG;
9620 - return DFB_UNSUPPORTED;
9621 + return DR_UNSUPPORTED;
9623 data->pitch = (value * FS_PITCH_ONE + 0.5f);
9625 fs_playback_set_pitch( data->playback, data->pitch*data->dir );
9632 +static DirectResult
9633 IFusionSoundPlayback_SetDirection( IFusionSoundPlayback *thiz,
9634 FSPlaybackDirection direction )
9636 @@ -293,30 +293,30 @@ IFusionSoundPlayback_SetDirection( IFusionSoundPlayback *thiz,
9637 data->dir = direction;
9640 - return DFB_INVARG;
9644 fs_playback_set_pitch( data->playback, data->pitch*data->dir );
9651 +static DirectResult
9652 IFusionSoundPlayback_SetDownmixLevels( IFusionSoundPlayback *thiz,
9659 DIRECT_INTERFACE_GET_DATA(IFusionSoundPlayback)
9661 D_DEBUG( "%s (%p, %.3f, %.3f)\n", __FUNCTION__, data->playback, center, rear );
9663 if (center < 0.0f || center > 1.0f)
9664 - return DFB_INVARG;
9667 if (rear < 0.0f || rear > 1.0f)
9668 - return DFB_INVARG;
9671 ret = fs_playback_set_downmix( data->playback, center, rear );
9673 @@ -327,7 +327,7 @@ IFusionSoundPlayback_SetDownmixLevels( IFusionSoundPlayback *thiz,
9679 IFusionSoundPlayback_Construct( IFusionSoundPlayback *thiz,
9680 CorePlayback *playback,
9682 @@ -338,7 +338,7 @@ IFusionSoundPlayback_Construct( IFusionSoundPlayback *thiz,
9683 if (fs_playback_ref( playback )) {
9684 DIRECT_DEALLOCATE_INTERFACE( thiz );
9686 - return DFB_FUSION;
9690 /* Attach our listener to the playback. */
9691 @@ -349,7 +349,7 @@ IFusionSoundPlayback_Construct( IFusionSoundPlayback *thiz,
9693 DIRECT_DEALLOCATE_INTERFACE( thiz );
9695 - return DFB_FUSION;
9699 /* Initialize private data. */
9700 @@ -382,7 +382,7 @@ IFusionSoundPlayback_Construct( IFusionSoundPlayback *thiz,
9701 thiz->SetDirection = IFusionSoundPlayback_SetDirection;
9702 thiz->SetDownmixLevels = IFusionSoundPlayback_SetDownmixLevels;
9709 @@ -410,7 +410,7 @@ IFusionSoundPlayback_React( const void *msg_data,
9714 +static DirectResult
9715 IFusionSoundPlayback_UpdateVolume( IFusionSoundPlayback_data* data )
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
9724 * initializes interface struct and private data
9726 -DFBResult IFusionSoundPlayback_Construct( IFusionSoundPlayback *thiz,
9727 +DirectResult IFusionSoundPlayback_Construct( IFusionSoundPlayback *thiz,
9728 CorePlayback *playback,
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
9739 -static DFBResult IFusionSoundStream_FillBuffer( IFusionSoundStream_data *data,
9740 +static DirectResult IFusionSoundStream_FillBuffer( IFusionSoundStream_data *data,
9741 const void *sample_data,
9744 @@ -81,17 +81,17 @@ IFusionSoundStream_Destruct( IFusionSoundStream *thiz )
9745 DIRECT_DEALLOCATE_INTERFACE( thiz );
9749 +static DirectResult
9750 IFusionSoundStream_AddRef( IFusionSoundStream *thiz )
9752 DIRECT_INTERFACE_GET_DATA(IFusionSoundStream)
9761 +static DirectResult
9762 IFusionSoundStream_Release( IFusionSoundStream *thiz )
9764 DIRECT_INTERFACE_GET_DATA(IFusionSoundStream)
9765 @@ -99,18 +99,18 @@ IFusionSoundStream_Release( IFusionSoundStream *thiz )
9766 if (--data->ref == 0)
9767 IFusionSoundStream_Destruct( thiz );
9775 +static DirectResult
9776 IFusionSoundStream_GetDescription( IFusionSoundStream *thiz,
9777 FSStreamDescription *desc )
9779 DIRECT_INTERFACE_GET_DATA(IFusionSoundStream)
9782 - return DFB_INVARG;
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;
9796 +static DirectResult
9797 IFusionSoundStream_Write( IFusionSoundStream *thiz,
9798 const void *sample_data,
9800 @@ -133,14 +133,14 @@ IFusionSoundStream_Write( IFusionSoundStream *thiz,
9801 DIRECT_INTERFACE_GET_DATA(IFusionSoundStream)
9803 if (!sample_data || length < 1)
9804 - return DFB_INVARG;
9807 pthread_mutex_lock( &data->lock );
9809 data->pending = length;
9811 while (data->pending) {
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 );
9826 @@ -193,17 +193,17 @@ IFusionSoundStream_Write( IFusionSoundStream *thiz,
9828 pthread_mutex_unlock( &data->lock );
9835 +static DirectResult
9836 IFusionSoundStream_Wait( IFusionSoundStream *thiz,
9839 DIRECT_INTERFACE_GET_DATA(IFusionSoundStream)
9841 if (length < 0 || length > data->size)
9842 - return DFB_INVARG;
9845 pthread_mutex_lock( &data->lock );
9847 @@ -227,16 +227,16 @@ IFusionSoundStream_Wait( IFusionSoundStream *thiz,
9849 pthread_mutex_unlock( &data->lock );
9856 +static DirectResult
9857 IFusionSoundStream_GetStatus( IFusionSoundStream *thiz,
9861 int *write_position,
9862 - DFBBoolean *playing )
9865 DIRECT_INTERFACE_GET_DATA(IFusionSoundStream)
9867 @@ -259,10 +259,10 @@ IFusionSoundStream_GetStatus( IFusionSoundStream *thiz,
9869 pthread_mutex_unlock( &data->lock );
9876 +static DirectResult
9877 IFusionSoundStream_Flush( IFusionSoundStream *thiz )
9879 DIRECT_INTERFACE_GET_DATA(IFusionSoundStream)
9880 @@ -284,10 +284,10 @@ IFusionSoundStream_Flush( IFusionSoundStream *thiz )
9882 pthread_mutex_unlock( &data->lock );
9889 +static DirectResult
9890 IFusionSoundStream_Drop( IFusionSoundStream *thiz )
9892 DIRECT_INTERFACE_GET_DATA(IFusionSoundStream)
9893 @@ -302,17 +302,17 @@ IFusionSoundStream_Drop( IFusionSoundStream *thiz )
9895 pthread_mutex_unlock( &data->lock );
9902 +static DirectResult
9903 IFusionSoundStream_GetPresentationDelay( IFusionSoundStream *thiz,
9906 DIRECT_INTERFACE_GET_DATA(IFusionSoundStream)
9909 - return DFB_INVARG;
9912 pthread_mutex_lock( &data->lock );
9914 @@ -321,21 +321,21 @@ IFusionSoundStream_GetPresentationDelay( IFusionSoundStream *thiz,
9916 pthread_mutex_unlock( &data->lock );
9923 +static DirectResult
9924 IFusionSoundStream_GetPlayback( IFusionSoundStream *thiz,
9925 IFusionSoundPlayback **ret_interface )
9927 DIRECT_INTERFACE_GET_DATA(IFusionSoundStream)
9930 - return DFB_INVARG;
9933 if (!data->iplayback) {
9934 IFusionSoundPlayback *interface;
9938 DIRECT_ALLOCATE_INTERFACE( interface, IFusionSoundPlayback );
9940 @@ -352,22 +352,22 @@ IFusionSoundStream_GetPlayback( IFusionSoundStream *thiz,
9942 *ret_interface = data->iplayback;
9949 +static DirectResult
9950 IFusionSoundStream_Access( IFusionSoundStream *thiz,
9959 DIRECT_INTERFACE_GET_DATA(IFusionSoundStream)
9961 if (!ret_data || !ret_avail)
9962 - return DFB_INVARG;
9965 pthread_mutex_lock( &data->lock );
9967 @@ -398,22 +398,22 @@ IFusionSoundStream_Access( IFusionSoundStream *thiz,
9972 +static DirectResult
9973 IFusionSoundStream_Commit( IFusionSoundStream *thiz,
9979 DIRECT_INTERFACE_GET_DATA(IFusionSoundStream)
9982 - return DFB_INVARG;
9985 pthread_mutex_lock( &data->lock );
9987 if (length > data->size - data->filled) {
9988 pthread_mutex_unlock( &data->lock );
9989 - return DFB_INVARG;
9993 D_DEBUG( "%s: length %d, filled %d/%d (%splaying)\n",
9994 @@ -453,13 +453,13 @@ IFusionSoundStream_Commit( IFusionSoundStream *thiz,
9996 pthread_mutex_unlock( &data->lock );
10007 IFusionSoundStream_Construct( IFusionSoundStream *thiz,
10009 CoreSoundBuffer *buffer,
10010 @@ -469,14 +469,14 @@ IFusionSoundStream_Construct( IFusionSoundStream *thiz,
10015 + DirectResult ret;
10016 CorePlayback *playback;
10018 DIRECT_ALLOCATE_INTERFACE_DATA(thiz, IFusionSoundStream)
10020 /* Increase reference counter of the buffer. */
10021 if (fs_buffer_ref( buffer )) {
10022 - ret = DFB_FUSION;
10027 @@ -487,7 +487,7 @@ IFusionSoundStream_Construct( IFusionSoundStream *thiz,
10029 /* Attach our listener to the playback object. */
10030 if (fs_playback_attach( playback, IFusionSoundStream_React, data, &data->reaction )) {
10031 - ret = DFB_FUSION;
10036 @@ -528,7 +528,7 @@ IFusionSoundStream_Construct( IFusionSoundStream *thiz,
10037 thiz->Access = IFusionSoundStream_Access;
10038 thiz->Commit = IFusionSoundStream_Commit;
10044 fs_playback_unref( playback );
10045 @@ -544,13 +544,13 @@ error_ref:
10050 +static DirectResult
10051 IFusionSoundStream_FillBuffer( IFusionSoundStream_data *data,
10052 const void *sample_data,
10057 + DirectResult ret;
10061 @@ -597,7 +597,7 @@ IFusionSoundStream_FillBuffer( IFusionSoundStream_data *data,
10063 *ret_bytes = offset;
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 {
10076 * initializes interface struct and private data
10078 -DFBResult IFusionSoundStream_Construct( IFusionSoundStream *thiz,
10079 +DirectResult IFusionSoundStream_Construct( IFusionSoundStream *thiz,
10081 CoreSoundBuffer *buffer,
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>
10092 +static DirectResult
10093 IFusionSoundMusicProvider_AddRef( IFusionSoundMusicProvider *thiz )
10095 - return DFB_UNIMPLEMENTED;
10096 + return DR_UNIMPLEMENTED;
10100 +static DirectResult
10101 IFusionSoundMusicProvider_Release( IFusionSoundMusicProvider *thiz )
10103 - return DFB_UNIMPLEMENTED;
10104 + return DR_UNIMPLEMENTED;
10108 +static DirectResult
10109 IFusionSoundMusicProvider_GetCapabilities( IFusionSoundMusicProvider *thiz,
10110 FSMusicProviderCapabilities *caps )
10113 - return DFB_INVARG;
10114 + return DR_INVARG;
10116 *caps = FMCAPS_BASIC;
10118 - return DFB_UNIMPLEMENTED;
10119 + return DR_UNIMPLEMENTED;
10123 +static DirectResult
10124 IFusionSoundMusicProvider_EnumTracks( IFusionSoundMusicProvider *thiz,
10125 FSTrackCallback callback,
10126 void *callbackdata )
10128 FSTrackDescription desc;
10130 + DirectResult ret;
10133 - return DFB_INVARG;
10134 + return DR_INVARG;
10136 ret = thiz->GetTrackDescription( thiz, &desc );
10138 @@ -79,145 +79,145 @@ IFusionSoundMusicProvider_EnumTracks( IFusionSoundMusicProvider *thiz,
10140 callback( 0, desc, callbackdata );
10147 +static DirectResult
10148 IFusionSoundMusicProvider_GetTrackID( IFusionSoundMusicProvider *thiz,
10149 FSTrackID *ret_track_id )
10152 - return DFB_INVARG;
10153 + return DR_INVARG;
10162 +static DirectResult
10163 IFusionSoundMusicProvider_GetTrackDescription( IFusionSoundMusicProvider *thiz,
10164 FSTrackDescription *desc )
10167 - return DFB_INVARG;
10168 + return DR_INVARG;
10170 memset( desc, 0, sizeof(FSTrackDescription) );
10172 - return DFB_UNIMPLEMENTED;
10173 + return DR_UNIMPLEMENTED;
10177 +static DirectResult
10178 IFusionSoundMusicProvider_GetStreamDescription( IFusionSoundMusicProvider *thiz,
10179 FSStreamDescription *desc )
10182 - return DFB_INVARG;
10183 + return DR_INVARG;
10185 desc->flags = FSSDF_NONE;
10187 - return DFB_UNIMPLEMENTED;
10188 + return DR_UNIMPLEMENTED;
10192 +static DirectResult
10193 IFusionSoundMusicProvider_GetBufferDescription( IFusionSoundMusicProvider *thiz,
10194 FSBufferDescription *desc )
10197 - return DFB_INVARG;
10198 + return DR_INVARG;
10200 desc->flags = FSBDF_NONE;
10202 - return DFB_UNIMPLEMENTED;
10203 + return DR_UNIMPLEMENTED;
10207 +static DirectResult
10208 IFusionSoundMusicProvider_SelectTrack( IFusionSoundMusicProvider *thiz,
10209 FSTrackID track_id )
10212 - return DFB_UNSUPPORTED;
10213 + return DR_UNSUPPORTED;
10220 +static DirectResult
10221 IFusionSoundMusicProvider_PlayToStream( IFusionSoundMusicProvider *thiz,
10222 IFusionSoundStream *destination )
10224 - return DFB_UNIMPLEMENTED;
10225 + return DR_UNIMPLEMENTED;
10229 +static DirectResult
10230 IFusionSoundMusicProvider_PlayToBuffer( IFusionSoundMusicProvider *thiz,
10231 IFusionSoundBuffer *destination,
10232 FMBufferCallback callback,
10235 - return DFB_UNIMPLEMENTED;
10236 + return DR_UNIMPLEMENTED;
10240 +static DirectResult
10241 IFusionSoundMusicProvider_Stop( IFusionSoundMusicProvider *thiz )
10243 - return DFB_UNIMPLEMENTED;
10244 + return DR_UNIMPLEMENTED;
10248 +static DirectResult
10249 IFusionSoundMusicProvider_GetStatus( IFusionSoundMusicProvider *thiz,
10250 FSMusicProviderStatus *status )
10253 - return DFB_INVARG;
10254 + return DR_INVARG;
10256 *status = FMSTATE_UNKNOWN;
10258 - return DFB_UNIMPLEMENTED;
10259 + return DR_UNIMPLEMENTED;
10263 +static DirectResult
10264 IFusionSoundMusicProvider_SeekTo( IFusionSoundMusicProvider *thiz,
10267 - return DFB_UNIMPLEMENTED;
10268 + return DR_UNIMPLEMENTED;
10272 +static DirectResult
10273 IFusionSoundMusicProvider_GetPos( IFusionSoundMusicProvider *thiz,
10277 - return DFB_INVARG;
10278 + return DR_INVARG;
10282 - return DFB_UNIMPLEMENTED;
10283 + return DR_UNIMPLEMENTED;
10287 +static DirectResult
10288 IFusionSoundMusicProvider_GetLength( IFusionSoundMusicProvider *thiz,
10292 - return DFB_INVARG;
10293 + return DR_INVARG;
10297 - return DFB_UNIMPLEMENTED;
10298 + return DR_UNIMPLEMENTED;
10302 +static DirectResult
10303 IFusionSoundMusicProvider_SetPlaybackFlags( IFusionSoundMusicProvider *thiz,
10304 FSMusicProviderPlaybackFlags flags )
10306 - return DFB_UNIMPLEMENTED;
10307 + return DR_UNIMPLEMENTED;
10311 +static DirectResult
10312 IFusionSoundMusicProvider_WaitStatus( IFusionSoundMusicProvider *thiz,
10313 FSMusicProviderStatus mask,
10314 unsigned int timeout )
10316 - return DFB_UNIMPLEMENTED;
10317 + return DR_UNIMPLEMENTED;
10321 @@ -244,11 +244,11 @@ IFusionSoundMusicProvider_Construct( IFusionSoundMusicProvider *thiz )
10327 IFusionSoundMusicProvider_Create( const char *filename,
10328 IFusionSoundMusicProvider **interface )
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;
10343 -DFBResult IFusionSoundMusicProvider_Create( const char *filename,
10344 +DirectResult IFusionSoundMusicProvider_Create( const char *filename,
10345 IFusionSoundMusicProvider **interface );
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 )
10357 +static DirectResult
10358 parse_args( const char *args )
10360 char *buf = alloca( strlen(args) + 1 );
10361 @@ -147,7 +147,7 @@ parse_args( const char *args )
10362 strcpy( buf, args );
10364 while (buf && buf[0]) {
10366 + DirectResult ret;
10370 @@ -164,9 +164,9 @@ parse_args( const char *args )
10372 ret = fs_config_set( buf, value );
10377 - case DFB_UNSUPPORTED:
10378 + case DR_UNSUPPORTED:
10379 D_ERROR( "FusionSound/Config: Unknown option '%s'!\n", buf );
10382 @@ -176,7 +176,7 @@ parse_args( const char *args )
10391 @@ -203,7 +203,7 @@ fs_config_usage( void )
10392 return config_usage;
10397 fs_config_set( const char *name, const char *value )
10399 if (!strcmp( name, "driver" )) {
10400 @@ -214,7 +214,7 @@ fs_config_set( const char *name, const char *value )
10403 D_ERROR( "FusionSound/Config '%s': No value specified!\n", name );
10404 - return DFB_INVARG;
10405 + return DR_INVARG;
10408 else if (!strcmp( name, "device" )) {
10409 @@ -225,7 +225,7 @@ fs_config_set( const char *name, const char *value )
10412 D_ERROR( "FusionSound/Config '%s': No value specified!\n", name );
10413 - return DFB_INVARG;
10414 + return DR_INVARG;
10417 else if (!strcmp( name, "channels" )) {
10418 @@ -234,18 +234,18 @@ fs_config_set( const char *name, const char *value )
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;
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;
10431 fs_config->channelmode = fs_mode_for_channels( channels );
10434 D_ERROR( "FusionSound/Config '%s': No value specified!\n", name );
10435 - return DFB_INVARG;
10436 + return DR_INVARG;
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;
10448 fs_config->channelmode = mode;
10451 D_ERROR( "FusionSound/Config '%s': No value specified!\n", name );
10452 - return DFB_INVARG;
10453 + return DR_INVARG;
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;
10465 fs_config->sampleformat = format;
10468 D_ERROR( "FusionSound/Config '%s': No format specified!\n", name );
10469 - return DFB_INVARG;
10470 + return DR_INVARG;
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;
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;
10487 fs_config->samplerate = rate;
10490 D_ERROR( "FusionSound/Config '%s': No value specified!\n", name );
10491 - return DFB_INVARG;
10492 + return DR_INVARG;
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;
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;
10509 fs_config->buffertime = time;
10512 D_ERROR( "FusionSound/Config '%s': No value specified!\n", name );
10513 - return DFB_INVARG;
10514 + return DR_INVARG;
10517 else if (!strcmp( name, "session" )) {
10518 @@ -330,14 +330,14 @@ fs_config_set( const char *name, const char *value )
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;
10526 fs_config->session = session;
10529 D_ERROR( "FusionSound/Config '%s': No value specified!\n", name );
10530 - return DFB_INVARG;
10531 + return DR_INVARG;
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;
10543 if (fs_config->remote.host)
10544 @@ -359,7 +359,7 @@ fs_config_set( const char *name, const char *value )
10547 D_ERROR( "FusionSound/Config '%s': No value specified!\n", name );
10548 - return DFB_INVARG;
10549 + return DR_INVARG;
10552 else if (!strcmp( name, "remote-compression" )) {
10553 @@ -372,12 +372,12 @@ fs_config_set( const char *name, const char *value )
10556 D_ERROR( "FusionSound/Config '%s': Unsupported value '%s'!\n", name, value );
10557 - return DFB_INVARG;
10558 + return DR_INVARG;
10562 D_ERROR( "FusionSound/Config '%s': No value specified!\n", name );
10563 - return DFB_INVARG;
10564 + return DR_INVARG;
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;
10571 else if (fusion_config_set( name, value ) && direct_config_set( name, value ))
10572 - return DFB_UNSUPPORTED;
10573 + return DR_UNSUPPORTED;
10580 +static DirectResult
10581 fs_config_read( const char *filename )
10583 - DFBResult ret = DFB_OK;
10584 + DirectResult ret = DR_OK;
10588 @@ -427,7 +427,7 @@ fs_config_read( const char *filename )
10590 D_DEBUG( "FusionSound/Config: "
10591 "Unable to open config file `%s'!\n", filename );
10595 D_INFO( "FusionSound/Config: "
10596 "Parsing config file '%s'.\n", filename );
10597 @@ -449,7 +449,7 @@ fs_config_read( const char *filename )
10599 ret = fs_config_set( name, value );
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 );
10606 @@ -461,22 +461,22 @@ fs_config_read( const char *filename )
10612 fs_config_init( int *argc, char **argv[] )
10615 + DirectResult ret;
10616 char *home = getenv( "HOME" );
10626 /* Read system settings. */
10627 ret = fs_config_read( SYSCONFDIR"/fusionsoundrc" );
10628 - if (ret && ret != DFB_IO)
10629 + if (ret && ret != DR_IO)
10632 /* Read user settings. */
10633 @@ -487,7 +487,7 @@ fs_config_init( int *argc, char **argv[] )
10634 snprintf( buf, len, "%s/.fusionsoundrc", home );
10636 ret = fs_config_read( buf );
10637 - if (ret && ret != DFB_IO)
10638 + if (ret && ret != DR_IO)
10642 @@ -509,7 +509,7 @@ fs_config_init( int *argc, char **argv[] )
10643 snprintf( buf, len, SYSCONFDIR"/fusionsoundrc.%s", prog );
10645 ret = fs_config_read( buf );
10646 - if (ret && ret != DFB_IO)
10647 + if (ret && ret != DR_IO)
10651 @@ -521,7 +521,7 @@ fs_config_init( int *argc, char **argv[] )
10652 snprintf( buf, len, "%s/.fusionsoundrc.%s", home, prog );
10654 ret = fs_config_read( buf );
10655 - if (ret && ret != DFB_IO)
10656 + if (ret && ret != DR_IO)
10660 @@ -573,5 +573,5 @@ fs_config_init( int *argc, char **argv[] )
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
10675 -DFBResult fs_config_init( int *argc, char **argv[] );
10676 +DirectResult fs_config_init( int *argc, char **argv[] );
10679 * Set indiviual option. Used by config_init(), and FusionSoundSetOption()
10681 -DFBResult fs_config_set( const char *name, const char *value );
10682 +DirectResult fs_config_set( const char *name, const char *value );
10684 const char *fs_config_usage( void );
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;
10695 +static DirectResult
10696 init_fusionsound( int *argc, char **argv[] )
10699 + DirectResult ret;
10701 /* Initialize FusionSound. */
10702 ret = FusionSoundInit( argc, argv );
10703 @@ -72,7 +72,7 @@ init_fusionsound( int *argc, char **argv[] )
10705 return FusionSoundError( "FusionSoundCreate", ret );
10712 @@ -156,7 +156,7 @@ dump_buffers( CoreSound *core )
10714 main( int argc, char *argv[] )
10717 + DirectResult ret;
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
10727 main( int argc, char *argv[] )
10730 + DirectResult ret;
10731 IFusionSound *sound;
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 )
10742 -static DFBEnumerationResult
10743 +static DirectEnumerationResult
10744 track_add_callback( FSTrackID id, FSTrackDescription desc, void *ctx )
10746 Media *media = ctx;
10747 @@ -202,18 +202,18 @@ track_add_callback( FSTrackID id, FSTrackDescription desc, void *ctx )
10748 track = D_MALLOC( sizeof(MediaTrack) );
10751 - return DFENUM_CANCEL;
10752 + return DENUM_CANCEL;
10755 direct_list_append( (DirectLink**)&media->tracks, &track->link );
10757 - return DFENUM_OK;
10762 playback_run( IFusionSoundMusicProvider *provider, Media *media )
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 )
10771 main( int argc, char **argv )
10775 + DirectResult ret;
10778 ret = FusionSoundInit( &argc, &argv );
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 @@
10786 /*****************************************************************************/
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();
10793 -static DFBBoolean keep_alive = DFB_FALSE;
10794 +static bool keep_alive;
10796 /*****************************************************************************/
10799 main( int argc, char *argv[] )
10802 + DirectResult ret;
10804 /* Initialize FusionSound including command line parsing. */
10805 ret = FusionSoundInit( &argc, &argv );
10806 @@ -109,7 +109,7 @@ ConstructDispatcher( VoodooServer *server,
10808 *ret_instance = instance;
10814 /*****************************************************************************/
10815 @@ -130,7 +130,7 @@ usage( const char *progname )
10816 FUSIONSOUND_VERSION, progname );
10821 parse_command_line( int argc, char *argv[] )
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" )) {
10828 - return DFB_FALSE;
10831 else if (!strcmp( argv[i], "-v" ) || !strcmp( argv[i], "--version" )) {
10832 puts( FUSIONSOUND_VERSION );
10835 else if (!strcmp( argv[i], "-k" ) || !strcmp( argv[i], "--keep-alive" )) {
10836 - keep_alive = DFB_TRUE;
10837 + keep_alive = DR_TRUE;
10840 fprintf( stderr, "Unsupported option '%s'!\n", argv[i] );
10841 - return DFB_FALSE;
10851 +static DirectResult
10855 + DirectResult ret;
10856 VoodooServer *server;
10858 ret = voodoo_server_create( &server );
10859 @@ -185,6 +185,6 @@ server_run()
10861 voodoo_server_destroy( server );
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 )
10873 main( int argc, char **argv )
10876 + DirectResult ret;
10877 IFusionSound *sound;
10878 float volume = 0.0f;
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
10885 Fixed types conversion.
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)
10896 - while (DR_TRUE) {
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;
10905 - while (DR_TRUE) {
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" );
10918 - return DFENUM_OK;
10922 static DirectEnumerationResult
10923 @@ -80,7 +80,7 @@ track_playback_callback( FSTrackID id, FSTrackDescription desc, void *ctx )
10924 ret = provider->SelectTrack( provider, id );
10926 FusionSoundError( "IFusionSoundMusicProvider::SelectTrack", ret );
10927 - return DFENUM_OK;
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 );
10935 FusionSoundError( "IFusionSound::CreateStream", ret );
10936 - return DFENUM_CANCEL;
10937 + return DENUM_CANCEL;
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 );
10944 FusionSoundError( "IFusionSoundMusicProvider::PlayTo", ret );
10945 - return DFENUM_CANCEL;
10946 + return DENUM_CANCEL;
10949 /* Update track's description. */
10950 @@ -202,7 +202,7 @@ track_playback_callback( FSTrackID id, FSTrackDescription desc, void *ctx )
10953 case '\033': // Escape
10954 - return DFENUM_CANCEL;
10955 + return DENUM_CANCEL;
10959 @@ -214,7 +214,7 @@ track_playback_callback( FSTrackID id, FSTrackDescription desc, void *ctx )
10963 - return DFENUM_OK;
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;
10976 - if (callback( i, desc, callbackdata ) != DFENUM_OK)
10977 + if (callback( i, desc, callbackdata ))
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,
10988 VoodooResponseMessage *response;
10989 - bool playing = DR_FALSE;
10990 + bool playing = false;
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" )) {
11005 else if (!strcmp( argv[i], "-v" ) || !strcmp( argv[i], "--version" )) {
11006 puts( FUSIONSOUND_VERSION );
11009 else if (!strcmp( argv[i], "-k" ) || !strcmp( argv[i], "--keep-alive" )) {
11010 - keep_alive = DR_TRUE;
11011 + keep_alive = true;
11014 fprintf( stderr, "Unsupported option '%s'!\n", argv[i] );
11024 static DirectResult