summaryrefslogtreecommitdiff
path: root/src/audio_out/audio_fusionsound_out.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/audio_out/audio_fusionsound_out.c')
-rw-r--r--src/audio_out/audio_fusionsound_out.c76
1 files changed, 38 insertions, 38 deletions
diff --git a/src/audio_out/audio_fusionsound_out.c b/src/audio_out/audio_fusionsound_out.c
index 6c3a0ae33..873ab32e9 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
@@ -69,10 +69,10 @@ typedef struct fusionsound_driver_s {
float vol;
int vol_mute;
-
+
float amp;
int amp_mute;
-
+
int paused;
} fusionsound_driver_t;
@@ -90,12 +90,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:
@@ -140,13 +140,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",
@@ -160,10 +160,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)
@@ -182,22 +182,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);
}
@@ -209,7 +209,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: "
@@ -226,7 +226,7 @@ static int ao_fusionsound_write(ao_driver_t *ao_driver,
FusionSoundErrorString (ret));
return 0;
}
-
+
return num_frames;
}
@@ -264,13 +264,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);
}
@@ -287,17 +287,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;
}
@@ -305,10 +305,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;
@@ -318,11 +318,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;
@@ -331,20 +331,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));
}
@@ -362,10 +362,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;
@@ -384,7 +384,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;
@@ -424,7 +424,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;
@@ -449,7 +449,7 @@ static void dispose_class(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,
@@ -485,7 +485,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 }