# HG changeset patch # User chainsaw # Date 1136924560 28800 # Node ID 7fa1738514d5353202843bfc8280508b2a82ca9d # Parent 97ba91ee699ed48e339f38872b0b32c9d45d77c5 [svn] Convert all input plugins (except timidity & wav-sndfile) to produce_audio. diff -r 97ba91ee699e -r 7fa1738514d5 Plugins/Input/adplug/adplug-xmms.cc --- a/Plugins/Input/adplug/adplug-xmms.cc Mon Jan 09 15:00:10 2006 -0800 +++ b/Plugins/Input/adplug/adplug-xmms.cc Tue Jan 10 12:22:40 2006 -0800 @@ -30,6 +30,10 @@ #include "audacious/plugin.h" #include "libaudacious/util.h" #include "libaudacious/configdb.h" +extern "C" { +#include "audacious/output.h" +} + /***** Defines *****/ @@ -641,12 +645,11 @@ toadd -= (long)(plr.p->getrefresh() * i); } - // write sound buffer and update vis - adplug_ip.add_vis_pcm(adplug_ip.output->written_time(), + // write sound buffer + while(adplug_ip.output->buffer_free() < SNDBUFSIZE * sampsize) xmms_usleep(10000); + produce_audio(adplug_ip.output->written_time(), bit16 ? FORMAT_16 : FORMAT_8, - stereo ? 2 : 1, SNDBUFSIZE * sampsize, sndbuf); - while(adplug_ip.output->buffer_free() < SNDBUFSIZE * sampsize) xmms_usleep(10000); - adplug_ip.output->write_audio(sndbuf, SNDBUFSIZE * sampsize); + stereo ? 2 : 1, SNDBUFSIZE * sampsize, sndbuf, NULL); #if 0 // update infobox, if necessary diff -r 97ba91ee699e -r 7fa1738514d5 Plugins/Input/flac/plugin.c --- a/Plugins/Input/flac/plugin.c Mon Jan 09 15:00:10 2006 -0800 +++ b/Plugins/Input/flac/plugin.c Tue Jan 10 12:22:40 2006 -0800 @@ -24,11 +24,12 @@ #include #include -#include -#include -#include -#include -#include +#include "audacious/plugin.h" +#include "audacious/output.h" +#include "libaudacious/util.h" +#include "libaudacious/configdb.h" +#include "libaudacious/titlestring.h" +#include "libaudacious/vfs.h" #ifdef HAVE_CONFIG_H #include @@ -490,11 +491,11 @@ FLAC__uint64 decode_position; sample_buffer_first_ += n; - flac_ip.add_vis_pcm(flac_ip.output->written_time(), file_info_.sample_format, file_info_.channels, bytes, sample_buffer_start); while(flac_ip.output->buffer_free() < (int)bytes && file_info_.is_playing && file_info_.seek_to_in_sec == -1) xmms_usleep(10000); if(file_info_.is_playing && file_info_.seek_to_in_sec == -1) - flac_ip.output->write_audio(sample_buffer_start, bytes); + produce_audio(flac_ip.output->written_time(), file_info_.sample_format, + file_info_.channels, bytes, sample_buffer_start, NULL); /* compute current bitrate */ diff -r 97ba91ee699e -r 7fa1738514d5 Plugins/Input/modplug/modplugbmp.cpp --- a/Plugins/Input/modplug/modplugbmp.cpp Mon Jan 09 15:00:10 2006 -0800 +++ b/Plugins/Input/modplug/modplugbmp.cpp Tue Jan 10 12:22:40 2006 -0800 @@ -14,6 +14,9 @@ #include "stddefs.h" #include "archive/open.h" #include "libaudacious/configdb.h" +extern "C" { +#include "audacious/output.h" +} // ModplugXMMS member functions =============================== @@ -250,18 +253,14 @@ if(mStopped) break; - mOutPlug->write_audio - ( - mBuffer, - mBufSize - ); - mInPlug->add_vis_pcm + produce_audio ( mPlayed, mFormat, lChannels, mBufSize, - mBuffer + mBuffer, + NULL ); mPlayed += mBufTime; diff -r 97ba91ee699e -r 7fa1738514d5 Plugins/Input/sexypsf/xmms.c --- a/Plugins/Input/sexypsf/xmms.c Mon Jan 09 15:00:10 2006 -0800 +++ b/Plugins/Input/sexypsf/xmms.c Tue Jan 10 12:22:40 2006 -0800 @@ -17,6 +17,7 @@ */ #include "audacious/plugin.h" +#include "audacious/output.h" #include "libaudacious/util.h" #include #include @@ -102,20 +103,18 @@ void sexypsf_update(unsigned char *Buffer, long count) { int mask = ~((((16 / 8) * 2)) - 1); - if(count) - sexypsf_ip.add_vis_pcm(sexypsf_ip.output->written_time(), FMT_S16_NE, 2, count/4, Buffer); while(count>0) { int t=sexypsf_ip.output->buffer_free() & mask; if(t>count) { - sexypsf_ip.output->write_audio(Buffer,count); + produce_audio(sexypsf_ip.output->written_time(), FMT_S16_NE, 2, count, Buffer, NULL); } else { if(t) - sexypsf_ip.output->write_audio(Buffer,t); + produce_audio(sexypsf_ip.output->written_time(), FMT_S16_NE, 2, t, Buffer, NULL); usleep((count-t)*1000*5/441/2); } count-=t; diff -r 97ba91ee699e -r 7fa1738514d5 Plugins/Input/tonegen/tonegen.c --- a/Plugins/Input/tonegen/tonegen.c Mon Jan 09 15:00:10 2006 -0800 +++ b/Plugins/Input/tonegen/tonegen.c Tue Jan 10 12:22:40 2006 -0800 @@ -18,6 +18,7 @@ */ #include "audacious/plugin.h" +#include "audacious/output.h" #include "libaudacious/util.h" #include "config.h" #include @@ -104,12 +105,9 @@ data[i] = rint(((1 << 15) - 1) * (sum_sines / frequencies->len)); } - tone_ip.add_vis_pcm(tone_ip.output->written_time(), - FMT_S16_NE, 1, BUF_BYTES, data); while (tone_ip.output->buffer_free() < BUF_BYTES && going) xmms_usleep(30000); - if (going) - tone_ip.output->write_audio(data, BUF_BYTES); + produce_audio(tone_ip.output->written_time(), FMT_S16_NE, 1, BUF_BYTES, data, &going); } g_array_free(frequencies, TRUE);