2
generic interactive controler
3
Copyright (C) 2000 Martin Vogt
5
This program is free software; you can redistribute it and/or modify
6
it under the terms of the GNU Library General Public License as published by
7
the Free Software Foundation.
9
For more information look at the file COPYRIGHT in this package
14
// Set for local include
15
#define DIRECT_INCLUDE
17
#include "../yafcore/yaf_control.h"
18
#include "../yafxplayer/inputDecoderYAF.h"
27
// for dynamic loading
30
#include "../../../lib/decoder/vorbisPlugin.h"
32
#if defined(HAVE_GETOPT_H)
39
void control_vorbis(InputInterface* input,OutputInterface* output,
40
InputDecoder* decoder) {
43
cout<< "Command:0 Msg:protocol yaf-0.1" << endl;
44
cout<< "Command:0 Msg:implements xplayer" << endl;
45
cout<< "Command:0 Msg:decoder vorbis Version:20000223" << endl;
46
cout<< "Command:0 Msg:mimetypes audio/ogg;" << endl;
47
cout<< "Command:0 Msg:comment vorbis by Monty http://www.xiph.org/" << endl;
48
cout<< "Command:0 Msg:comment yaf port by mvogt@rhrk.uni-kl.de"<<endl;
49
cout<< "Command:0 Msg:comment based on sources from vorbis"<<endl;
50
cout<< "Command:0 Msg:comment enter 'help' " << endl;
56
yaf_control(input,output,decoder);
61
cout << "yaf-vorbis is a interactive frontend for the vorbis decoder"<<endl;
62
cout << "Usage : yaf-vorbis [url]"<<endl;
64
cout << "-a : no internal audio device"<<endl;
65
cout << "-y : autoplay off"<<endl;
67
cout << "THIS SOFTWARE COMES WITH ABSOLUTELY NO WARRANTY! " \
68
<< "USE AT YOUR OWN RISK!"<<endl;
70
cout << "for more help type 'help' in interactive mode"<<endl;
75
int main(int argc, char** argv) {
77
int lInternalAudio=true;
80
pow(6.0,3.0); // fixes bug in __math.h
81
InputInterface* input=new InputInterface();
82
OutputInterface output(&cout);
84
YafOutputStream* yafOutput=new YafOutputStream(input);
87
VorbisPlugin* plugin=new VorbisPlugin();
89
plugin->setOutputPlugin(yafOutput);
90
InputDecoderYAF decoder(plugin,yafOutput);
95
c = getopt (argc, argv, "2amhy");
107
plugin->config("-2","true",NULL);
111
decoder.setAutoPlay(false);
115
plugin->config("-m","true",NULL);
119
plugin->config("runtime","on",NULL);
123
plugin->config("-c","true",NULL);
127
printf ("?? getopt returned character code 0%o ??\n", c);
132
if (optind < argc ) {
134
buffer.append("open ");
135
buffer.append(argv[optind]);
138
input->addInputLine(&buffer);
144
yafOutput->internalDevice(lInternalAudio);
145
control_vorbis(input,&output,&decoder);