diff options
Diffstat (limited to 'src/audio_out/audio_fusionsound_out.c')
-rw-r--r-- | src/audio_out/audio_fusionsound_out.c | 84 |
1 files changed, 42 insertions, 42 deletions
diff --git a/src/audio_out/audio_fusionsound_out.c b/src/audio_out/audio_fusionsound_out.c index 7db9e1ad2..c3455fd14 100644 --- a/src/audio_out/audio_fusionsound_out.c +++ b/src/audio_out/audio_fusionsound_out.c @@ -1,13 +1,13 @@ /* * Copyright (C) 2000-2006 the xine project and Claudio Ciccani - * + * * This file is part of xine, a free video player. - * + * * xine is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. - * + * * xine is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the @@ -47,7 +47,7 @@ #define FUSIONSOUND_VERSION_CODE VERSION_CODE( FUSIONSOUND_MAJOR_VERSION, \ FUSIONSOUND_MINOR_VERSION, \ FUSIONSOUND_MICRO_VERSION ) - + #if FUSIONSOUND_VERSION_CODE >= VERSION_CODE(1,1,0) # include <fusionsound_limits.h> /* defines FS_MAX_CHANNELS */ #else @@ -75,10 +75,10 @@ typedef struct fusionsound_driver_s { float vol; int vol_mute; - + float amp; int amp_mute; - + int paused; } fusionsound_driver_t; @@ -96,12 +96,12 @@ static int ao_fusionsound_open(ao_driver_t *ao_driver, DFBResult ret; lprintf ("ao_open( bits=%d, rate=%d, mode=%d )\n", bits, rate, mode); - - dsc.flags = FSSDF_BUFFERSIZE | FSBDF_CHANNELS | + + dsc.flags = FSSDF_BUFFERSIZE | FSBDF_CHANNELS | FSSDF_SAMPLEFORMAT | FSSDF_SAMPLERATE; switch (mode) { - case AO_CAP_MODE_MONO: + case AO_CAP_MODE_MONO: dsc.channels = 1; break; case AO_CAP_MODE_STEREO: @@ -168,13 +168,13 @@ static int ao_fusionsound_open(ao_driver_t *ao_driver, this->playback->Release (this->playback); this->playback = NULL; } - + if (this->stream) { this->stream->Release (this->stream); this->stream = NULL; } - - ret = this->sound->CreateStream (this->sound, &dsc, &this->stream); + + ret = this->sound->CreateStream (this->sound, &dsc, &this->stream); if (ret != DFB_OK) { xprintf (this->xine, XINE_VERBOSITY_LOG, "audio_fusionsound_out: IFusionSound::CreateStream() failed [%s]\n", @@ -188,10 +188,10 @@ static int ao_fusionsound_open(ao_driver_t *ao_driver, this->channels = dsc.channels; this->rate = dsc.samplerate; this->bytes_per_frame = this->channels * FS_BYTES_PER_SAMPLE(this->format); - + ret = this->stream->GetPlayback (this->stream, &this->playback); if (ret == DFB_OK) { - this->playback->SetVolume (this->playback, + this->playback->SetVolume (this->playback, (this->vol_mute ? 0 : this->vol) * (this->amp_mute ? 0 : this->amp)); if (this->paused) @@ -210,22 +210,22 @@ static int ao_fusionsound_open(ao_driver_t *ao_driver, static int ao_fusionsound_num_channels(ao_driver_t *ao_driver) { fusionsound_driver_t *this = (fusionsound_driver_t *) ao_driver; - + return this->channels; } static int ao_fusionsound_bytes_per_frame(ao_driver_t *ao_driver) { fusionsound_driver_t *this = (fusionsound_driver_t *) ao_driver; - + return this->bytes_per_frame; } static int ao_fusionsound_delay(ao_driver_t *ao_driver) { fusionsound_driver_t *this = (fusionsound_driver_t *) ao_driver; int delay = 0; - + this->stream->GetPresentationDelay (this->stream, &delay); - + return (delay * this->rate / 1000); } @@ -237,7 +237,7 @@ static int ao_fusionsound_write(ao_driver_t *ao_driver, int16_t *data, uint32_t num_frames) { fusionsound_driver_t *this = (fusionsound_driver_t *) ao_driver; DFBResult ret; - + if (this->paused) { xprintf (this->xine, XINE_VERBOSITY_DEBUG, "audio_fusionsound_out: " @@ -254,7 +254,7 @@ static int ao_fusionsound_write(ao_driver_t *ao_driver, FusionSoundErrorString (ret)); return 0; } - + return num_frames; } @@ -278,15 +278,15 @@ static void ao_fusionsound_close(ao_driver_t *ao_driver){ */ static uint32_t ao_fusionsound_get_capabilities(ao_driver_t *ao_driver) { - uint32_t caps = AO_CAP_MODE_MONO | AO_CAP_MODE_STEREO | + uint32_t caps = AO_CAP_MODE_MONO | AO_CAP_MODE_STEREO | AO_CAP_MIXER_VOL | AO_CAP_MUTE_VOL | AO_CAP_8BITS | AO_CAP_16BITS | - AO_CAP_24BITS; + AO_CAP_24BITS; #if FUSIONSOUND_VERSION_CODE >= VERSION_CODE(0,9,26) caps |= AO_CAP_FLOAT32; #endif #if FS_MAX_CHANNELS > 2 - caps |= AO_CAP_MODE_4CHANNEL | AO_CAP_MODE_4_1CHANNEL | + caps |= AO_CAP_MODE_4CHANNEL | AO_CAP_MODE_4_1CHANNEL | AO_CAP_MODE_5CHANNEL | AO_CAP_MODE_5_1CHANNEL; #endif return caps; @@ -297,13 +297,13 @@ static void ao_fusionsound_exit(ao_driver_t *ao_driver) { if (this->playback) this->playback->Release (this->playback); - + if (this->stream) this->stream->Release (this->stream); if (this->sound) this->sound->Release (this->sound); - + free (this); } @@ -320,17 +320,17 @@ static int ao_fusionsound_get_property(ao_driver_t *ao_driver, int property) { xprintf (this->xine, XINE_VERBOSITY_DEBUG, "audio_fusionsound_out: volume mute is %d\n", this->vol_mute); return this->vol_mute; - + case AO_PROP_AMP: xprintf (this->xine, XINE_VERBOSITY_DEBUG, "audio_fusionsound_out: amplifier is %.2f\n", this->amp); return (int) (this->amp * 100.0); - + case AO_PROP_AMP_MUTE: xprintf (this->xine, XINE_VERBOSITY_DEBUG, "audio_fusionsound_out: amplifier mute is %d\n", this->amp_mute); return this->amp_mute; - + default: break; } @@ -338,10 +338,10 @@ static int ao_fusionsound_get_property(ao_driver_t *ao_driver, int property) { return 0; } -static int ao_fusionsound_set_property(ao_driver_t *ao_driver, +static int ao_fusionsound_set_property(ao_driver_t *ao_driver, int property, int value ) { fusionsound_driver_t *this = (fusionsound_driver_t *) ao_driver; - + if (!this->playback) return 0; @@ -351,11 +351,11 @@ static int ao_fusionsound_set_property(ao_driver_t *ao_driver, xprintf (this->xine, XINE_VERBOSITY_DEBUG, "audio_fusionsound_out: volume set to %.2f\n", this->vol); break; - + case AO_PROP_MUTE_VOL: this->vol_mute = value ? 1 : 0; xprintf (this->xine, XINE_VERBOSITY_DEBUG, - "audio_fusionsound_out: volume mute set to %d\n", + "audio_fusionsound_out: volume mute set to %d\n", this->vol_mute); break; @@ -364,20 +364,20 @@ static int ao_fusionsound_set_property(ao_driver_t *ao_driver, xprintf (this->xine, XINE_VERBOSITY_DEBUG, "audio_fusionsound_out: amplifier set to %.2f\n", this->amp); break; - + case AO_PROP_AMP_MUTE: this->amp_mute = value ? 1 : 0; xprintf (this->xine, XINE_VERBOSITY_DEBUG, - "audio_fusionsound_out: amplifier mute set to %d\n", + "audio_fusionsound_out: amplifier mute set to %d\n", this->amp_mute); break; default: return 0; } - + if (this->playback) { - this->playback->SetVolume (this->playback, + this->playback->SetVolume (this->playback, (this->vol_mute ? 0 : this->vol) * (this->amp_mute ? 0 : this->amp)); } @@ -395,10 +395,10 @@ static int ao_fusionsound_control(ao_driver_t *ao_driver, int cmd, ...) { this->playback->Stop (this->playback); this->paused = 1; return 1; - + case AO_CTRL_PLAY_RESUME: lprintf ("Resume()\n"); - if (this->playback) + if (this->playback) this->playback->Continue (this->playback); this->paused = 0; return 1; @@ -417,7 +417,7 @@ static int ao_fusionsound_control(ao_driver_t *ao_driver, int cmd, ...) { } -static ao_driver_t* open_plugin(audio_driver_class_t *ao_class, +static ao_driver_t* open_plugin(audio_driver_class_t *ao_class, const void *data ) { fusionsound_class_t *class = (fusionsound_class_t *) ao_class; fusionsound_driver_t *this; @@ -457,7 +457,7 @@ static ao_driver_t* open_plugin(audio_driver_class_t *ao_class, this->ao_driver.exit = ao_fusionsound_exit; this->ao_driver.get_gap_tolerance = ao_fusionsound_get_gap_tolerance; this->ao_driver.control = ao_fusionsound_control; - + this->vol = this->amp = 1.0; return &this->ao_driver; @@ -470,7 +470,7 @@ static ao_driver_t* open_plugin(audio_driver_class_t *ao_class, static void* init_class(xine_t *xine, void *data) { fusionsound_class_t *class; const char *error; - + /* check FusionSound version */ error = FusionSoundCheckVersion( FUSIONSOUND_MAJOR_VERSION, FUSIONSOUND_MINOR_VERSION, @@ -506,7 +506,7 @@ static const ao_info_t ao_info_fusionsound = { */ const plugin_info_t xine_plugin_info[] EXPORTED = { - /* type, API, "name", version, special_info, init_function */ + /* type, API, "name", version, special_info, init_function */ { PLUGIN_AUDIO_OUT, AO_OUT_FS_IFACE_VERSION, "FusionSound", XINE_VERSION_CODE, &ao_info_fusionsound, init_class }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } |