comparison Plugins/Input/adplug/adplug-xmms.cc @ 414:7fa1738514d5 trunk

[svn] Convert all input plugins (except timidity & wav-sndfile) to produce_audio.
author chainsaw
date Tue, 10 Jan 2006 12:22:40 -0800
parents db298f2d3dd9
children fc1788e1ab04
comparison
equal deleted inserted replaced
413:97ba91ee699e 414:7fa1738514d5
28 #include "silentopl.h" 28 #include "silentopl.h"
29 #include "players.h" 29 #include "players.h"
30 #include "audacious/plugin.h" 30 #include "audacious/plugin.h"
31 #include "libaudacious/util.h" 31 #include "libaudacious/util.h"
32 #include "libaudacious/configdb.h" 32 #include "libaudacious/configdb.h"
33 extern "C" {
34 #include "audacious/output.h"
35 }
36
33 37
34 /***** Defines *****/ 38 /***** Defines *****/
35 39
36 // Version string 40 // Version string
37 #define ADPLUG_NAME "AdPlug" 41 #define ADPLUG_NAME "AdPlug"
639 opl.update((short *)sndbufpos, i); 643 opl.update((short *)sndbufpos, i);
640 sndbufpos += i * sampsize; towrite -= i; 644 sndbufpos += i * sampsize; towrite -= i;
641 toadd -= (long)(plr.p->getrefresh() * i); 645 toadd -= (long)(plr.p->getrefresh() * i);
642 } 646 }
643 647
644 // write sound buffer and update vis 648 // write sound buffer
645 adplug_ip.add_vis_pcm(adplug_ip.output->written_time(), 649 while(adplug_ip.output->buffer_free() < SNDBUFSIZE * sampsize) xmms_usleep(10000);
650 produce_audio(adplug_ip.output->written_time(),
646 bit16 ? FORMAT_16 : FORMAT_8, 651 bit16 ? FORMAT_16 : FORMAT_8,
647 stereo ? 2 : 1, SNDBUFSIZE * sampsize, sndbuf); 652 stereo ? 2 : 1, SNDBUFSIZE * sampsize, sndbuf, NULL);
648 while(adplug_ip.output->buffer_free() < SNDBUFSIZE * sampsize) xmms_usleep(10000);
649 adplug_ip.output->write_audio(sndbuf, SNDBUFSIZE * sampsize);
650 653
651 #if 0 654 #if 0
652 // update infobox, if necessary 655 // update infobox, if necessary
653 if(plr.infobox && plr.playing) update_infobox(); 656 if(plr.infobox && plr.playing) update_infobox();
654 #endif 657 #endif