summaryrefslogtreecommitdiff
path: root/cmps/tests/MetaScanTest.cc
diff options
context:
space:
mode:
authorgeronimo <geronimo013@gmx.de>2012-07-30 17:51:05 +0200
committergeronimo <geronimo013@gmx.de>2012-07-30 17:51:05 +0200
commitad667186c0c45cfca9d3f153faec7ce35545b238 (patch)
treedb5ab8a2bb22c418bc8a233db3c4955ed16957c5 /cmps/tests/MetaScanTest.cc
parent41922cdaf9c8db57c6b51f090eefe95b0008a0fb (diff)
downloadcmp-ad667186c0c45cfca9d3f153faec7ce35545b238.tar.gz
cmp-ad667186c0c45cfca9d3f153faec7ce35545b238.tar.bz2
created more readers
Diffstat (limited to 'cmps/tests/MetaScanTest.cc')
-rw-r--r--cmps/tests/MetaScanTest.cc31
1 files changed, 22 insertions, 9 deletions
diff --git a/cmps/tests/MetaScanTest.cc b/cmps/tests/MetaScanTest.cc
index bdd51ae..f53c2ca 100644
--- a/cmps/tests/MetaScanTest.cc
+++ b/cmps/tests/MetaScanTest.cc
@@ -1,25 +1,25 @@
/**
* ======================== legal notice ======================
- *
+ *
* File: MetaScanTest.cc
* Created: 27.07.2012, 10:03
* Author: <a href="mailto:geronimo013@gmx.de">Geronimo</a>
* Project: cmps - the backend (server) part of compound media player
- *
+ *
* CMP - compound media player
- *
+ *
* is a client/server mediaplayer intended to play any media from any workstation
* without the need to export or mount shares. cmps is an easy to use backend
* with a (ready to use) HTML-interface. Additionally the backend supports
* authentication via HTTP-digest authorization.
* cmpc is a client with vdr-like osd-menues.
- *
+ *
* Copyright (c) 2012 Reinhard Mantey, some rights reserved!
* published under Creative Commons by-sa
* For details see http://creativecommons.org/licenses/by-sa/3.0/
- *
+ *
* The cmp project's homepage is at http://projects.vdr-developer.org/projects/cmp
- *
+ *
* --------------------------------------------------------------
*/
#include <File.h>
@@ -44,7 +44,7 @@ static void parseConfig(const char *FileName)
cConfigReader *cr = new cConfigReader(new cLineReader(new cFileReader(new cFile(FileName))));
cConfigReader::ConfigEntry *ce;
- while ((ce = cr->ReadValue())) {
+ while ((ce = cr->ReadEntry())) {
std::cout << "config entry [" << std::get<0>(*ce) << "] => " << std::get<1>(*ce) << std::endl;
delete ce;
}
@@ -52,14 +52,27 @@ static void parseConfig(const char *FileName)
delete cr;
}
+static void testMediaInfo(const char *FileName)
+{
+ cMediainfoReader *mir = new cMediainfoReader(new cLineReader(new cCommandReader("/usr/bin/mediainfo")));
+ cMediainfoReader::InfoEntry *ie;
+
+ while ((ie = mir->ReadEntry())) {
+ std::cout << "media info - [" << std::get<0>(*ie) << "] ==> " << std::get<1>(*ie) << std::endl;
+ delete ie;
+ }
+ mir->Close();
+ delete mir;
+}
+
static void testMediaFiles(const char *FileName)
{
cLineReader *lr = new cLineReader(new cFileReader(new cFile(FileName)));
const char *line;
while ((line = lr->ReadLine())) {
- std::cout << "media-test-file: " << line << std::endl;
- testPipe(line);
+ std::cout << std::endl << "media-test-file: " << line << std::endl;
+ testMediaInfo(line);
}
lr->Close();
delete lr;