summaryrefslogtreecommitdiff
path: root/plugins/profiler/vdrDVBProfiler
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/profiler/vdrDVBProfiler')
-rw-r--r--plugins/profiler/vdrDVBProfiler/channelTitle.conf2
-rw-r--r--plugins/profiler/vdrDVBProfiler/dvbProfiler.cpp17
2 files changed, 14 insertions, 5 deletions
diff --git a/plugins/profiler/vdrDVBProfiler/channelTitle.conf b/plugins/profiler/vdrDVBProfiler/channelTitle.conf
index 598c667..b8daa5d 100644
--- a/plugins/profiler/vdrDVBProfiler/channelTitle.conf
+++ b/plugins/profiler/vdrDVBProfiler/channelTitle.conf
@@ -24,4 +24,4 @@
#
# Thank you.
-%no% %chan% %- |title% \ No newline at end of file
+%no;3% %chan% %- |title% \ No newline at end of file
diff --git a/plugins/profiler/vdrDVBProfiler/dvbProfiler.cpp b/plugins/profiler/vdrDVBProfiler/dvbProfiler.cpp
index 333f773..c21275c 100644
--- a/plugins/profiler/vdrDVBProfiler/dvbProfiler.cpp
+++ b/plugins/profiler/vdrDVBProfiler/dvbProfiler.cpp
@@ -59,8 +59,8 @@ public:
string ToString(){
stringstream output;
- size_t startPos = 0, endPos = 0, delim = 0;
- string delimiter, var;
+ size_t startPos = 0, endPos = 0, delim = 0, opt = 0;
+ string delimiter, options, var;
while((startPos = pattern.find_first_of('%', startPos)) != string::npos){
// Copy the content from endPos to startPos
output << pattern.substr(endPos + 1, startPos - endPos - (endPos > 0 ? 1 : 0 ));
@@ -69,9 +69,18 @@ public:
delimiter = pattern.substr(startPos + 1, delim - startPos - 1);
startPos = delim;
}
- var = pattern.substr(startPos + 1, endPos - startPos - 1);
+ if((opt = pattern.find_first_of(';', startPos+1)) != string::npos && opt < endPos){
+ options = pattern.substr(opt + 1, endPos - opt - 1);
+ } else {
+ opt = endPos;
+ }
+ var = pattern.substr(startPos + 1, opt - startPos - 1);
if (var.compare("no") == 0 && channelNo > 0){
- output << delimiter << channelNo;
+ int width = atoi(options.c_str());
+ output << delimiter;
+ if(width > 0)
+ output << setfill('0') << setw(width);
+ output << channelNo;
} else if(var.compare("chan") == 0 && !channelName.empty()){
output << delimiter << channelName;
} else if(var.compare("title") == 0 && !title.empty()){