From e2de64d6f1beb9e492daf5b886e19933c1fa41dd Mon Sep 17 00:00:00 2001 From: toma Date: Wed, 25 Nov 2009 17:56:58 +0000 Subject: Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features. BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdemultimedia@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- mpeglib/example/yaf/yafcdda/Makefile.am | 35 +++++ mpeglib/example/yaf/yafcdda/cdda_control.cpp | 184 +++++++++++++++++++++++++++ 2 files changed, 219 insertions(+) create mode 100644 mpeglib/example/yaf/yafcdda/Makefile.am create mode 100644 mpeglib/example/yaf/yafcdda/cdda_control.cpp (limited to 'mpeglib/example/yaf/yafcdda') diff --git a/mpeglib/example/yaf/yafcdda/Makefile.am b/mpeglib/example/yaf/yafcdda/Makefile.am new file mode 100644 index 00000000..2930f348 --- /dev/null +++ b/mpeglib/example/yaf/yafcdda/Makefile.am @@ -0,0 +1,35 @@ +# splay-yaf - Makefile.am + +INCLUDES = -I../../include $(all_includes) + + +bin_PROGRAMS = yaf-cdda + +yaf_cdda_SOURCES = cdda_control.cpp + + +noinst_HEADERS = + +yaf_cdda_LDFLAGS = $(all_libraries) $(KDE_RPATH) + + +yaf_cdda_LDADD = ../yafxplayer/libyafxplayer.la \ + ../yafcore/libyafcore.la \ + ../../../lib/libmpeg.la \ + $(THIS_LIB_LIBS) + + + + + + + + + + + + + + + + diff --git a/mpeglib/example/yaf/yafcdda/cdda_control.cpp b/mpeglib/example/yaf/yafcdda/cdda_control.cpp new file mode 100644 index 00000000..5bac58e2 --- /dev/null +++ b/mpeglib/example/yaf/yafcdda/cdda_control.cpp @@ -0,0 +1,184 @@ +/* + generic interactive controller + Copyright (C) 2000 Martin Vogt + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU Library General Public License as published by + the Free Software Foundation. + + For more information look at the file COPYRIGHT in this package + + */ + + + + +// Set for local include +#define DIRECT_INCLUDE + +#include "../yafcore/yaf_control.h" +#include "../yafxplayer/inputDecoderYAF.h" + + + + + + +#include +using namespace std; +#include +#include +#include + +#if defined(HAVE_GETOPT_H) +#include +#endif + +// we include our plugin here +#include "../../../lib/decoder/cddaPlugin.h" + +#if defined(HAVE_GETOPT_H) +#include +#endif + + + + + +void control_divx(InputInterface* input,OutputInterface* output, + InputDecoder* decoder) { + + + cout<< "Command:0 Msg:protocol yaf-0.1" << endl; + cout<< "Command:0 Msg:implements xplayer" << endl; + cout<< "Command:0 Msg:decoder cdparanoia " << endl; + cout<< "Command:0 Msg:mimetypes audio/cdda;" << endl; + cout<< "Command:0 Msg:comment cdparanoia by Monty " << endl; + cout<< "Command:0 Msg:comment yaf port by mvogt@rhrk.uni-kl.de"<setOutputPlugin(yafOutput); + InputDecoderYAF decoder(plugin,yafOutput); + + + + while(1) { + c = getopt (argc, argv, "2al:L:scb:mhpywd:"); + if (c == -1) break; + switch(c) { + case 'a': { + lInternalAudio=false; + break; + } + case 'h': { + usage(); + exit(0); + } + case 'y': { + decoder.setAutoPlay(false); + break; + } + case '2': { + plugin->config("-2","true",NULL); + break; + } + case 'm': { + plugin->config("-m","true",NULL); + break; + } + case 'c': { + plugin->config("-c","true",NULL); + break; + } + case 'w': { + plugin->config("-w","true",NULL); + break; + } + case 's': { + yafOutput->config("-s","true",NULL); + break; + } + case 'b': { + yafOutput->config("-b",optarg,NULL); + break; + } + case 'd': { + yafOutput->config("yufDump",optarg,NULL); + break; + } + case 'p': { + yafOutput->config("-p",optarg,NULL); + break; + } + case 'l': { + plugin->config("AudioLayer",optarg,NULL); + cout << "trying to configure" << endl; + break; + } + case 'L': { + plugin->config("VideoLayer",optarg,NULL); + break; + } + + + default: + printf ("?? getopt returned character code 0%o ??\n", c); + usage(); + exit(-1); + } + } + + if (optind < argc ) { + Buffer buffer(300); + buffer.append("open "); + buffer.append(argv[optind]); + buffer.append("\n"); + input.addInputLine(&buffer); + + } + yafOutput->internalDevice(lInternalAudio); + control_divx(&input,&output,&decoder); + delete plugin; + delete yafOutput; + +} + + -- cgit v1.2.1