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/cddaplay/Makefile.am | 33 +++++++++++++++ mpeglib/example/cddaplay/cddaplay.cpp | 75 +++++++++++++++++++++++++++++++++++ 2 files changed, 108 insertions(+) create mode 100644 mpeglib/example/cddaplay/Makefile.am create mode 100644 mpeglib/example/cddaplay/cddaplay.cpp (limited to 'mpeglib/example/cddaplay') diff --git a/mpeglib/example/cddaplay/Makefile.am b/mpeglib/example/cddaplay/Makefile.am new file mode 100644 index 00000000..49f42a2a --- /dev/null +++ b/mpeglib/example/cddaplay/Makefile.am @@ -0,0 +1,33 @@ +# splay-yaf - Makefile.am + +INCLUDES = -I../../include $(all_includes) + +# EXTRA_DIST = stresstest + +noinst_PROGRAMS = cddaplay + +cddaplay_SOURCES = cddaplay.cpp + +noinst_HEADERS = + +cddaplay_LDFLAGS = $(all_libraries) + + +cddaplay_LDADD = ../../lib/libmpeg.la \ + $(THIS_LIB_LIBS) + + + + + + + + + + + + + + + + diff --git a/mpeglib/example/cddaplay/cddaplay.cpp b/mpeglib/example/cddaplay/cddaplay.cpp new file mode 100644 index 00000000..ecf46e74 --- /dev/null +++ b/mpeglib/example/cddaplay/cddaplay.cpp @@ -0,0 +1,75 @@ +/* + * main.c -- + * + * Example program for mpegplay library. + + + */ + + +#include "../../lib/decoder/cddaPlugin.h" +#include "../../lib/input/inputPlugin.h" + +#include + +using namespace std; + +int main(int argc, char** argv) { + + + if (argc <= 1) { + printf("Usage:\n\n"); + printf("%s \"cdda://dev/ track:.cdda\n\n",argv[0]); + exit(0); + } + // + // The order is important !!!! + // 1. construct + // 2. set Output + // 3. open input + // 4. set input + // + // you cannot set the input _before_ the output + // in fact you can, but this gives you a segfault! + + CDDAPlugin* plugin=new CDDAPlugin(); + OutputStream* out=OutPlugin::createOutputStream(_OUTPUT_LOCAL); + InputStream* in= InputPlugin::createInputStream(argv[1]); + + + + // The plugin does not do "open" + in->open(argv[1]); + + + + + + // watch the order! + plugin->setOutputPlugin(out); + plugin->setInputPlugin(in); + //plugin->seek(1950); + cout << "hello 1 -s"<play(); + cout << "hello 1 -e"<getStreamState() != _STREAM_STATE_EOF) { + cout << "******* plugin->getStreamState() continue"<close(); + + delete plugin; + delete in; + delete out; + +} + -- cgit v1.2.1