From 736033f3d532c4814eeff84db5dbf99f0249df6e Mon Sep 17 00:00:00 2001 From: geronimo Date: Fri, 27 Jul 2012 08:31:40 +0200 Subject: added usage option to cmps --- README | 31 +++++++++++------------ cmps/main.cc | 21 +++++++++++++++- cmps/server.cbp | 13 +++------- cmps/server.layout | 4 +-- cmps/server.layout.save | 2 +- cmps/serverlib/serverlib.layout | 8 +++--- cmps/serverlib/serverlib.layout.save | 12 ++++----- libs/fsScan/fsScan.layout | 36 +++++++++++++------------- libs/fsScan/fsScan.layout.save | 46 +++++++++++++++++----------------- libs/networking/networking.layout | 14 +++++------ libs/networking/networking.layout.save | 12 ++++----- libs/util/util.layout | 24 +++++++++--------- libs/util/util.layout.save | 26 +++++++++---------- libs/vdr/vdr.layout | 13 +++++++--- libs/vdr/vdr.layout.save | 14 +++++------ 15 files changed, 145 insertions(+), 131 deletions(-) diff --git a/README b/README index 70063b0..fba16ee 100644 --- a/README +++ b/README @@ -14,35 +14,32 @@ scans the given media root directory (default /media) and offers the result as list in html- and json-format. The lists contain an url for the media, which can be streamed by using http-protocol. No external tools are used at server side. -The libraries I use are libyajl, libssl, libcrypto and libstdc++ - where I -used selfcompiled libyajl release 2.0.5 (the only lib I had to compile at -debian stable system). -As parts of the server libraries are work from vdr, cmps inherits the -dependencies of vdr. +The libraries I use are libssl, libcrypto and libstdc++ +As parts of the server libraries are work from vdr, cmps inherits some +dependencies of vdr (i.e. libpthread and librt). So the complete (runtime) dependencies of cmps are: - libjpeg libpthread - libcap librt - libfribidi - libfreetype - libfontconfig - libyajl libssl libcrypto libstdc++ - libcrypto + cmps supports three commandline parameters: -r the directory where to start scanning for media -p ### the serverport where the mediaserver can be connected to -i the favicon - the icon to distinguish the server, if list is requested by standard web-browsers. +> attribution: +cmps uses some classes from the vdr-project, a project of Klaus Schmidinger, +located at http://tvdr.de + cmpc (the client) ----------------- *tbd* + cmpcj (a java client) --------------------- is the butler between mediaserver (cmps) and mediaplayer and offers several @@ -55,11 +52,11 @@ path of the media. A doubleclick on a mediaitem starts the player - cmpc (the client) stays blocked until the player stops. -attribution: -cmpcj uses glazedlists from http://www.glazedlists.com and -jackson from http://jackson.codehaus.org -the used folder icons are from http://www.iconfinder.com/search/?q=iconset%3Asabre -the vdr- and dvd-icons build on my own (based on the work from above) +> attribution: +cmpcj uses glazedlists from http://www.glazedlists.com and jackson from +http://jackson.codehaus.org +The used folder icons are from http://www.iconfinder.com/search/?q=iconset%3Asabre +where as the vdr- and dvd-icons are built on my own (based on the work from above) The C/C++ libraries 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 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 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 @@