2
generic interactive controler
3
Copyright (C) 1998 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
15
// Set for local include
16
#define DIRECT_INCLUDE
18
#include "../yafcore/yaf_control.h"
19
#include "../yafxplayer/inputDecoderYAF.h"
26
// we include our plugin here
27
#include "../../../lib/decoder/splayPlugin.h"
29
#if defined(HAVE_GETOPT_H)
34
void control_splay(InputInterface* input,OutputInterface* output,
35
InputDecoder* decoder) {
38
cout<< "Command:0 Msg:protocol yaf-0.1" << endl;
39
cout<< "Command:0 Msg:implements xplayer" << endl;
40
cout<< "Command:0 Msg:decoder splay Version:0.8.2" << endl;
41
cout<< "Command:0 Msg:mimetypes audio/mpg1;audio/mpg2;audio/mp3;" << endl;
42
cout<< "Command:0 Msg:comment splay by Woo-jae Jung" << endl;
43
cout<< "Command:0 Msg:comment yaf port by mvogt@rhrk.uni-kl.de"<<endl;
44
cout<< "Command:0 Msg:comment based on sources from eMusic and splay"<<endl;
45
cout<< "Command:0 Msg:comment enter 'help' " << endl;
49
yaf_control(input,output,decoder);
54
cout << "yaf-splay is a interactive frontend for the splay decoder"<<endl;
55
cout << "Usage : yaf-splay [-2am] [url]"<<endl;
57
cout << "-2 : playing with half frequency."<<endl;
58
cout << "-m : force to mono."<<endl;
59
cout << "-r : autoupdate musicinfo"<<endl;
60
cout << "-a : no internal audio device"<<endl;
61
cout << "-c : no time calculation"<<endl;
62
cout << "-y : autoplay off"<<endl;
63
cout << "-d : only decode"<<endl;
65
cout << "THIS SOFTWARE COMES WITH ABSOLUTELY NO WARRANTY! " \
66
<< "USE AT YOUR OWN RISK!"<<endl;
68
cout << "for more help type 'help' in interactive mode"<<endl;
73
int main(int argc, char** argv) {
75
int lInternalAudio=true;
78
pow(6.0,3.0); // fixes bug in __math.h
83
InputInterface* input=new InputInterface();
85
OutputInterface output(&cout);
87
YafOutputStream* yafOutput=new YafOutputStream(input);
90
SplayPlugin* plugin=new SplayPlugin();
92
plugin->setOutputPlugin(yafOutput);
93
InputDecoderYAF decoder(plugin,yafOutput);
98
c = getopt (argc, argv, "2yamhd");
102
lInternalAudio=false;
110
plugin->config("-2","true",NULL);
114
decoder.setAutoPlay(false);
118
plugin->config("-m","true",NULL);
122
plugin->config("runtime","on",NULL);
126
plugin->config("-d","on",NULL);
130
plugin->config("-c","true",NULL);
134
printf ("?? getopt returned character code 0%o ??\n", c);
139
if (optind < argc ) {
141
buffer.append("open ");
142
buffer.append(argv[optind]);
145
input->addInputLine(&buffer);
151
yafOutput->internalDevice(lInternalAudio);
152
control_splay(input,&output,&decoder);