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
16
// Set for local include
17
#define DIRECT_INCLUDE
19
#include "../yafcore/yaf_control.h"
20
#include "../yafxplayer/inputDecoderYAF.h"
32
#if defined(HAVE_GETOPT_H)
36
// we include our plugin here
37
#include "../../../lib/decoder/cddaPlugin.h"
39
#if defined(HAVE_GETOPT_H)
47
void control_divx(InputInterface* input,OutputInterface* output,
48
InputDecoder* decoder) {
51
cout<< "Command:0 Msg:protocol yaf-0.1" << endl;
52
cout<< "Command:0 Msg:implements xplayer" << endl;
53
cout<< "Command:0 Msg:decoder cdparanoia " << endl;
54
cout<< "Command:0 Msg:mimetypes audio/cdda;" << endl;
55
cout<< "Command:0 Msg:comment cdparanoia by Monty <xiphmont@mit.edu>" << endl;
56
cout<< "Command:0 Msg:comment yaf port by mvogt@rhrk.uni-kl.de"<<endl;
57
cout<< "Command:0 Msg:comment based on sources from audiocd"<<endl;
58
cout<< "Command:0 Msg:comment enter 'help' " << endl;
64
yaf_control(input,output,decoder);
69
cout << "yaf-cdda is a interactive frontend for the cdda decoder"<<endl;
70
cout << "Usage : yaf-cdda [ahy] [url]"<<endl;
72
cout << "-a : no internal audio device"<<endl;
73
cout << "-h : help"<<endl;
74
cout << "-y : autoplay off"<<endl;
76
cout << "THIS SOFTWARE COMES WITH ABSOLUTELY NO WARRANTY! " \
77
<< "USE AT YOUR OWN RISK!"<<endl;
79
cout << "for more help type 'help' in interactive mode"<<endl;
85
int main(int argc, char** argv) {
87
int lInternalAudio=true;
89
pow(6.0,3.0); // fixes bug in __math.h
91
OutputInterface output(&cout);
94
YafOutputStream* yafOutput=new YafOutputStream(&input);
95
CDDAPlugin* plugin=new CDDAPlugin();
97
plugin->setOutputPlugin(yafOutput);
98
InputDecoderYAF decoder(plugin,yafOutput);
103
c = getopt (argc, argv, "2al:L:scb:mhpywd:");
107
lInternalAudio=false;
115
decoder.setAutoPlay(false);
119
plugin->config("-2","true",NULL);
123
plugin->config("-m","true",NULL);
127
plugin->config("-c","true",NULL);
131
plugin->config("-w","true",NULL);
135
yafOutput->config("-s","true",NULL);
139
yafOutput->config("-b",optarg,NULL);
143
yafOutput->config("yufDump",optarg,NULL);
147
yafOutput->config("-p",optarg,NULL);
151
plugin->config("AudioLayer",optarg,NULL);
152
cout << "trying to configure" << endl;
156
plugin->config("VideoLayer",optarg,NULL);
162
printf ("?? getopt returned character code 0%o ??\n", c);
168
if (optind < argc ) {
170
buffer.append("open ");
171
buffer.append(argv[optind]);
173
input.addInputLine(&buffer);
176
yafOutput->internalDevice(lInternalAudio);
177
control_divx(&input,&output,&decoder);