diff options
author | louis <louis.braun@gmx.de> | 2015-07-25 14:19:32 +0200 |
---|---|---|
committer | louis <louis.braun@gmx.de> | 2015-07-25 14:19:32 +0200 |
commit | 6e0f56e56c8eae6052d59f840f7108befa389693 (patch) | |
tree | 56379a0ad187362a5a1fbc96151834a5f3436319 /libcore | |
parent | d9c5219f430e6963e239fa21f965aa1bf1b90ab0 (diff) | |
download | vdr-plugin-skindesigner-6e0f56e56c8eae6052d59f840f7108befa389693.tar.gz vdr-plugin-skindesigner-6e0f56e56c8eae6052d59f840f7108befa389693.tar.bz2 |
added progressmodeonly viewelement in displayreplay
Diffstat (limited to 'libcore')
-rw-r--r-- | libcore/helpers.c | 13 | ||||
-rw-r--r-- | libcore/helpers.h | 2 |
2 files changed, 15 insertions, 0 deletions
diff --git a/libcore/helpers.c b/libcore/helpers.c index 9fb0bdf..e195c37 100644 --- a/libcore/helpers.c +++ b/libcore/helpers.c @@ -213,6 +213,19 @@ void cStopWatch::Stop(const char* message) { dsyslog("skindesigner: %s - needed %d ms", message, (int)(cTimeMs::Now() - start)); } +string GetTimeString(int seconds) { + time_t sec(seconds); + tm *p = gmtime(&sec); + int hours = p->tm_hour; + int mins = p->tm_min; + int secs = p->tm_sec; + if (hours > 0) { + return *cString::sprintf("%d:%02d:%02d", hours, mins, secs); + } + return *cString::sprintf("%02d:%02d", mins, secs);; +} + + //View Helpers string GetScreenResolutionString(int width, int height, bool *isHD) { string name = ""; diff --git a/libcore/helpers.h b/libcore/helpers.h index b370eb0..74ed7d3 100644 --- a/libcore/helpers.h +++ b/libcore/helpers.h @@ -41,6 +41,8 @@ public: void Stop(const char* message); }; +string GetTimeString(int seconds); + string GetScreenResolutionString(int width, int height, bool *isHD); string GetScreenAspectString(double aspect, bool *isWideScreen); |