From 2c17177f2faa9e03d29fad3e0e4d9b0a827ca401 Mon Sep 17 00:00:00 2001 From: louis Date: Mon, 20 Oct 2014 17:35:52 +0200 Subject: added extented recording information --- libcore/helpers.c | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) (limited to 'libcore/helpers.c') diff --git a/libcore/helpers.c b/libcore/helpers.c index c8e7fe2..1934f3e 100644 --- a/libcore/helpers.c +++ b/libcore/helpers.c @@ -175,3 +175,46 @@ void cStopWatch::Report(const char* message) { void cStopWatch::Stop(const char* message) { dsyslog("skindesigner: %s - needed %d ms", message, (int)(cTimeMs::Now() - start)); } + +//View Helpers +string GetScreenResolutionString(int width, int height, bool *isHD) { + string name = ""; + switch (width) { + case 1920: + case 1440: + name = "hd1080i"; + *isHD = true; + break; + case 1280: + if (height == 720) + name = "hd720p"; + else + name = "hd1080i"; + *isHD = true; + break; + case 720: + name = "sd576i"; + break; + default: + name = "sd576i"; + break; + } + return name; +} + +string GetScreenAspectString(double aspect, bool *isWideScreen) { + string name = ""; + *isWideScreen = false; + if (aspect == 4.0/3.0) { + name = "4:3"; + *isWideScreen = false; + } else if (aspect == 16.0/9.0) { + name = "16:9"; + *isWideScreen = true; + } else if (aspect == 2.21) { + name = "21:9"; + *isWideScreen = true; + } + return name; +} + -- cgit v1.2.3