diff options
author | geronimo <geronimo013@gmx.de> | 2012-07-29 15:11:47 +0200 |
---|---|---|
committer | geronimo <geronimo013@gmx.de> | 2012-07-29 15:11:47 +0200 |
commit | 85cb3f04252b0228830903b21c08bb64e9919c18 (patch) | |
tree | 5c00dbd8d296861aa56cca598ee2a36e51971822 /cmps | |
parent | 736033f3d532c4814eeff84db5dbf99f0249df6e (diff) | |
download | cmp-85cb3f04252b0228830903b21c08bb64e9919c18.tar.gz cmp-85cb3f04252b0228830903b21c08bb64e9919c18.tar.bz2 |
changed server setup to config file, little rearrangement of sources
Diffstat (limited to 'cmps')
27 files changed, 321 insertions, 149 deletions
diff --git a/cmps/main.cc b/cmps/main.cc index 0f392af..da5b260 100644 --- a/cmps/main.cc +++ b/cmps/main.cc @@ -25,7 +25,7 @@ #include <HTTPServer.h> #include <HTTPRequest.h> #include <HTTPResponse.h> -#include <FilesystemScanner.h> +#include <FSMediaScanner.h> #include <MediaFactory.h> #include <MediaListHandler.h> #include <MediaFileHandler.h> @@ -39,16 +39,15 @@ #include <getopt.h> static struct option longOptions[] = { - { "port", required_argument, NULL, 'p' } -, { "mediaRoot", required_argument, NULL, 'r' } -, { "favicon", required_argument, NULL, 'i' } -, { "help", no_argument, NULL, 'h' } + { "appDir", required_argument, NULL, 'd' } +, { "realm", required_argument, NULL, 'r' } +, { "help", no_argument, NULL, 'h' } , { NULL, no_argument, NULL, 0 } }; static int refreshScanner(void *opaque, cHTTPRequest &Request) { - cFilesystemScanner *fsc = (cFilesystemScanner *)opaque; + cFSMediaScanner *fsc = (cFSMediaScanner *)opaque; if (fsc) { fsc->Refresh(); @@ -61,19 +60,17 @@ static void usage(void) { fprintf(stderr, "cmps - the backend of CMP (compound media player)\n"); fprintf(stderr, " is streaming- and HTTP-server and accepts these commandline options:\n"); - fprintf(stderr, "-h, --help the help, you are reading\n"); - fprintf(stderr, "-r, --mediaRoot <path> the directory, where to start to scan for media\n"); - fprintf(stderr, " (default is /media)\n"); - fprintf(stderr, "-p, --port ### the servers port to listen for client connections\n"); - fprintf(stderr, " (default is 12345)\n"); - fprintf(stderr, "-i, --favicon <path> the application icon, used by webbrowsers to\n"); - fprintf(stderr, " prefix the urls to identify the server\n"); - fprintf(stderr, " (default is /media/favicon.ico)\n"); + fprintf(stderr, "-h, --help the help, you are reading\n"); + fprintf(stderr, "-d, --appDir <path> the directory, where the server may write config files\n"); + fprintf(stderr, " (default is /var/lib/cmp)\n"); + fprintf(stderr, "-r, --realm <path> absolute path to credential file. That file must be\n"); + fprintf(stderr, " writable to enable remote administration of principals)\n"); + fprintf(stderr, " (default is no file / no authorization required)\n"); exit(0); } -static void parseCommandline(int argc, char *argv[], cServerConfig &config) +static void setup(int argc, char *argv[], cServerConfig &config) { int c; @@ -84,53 +81,43 @@ static void parseCommandline(int argc, char *argv[], cServerConfig &config) while ((c = getopt_long(argc, argv, "hp:r:i:", longOptions, NULL)) != -1) { switch (c) { - case 'p': { - if (isnumber(optarg)) { - int n = atoi(optarg); + case 'd': { + cFile appDir(optarg); - if (n > 0) config.SetPort(n); + if (appDir.Exists() && appDir.IsDirectory() && appDir.CanWrite()) { + config.SetConfigBaseDir(appDir.AbsolutePath()); } } break; case 'r': { - struct stat st; + cFile credentials(optarg); - if (!stat(optarg, &st)) { - if ((st.st_mode & S_IFMT) == S_IFDIR && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) { - config.SetDocumentRoot(optarg); - } - } - } break; - - case 'i': { - struct stat st; - - if (!stat(optarg, &st)) { - if ((st.st_mode & S_IFMT) == S_IFREG && (st.st_mode & (S_IRUSR | S_IRGRP | S_IROTH))) { - config.SetAppIcon(optarg); - } + if (credentials.Exists() && credentials.CanRead()) { + config.SetCredentialsFile(credentials.AbsolutePath()); } } break; case 'h': usage(); break; } } + config.Load("srserver.conf"); + if (!config.CredentialsFile() && config.AuthorizationRequired()) config.SetAuthorizationRequired(false); + config.Dump(); } int main(int argc, char** argv) { - cServerConfig config(12345); - - parseCommandline(argc, argv, config); + cServerConfig config("/var/lib/cmp"); - cFilesystemScanner *scanner = new cFilesystemScanner(); + setup(argc, argv, config); + cFSMediaScanner *scanner = new cFSMediaScanner(); if (!scanner) { fprintf(stderr, "could not initialize application! (1)"); exit(-1); } - scanner->SetMediaFactory(new cMediaFactory(config.DocumentRoot())); + scanner->SetMediaFactory(new cMediaFactory(config)); - cAbstractMediaRequestHandler::SetFilesystemScanner(scanner); + cAbstractMediaRequestHandler::SetFSMediaScanner(scanner); /* * register request handlers with their uri-prefix */ diff --git a/cmps/nbproject/Makefile-Debug.mk b/cmps/nbproject/Makefile-Debug.mk index 183ac43..a86df80 100644 --- a/cmps/nbproject/Makefile-Debug.mk +++ b/cmps/nbproject/Makefile-Debug.mk @@ -52,8 +52,8 @@ TESTFILES= \ CFLAGS= # CC Compiler Flags -CCFLAGS=-std=gnu++0x -fomit-frame-pointer -fPIC -pthread -Wall -Wno-parentheses -Wno-switch -Wdisabled-optimization -Wpointer-arith -Wredundant-decls -Wwrite-strings -Wtype-limits -Wundef -fno-math-errno -fno-signed-zeros -fno-tree-vectorize -Werror=implicit-function-declaration -ansi -CXXFLAGS=-std=gnu++0x -fomit-frame-pointer -fPIC -pthread -Wall -Wno-parentheses -Wno-switch -Wdisabled-optimization -Wpointer-arith -Wredundant-decls -Wwrite-strings -Wtype-limits -Wundef -fno-math-errno -fno-signed-zeros -fno-tree-vectorize -Werror=implicit-function-declaration -ansi +CCFLAGS=-std=gnu++0x -fomit-frame-pointer -fPIC -pthread -Wall -Wno-parentheses -Wno-switch -Wdisabled-optimization -Wpointer-arith -Wredundant-decls -Wwrite-strings -Wtype-limits -Wundef -fno-math-errno -fno-signed-zeros -fno-tree-vectorize -Werror=implicit-function-declaration +CXXFLAGS=-std=gnu++0x -fomit-frame-pointer -fPIC -pthread -Wall -Wno-parentheses -Wno-switch -Wdisabled-optimization -Wpointer-arith -Wredundant-decls -Wwrite-strings -Wtype-limits -Wundef -fno-math-errno -fno-signed-zeros -fno-tree-vectorize -Werror=implicit-function-declaration # Fortran Compiler Flags FFLAGS= @@ -62,7 +62,7 @@ FFLAGS= ASFLAGS= # Link Libraries and Options -LDLIBSOPTIONS=serverlib/dist/Debug/GNU-Linux-x86/libserverlib.a ../libs/fsScan/dist/Debug/GNU-Linux-x86/libfsscan.a ../libs/networking/dist/Debug/GNU-Linux-x86/libnetworking.a ../libs/util/dist/Debug/GNU-Linux-x86/libutil.a ../libs/vdr/dist/Debug/GNU-Linux-x86/libvdr.a -lpthread -lrt -lssl -lcrypt +LDLIBSOPTIONS=serverlib/dist/Debug/GNU-Linux-x86/libserverlib.a ../libs/fsScan/dist/Debug/GNU-Linux-x86/libfsscan.a ../libs/networking/dist/Debug/GNU-Linux-x86/libnetworking.a ../libs/IO/dist/Debug/GNU-Linux-x86/libio.a ../libs/util/dist/Debug/GNU-Linux-x86/libutil.a ../libs/vdr/dist/Debug/GNU-Linux-x86/libvdr.a -lpthread -lrt -lssl -lcrypt -lpcrecpp # Build Targets .build-conf: ${BUILD_SUBPROJECTS} @@ -74,6 +74,8 @@ ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/cmps: ../libs/fsScan/dist/Debug/GNU-L ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/cmps: ../libs/networking/dist/Debug/GNU-Linux-x86/libnetworking.a +${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/cmps: ../libs/IO/dist/Debug/GNU-Linux-x86/libio.a + ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/cmps: ../libs/util/dist/Debug/GNU-Linux-x86/libutil.a ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/cmps: ../libs/vdr/dist/Debug/GNU-Linux-x86/libvdr.a @@ -85,15 +87,22 @@ ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/cmps: ${OBJECTFILES} ${OBJECTDIR}/main.o: main.cc ${MKDIR} -p ${OBJECTDIR} ${RM} $@.d - $(COMPILE.cc) -g -Wall -D_GNU_SOURCE=1 -D_REENTRANT -Iinclude -Iserverlib/include -I../libs/fsScan/include -I../libs/networking/include -I../libs/util/include -I../libs/vdr/include -MMD -MP -MF $@.d -o ${OBJECTDIR}/main.o main.cc + $(COMPILE.cc) -g -Wall -D_GNU_SOURCE=1 -D_REENTRANT -Iinclude -Iserverlib/include -I../libs/fsScan/include -I../libs/networking/include -I../libs/IO/include -I../libs/util/include -I../libs/vdr/include -MMD -MP -MF $@.d -o ${OBJECTDIR}/main.o main.cc # Subprojects .build-subprojects: cd serverlib && ${MAKE} -f Makefile CONF=Debug cd ../libs/fsScan && ${MAKE} -f Makefile CONF=Debug cd ../libs/networking && ${MAKE} -f Makefile CONF=Debug + cd ../libs/IO && ${MAKE} -f Makefile CONF=Debug cd ../libs/util && ${MAKE} -f Makefile CONF=Debug cd ../libs/vdr && ${MAKE} -f Makefile CONF=Debug + cd ../libs/vdr && ${MAKE} -f Makefile CONF=Debug + cd ../libs/util && ${MAKE} -f Makefile CONF=Debug + cd ../libs/networking && ${MAKE} -f Makefile CONF=Debug + cd ../libs/IO && ${MAKE} -f Makefile CONF=Debug + cd ../libs/fsScan && ${MAKE} -f Makefile CONF=Debug + cd serverlib && ${MAKE} -f Makefile CONF=Debug # Build Test Targets .build-tests-conf: .build-conf ${TESTFILES} @@ -121,31 +130,31 @@ ${TESTDIR}/TestFiles/f4: ${TESTDIR}/tests/JSonTest.o ${OBJECTFILES:%.o=%_nomain. ${TESTDIR}/tests/CodecTest.o: tests/CodecTest.cc ${MKDIR} -p ${TESTDIR}/tests ${RM} $@.d - $(COMPILE.cc) -g -Wall -D_GNU_SOURCE=1 -D_REENTRANT -Iinclude -Iserverlib/include -I../libs/fsScan/include -I../libs/networking/include -I../libs/util/include -I../libs/vdr/include -I. -MMD -MP -MF $@.d -o ${TESTDIR}/tests/CodecTest.o tests/CodecTest.cc + $(COMPILE.cc) -g -Wall -D_GNU_SOURCE=1 -D_REENTRANT -Iinclude -Iserverlib/include -I../libs/fsScan/include -I../libs/networking/include -I../libs/IO/include -I../libs/util/include -I../libs/vdr/include -I. -MMD -MP -MF $@.d -o ${TESTDIR}/tests/CodecTest.o tests/CodecTest.cc ${TESTDIR}/tests/ConnectionHandlerTest.o: tests/ConnectionHandlerTest.cc ${MKDIR} -p ${TESTDIR}/tests ${RM} $@.d - $(COMPILE.cc) -g -Wall -D_GNU_SOURCE=1 -D_REENTRANT -Iinclude -Iserverlib/include -I../libs/fsScan/include -I../libs/networking/include -I../libs/util/include -I../libs/vdr/include -I. -MMD -MP -MF $@.d -o ${TESTDIR}/tests/ConnectionHandlerTest.o tests/ConnectionHandlerTest.cc + $(COMPILE.cc) -g -Wall -D_GNU_SOURCE=1 -D_REENTRANT -Iinclude -Iserverlib/include -I../libs/fsScan/include -I../libs/networking/include -I../libs/IO/include -I../libs/util/include -I../libs/vdr/include -I. -MMD -MP -MF $@.d -o ${TESTDIR}/tests/ConnectionHandlerTest.o tests/ConnectionHandlerTest.cc ${TESTDIR}/tests/FileSystemTest.o: tests/FileSystemTest.cc ${MKDIR} -p ${TESTDIR}/tests ${RM} $@.d - $(COMPILE.cc) -g -Wall -D_GNU_SOURCE=1 -D_REENTRANT -Iinclude -Iserverlib/include -I../libs/fsScan/include -I../libs/networking/include -I../libs/util/include -I../libs/vdr/include -I. -MMD -MP -MF $@.d -o ${TESTDIR}/tests/FileSystemTest.o tests/FileSystemTest.cc + $(COMPILE.cc) -g -Wall -D_GNU_SOURCE=1 -D_REENTRANT -Iinclude -Iserverlib/include -I../libs/fsScan/include -I../libs/networking/include -I../libs/IO/include -I../libs/util/include -I../libs/vdr/include -I. -MMD -MP -MF $@.d -o ${TESTDIR}/tests/FileSystemTest.o tests/FileSystemTest.cc ${TESTDIR}/tests/FScanTest.o: tests/FScanTest.cc ${MKDIR} -p ${TESTDIR}/tests ${RM} $@.d - $(COMPILE.cc) -g -Wall -D_GNU_SOURCE=1 -D_REENTRANT -Iinclude -Iserverlib/include -I../libs/fsScan/include -I../libs/networking/include -I../libs/util/include -I../libs/vdr/include -I. -MMD -MP -MF $@.d -o ${TESTDIR}/tests/FScanTest.o tests/FScanTest.cc + $(COMPILE.cc) -g -Wall -D_GNU_SOURCE=1 -D_REENTRANT -Iinclude -Iserverlib/include -I../libs/fsScan/include -I../libs/networking/include -I../libs/IO/include -I../libs/util/include -I../libs/vdr/include -I. -MMD -MP -MF $@.d -o ${TESTDIR}/tests/FScanTest.o tests/FScanTest.cc ${TESTDIR}/tests/JSonTest.o: tests/JSonTest.cc ${MKDIR} -p ${TESTDIR}/tests ${RM} $@.d - $(COMPILE.cc) -g -Wall -D_GNU_SOURCE=1 -D_REENTRANT -Iinclude -Iserverlib/include -I../libs/fsScan/include -I../libs/networking/include -I../libs/util/include -I../libs/vdr/include -I. -MMD -MP -MF $@.d -o ${TESTDIR}/tests/JSonTest.o tests/JSonTest.cc + $(COMPILE.cc) -g -Wall -D_GNU_SOURCE=1 -D_REENTRANT -Iinclude -Iserverlib/include -I../libs/fsScan/include -I../libs/networking/include -I../libs/IO/include -I../libs/util/include -I../libs/vdr/include -I. -MMD -MP -MF $@.d -o ${TESTDIR}/tests/JSonTest.o tests/JSonTest.cc ${OBJECTDIR}/main_nomain.o: ${OBJECTDIR}/main.o main.cc @@ -156,7 +165,7 @@ ${OBJECTDIR}/main_nomain.o: ${OBJECTDIR}/main.o main.cc (echo "$$NMOUTPUT" | ${GREP} 'T _main$$'); \ then \ ${RM} $@.d;\ - $(COMPILE.cc) -g -Wall -D_GNU_SOURCE=1 -D_REENTRANT -Iinclude -Iserverlib/include -I../libs/fsScan/include -I../libs/networking/include -I../libs/util/include -I../libs/vdr/include -Dmain=__nomain -MMD -MP -MF $@.d -o ${OBJECTDIR}/main_nomain.o main.cc;\ + $(COMPILE.cc) -g -Wall -D_GNU_SOURCE=1 -D_REENTRANT -Iinclude -Iserverlib/include -I../libs/fsScan/include -I../libs/networking/include -I../libs/IO/include -I../libs/util/include -I../libs/vdr/include -Dmain=__nomain -MMD -MP -MF $@.d -o ${OBJECTDIR}/main_nomain.o main.cc;\ else \ ${CP} ${OBJECTDIR}/main.o ${OBJECTDIR}/main_nomain.o;\ fi @@ -184,8 +193,15 @@ ${OBJECTDIR}/main_nomain.o: ${OBJECTDIR}/main.o main.cc cd serverlib && ${MAKE} -f Makefile CONF=Debug clean cd ../libs/fsScan && ${MAKE} -f Makefile CONF=Debug clean cd ../libs/networking && ${MAKE} -f Makefile CONF=Debug clean + cd ../libs/IO && ${MAKE} -f Makefile CONF=Debug clean cd ../libs/util && ${MAKE} -f Makefile CONF=Debug clean cd ../libs/vdr && ${MAKE} -f Makefile CONF=Debug clean + cd ../libs/vdr && ${MAKE} -f Makefile CONF=Debug clean + cd ../libs/util && ${MAKE} -f Makefile CONF=Debug clean + cd ../libs/networking && ${MAKE} -f Makefile CONF=Debug clean + cd ../libs/IO && ${MAKE} -f Makefile CONF=Debug clean + cd ../libs/fsScan && ${MAKE} -f Makefile CONF=Debug clean + cd serverlib && ${MAKE} -f Makefile CONF=Debug clean # Enable dependency checking .dep.inc: .depcheck-impl diff --git a/cmps/nbproject/configurations.xml b/cmps/nbproject/configurations.xml index e30f086..38fad19 100644 --- a/cmps/nbproject/configurations.xml +++ b/cmps/nbproject/configurations.xml @@ -69,10 +69,11 @@ <pElem>serverlib/include</pElem> <pElem>../libs/fsScan/include</pElem> <pElem>../libs/networking/include</pElem> + <pElem>../libs/IO/include</pElem> <pElem>../libs/util/include</pElem> <pElem>../libs/vdr/include</pElem> </incDir> - <commandLine>-std=gnu++0x -fomit-frame-pointer -fPIC -pthread -Wall -Wno-parentheses -Wno-switch -Wdisabled-optimization -Wpointer-arith -Wredundant-decls -Wwrite-strings -Wtype-limits -Wundef -fno-math-errno -fno-signed-zeros -fno-tree-vectorize -Werror=implicit-function-declaration -ansi</commandLine> + <commandLine>-std=gnu++0x -fomit-frame-pointer -fPIC -pthread -Wall -Wno-parentheses -Wno-switch -Wdisabled-optimization -Wpointer-arith -Wredundant-decls -Wwrite-strings -Wtype-limits -Wundef -fno-math-errno -fno-signed-zeros -fno-tree-vectorize -Werror=implicit-function-declaration</commandLine> <preprocessorList> <Elem>_GNU_SOURCE=1</Elem> <Elem>_REENTRANT</Elem> @@ -118,6 +119,18 @@ </makeArtifact> </linkerLibProjectItem> <linkerLibProjectItem> + <makeArtifact PL="../libs/IO" + CT="3" + CN="Debug" + AC="true" + BL="true" + WD="../libs/IO" + BC="${MAKE} -f Makefile CONF=Debug" + CC="${MAKE} -f Makefile CONF=Debug clean" + OP="${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/libio.a"> + </makeArtifact> + </linkerLibProjectItem> + <linkerLibProjectItem> <makeArtifact PL="../libs/util" CT="3" CN="Debug" @@ -145,8 +158,71 @@ <linkerLibLibItem>rt</linkerLibLibItem> <linkerLibLibItem>ssl</linkerLibLibItem> <linkerLibLibItem>crypt</linkerLibLibItem> + <linkerLibLibItem>pcrecpp</linkerLibLibItem> </linkerLibItems> </linkerTool> + <requiredProjects> + <makeArtifact PL="../libs/vdr" + CT="3" + CN="Debug" + AC="true" + BL="true" + WD="../libs/vdr" + BC="${MAKE} -f Makefile CONF=Debug" + CC="${MAKE} -f Makefile CONF=Debug clean" + OP="${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/libvdr.a"> + </makeArtifact> + <makeArtifact PL="../libs/util" + CT="3" + CN="Debug" + AC="true" + BL="true" + WD="../libs/util" + BC="${MAKE} -f Makefile CONF=Debug" + CC="${MAKE} -f Makefile CONF=Debug clean" + OP="${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/libutil.a"> + </makeArtifact> + <makeArtifact PL="../libs/networking" + CT="3" + CN="Debug" + AC="true" + BL="true" + WD="../libs/networking" + BC="${MAKE} -f Makefile CONF=Debug" + CC="${MAKE} -f Makefile CONF=Debug clean" + OP="${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/libnetworking.a"> + </makeArtifact> + <makeArtifact PL="../libs/IO" + CT="3" + CN="Debug" + AC="true" + BL="true" + WD="../libs/IO" + BC="${MAKE} -f Makefile CONF=Debug" + CC="${MAKE} -f Makefile CONF=Debug clean" + OP="${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/libio.a"> + </makeArtifact> + <makeArtifact PL="../libs/fsScan" + CT="3" + CN="Debug" + AC="true" + BL="true" + WD="../libs/fsScan" + BC="${MAKE} -f Makefile CONF=Debug" + CC="${MAKE} -f Makefile CONF=Debug clean" + OP="${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/libfsscan.a"> + </makeArtifact> + <makeArtifact PL="serverlib" + CT="3" + CN="Debug" + AC="true" + BL="true" + WD="serverlib" + BC="${MAKE} -f Makefile CONF=Debug" + CC="${MAKE} -f Makefile CONF=Debug clean" + OP="${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/libserverlib.a"> + </makeArtifact> + </requiredProjects> </compileType> <folder path="TestFiles/f1"> <cTool> diff --git a/cmps/nbproject/project.xml b/cmps/nbproject/project.xml index b24cfef..ddc8162 100644 --- a/cmps/nbproject/project.xml +++ b/cmps/nbproject/project.xml @@ -11,6 +11,7 @@ <make-dep-projects> <make-dep-project>../libs/util</make-dep-project> <make-dep-project>../libs/vdr</make-dep-project> + <make-dep-project>../libs/IO</make-dep-project> <make-dep-project>../libs/fsScan</make-dep-project> <make-dep-project>serverlib</make-dep-project> <make-dep-project>../libs/networking</make-dep-project> diff --git a/cmps/server.cbp b/cmps/server.cbp index 4c165d5..f33bde6 100644 --- a/cmps/server.cbp +++ b/cmps/server.cbp @@ -30,12 +30,13 @@ </Build> <Compiler> <Add option="-Wall" /> - <Add option="-std=gnu++0x -fomit-frame-pointer -fPIC -pthread -Wall -Wno-parentheses -Wno-switch -Wdisabled-optimization -Wpointer-arith -Wredundant-decls -Wwrite-strings -Wtype-limits -Wundef -fno-math-errno -fno-signed-zeros -fno-tree-vectorize -Werror=implicit-function-declaration -ansi" /> + <Add option="-std=gnu++0x -fomit-frame-pointer -fPIC -pthread -Wall -Wno-parentheses -Wno-switch -Wdisabled-optimization -Wpointer-arith -Wredundant-decls -Wwrite-strings -Wtype-limits -Wundef -fno-math-errno -fno-signed-zeros -fno-tree-vectorize -Werror=implicit-function-declaration" /> <Add option="-D_REENTRANT" /> <Add option="-D_GNU_SOURCE=1" /> <Add directory="../libs/vdr/include" /> <Add directory="../libs/util/include" /> <Add directory="../libs/networking/include" /> + <Add directory="../libs/IO/include" /> <Add directory="../libs/fsScan/include" /> <Add directory="serverlib/include" /> <Add directory="include" /> @@ -44,12 +45,14 @@ <Add library="serverlib/libserverlib.a" /> <Add library="../libs/fsScan/libfsScan.a" /> <Add library="../libs/networking/libnetworking.a" /> + <Add library="../libs/IO/libIO.a" /> <Add library="../libs/util/libutil.a" /> <Add library="../libs/vdr/libvdr.a" /> <Add library="pthread" /> <Add library="ssl" /> <Add library="crypt" /> <Add library="rt" /> + <Add library="pcrecpp" /> </Linker> <Unit filename="main.cc" /> <Extensions> diff --git a/cmps/server.cbp.save b/cmps/server.cbp.save index fd89233..f33bde6 100644 --- a/cmps/server.cbp.save +++ b/cmps/server.cbp.save @@ -7,7 +7,7 @@ <Option compiler="gcc" /> <Build> <Target title="Debug"> - <Option output="bin/Debug/CMP" prefix_auto="1" extension_auto="1" /> + <Option output="bin/Debug/cmps" prefix_auto="1" extension_auto="1" /> <Option object_output="obj/Debug/" /> <Option type="1" /> <Option compiler="gcc" /> @@ -16,7 +16,7 @@ </Compiler> </Target> <Target title="Release"> - <Option output="bin/Release/CMP" prefix_auto="1" extension_auto="1" /> + <Option output="bin/Release/cmps" prefix_auto="1" extension_auto="1" /> <Option object_output="obj/Release/" /> <Option type="1" /> <Option compiler="gcc" /> @@ -30,12 +30,13 @@ </Build> <Compiler> <Add option="-Wall" /> - <Add option="-std=gnu++0x -fomit-frame-pointer -fPIC -pthread -Wall -Wno-parentheses -Wno-switch -Wdisabled-optimization -Wpointer-arith -Wredundant-decls -Wwrite-strings -Wtype-limits -Wundef -fno-math-errno -fno-signed-zeros -fno-tree-vectorize -Werror=implicit-function-declaration -ansi" /> + <Add option="-std=gnu++0x -fomit-frame-pointer -fPIC -pthread -Wall -Wno-parentheses -Wno-switch -Wdisabled-optimization -Wpointer-arith -Wredundant-decls -Wwrite-strings -Wtype-limits -Wundef -fno-math-errno -fno-signed-zeros -fno-tree-vectorize -Werror=implicit-function-declaration" /> <Add option="-D_REENTRANT" /> <Add option="-D_GNU_SOURCE=1" /> <Add directory="../libs/vdr/include" /> <Add directory="../libs/util/include" /> <Add directory="../libs/networking/include" /> + <Add directory="../libs/IO/include" /> <Add directory="../libs/fsScan/include" /> <Add directory="serverlib/include" /> <Add directory="include" /> @@ -44,12 +45,14 @@ <Add library="serverlib/libserverlib.a" /> <Add library="../libs/fsScan/libfsScan.a" /> <Add library="../libs/networking/libnetworking.a" /> + <Add library="../libs/IO/libIO.a" /> <Add library="../libs/util/libutil.a" /> <Add library="../libs/vdr/libvdr.a" /> <Add library="pthread" /> <Add library="ssl" /> <Add library="crypt" /> <Add library="rt" /> + <Add library="pcrecpp" /> </Linker> <Unit filename="main.cc" /> <Extensions> diff --git a/cmps/server.layout b/cmps/server.layout index 75de2f8..cfd47d8 100644 --- a/cmps/server.layout +++ b/cmps/server.layout @@ -3,7 +3,7 @@ <ActiveTarget name="Debug" /> <File name="main.cc" open="1" top="1" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> <Cursor> - <Cursor1 position="1529" topLine="0" /> + <Cursor1 position="3431" topLine="40" /> </Cursor> </File> </CodeBlocks_layout_file> diff --git a/cmps/server.layout.save b/cmps/server.layout.save index 2c8a82b..697bb3f 100644 --- a/cmps/server.layout.save +++ b/cmps/server.layout.save @@ -3,7 +3,7 @@ <ActiveTarget name="Debug" /> <File name="main.cc" open="1" top="0" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> <Cursor> - <Cursor1 position="1529" topLine="0" /> + <Cursor1 position="4020" topLine="55" /> </Cursor> </File> </CodeBlocks_layout_file> diff --git a/cmps/serverlib/include/AbstractMediaRequestHandler.h b/cmps/serverlib/include/AbstractMediaRequestHandler.h index f92e87c..5122390 100644 --- a/cmps/serverlib/include/AbstractMediaRequestHandler.h +++ b/cmps/serverlib/include/AbstractMediaRequestHandler.h @@ -27,15 +27,15 @@ #include <HTTPRequestHandler.h> -class cFilesystemScanner; +class cFSMediaScanner; class cAbstractMediaRequestHandler : public cHTTPRequestHandler { public: virtual ~cAbstractMediaRequestHandler(); - static void SetFilesystemScanner(cFilesystemScanner *Scanner); + static void SetFSMediaScanner(cFSMediaScanner *Scanner); protected: cAbstractMediaRequestHandler(); - cFilesystemScanner *FileSystemScanner(void); + cFSMediaScanner *FSMediaScanner(void); }; #endif /* ABSTRACTMEDIAREQUESTHANDLER_H */ diff --git a/cmps/serverlib/include/HTMLListAssembler.h b/cmps/serverlib/include/HTMLListAssembler.h index 2b8fa65..878ec5e 100644 --- a/cmps/serverlib/include/HTMLListAssembler.h +++ b/cmps/serverlib/include/HTMLListAssembler.h @@ -1,25 +1,25 @@ /** * ======================== legal notice ====================== - * + * * File: HTMLListAssembler.h * Created: 6. Juli 2012, 09 * 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 - * + * * -------------------------------------------------------------- */ #ifndef HTMLLISTASSEMBLER_H diff --git a/cmps/serverlib/include/HTTPMediaResponse.h b/cmps/serverlib/include/HTTPMediaResponse.h index 40830c4..981e431 100644 --- a/cmps/serverlib/include/HTTPMediaResponse.h +++ b/cmps/serverlib/include/HTTPMediaResponse.h @@ -1,25 +1,25 @@ /** * ======================== legal notice ====================== - * + * * File: HTTPMediaResponse.h * Created: 6. Juli 2012, 07 * 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 - * + * * -------------------------------------------------------------- */ #ifndef HTTPMEDIARESPONSE_H diff --git a/cmps/serverlib/nbproject/Makefile-Debug.mk b/cmps/serverlib/nbproject/Makefile-Debug.mk index a95cf37..62660d5 100644 --- a/cmps/serverlib/nbproject/Makefile-Debug.mk +++ b/cmps/serverlib/nbproject/Makefile-Debug.mk @@ -48,8 +48,8 @@ OBJECTFILES= \ CFLAGS= # CC Compiler Flags -CCFLAGS=-std=gnu++0x -fomit-frame-pointer -fPIC -pthread -Wall -Wno-parentheses -Wno-switch -Wdisabled-optimization -Wpointer-arith -Wredundant-decls -Wwrite-strings -Wtype-limits -Wundef -fno-math-errno -fno-signed-zeros -fno-tree-vectorize -Werror=implicit-function-declaration -ansi -CXXFLAGS=-std=gnu++0x -fomit-frame-pointer -fPIC -pthread -Wall -Wno-parentheses -Wno-switch -Wdisabled-optimization -Wpointer-arith -Wredundant-decls -Wwrite-strings -Wtype-limits -Wundef -fno-math-errno -fno-signed-zeros -fno-tree-vectorize -Werror=implicit-function-declaration -ansi +CCFLAGS=-std=gnu++0x -fomit-frame-pointer -fPIC -pthread -Wall -Wno-parentheses -Wno-switch -Wdisabled-optimization -Wpointer-arith -Wredundant-decls -Wwrite-strings -Wtype-limits -Wundef -fno-math-errno -fno-signed-zeros -fno-tree-vectorize -Werror=implicit-function-declaration +CXXFLAGS=-std=gnu++0x -fomit-frame-pointer -fPIC -pthread -Wall -Wno-parentheses -Wno-switch -Wdisabled-optimization -Wpointer-arith -Wredundant-decls -Wwrite-strings -Wtype-limits -Wundef -fno-math-errno -fno-signed-zeros -fno-tree-vectorize -Werror=implicit-function-declaration # Fortran Compiler Flags FFLAGS= @@ -73,40 +73,45 @@ ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/libserverlib.a: ${OBJECTFILES} ${OBJECTDIR}/src/JSonListAssembler.o: src/JSonListAssembler.cc ${MKDIR} -p ${OBJECTDIR}/src ${RM} $@.d - $(COMPILE.cc) -g -Wall -D_GNU_SOURCE=1 -D_REENTRANT -Iinclude -I../../libs/fsScan/include -I../../libs/networking/include -I../../libs/util/include -I../../libs/vdr/include -MMD -MP -MF $@.d -o ${OBJECTDIR}/src/JSonListAssembler.o src/JSonListAssembler.cc + $(COMPILE.cc) -g -Wall -D_GNU_SOURCE=1 -D_REENTRANT -Iinclude -I../../libs/fsScan/include -I../../libs/networking/include -I../../libs/IO/include -I../../libs/util/include -I../../libs/vdr/include -MMD -MP -MF $@.d -o ${OBJECTDIR}/src/JSonListAssembler.o src/JSonListAssembler.cc ${OBJECTDIR}/src/CommandHandler.o: src/CommandHandler.cc ${MKDIR} -p ${OBJECTDIR}/src ${RM} $@.d - $(COMPILE.cc) -g -Wall -D_GNU_SOURCE=1 -D_REENTRANT -Iinclude -I../../libs/fsScan/include -I../../libs/networking/include -I../../libs/util/include -I../../libs/vdr/include -MMD -MP -MF $@.d -o ${OBJECTDIR}/src/CommandHandler.o src/CommandHandler.cc + $(COMPILE.cc) -g -Wall -D_GNU_SOURCE=1 -D_REENTRANT -Iinclude -I../../libs/fsScan/include -I../../libs/networking/include -I../../libs/IO/include -I../../libs/util/include -I../../libs/vdr/include -MMD -MP -MF $@.d -o ${OBJECTDIR}/src/CommandHandler.o src/CommandHandler.cc ${OBJECTDIR}/src/HTMLListAssembler.o: src/HTMLListAssembler.cc ${MKDIR} -p ${OBJECTDIR}/src ${RM} $@.d - $(COMPILE.cc) -g -Wall -D_GNU_SOURCE=1 -D_REENTRANT -Iinclude -I../../libs/fsScan/include -I../../libs/networking/include -I../../libs/util/include -I../../libs/vdr/include -MMD -MP -MF $@.d -o ${OBJECTDIR}/src/HTMLListAssembler.o src/HTMLListAssembler.cc + $(COMPILE.cc) -g -Wall -D_GNU_SOURCE=1 -D_REENTRANT -Iinclude -I../../libs/fsScan/include -I../../libs/networking/include -I../../libs/IO/include -I../../libs/util/include -I../../libs/vdr/include -MMD -MP -MF $@.d -o ${OBJECTDIR}/src/HTMLListAssembler.o src/HTMLListAssembler.cc ${OBJECTDIR}/src/AbstractMediaRequestHandler.o: src/AbstractMediaRequestHandler.cc ${MKDIR} -p ${OBJECTDIR}/src ${RM} $@.d - $(COMPILE.cc) -g -Wall -D_GNU_SOURCE=1 -D_REENTRANT -Iinclude -I../../libs/fsScan/include -I../../libs/networking/include -I../../libs/util/include -I../../libs/vdr/include -MMD -MP -MF $@.d -o ${OBJECTDIR}/src/AbstractMediaRequestHandler.o src/AbstractMediaRequestHandler.cc + $(COMPILE.cc) -g -Wall -D_GNU_SOURCE=1 -D_REENTRANT -Iinclude -I../../libs/fsScan/include -I../../libs/networking/include -I../../libs/IO/include -I../../libs/util/include -I../../libs/vdr/include -MMD -MP -MF $@.d -o ${OBJECTDIR}/src/AbstractMediaRequestHandler.o src/AbstractMediaRequestHandler.cc ${OBJECTDIR}/src/HTTPMediaResponse.o: src/HTTPMediaResponse.cc ${MKDIR} -p ${OBJECTDIR}/src ${RM} $@.d - $(COMPILE.cc) -g -Wall -D_GNU_SOURCE=1 -D_REENTRANT -Iinclude -I../../libs/fsScan/include -I../../libs/networking/include -I../../libs/util/include -I../../libs/vdr/include -MMD -MP -MF $@.d -o ${OBJECTDIR}/src/HTTPMediaResponse.o src/HTTPMediaResponse.cc + $(COMPILE.cc) -g -Wall -D_GNU_SOURCE=1 -D_REENTRANT -Iinclude -I../../libs/fsScan/include -I../../libs/networking/include -I../../libs/IO/include -I../../libs/util/include -I../../libs/vdr/include -MMD -MP -MF $@.d -o ${OBJECTDIR}/src/HTTPMediaResponse.o src/HTTPMediaResponse.cc ${OBJECTDIR}/src/MediaListHandler.o: src/MediaListHandler.cc ${MKDIR} -p ${OBJECTDIR}/src ${RM} $@.d - $(COMPILE.cc) -g -Wall -D_GNU_SOURCE=1 -D_REENTRANT -Iinclude -I../../libs/fsScan/include -I../../libs/networking/include -I../../libs/util/include -I../../libs/vdr/include -MMD -MP -MF $@.d -o ${OBJECTDIR}/src/MediaListHandler.o src/MediaListHandler.cc + $(COMPILE.cc) -g -Wall -D_GNU_SOURCE=1 -D_REENTRANT -Iinclude -I../../libs/fsScan/include -I../../libs/networking/include -I../../libs/IO/include -I../../libs/util/include -I../../libs/vdr/include -MMD -MP -MF $@.d -o ${OBJECTDIR}/src/MediaListHandler.o src/MediaListHandler.cc ${OBJECTDIR}/src/MediaFileHandler.o: src/MediaFileHandler.cc ${MKDIR} -p ${OBJECTDIR}/src ${RM} $@.d - $(COMPILE.cc) -g -Wall -D_GNU_SOURCE=1 -D_REENTRANT -Iinclude -I../../libs/fsScan/include -I../../libs/networking/include -I../../libs/util/include -I../../libs/vdr/include -MMD -MP -MF $@.d -o ${OBJECTDIR}/src/MediaFileHandler.o src/MediaFileHandler.cc + $(COMPILE.cc) -g -Wall -D_GNU_SOURCE=1 -D_REENTRANT -Iinclude -I../../libs/fsScan/include -I../../libs/networking/include -I../../libs/IO/include -I../../libs/util/include -I../../libs/vdr/include -MMD -MP -MF $@.d -o ${OBJECTDIR}/src/MediaFileHandler.o src/MediaFileHandler.cc # Subprojects .build-subprojects: + cd ../../libs/vdr && ${MAKE} -f Makefile CONF=Debug + cd ../../libs/util && ${MAKE} -f Makefile CONF=Debug + cd ../../libs/networking && ${MAKE} -f Makefile CONF=Debug + cd ../../libs/IO && ${MAKE} -f Makefile CONF=Debug + cd ../../libs/fsScan && ${MAKE} -f Makefile CONF=Debug # Clean Targets .clean-conf: ${CLEAN_SUBPROJECTS} @@ -115,6 +120,11 @@ ${OBJECTDIR}/src/MediaFileHandler.o: src/MediaFileHandler.cc # Subprojects .clean-subprojects: + cd ../../libs/vdr && ${MAKE} -f Makefile CONF=Debug clean + cd ../../libs/util && ${MAKE} -f Makefile CONF=Debug clean + cd ../../libs/networking && ${MAKE} -f Makefile CONF=Debug clean + cd ../../libs/IO && ${MAKE} -f Makefile CONF=Debug clean + cd ../../libs/fsScan && ${MAKE} -f Makefile CONF=Debug clean # Enable dependency checking .dep.inc: .depcheck-impl diff --git a/cmps/serverlib/nbproject/configurations.xml b/cmps/serverlib/nbproject/configurations.xml index 3291f98..b0c9ad3 100644 --- a/cmps/serverlib/nbproject/configurations.xml +++ b/cmps/serverlib/nbproject/configurations.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<configurationDescriptor version="80"> +<configurationDescriptor version="84"> <logicalFolder name="root" displayName="root" projectFiles="true" kind="ROOT"> <logicalFolder name="HeaderFiles" displayName="Header Files" @@ -53,10 +53,11 @@ <pElem>include</pElem> <pElem>../../libs/fsScan/include</pElem> <pElem>../../libs/networking/include</pElem> + <pElem>../../libs/IO/include</pElem> <pElem>../../libs/util/include</pElem> <pElem>../../libs/vdr/include</pElem> </incDir> - <commandLine>-std=gnu++0x -fomit-frame-pointer -fPIC -pthread -Wall -Wno-parentheses -Wno-switch -Wdisabled-optimization -Wpointer-arith -Wredundant-decls -Wwrite-strings -Wtype-limits -Wundef -fno-math-errno -fno-signed-zeros -fno-tree-vectorize -Werror=implicit-function-declaration -ansi</commandLine> + <commandLine>-std=gnu++0x -fomit-frame-pointer -fPIC -pthread -Wall -Wno-parentheses -Wno-switch -Wdisabled-optimization -Wpointer-arith -Wredundant-decls -Wwrite-strings -Wtype-limits -Wundef -fno-math-errno -fno-signed-zeros -fno-tree-vectorize -Werror=implicit-function-declaration</commandLine> <preprocessorList> <Elem>_GNU_SOURCE=1</Elem> <Elem>_REENTRANT</Elem> @@ -65,6 +66,58 @@ </ccTool> <archiverTool> </archiverTool> + <requiredProjects> + <makeArtifact PL="../../libs/vdr" + CT="3" + CN="Debug" + AC="true" + BL="true" + WD="../../libs/vdr" + BC="${MAKE} -f Makefile CONF=Debug" + CC="${MAKE} -f Makefile CONF=Debug clean" + OP="${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/libvdr.a"> + </makeArtifact> + <makeArtifact PL="../../libs/util" + CT="3" + CN="Debug" + AC="true" + BL="true" + WD="../../libs/util" + BC="${MAKE} -f Makefile CONF=Debug" + CC="${MAKE} -f Makefile CONF=Debug clean" + OP="${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/libutil.a"> + </makeArtifact> + <makeArtifact PL="../../libs/networking" + CT="3" + CN="Debug" + AC="true" + BL="true" + WD="../../libs/networking" + BC="${MAKE} -f Makefile CONF=Debug" + CC="${MAKE} -f Makefile CONF=Debug clean" + OP="${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/libnetworking.a"> + </makeArtifact> + <makeArtifact PL="../../libs/IO" + CT="3" + CN="Debug" + AC="true" + BL="true" + WD="../../libs/IO" + BC="${MAKE} -f Makefile CONF=Debug" + CC="${MAKE} -f Makefile CONF=Debug clean" + OP="${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/libio.a"> + </makeArtifact> + <makeArtifact PL="../../libs/fsScan" + CT="3" + CN="Debug" + AC="true" + BL="true" + WD="../../libs/fsScan" + BC="${MAKE} -f Makefile CONF=Debug" + CC="${MAKE} -f Makefile CONF=Debug clean" + OP="${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/libfsscan.a"> + </makeArtifact> + </requiredProjects> </compileType> </conf> <conf name="Release" type="3"> diff --git a/cmps/serverlib/nbproject/private/configurations.xml b/cmps/serverlib/nbproject/private/configurations.xml index fa15dc7..616cc91 100644 --- a/cmps/serverlib/nbproject/private/configurations.xml +++ b/cmps/serverlib/nbproject/private/configurations.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<configurationDescriptor version="80"> +<configurationDescriptor version="84"> <projectmakefile>Makefile</projectmakefile> <confs> <conf name="Debug" type="3"> diff --git a/cmps/serverlib/nbproject/project.xml b/cmps/serverlib/nbproject/project.xml index 564e561..fee9c5d 100644 --- a/cmps/serverlib/nbproject/project.xml +++ b/cmps/serverlib/nbproject/project.xml @@ -8,7 +8,13 @@ <cpp-extensions>cc</cpp-extensions> <header-extensions>h</header-extensions> <sourceEncoding>UTF-8</sourceEncoding> - <make-dep-projects/> + <make-dep-projects> + <make-dep-project>../../libs/util</make-dep-project> + <make-dep-project>../../libs/vdr</make-dep-project> + <make-dep-project>../../libs/networking</make-dep-project> + <make-dep-project>../../libs/IO</make-dep-project> + <make-dep-project>../../libs/fsScan</make-dep-project> + </make-dep-projects> <sourceRootList/> <confList> <confElem> diff --git a/cmps/serverlib/serverlib.cbp b/cmps/serverlib/serverlib.cbp index 92deaf4..f81f760 100644 --- a/cmps/serverlib/serverlib.cbp +++ b/cmps/serverlib/serverlib.cbp @@ -7,7 +7,7 @@ <Option compiler="gcc" /> <Build> <Target title="Debug"> - <Option output="libserverlib" prefix_auto="1" extension_auto="1" /> + <Option output="serverlib" prefix_auto="1" extension_auto="1" /> <Option working_dir="" /> <Option object_output="obj/Debug/" /> <Option type="2" /> @@ -19,7 +19,7 @@ </Compiler> </Target> <Target title="Release"> - <Option output="libserverlib" prefix_auto="1" extension_auto="1" /> + <Option output="serverlib" prefix_auto="1" extension_auto="1" /> <Option working_dir="" /> <Option object_output="obj/Release/" /> <Option type="2" /> @@ -35,12 +35,13 @@ </Target> </Build> <Compiler> - <Add option="-std=gnu++0x -fomit-frame-pointer -fPIC -pthread -Wall -Wno-parentheses -Wno-switch -Wdisabled-optimization -Wpointer-arith -Wredundant-decls -Wwrite-strings -Wtype-limits -Wundef -fno-math-errno -fno-signed-zeros -fno-tree-vectorize -Werror=implicit-function-declaration -ansi" /> + <Add option="-std=gnu++0x -fomit-frame-pointer -fPIC -pthread -Wall -Wno-parentheses -Wno-switch -Wdisabled-optimization -Wpointer-arith -Wredundant-decls -Wwrite-strings -Wtype-limits -Wundef -fno-math-errno -fno-signed-zeros -fno-tree-vectorize -Werror=implicit-function-declaration" /> <Add option="-D_REENTRANT" /> <Add option="-D_GNU_SOURCE=1" /> <Add directory="include" /> <Add directory="../../libs/fsScan/include" /> <Add directory="../../libs/networking/include" /> + <Add directory="../../libs/IO/include" /> <Add directory="../../libs/util/include" /> <Add directory="../../libs/vdr/include" /> </Compiler> diff --git a/cmps/serverlib/serverlib.layout b/cmps/serverlib/serverlib.layout index 8f17071..de6ba2e 100644 --- a/cmps/serverlib/serverlib.layout +++ b/cmps/serverlib/serverlib.layout @@ -11,14 +11,14 @@ <Cursor1 position="0" topLine="0" /> </Cursor> </File> - <File name="src/AbstractMediaRequestHandler.cc" open="0" top="0" tabpos="2" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> + <File name="src/JSonListAssembler.cc" open="0" top="0" tabpos="7" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> <Cursor> - <Cursor1 position="0" topLine="0" /> + <Cursor1 position="1183" topLine="0" /> </Cursor> </File> - <File name="src/JSonListAssembler.cc" open="0" top="0" tabpos="7" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> + <File name="src/AbstractMediaRequestHandler.cc" open="0" top="0" tabpos="2" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> <Cursor> - <Cursor1 position="1183" topLine="0" /> + <Cursor1 position="0" topLine="0" /> </Cursor> </File> </CodeBlocks_layout_file> diff --git a/cmps/serverlib/serverlib.layout.save b/cmps/serverlib/serverlib.layout.save index cd411cc..de6ba2e 100644 --- a/cmps/serverlib/serverlib.layout.save +++ b/cmps/serverlib/serverlib.layout.save @@ -1,22 +1,22 @@ <?xml version="1.0" encoding="UTF-8" standalone="yes" ?> <CodeBlocks_layout_file> <ActiveTarget name="Debug" /> - <File name="src/AbstractMediaRequestHandler.cc" open="0" top="0" tabpos="2" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> + <File name="src/HTMLListAssembler.cc" open="0" top="0" tabpos="3" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> <Cursor> <Cursor1 position="0" topLine="0" /> </Cursor> </File> - <File name="src/JSonListAssembler.cc" open="0" top="0" tabpos="7" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> + <File name="src/MediaListHandler.cc" open="0" top="0" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> <Cursor> - <Cursor1 position="1183" topLine="0" /> + <Cursor1 position="0" topLine="0" /> </Cursor> </File> - <File name="src/HTMLListAssembler.cc" open="0" top="0" tabpos="3" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> + <File name="src/JSonListAssembler.cc" open="0" top="0" tabpos="7" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> <Cursor> - <Cursor1 position="0" topLine="0" /> + <Cursor1 position="1183" topLine="0" /> </Cursor> </File> - <File name="src/MediaListHandler.cc" open="0" top="0" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> + <File name="src/AbstractMediaRequestHandler.cc" open="0" top="0" tabpos="2" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> <Cursor> <Cursor1 position="0" topLine="0" /> </Cursor> diff --git a/cmps/serverlib/src/AbstractMediaRequestHandler.cc b/cmps/serverlib/src/AbstractMediaRequestHandler.cc index ad845b6..b60bcb8 100644 --- a/cmps/serverlib/src/AbstractMediaRequestHandler.cc +++ b/cmps/serverlib/src/AbstractMediaRequestHandler.cc @@ -23,9 +23,9 @@ * -------------------------------------------------------------- */ #include <AbstractMediaRequestHandler.h> -#include <FilesystemScanner.h> +#include <FSMediaScanner.h> -static cFilesystemScanner *scanner = NULL; +static cFSMediaScanner *scanner = NULL; cAbstractMediaRequestHandler::cAbstractMediaRequestHandler() { @@ -35,12 +35,12 @@ cAbstractMediaRequestHandler::~cAbstractMediaRequestHandler() { } -cFilesystemScanner *cAbstractMediaRequestHandler::FileSystemScanner(void) +cFSMediaScanner *cAbstractMediaRequestHandler::FSMediaScanner(void) { return scanner; } -void cAbstractMediaRequestHandler::SetFilesystemScanner(cFilesystemScanner* Scanner) +void cAbstractMediaRequestHandler::SetFSMediaScanner(cFSMediaScanner* Scanner) { scanner = Scanner; }
\ No newline at end of file diff --git a/cmps/serverlib/src/HTMLListAssembler.cc b/cmps/serverlib/src/HTMLListAssembler.cc index bf190fe..1fc964e 100644 --- a/cmps/serverlib/src/HTMLListAssembler.cc +++ b/cmps/serverlib/src/HTMLListAssembler.cc @@ -1,25 +1,25 @@ /** * ======================== legal notice ====================== - * + * * File: HTMLListAssembler.cc * Created: 6. Juli 2012, 09 * 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 <HTMLListAssembler.h> diff --git a/cmps/serverlib/src/HTTPMediaResponse.cc b/cmps/serverlib/src/HTTPMediaResponse.cc index e403afe..729c46e 100644 --- a/cmps/serverlib/src/HTTPMediaResponse.cc +++ b/cmps/serverlib/src/HTTPMediaResponse.cc @@ -1,25 +1,25 @@ /** * ======================== legal notice ====================== - * + * * File: HTTPMediaResponse.cc * Created: 6. Juli 2012, 07 * 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 <HTTPMediaResponse.h> diff --git a/cmps/serverlib/src/JSonListAssembler.cc b/cmps/serverlib/src/JSonListAssembler.cc index 05ff5cc..6cba0bb 100644 --- a/cmps/serverlib/src/JSonListAssembler.cc +++ b/cmps/serverlib/src/JSonListAssembler.cc @@ -1,25 +1,25 @@ /** * ======================== legal notice ====================== - * + * * File: JSonListAssembler.cc * Created: 6. Juli 2012, 09 * 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 <JSonListAssembler.h> diff --git a/cmps/serverlib/src/MediaFileHandler.cc b/cmps/serverlib/src/MediaFileHandler.cc index 200c933..c4e237c 100644 --- a/cmps/serverlib/src/MediaFileHandler.cc +++ b/cmps/serverlib/src/MediaFileHandler.cc @@ -1,30 +1,30 @@ /** * ======================== legal notice ====================== - * + * * File: MediaFileHandler.cc * Created: 5. Juli 2012, 08 * 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 <MediaFileHandler.h> #include <AbstractMedia.h> -#include <FilesystemScanner.h> +#include <FSMediaScanner.h> #include <HTTPRequest.h> #include <HTTPMediaResponse.h> #include <StringBuilder.h> @@ -41,8 +41,8 @@ cMediaFileHandler::~cMediaFileHandler() cHTTPResponse *cMediaFileHandler::ProcessRequest(cHTTPRequest& Request) { isyslog("have to find requested media: >%s<", Request.Url().Path()); - - cAbstractMedia *media = FileSystemScanner()->FindMedia(Request.Url().Path()); + + cAbstractMedia *media = FSMediaScanner()->FindMedia(Request.Url().Path()); isyslog("cMediaFileHandler::ProcessRequest ... %0X", media); diff --git a/cmps/serverlib/src/MediaListHandler.cc b/cmps/serverlib/src/MediaListHandler.cc index cdb2b21..d5aaa78 100644 --- a/cmps/serverlib/src/MediaListHandler.cc +++ b/cmps/serverlib/src/MediaListHandler.cc @@ -24,7 +24,7 @@ */ #include <MediaListHandler.h> #include <AbstractListAssembler.h> -#include <FilesystemScanner.h> +#include <FSMediaScanner.h> #include <HTTPRequest.h> #include <HTTPResponse.h> #include <StringBuilder.h> @@ -69,7 +69,7 @@ cHTTPResponse *cMediaListHandler::ProcessRequest(cHTTPRequest& Request) if (!la) return new cHTTPResponse(HTTP_NotFound); res = new cHTTPResponse(HTTP_OK); res->SetContentType(la->MediaType()); - la->AssembleList(res->StringBuilder(), FileSystemScanner()->MediaPool(), FileSystemScanner()->Categories(), start, delta); + la->AssembleList(res->StringBuilder(), FSMediaScanner()->MediaPool(), FSMediaScanner()->Categories(), start, delta); return res; } diff --git a/cmps/tests/ConnectionHandlerTest.cc b/cmps/tests/ConnectionHandlerTest.cc index 6e0257b..8ff3cce 100644 --- a/cmps/tests/ConnectionHandlerTest.cc +++ b/cmps/tests/ConnectionHandlerTest.cc @@ -24,7 +24,7 @@ */ #include <ConnectionHandler.h> #include <ServerConfig.h> -#include <FilesystemScanner.h> +#include <FSMediaScanner.h> #include <MediaFactory.h> #include <MediaListHandler.h> #include <MediaFileHandler.h> @@ -54,7 +54,7 @@ private: cServerConfig config; cConnectionHandler ch; const char *name; - cFilesystemScanner *scanner; + cFSMediaScanner *scanner; }; cTestUnit::cTestUnit(const char* Name, cConnectionPoint &cp) @@ -67,7 +67,7 @@ cTestUnit::cTestUnit(const char* Name, cConnectionPoint &cp) config.SetDocumentRoot("/media/video"); config.SetAppIcon("/media/favicon.ico"); - scanner = new cFilesystemScanner(); + scanner = new cFSMediaScanner(); if (!scanner) { fprintf(stderr, "could not initialize application! (1)"); exit(-1); diff --git a/cmps/tests/FScanTest.cc b/cmps/tests/FScanTest.cc index 3a60bfb..a426c0d 100644 --- a/cmps/tests/FScanTest.cc +++ b/cmps/tests/FScanTest.cc @@ -1,33 +1,32 @@ /** * ======================== legal notice ====================== - * + * * File: FScanTest.cc * Created: 02.07.2012, 16 * 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 <stdlib.h> #include <iostream> #include <Audio.h> #include <Movie.h> -#include <Picture.h> -#include <FilesystemScanner.h> +#include <PictuFSMediaScannerner.h> #include <MediaFactory.h> #include <TimeMs.h> @@ -73,7 +72,7 @@ void FScanTest::test4() ///< file server (added 18G audio) found 5698 media, in 44653 ms. ///< file server (same files, fresh reboot) found 5698 media, in 54723 ms. { - cFilesystemScanner scanner; + cFSMediaScanner scanner; cAbstractMedia *media; std::cout << "FScanTest test 4" << std::endl; diff --git a/cmps/tests/FileSystemTest.cc b/cmps/tests/FileSystemTest.cc index 42a7836..3908941 100644 --- a/cmps/tests/FileSystemTest.cc +++ b/cmps/tests/FileSystemTest.cc @@ -1,10 +1,27 @@ -/* - * File: FileSystemTest.cc - * Author: django - * - * Created on 21.07.2012, 12:40:48 +/** + * ======================== legal notice ====================== + * + * File: FileSystemTest.cc + * Created: 21.07.2012, 12 + * 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 <stdlib.h> #include <iostream> #include <FileSystem.h> |