3
Example how the plugin interface works.(LINUX Open Sound System only!)
12
#include "../../lib/decoder/tplayPlugin.h"
13
#include "../../lib/decoder/nukePlugin.h"
18
int main(int argc, char** argv) {
23
printf("%s filename\n\n",argv[0]);
28
// The order is important !!!!
34
// you cannot set the input _before_ the output
35
// in fact you can, but this gives you a segfault!
37
DecoderPlugin* plugin=new TplayPlugin();
38
//DecoderPlugin* plugin=new NukePlugin();
39
OutputStream* out=OutPlugin::createOutputStream(_OUTPUT_LOCAL,true);
40
InputStream* in=InputPlugin::createInputStream(argv[1],true);
42
// The plugin does not do "open"
46
plugin->setOutputPlugin(out);
47
plugin->setInputPlugin(in);
53
while(plugin->getStreamState() != _STREAM_STATE_EOF) {
54
TimeWrapper::sleep(1);
56
cout << "plugin eof"<<endl;