summaryrefslogtreecommitdiff
path: root/libs/networking/src
diff options
context:
space:
mode:
authorgeronimo <geronimo013@gmx.de>2012-08-01 15:29:31 (GMT)
committergeronimo <geronimo013@gmx.de>2012-08-01 15:29:31 (GMT)
commitcca6e883c8141c3a67c3c5b232ce0c9b18e7fd59 (patch)
tree7149351cb466316771ab0ce0bd4ea64b2ba17aa1 /libs/networking/src
parent76c51473ee29a9103201618c8dbbc11fe9b7149e (diff)
downloadcmp-cca6e883c8141c3a67c3c5b232ce0c9b18e7fd59.tar.gz
cmp-cca6e883c8141c3a67c3c5b232ce0c9b18e7fd59.tar.bz2
added mediatypes for interlaced video and selective configuration of deepscan
Diffstat (limited to 'libs/networking/src')
-rw-r--r--libs/networking/src/ServerConfig.cc70
1 files changed, 38 insertions, 32 deletions
diff --git a/libs/networking/src/ServerConfig.cc b/libs/networking/src/ServerConfig.cc
index 29e12d9..b5f1969 100644
--- a/libs/networking/src/ServerConfig.cc
+++ b/libs/networking/src/ServerConfig.cc
@@ -121,38 +121,7 @@ int cServerConfig::Load(const char* FileName)
int numberOfEntries = 0;
while ((ce = cr->ReadEntry())) {
- std::string name = std::get<0>(*ce);
-
- if (!strcmp("media-root", name.c_str())) {
- SetDocumentRoot(std::get<1>(*ce).c_str());
- ++numberOfEntries;
- }
- else if (!strcmp("favicon", name.c_str())) {
- SetAppIcon(std::get<1>(*ce).c_str());
- ++numberOfEntries;
- }
- else if (!strcmp("cmps-port", name.c_str())) {
- SetPort(atoi(std::get<1>(*ce).c_str()));
- ++numberOfEntries;
- }
-#ifdef NOT_YET
- else if (!strcmp("want-auth", name.c_str())) {
- SetAuthorizationRequired(!strcasecmp("true", std::get<1>(*ce).c_str()));
- ++numberOfEntries;
- }
-#endif
- else if (!strcmp("want-meta", name.c_str())) {
- SetWantExtendedScan(!strcasecmp("true", std::get<1>(*ce).c_str()));
- ++numberOfEntries;
- }
- else if (!strcmp("mediainfo", name.c_str())) {
- SetMediaInfo(std::get<1>(*ce).c_str());
- ++numberOfEntries;
- }
- else if (!strcmp("ffmpeg", name.c_str())) {
- SetFFMpeg(std::get<1>(*ce).c_str());
- ++numberOfEntries;
- }
+ if (Eval(ce)) ++numberOfEntries;
delete ce;
}
cr->Close();
@@ -161,6 +130,43 @@ int cServerConfig::Load(const char* FileName)
return numberOfEntries > 0;
}
+bool cServerConfig::Eval(cConfigReader::ConfigEntry *Entry)
+{
+ std::string name = std::get<0>(*Entry);
+
+ if (!strcmp("media-root", name.c_str())) {
+ SetDocumentRoot(std::get<1>(*Entry).c_str());
+ return true;
+ }
+ else if (!strcmp("favicon", name.c_str())) {
+ SetAppIcon(std::get<1>(*Entry).c_str());
+ return true;
+ }
+ else if (!strcmp("cmps-port", name.c_str())) {
+ SetPort(atoi(std::get<1>(*Entry).c_str()));
+ return true;
+ }
+#ifdef NOT_YET
+ else if (!strcmp("want-auth", name.c_str())) {
+ SetAuthorizationRequired(!strcasecmp("true", std::get<1>(*ce).c_str()));
+ return true;
+ }
+#endif
+ else if (!strcmp("want-meta", name.c_str())) {
+ SetWantExtendedScan(!strcasecmp("true", std::get<1>(*Entry).c_str()));
+ return true;
+ }
+ else if (!strcmp("mediainfo", name.c_str())) {
+ SetMediaInfo(std::get<1>(*Entry).c_str());
+ return true;
+ }
+ else if (!strcmp("ffmpeg", name.c_str())) {
+ SetFFMpeg(std::get<1>(*Entry).c_str());
+ return true;
+ }
+ return false;
+}
+
int cServerConfig::Store(const char* FileName)
{
//TODO: