summaryrefslogtreecommitdiff
path: root/cmps
diff options
context:
space:
mode:
authorgeronimo <geronimo013@gmx.de>2012-07-27 08:31:40 +0200
committergeronimo <geronimo013@gmx.de>2012-07-27 08:31:40 +0200
commit736033f3d532c4814eeff84db5dbf99f0249df6e (patch)
tree3cdeb1ed7f8a8480c3ac3fe46d22250148ec702d /cmps
parentd2769982da50332c9354344e2e196f581f7d888b (diff)
downloadcmp-736033f3d532c4814eeff84db5dbf99f0249df6e.tar.gz
cmp-736033f3d532c4814eeff84db5dbf99f0249df6e.tar.bz2
added usage option to cmps
Diffstat (limited to 'cmps')
-rw-r--r--cmps/main.cc21
-rw-r--r--cmps/server.cbp13
-rw-r--r--cmps/server.layout4
-rw-r--r--cmps/server.layout.save2
-rw-r--r--cmps/serverlib/serverlib.layout8
-rw-r--r--cmps/serverlib/serverlib.layout.save12
6 files changed, 36 insertions, 24 deletions
diff --git a/cmps/main.cc b/cmps/main.cc
index d897ab8..0f392af 100644
--- a/cmps/main.cc
+++ b/cmps/main.cc
@@ -42,6 +42,7 @@ static struct option longOptions[] = {
{ "port", required_argument, NULL, 'p' }
, { "mediaRoot", required_argument, NULL, 'r' }
, { "favicon", required_argument, NULL, 'i' }
+, { "help", no_argument, NULL, 'h' }
, { NULL, no_argument, NULL, 0 }
};
@@ -56,6 +57,22 @@ static int refreshScanner(void *opaque, cHTTPRequest &Request)
return -1;
}
+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");
+
+ exit(0);
+}
+
static void parseCommandline(int argc, char *argv[], cServerConfig &config)
{
int c;
@@ -65,7 +82,7 @@ static void parseCommandline(int argc, char *argv[], cServerConfig &config)
config.SetDocumentRoot("/media");
config.SetAppIcon("/media/favicon.ico");
- while ((c = getopt_long(argc, argv, "p:r:i:", longOptions, NULL)) != -1) {
+ while ((c = getopt_long(argc, argv, "hp:r:i:", longOptions, NULL)) != -1) {
switch (c) {
case 'p': {
if (isnumber(optarg)) {
@@ -94,6 +111,8 @@ static void parseCommandline(int argc, char *argv[], cServerConfig &config)
}
}
} break;
+
+ case 'h': usage(); break;
}
}
}
diff --git a/cmps/server.cbp b/cmps/server.cbp
index 55c4f6d..4c165d5 100644
--- a/cmps/server.cbp
+++ b/cmps/server.cbp
@@ -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" />
@@ -46,17 +46,10 @@
<Add library="../libs/networking/libnetworking.a" />
<Add library="../libs/util/libutil.a" />
<Add library="../libs/vdr/libvdr.a" />
- <Add library="jpeg" />
<Add library="pthread" />
- <Add library="dl" />
- <Add library="cap" />
- <Add library="rt" />
- <Add library="fribidi" />
- <Add library="freetype" />
- <Add library="fontconfig" />
- <Add library="yajl" />
<Add library="ssl" />
<Add library="crypt" />
+ <Add library="rt" />
</Linker>
<Unit filename="main.cc" />
<Extensions>
diff --git a/cmps/server.layout b/cmps/server.layout
index 140c8d3..75de2f8 100644
--- a/cmps/server.layout
+++ b/cmps/server.layout
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_layout_file>
<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">
+ <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="213" topLine="0" />
+ <Cursor1 position="1529" topLine="0" />
</Cursor>
</File>
</CodeBlocks_layout_file>
diff --git a/cmps/server.layout.save b/cmps/server.layout.save
index 140c8d3..2c8a82b 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="213" topLine="0" />
+ <Cursor1 position="1529" topLine="0" />
</Cursor>
</File>
</CodeBlocks_layout_file>
diff --git a/cmps/serverlib/serverlib.layout b/cmps/serverlib/serverlib.layout
index 51b7661..8f17071 100644
--- a/cmps/serverlib/serverlib.layout
+++ b/cmps/serverlib/serverlib.layout
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_layout_file>
<ActiveTarget name="Debug" />
- <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/HTMLListAssembler.cc" open="0" top="0" tabpos="3" 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/MediaListHandler.cc" open="0" top="0" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
@@ -16,9 +16,9 @@
<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>
</CodeBlocks_layout_file>
diff --git a/cmps/serverlib/serverlib.layout.save b/cmps/serverlib/serverlib.layout.save
index 51b7661..cd411cc 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="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>
- <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/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/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/HTMLListAssembler.cc" open="0" top="0" tabpos="3" 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>