From 9933c5a2b1b8815a2fa3e98b7f29be240bbb6d14 Mon Sep 17 00:00:00 2001 From: anbr Date: Tue, 28 Dec 2010 23:16:38 +0100 Subject: Read image : Fill OSD-field with capitalize volume name --- Makefile | 2 +- commands.c | 14 +++++++++++++- 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"); -- cgit v1.2.3