diff options
author | Michele Calgaro <[email protected]> | 2020-12-06 21:23:48 +0900 |
---|---|---|
committer | Michele Calgaro <[email protected]> | 2020-12-06 21:34:48 +0900 |
commit | 84498d97e27f79e7e919b42bbe54208a02856aaf (patch) | |
tree | 8a66f6e1a88bc2304b453796663ae75f20425490 /arts/kde/kconverttest.cpp | |
parent | 8bc0bc7fc67437fbf757283604104e998ad2fda7 (diff) | |
download | tdelibs-84498d97e27f79e7e919b42bbe54208a02856aaf.tar.gz tdelibs-84498d97e27f79e7e919b42bbe54208a02856aaf.zip |
Renaming of files in preparation for code style tools.
Signed-off-by: Michele Calgaro <[email protected]>
(cherry picked from commit 4f99f868f09bbffa2e15733b8b7c78eba07a199e)
Diffstat (limited to 'arts/kde/kconverttest.cpp')
-rw-r--r-- | arts/kde/kconverttest.cpp | 96 |
1 files changed, 96 insertions, 0 deletions
diff --git a/arts/kde/kconverttest.cpp b/arts/kde/kconverttest.cpp new file mode 100644 index 000000000..647c2f320 --- /dev/null +++ b/arts/kde/kconverttest.cpp @@ -0,0 +1,96 @@ +#include <stdio.h> + +#include <tqfile.h> +#include <tqobject.h> + +#include <tdelocale.h> +#include <tdeaboutdata.h> +#include <tdecmdlineargs.h> +#include <tdeapplication.h> + +#include <flowsystem.h> +#include <kplayobject.h> +#include <kartsdispatcher.h> +#include <kplayobjectfactory.h> +#include <kaudioconverter.h> +#include "kconverttest.moc" + +using namespace std; +using namespace Arts; + +static TDECmdLineOptions options[] = +{ + { "+[URL]", I18N_NOOP("URL to open"), 0 }, + TDECmdLineLastOption +}; + +KConvertTest::KConvertTest() +{ +} + +void KConvertTest::slotRawStreamStart() +{ +// cout << "[START]\n\n" << endl; +} + +void KConvertTest::slotNewBlockSize(long blockSize) +{ + m_blockSize = blockSize; +} + +void KConvertTest::slotNewBlockPointer(long blockPointer) +{ + m_blockPointer = blockPointer; +} + +void KConvertTest::slotNewData() +{ + fwrite((void *) m_blockPointer, 1, m_blockSize, stdout); +} + +void KConvertTest::slotRawStreamFinished() +{ +// cout << "\n\n[END]" << endl; +} + +int main(int argc, char **argv) +{ + TDEAboutData aboutData("kconverttest", I18N_NOOP("KConvertTest"), I18N_NOOP("0.1"), "", TDEAboutData::License_GPL, ""); + + TDECmdLineArgs::init(argc, argv, &aboutData); + TDECmdLineArgs::addCmdLineOptions(options); + TDEApplication app; + + TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs(); + + KURL url; + + if(args->count()) + url = args->arg(0); + else + exit(1); + + args->clear(); + + KConvertTest *get = new KConvertTest(); + + KArtsDispatcher dispatcher; + KAudioConverter converter; + + // FIXME: crashes + // converter.setup(44100); + converter.requestPlayObject(url); + + TQObject::connect(&converter, TQT_SIGNAL(rawStreamStart()), get, TQT_SLOT(slotRawStreamStart())); + + TQObject::connect(&converter, TQT_SIGNAL(newBlockSize(long)), get, TQT_SLOT(slotNewBlockSize(long))); + TQObject::connect(&converter, TQT_SIGNAL(newBlockPointer(long)), get, TQT_SLOT(slotNewBlockPointer(long))); + TQObject::connect(&converter, TQT_SIGNAL(newData()), get, TQT_SLOT(slotNewData())); + + TQObject::connect(&converter, TQT_SIGNAL(rawStreamFinished()), get, TQT_SLOT(slotRawStreamFinished())); + + converter.start(); + + app.exec(); +} + |