summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoranbr <vdr07@deltab.de>2010-12-28 23:16:38 +0100
committeranbr <vdr07@deltab.de>2010-12-28 23:16:38 +0100
commit9933c5a2b1b8815a2fa3e98b7f29be240bbb6d14 (patch)
treefcd38e411dac1a2ec8c6426530d0362d70f8a4dc
parentb8f076b5b66c7b0236bd8905d63b1206dd427b7d (diff)
downloadvdr-plugin-dvdswitch-9933c5a2b1b8815a2fa3e98b7f29be240bbb6d14.tar.gz
vdr-plugin-dvdswitch-9933c5a2b1b8815a2fa3e98b7f29be240bbb6d14.tar.bz2
Read image : Fill OSD-field with capitalize volume name
-rw-r--r--Makefile2
-rw-r--r--commands.c14
2 files changed, 14 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 8429425..2b78aed 100644
--- a/Makefile
+++ b/Makefile
@@ -16,7 +16,7 @@ VERSION = $(shell grep 'static const char \*VERSION *=' $(PLUGIN).c | awk '{ pri
### The C++ compiler and options:
CXX ?= g++
-CXXFLAGS ?= -g -O2 -Wall -Woverloaded-virtual -Wno-parentheses
+CXXFLAGS ?= -O2 -Wall -Woverloaded-virtual -Wno-parentheses
### The directory environment:
diff --git a/commands.c b/commands.c
index c9bf489..0edcfc3 100644
--- a/commands.c
+++ b/commands.c
@@ -731,7 +731,19 @@ cCMDImageRead::cCMDImageRead(cImageList &imagelist)
{
dsyslog("dvdswitch: query name of volume %s",DVDSwitchSetup.DVDLinkOrg);
int err = volname(DVDSwitchSetup.DVDLinkOrg, File,sizeof(File));
- if(0 != err) {
+ if(0 == err) {
+ // Capitalization - lowercase name, except first character
+ bool s;
+ unsigned int n;
+ for (n = 0,s = true; n < sizeof(File) && File[n] != '\0'; ++n) {
+ if (isspace(File[n]) || '_' == File[n]) {
+ File[n] = ' ';
+ s = true;
+ } else if(s) { s = false; }
+ else { File[n] = tolower(File[n]); }
+ }
+
+ } else {
esyslog("dvdswitch: Can't query name of volume! %d", err);
OSDErrorNumMsg(err, tr("Can't query name of volume!"));
strcpy(File, "\0");