summaryrefslogtreecommitdiff
path: root/cmps
diff options
context:
space:
mode:
authorgeronimo <geronimo013@gmx.de>2012-07-19 15:10:24 +0200
committergeronimo <geronimo013@gmx.de>2012-07-19 15:10:24 +0200
commit04a867b018a8c6761047ef8878a4434692673084 (patch)
tree79109d9d6c053b9c5446f89e9cc07d30380a0fa1 /cmps
parent94023c37e288048eb22a2d4e3dfa8529fe3a3816 (diff)
downloadcmp-04a867b018a8c6761047ef8878a4434692673084.tar.gz
cmp-04a867b018a8c6761047ef8878a4434692673084.tar.bz2
add categories to json result message
Diffstat (limited to 'cmps')
-rw-r--r--cmps/nbproject/Makefile-Debug.mk17
-rw-r--r--cmps/nbproject/Makefile-Release.mk3
-rw-r--r--cmps/nbproject/configurations.xml13
-rw-r--r--cmps/serverlib/include/JSonListAssembler.h18
-rw-r--r--cmps/serverlib/nbproject/Makefile-Debug.mk15
-rw-r--r--cmps/serverlib/nbproject/Makefile-Release.mk15
-rw-r--r--cmps/serverlib/nbproject/configurations.xml1
-rw-r--r--cmps/serverlib/nbproject/private/private.xml1
-rw-r--r--cmps/serverlib/serverlib.layout8
-rw-r--r--cmps/serverlib/serverlib.layout.save10
-rw-r--r--cmps/serverlib/src/JSonListAssembler.cc43
11 files changed, 80 insertions, 64 deletions
diff --git a/cmps/nbproject/Makefile-Debug.mk b/cmps/nbproject/Makefile-Debug.mk
index 53e20b9..a3a76de 100644
--- a/cmps/nbproject/Makefile-Debug.mk
+++ b/cmps/nbproject/Makefile-Debug.mk
@@ -22,6 +22,7 @@ AS=as
# Macros
CND_PLATFORM=GNU-Linux-x86
+CND_DLIB_EXT=so
CND_CONF=Debug
CND_DISTDIR=dist
CND_BUILDDIR=build
@@ -60,7 +61,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 -ljpeg -lpthread -ldl -lcap -lrt -lfribidi -lfreetype -lfontconfig -lyajl -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/util/dist/Debug/GNU-Linux-x86/libutil.a ../libs/vdr/dist/Debug/GNU-Linux-x86/libvdr.a -lpthread -lrt -lssl -lcrypt
# Build Targets
.build-conf: ${BUILD_SUBPROJECTS}
@@ -80,10 +81,10 @@ ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/cmps: ${OBJECTFILES}
${MKDIR} -p ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}
${LINK.cc} -o ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/cmps ${OBJECTFILES} ${LDLIBSOPTIONS}
-${OBJECTDIR}/main.o: nbproject/Makefile-${CND_CONF}.mk main.cc
+${OBJECTDIR}/main.o: main.cc
${MKDIR} -p ${OBJECTDIR}
${RM} $@.d
- $(COMPILE.cc) -g -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/util/include -I../libs/vdr/include -MMD -MP -MF $@.d -o ${OBJECTDIR}/main.o main.cc
# Subprojects
.build-subprojects:
@@ -115,25 +116,25 @@ ${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 -I. -Iinclude -Iserverlib/include -I../libs/fsScan/include -I../libs/networking/include -I../libs/util/include -I../libs/vdr/include -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/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 -I. -Iinclude -Iserverlib/include -I../libs/fsScan/include -I../libs/networking/include -I../libs/util/include -I../libs/vdr/include -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/util/include -I../libs/vdr/include -I. -MMD -MP -MF $@.d -o ${TESTDIR}/tests/ConnectionHandlerTest.o tests/ConnectionHandlerTest.cc
${TESTDIR}/tests/FScanTest.o: tests/FScanTest.cc
${MKDIR} -p ${TESTDIR}/tests
${RM} $@.d
- $(COMPILE.cc) -g -I. -Iinclude -Iserverlib/include -I../libs/fsScan/include -I../libs/networking/include -I../libs/util/include -I../libs/vdr/include -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/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 -I. -Iinclude -Iserverlib/include -I../libs/fsScan/include -I../libs/networking/include -I../libs/util/include -I../libs/vdr/include -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/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
@@ -144,7 +145,7 @@ ${OBJECTDIR}/main_nomain.o: ${OBJECTDIR}/main.o main.cc
(echo "$$NMOUTPUT" | ${GREP} 'T _main$$'); \
then \
${RM} $@.d;\
- $(COMPILE.cc) -g -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/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
diff --git a/cmps/nbproject/Makefile-Release.mk b/cmps/nbproject/Makefile-Release.mk
index 8abe8f8..65f3816 100644
--- a/cmps/nbproject/Makefile-Release.mk
+++ b/cmps/nbproject/Makefile-Release.mk
@@ -22,6 +22,7 @@ AS=as
# Macros
CND_PLATFORM=GNU-Linux-x86
+CND_DLIB_EXT=so
CND_CONF=Release
CND_DISTDIR=dist
CND_BUILDDIR=build
@@ -70,7 +71,7 @@ ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/cmps: ${OBJECTFILES}
${MKDIR} -p ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}
${LINK.cc} -o ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/cmps ${OBJECTFILES} ${LDLIBSOPTIONS}
-${OBJECTDIR}/main.o: nbproject/Makefile-${CND_CONF}.mk main.cc
+${OBJECTDIR}/main.o: main.cc
${MKDIR} -p ${OBJECTDIR}
${RM} $@.d
$(COMPILE.cc) -O2 -MMD -MP -MF $@.d -o ${OBJECTDIR}/main.o main.cc
diff --git a/cmps/nbproject/configurations.xml b/cmps/nbproject/configurations.xml
index aac44fd..2138f97 100644
--- a/cmps/nbproject/configurations.xml
+++ b/cmps/nbproject/configurations.xml
@@ -46,6 +46,7 @@
kind="IMPORTANT_FILES_FOLDER">
<itemPath>Makefile</itemPath>
<itemPath>../README</itemPath>
+ <itemPath>summary.txt</itemPath>
</logicalFolder>
</logicalFolder>
<projectmakefile>Makefile</projectmakefile>
@@ -66,6 +67,11 @@
<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>
+ <preprocessorList>
+ <Elem>_GNU_SOURCE=1</Elem>
+ <Elem>_REENTRANT</Elem>
+ </preprocessorList>
+ <warningLevel>2</warningLevel>
</ccTool>
<linkerTool>
<linkerLibItems>
@@ -129,15 +135,8 @@
OP="${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/libvdr.a">
</makeArtifact>
</linkerLibProjectItem>
- <linkerLibLibItem>jpeg</linkerLibLibItem>
<linkerLibLibItem>pthread</linkerLibLibItem>
- <linkerLibLibItem>dl</linkerLibLibItem>
- <linkerLibLibItem>cap</linkerLibLibItem>
<linkerLibLibItem>rt</linkerLibLibItem>
- <linkerLibLibItem>fribidi</linkerLibLibItem>
- <linkerLibLibItem>freetype</linkerLibLibItem>
- <linkerLibLibItem>fontconfig</linkerLibLibItem>
- <linkerLibLibItem>yajl</linkerLibLibItem>
<linkerLibLibItem>ssl</linkerLibLibItem>
<linkerLibLibItem>crypt</linkerLibLibItem>
</linkerLibItems>
diff --git a/cmps/serverlib/include/JSonListAssembler.h b/cmps/serverlib/include/JSonListAssembler.h
index bfc68ed..6185508 100644
--- a/cmps/serverlib/include/JSonListAssembler.h
+++ b/cmps/serverlib/include/JSonListAssembler.h
@@ -1,25 +1,25 @@
/**
* ======================== legal notice ======================
- *
+ *
* File: JSonListAssembler.h
* Created: 6. Juli 2012, 09:53
* 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 JSONLISTASSEMBLER_H
@@ -29,6 +29,7 @@
#include <map>
class cStringBuilder;
+class cJSonWriter;
class cJSonListAssembler : public cAbstractListAssembler {
public:
cJSonListAssembler();
@@ -40,7 +41,10 @@ protected:
virtual bool OpenList(cStringBuilder &sb, std::map<int, size_t> &Categories, size_t total, size_t start = 0, uint delta = 40);
virtual bool AddElement(cStringBuilder &sb, void *ListElement, bool odd);
virtual bool CloseList(cStringBuilder &sb, size_t total, size_t start = 0, uint delta = 40);
-};
+
+private:
+ cJSonWriter *writer;
+ };
#endif /* JSONLISTASSEMBLER_H */
diff --git a/cmps/serverlib/nbproject/Makefile-Debug.mk b/cmps/serverlib/nbproject/Makefile-Debug.mk
index a19c3d9..a95cf37 100644
--- a/cmps/serverlib/nbproject/Makefile-Debug.mk
+++ b/cmps/serverlib/nbproject/Makefile-Debug.mk
@@ -22,6 +22,7 @@ AS=as
# Macros
CND_PLATFORM=GNU-Linux-x86
+CND_DLIB_EXT=so
CND_CONF=Debug
CND_DISTDIR=dist
CND_BUILDDIR=build
@@ -69,37 +70,37 @@ ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/libserverlib.a: ${OBJECTFILES}
${AR} -rv ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/libserverlib.a ${OBJECTFILES}
$(RANLIB) ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/libserverlib.a
-${OBJECTDIR}/src/JSonListAssembler.o: nbproject/Makefile-${CND_CONF}.mk src/JSonListAssembler.cc
+${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
-${OBJECTDIR}/src/CommandHandler.o: nbproject/Makefile-${CND_CONF}.mk src/CommandHandler.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
-${OBJECTDIR}/src/HTMLListAssembler.o: nbproject/Makefile-${CND_CONF}.mk src/HTMLListAssembler.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
-${OBJECTDIR}/src/AbstractMediaRequestHandler.o: nbproject/Makefile-${CND_CONF}.mk src/AbstractMediaRequestHandler.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
-${OBJECTDIR}/src/HTTPMediaResponse.o: nbproject/Makefile-${CND_CONF}.mk src/HTTPMediaResponse.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
-${OBJECTDIR}/src/MediaListHandler.o: nbproject/Makefile-${CND_CONF}.mk src/MediaListHandler.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
-${OBJECTDIR}/src/MediaFileHandler.o: nbproject/Makefile-${CND_CONF}.mk src/MediaFileHandler.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
diff --git a/cmps/serverlib/nbproject/Makefile-Release.mk b/cmps/serverlib/nbproject/Makefile-Release.mk
index a423680..55f83a2 100644
--- a/cmps/serverlib/nbproject/Makefile-Release.mk
+++ b/cmps/serverlib/nbproject/Makefile-Release.mk
@@ -22,6 +22,7 @@ AS=as
# Macros
CND_PLATFORM=GNU-Linux-x86
+CND_DLIB_EXT=so
CND_CONF=Release
CND_DISTDIR=dist
CND_BUILDDIR=build
@@ -69,37 +70,37 @@ ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/libserverlib.a: ${OBJECTFILES}
${AR} -rv ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/libserverlib.a ${OBJECTFILES}
$(RANLIB) ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/libserverlib.a
-${OBJECTDIR}/src/JSonListAssembler.o: nbproject/Makefile-${CND_CONF}.mk src/JSonListAssembler.cc
+${OBJECTDIR}/src/JSonListAssembler.o: src/JSonListAssembler.cc
${MKDIR} -p ${OBJECTDIR}/src
${RM} $@.d
$(COMPILE.cc) -O2 -MMD -MP -MF $@.d -o ${OBJECTDIR}/src/JSonListAssembler.o src/JSonListAssembler.cc
-${OBJECTDIR}/src/CommandHandler.o: nbproject/Makefile-${CND_CONF}.mk src/CommandHandler.cc
+${OBJECTDIR}/src/CommandHandler.o: src/CommandHandler.cc
${MKDIR} -p ${OBJECTDIR}/src
${RM} $@.d
$(COMPILE.cc) -O2 -MMD -MP -MF $@.d -o ${OBJECTDIR}/src/CommandHandler.o src/CommandHandler.cc
-${OBJECTDIR}/src/HTMLListAssembler.o: nbproject/Makefile-${CND_CONF}.mk src/HTMLListAssembler.cc
+${OBJECTDIR}/src/HTMLListAssembler.o: src/HTMLListAssembler.cc
${MKDIR} -p ${OBJECTDIR}/src
${RM} $@.d
$(COMPILE.cc) -O2 -MMD -MP -MF $@.d -o ${OBJECTDIR}/src/HTMLListAssembler.o src/HTMLListAssembler.cc
-${OBJECTDIR}/src/AbstractMediaRequestHandler.o: nbproject/Makefile-${CND_CONF}.mk src/AbstractMediaRequestHandler.cc
+${OBJECTDIR}/src/AbstractMediaRequestHandler.o: src/AbstractMediaRequestHandler.cc
${MKDIR} -p ${OBJECTDIR}/src
${RM} $@.d
$(COMPILE.cc) -O2 -MMD -MP -MF $@.d -o ${OBJECTDIR}/src/AbstractMediaRequestHandler.o src/AbstractMediaRequestHandler.cc
-${OBJECTDIR}/src/HTTPMediaResponse.o: nbproject/Makefile-${CND_CONF}.mk src/HTTPMediaResponse.cc
+${OBJECTDIR}/src/HTTPMediaResponse.o: src/HTTPMediaResponse.cc
${MKDIR} -p ${OBJECTDIR}/src
${RM} $@.d
$(COMPILE.cc) -O2 -MMD -MP -MF $@.d -o ${OBJECTDIR}/src/HTTPMediaResponse.o src/HTTPMediaResponse.cc
-${OBJECTDIR}/src/MediaListHandler.o: nbproject/Makefile-${CND_CONF}.mk src/MediaListHandler.cc
+${OBJECTDIR}/src/MediaListHandler.o: src/MediaListHandler.cc
${MKDIR} -p ${OBJECTDIR}/src
${RM} $@.d
$(COMPILE.cc) -O2 -MMD -MP -MF $@.d -o ${OBJECTDIR}/src/MediaListHandler.o src/MediaListHandler.cc
-${OBJECTDIR}/src/MediaFileHandler.o: nbproject/Makefile-${CND_CONF}.mk src/MediaFileHandler.cc
+${OBJECTDIR}/src/MediaFileHandler.o: src/MediaFileHandler.cc
${MKDIR} -p ${OBJECTDIR}/src
${RM} $@.d
$(COMPILE.cc) -O2 -MMD -MP -MF $@.d -o ${OBJECTDIR}/src/MediaFileHandler.o src/MediaFileHandler.cc
diff --git a/cmps/serverlib/nbproject/configurations.xml b/cmps/serverlib/nbproject/configurations.xml
index 5ca0eaf..3291f98 100644
--- a/cmps/serverlib/nbproject/configurations.xml
+++ b/cmps/serverlib/nbproject/configurations.xml
@@ -37,6 +37,7 @@
projectFiles="false"
kind="IMPORTANT_FILES_FOLDER">
<itemPath>Makefile</itemPath>
+ <itemPath>summary.txt</itemPath>
</logicalFolder>
</logicalFolder>
<projectmakefile>Makefile</projectmakefile>
diff --git a/cmps/serverlib/nbproject/private/private.xml b/cmps/serverlib/nbproject/private/private.xml
index 5ee2703..dfdcba4 100644
--- a/cmps/serverlib/nbproject/private/private.xml
+++ b/cmps/serverlib/nbproject/private/private.xml
@@ -5,4 +5,5 @@
<activeConfIndexElem>0</activeConfIndexElem>
</data>
<editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/1"/>
+ <editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="0"/>
</project-private>
diff --git a/cmps/serverlib/serverlib.layout b/cmps/serverlib/serverlib.layout
index 8102807..d8fea17 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/JSonListAssembler.cc" open="1" top="1" 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="1138" topLine="0" />
+ <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="1" top="1" 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>
</CodeBlocks_layout_file>
diff --git a/cmps/serverlib/serverlib.layout.save b/cmps/serverlib/serverlib.layout.save
index 2f5e283..6d13f5b 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/JSonListAssembler.cc" open="1" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
+ <File name="src/JSonListAssembler.cc" open="0" top="0" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
- <Cursor1 position="0" topLine="0" />
+ <Cursor1 position="1138" 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/MediaListHandler.cc" open="0" top="0" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="0" 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/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/HTMLListAssembler.cc" open="0" top="0" tabpos="3" 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/JSonListAssembler.cc b/cmps/serverlib/src/JSonListAssembler.cc
index c5126a3..8660953 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:53
* 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>
@@ -32,37 +32,44 @@ cJSonListAssembler::cJSonListAssembler()
cJSonListAssembler::~cJSonListAssembler()
{
+ if (writer) delete writer;
+ writer = NULL;
}
bool cJSonListAssembler::OpenList(cStringBuilder &sb, std::map<int, size_t> &Categories, size_t total, size_t start, uint delta)
{
- cJSonWriter writer(sb);
+ writer = new cJSonWriter(sb);
- writer.Object().Key("total").Value(total);
- writer.Key("results").Array();
+ writer->Object().Key("total").Value(total);
+ writer->Key("types").Array();
+ std::map<int, size_t>::iterator it = Categories.begin();
+
+ while (it != Categories.end()) {
+ writer->Object().Key("name").Value(cAbstractMedia::MediaType2Text(it->first));
+ writer->Key("start").Value(it->second).EndObject();
+ ++it;
+ }
+ writer->EndArray().Key("results").Array();
return true;
}
bool cJSonListAssembler::AddElement(cStringBuilder &sb, void *ListElement, bool odd)
{
- cJSonWriter writer(sb);
cAbstractMedia *m = (cAbstractMedia *)ListElement;
- writer.Object();
- writer.Key("name").Value(m->Name());
- writer.Key("type").Value(m->MediaType());
- writer.Key("path").Value(m->LogicalPath());
- writer.EndObject();
+ writer->Object();
+ writer->Key("name").Value(m->Name());
+ writer->Key("type").Value(m->MediaType());
+ writer->Key("path").Value(m->LogicalPath());
+ writer->EndObject();
return true;
}
bool cJSonListAssembler::CloseList(cStringBuilder &sb, size_t total, size_t start, uint delta)
{
- cJSonWriter writer(sb);
-
- writer.EndArray().EndObject();
+ writer->EndArray().EndObject();
return true;
}