changeset 1685:8c93d207a4d9

effects_enabled() craq removed
author William Pitcock <nenolod@atheme.org>
date Tue, 11 Sep 2007 06:04:15 -0500
parents 48272eee788f
children 2e8adf61c54f
files src/OSS/audio.c src/OSS4/audio.c src/alsa/audio.c src/arts/audio.c src/esd/audio.c src/filewriter/filewriter.c src/jack/jack.c src/null/null.c src/sun/audio.c
diffstat 9 files changed, 0 insertions(+), 280 deletions(-) [+]
line wrap: on
line diff
--- a/src/OSS/audio.c	Mon Sep 10 00:57:50 2007 -0500
+++ b/src/OSS/audio.c	Tue Sep 11 06:04:15 2007 -0500
@@ -274,35 +274,7 @@
 {
 
     audio_buf_info abuf_info;
-#if 0
-    AFormat new_format;
-    int new_frequency, new_channels;
-    EffectPlugin *ep;
 
-    new_format = input.format.xmms;
-    new_frequency = input.frequency;
-    new_channels = input.channels;
-
-
-    ep = get_current_effect_plugin();
-    if (effects_enabled() && ep && ep->query_format) {
-        ep->query_format(&new_format, &new_frequency, &new_channels);
-    }
-
-    if (new_format != effect.format.xmms ||
-        new_frequency != effect.frequency ||
-        new_channels != effect.channels) {
-        output_time_offset += (output_bytes * 1000) / output.bps;
-        output_bytes = 0;
-        close(fd);
-        fd = open(device_name, O_WRONLY);
-        oss_setup_format(new_format, new_frequency, new_channels);
-    }
-    if (effects_enabled() && ep && ep->mod_samples)
-        length = ep->mod_samples(&data, length,
-                                 input.format.xmms,
-                                 input.frequency, input.channels);
-#endif
     if (realtime && !ioctl(fd, SNDCTL_DSP_GETOSPACE, &abuf_info)) {
         while (abuf_info.bytes < length) {
             g_usleep(10000);
--- a/src/OSS4/audio.c	Mon Sep 10 00:57:50 2007 -0500
+++ b/src/OSS4/audio.c	Tue Sep 11 06:04:15 2007 -0500
@@ -274,35 +274,7 @@
 {
 
     audio_buf_info abuf_info;
-#if 0
-    AFormat new_format;
-    int new_frequency, new_channels;
-    EffectPlugin *ep;
 
-    new_format = input.format.xmms;
-    new_frequency = input.frequency;
-    new_channels = input.channels;
-
-
-    ep = get_current_effect_plugin();
-    if (effects_enabled() && ep && ep->query_format) {
-        ep->query_format(&new_format, &new_frequency, &new_channels);
-    }
-
-    if (new_format != effect.format.xmms ||
-        new_frequency != effect.frequency ||
-        new_channels != effect.channels) {
-        output_time_offset += (output_bytes * 1000) / output.bps;
-        output_bytes = 0;
-        close(fd);
-        fd = open(device_name, O_WRONLY);
-        oss_setup_format(new_format, new_frequency, new_channels);
-    }
-    if (effects_enabled() && ep && ep->mod_samples)
-        length = ep->mod_samples(&data, length,
-                                 input.format.xmms,
-                                 input.frequency, input.channels);
-#endif
     if (realtime && !ioctl(fd, SNDCTL_DSP_GETOSPACE, &abuf_info)) {
         while (abuf_info.bytes < length) {
             g_usleep(10000);
--- a/src/alsa/audio.c	Mon Sep 10 00:57:50 2007 -0500
+++ b/src/alsa/audio.c	Tue Sep 11 06:04:15 2007 -0500
@@ -708,36 +708,6 @@
 	if (paused)
 		return;
 
-#if 0
-	new_freq = inputf->rate;
-	new_chn = inputf->channels;
-	f = inputf->xmms_format;
-
-	if (effects_enabled() && (ep = get_current_effect_plugin()) &&
-	    ep->query_format)
-		ep->query_format(&f, &new_freq, &new_chn);
-
-	if (f != effectf->xmms_format || (unsigned int)new_freq != effectf->rate ||
-	    (unsigned int)new_chn != effectf->channels)
-	{
-		debug("Changing audio format for effect plugin");
-		g_free(effectf);
-		effectf = snd_format_from_xmms(f, new_freq, new_chn);
-		if (alsa_reopen(effectf) < 0)
-		{
-			/* fatal error... */
-			alsa_close();
-			return;
-		}
-	}
-
-	if (ep)
-		length = ep->mod_samples(&data, length,
-					 inputf->xmms_format,
-					 inputf->rate,
-					 inputf->channels);
-#endif
-
 	if (alsa_convert_func != NULL)
 		length = alsa_convert_func(convertb, &data, length);
 	if (alsa_stereo_convert_func != NULL)
--- a/src/arts/audio.c	Mon Sep 10 00:57:50 2007 -0500
+++ b/src/arts/audio.c	Tue Sep 11 06:04:15 2007 -0500
@@ -276,48 +276,6 @@
 
 void artsxmms_write(gpointer ptr, int length)
 {
-#if 0
-	AFormat new_format;
-	int new_frequency, new_channels;
-	EffectPlugin *ep;
-	
-	new_format = input_params.format;
-	new_frequency = input_params.frequency;
-	new_channels = input_params.channels;
-
-	ep = get_current_effect_plugin();
-	if (effects_enabled() && ep && ep->query_format)
-		ep->query_format(&new_format, &new_frequency, &new_channels);
-	
-	if (new_format != output_params.format ||
-	    new_frequency != output_params.frequency ||
-	    new_channels != output_params.channels)
-	{
-		/*
-		 * The effect plugins has changed the format of the stream.
-		 */
-
-		guint64 offset = (written * 1000) / output_params.bps;
-		artsxmms_set_params(&output_params, new_format,
-				    new_frequency, new_channels);
-		arts_convert_func = arts_get_convert_func(output_params.format);
-	
-		written = (offset * output_params.bps) / 1000;
-
-		artsxmms_helper_init(&output_params);
-	}
-
-	/*
-	 * Doing the effect plugin processing here adds some latency,
-	 * but the alternative is just too frigging hairy.
-	 */
-	
-	if (effects_enabled() && ep && ep->mod_samples)
-		length = ep->mod_samples(&ptr, length, input_params.format,
-					 input_params.frequency,
-					 input_params.channels);
-#endif
-
 	if (arts_convert_func)
 		arts_convert_func(ptr, length);
 
--- a/src/esd/audio.c	Mon Sep 10 00:57:50 2007 -0500
+++ b/src/esd/audio.c	Tue Sep 11 06:04:15 2007 -0500
@@ -273,35 +273,6 @@
 static void
 esdout_write_audio(gpointer data, gint length)
 {
-#if 0
-    AFormat new_format;
-    gint new_frequency, new_channels;
-    EffectPlugin *ep;
-
-    new_format = input_format;
-    new_frequency = input_frequency;
-    new_channels = input_channels;
-
-    ep = get_current_effect_plugin();
-    if (effects_enabled() && ep && ep->query_format) {
-        ep->query_format(&new_format, &new_frequency, &new_channels);
-    }
-
-    if (new_format != format || new_frequency != frequency
-        || new_channels != channels) {
-        output_time_offset += (gint) ((output_bytes * 1000) / ebps);
-        output_bytes = 0;
-        esdout_setup_format(new_format, new_frequency, new_channels);
-        frequency = new_frequency;
-        channels = new_channels;
-        esd_close(fd);
-        esdout_set_audio_params();
-    }
-    if (effects_enabled() && ep && ep->mod_samples)
-        length =
-            ep->mod_samples(&data, length, input_format, input_frequency,
-                            input_channels);
-#endif
     while (length > 0) {
         int num_written;
         if (esd_translate)
--- a/src/filewriter/filewriter.c	Mon Sep 10 00:57:50 2007 -0500
+++ b/src/filewriter/filewriter.c	Tue Sep 11 06:04:15 2007 -0500
@@ -321,26 +321,6 @@
 
 static void file_write(void *ptr, gint length)
 {
-    AFormat new_format;
-    int new_frequency, new_channels;
-    EffectPlugin *ep;
-
-    new_format = input.format;
-    new_frequency = input.frequency;
-    new_channels = input.channels;
-
-    ep = get_current_effect_plugin();
-    if ( effects_enabled() && ep && ep->query_format ) {
-        ep->query_format(&new_format,&new_frequency,&new_channels);
-    }
-
-    if ( effects_enabled() && ep && ep->mod_samples ) {
-        length = ep->mod_samples(&ptr,length,
-                                 input.format,
-                                 input.frequency,
-                                 input.channels );
-    }
-
     if (input.format == FMT_S8 || input.format == FMT_S16_BE ||
         input.format == FMT_U16_LE || input.format == FMT_U16_BE ||
         input.format == FMT_U16_NE)
--- a/src/jack/jack.c	Mon Sep 10 00:57:50 2007 -0500
+++ b/src/jack/jack.c	Tue Sep 11 06:04:15 2007 -0500
@@ -429,72 +429,9 @@
 void jack_write(gpointer ptr, gint length)
 {
   long written;
-#if 0
-  EffectPlugin *ep;
-  AFormat new_format;
-  int new_frequency, new_channels;
-  long positionMS;
-#endif
 
   TRACE("starting length of %d\n", length);
 
-#if 0
-  /* copy the current values into temporary values */
-  new_format = input.format;
-  new_frequency = input.frequency;
-  new_channels = input.channels;
-
-  /* query xmms for the current plugin */
-  ep = get_current_effect_plugin();
-  if(effects_enabled() && ep && ep->query_format)
-  {
-    ep->query_format(&new_format, &new_frequency, &new_channels);
-  }
-
-  /* if the format has changed take this into account by modifying */
-  /* the time offset and reopening the device with the new format settings */
-  if (new_format != effect.format ||
-      new_frequency != effect.frequency ||
-      new_channels != effect.channels)
-  {
-    TRACE("format changed, storing new values and opening/closing jack\n");
-    TRACE("effect.format == %d, new_format == %d, effect.frequency == %ld, new_frequency == %d, effect.channels == %d, new_channels = %d\n",
-	  effect.format, new_format, effect.frequency, new_frequency, effect.channels, new_channels);
-
-    positionMS = JACK_GetPosition(driver, MILLISECONDS, PLAYED);
-
-    jack_close();
-    jack_open(new_format, new_frequency, new_channels);
-
-    /* restore the position after the open and close */
-    JACK_SetState(driver, PAUSED);
-    JACK_SetPosition(driver, MILLISECONDS, positionMS);
-    JACK_SetState(driver, PLAYING);
-  }
-
-  /* if effects are enabled and we have a plugin, run the current */
-  /* samples through the plugin */
-  if (effects_enabled() && ep && ep->mod_samples)
-  {
-    length = ep->mod_samples(&ptr, length,
-                             input.format,
-                             input.frequency,
-                             input.channels);
-    TRACE("effects_enabled(), length is now %d\n", length);
-  }
-
-  TRACE("effect.frequency == %ld, input.frequency == %ld, output.frequency == %ld\n",
-        effect.frequency, input.frequency, output.frequency);
-
-  /* if we need rate conversion, perform it here */
-  if((effect.frequency != output.frequency) && isXmmsFrequencyAvailable)
-  {
-    TRACE("performing rate conversion from '%ld'(effect) to '%ld'(output)\n", effect.frequency, output.frequency);
-    length = freq_convert (convertb, &ptr, length, effect.frequency, output.frequency);
-  }
-
-  TRACE("length = %d\n", length);
-#endif
   /* loop until we have written all the data out to the jack device */
   /* this is due to xmms' audio driver api */
   char *buf = (char*)ptr;
--- a/src/null/null.c	Mon Sep 10 00:57:50 2007 -0500
+++ b/src/null/null.c	Tue Sep 11 06:04:15 2007 -0500
@@ -149,22 +149,12 @@
 
 static void null_write(void *ptr, int length)
 {
-#if 0
-	EffectPlugin *ep;
-#endif
 	if (timer && !started)
 	{
 		g_timer_start(timer);
 		started = TRUE;
 	}
 
-#if 0
-	if ((ep = get_current_effect_plugin()) != NULL &&
-	    effects_enabled() && ep->mod_samples)
-		ep->mod_samples(&ptr, length, input_format.format,
-				input_format.frequency, input_format.channels);
-#endif
-
 	written += length;
 }
 
--- a/src/sun/audio.c	Mon Sep 10 00:57:50 2007 -0500
+++ b/src/sun/audio.c	Tue Sep 11 06:04:15 2007 -0500
@@ -309,36 +309,6 @@
 
 static inline void sun_write_audio(gpointer data, int length)
 {
-#if 0
-	AFormat new_format;
-	EffectPlugin *ep;
-	int new_frequency, new_channels;
-
-	new_format = input.format.xmms;
-	new_frequency = input.frequency;
-	new_channels = input.channels;
-
-	ep = get_current_effect_plugin();
-	if (effects_enabled() && ep && ep->query_format)
-		ep->query_format(&new_format, &new_frequency, &new_channels);
-
-	if (new_format != effect.format.xmms || 
-	    new_frequency != effect.frequency ||
-	    new_channels != effect.channels)
-	{
-		output_time_offset += (output_bytes * 1000) / output.bps;
-		output_bytes = 0;
-		close(audio.fd);
-		audio.fd = open(audio.devaudio, O_RDWR);
-		sun_setformat(new_format, new_frequency, new_channels);
-	}
-	if (effects_enabled() && ep && ep->mod_samples)
-	{
-		length = ep->mod_samples(&data, length, input.format.xmms,
-					 input.frequency, input.channels);
-	}
-#endif
-
 	if (sun_convert != NULL)
 		length = sun_convert(&data, length);