|
|
7e26054 |
diff --git a/screenshot.c b/screenshot.c
|
|
|
7e26054 |
index cae9a61..641cc49 100755
|
|
|
7e26054 |
--- a/screenshot.c
|
|
|
7e26054 |
+++ b/screenshot.c
|
|
|
7e26054 |
@@ -58,15 +58,19 @@ void cThreadScreenshot::Action(void) {
|
|
|
7e26054 |
Skins.Flush();
|
|
|
7e26054 |
}
|
|
|
7e26054 |
*/
|
|
|
7e26054 |
+ int iResX = screenshotConfig.iResX;
|
|
|
7e26054 |
int iResY = screenshotConfig.iResY;
|
|
|
7e26054 |
- if( iResY == 0 )
|
|
|
7e26054 |
+ if( iResX <= 0 && iResY <= 0 ) {
|
|
|
7e26054 |
+ iResX = -1;
|
|
|
7e26054 |
+ iResY = -1;
|
|
|
7e26054 |
+ }
|
|
|
7e26054 |
+ else if( iResY == 0 )
|
|
|
7e26054 |
{
|
|
|
7e26054 |
iResY = screenshotConfig.iResX / (1.25 * Setup.OSDAspect);
|
|
|
7e26054 |
}
|
|
|
7e26054 |
isOk = cDevice::PrimaryDevice()->GrabImageFile(fileName, screenshotConfig.iFileformat,
|
|
|
7e26054 |
screenshotConfig.iQuality,
|
|
|
7e26054 |
- screenshotConfig.iResX,
|
|
|
7e26054 |
- iResY);
|
|
|
7e26054 |
+ iResX, iResY);
|
|
|
7e26054 |
i++;
|
|
|
7e26054 |
}
|
|
|
7e26054 |
|
|
|
7e26054 |
@@ -78,7 +82,9 @@ void cThreadScreenshot::Action(void) {
|
|
|
7e26054 |
// show result
|
|
|
7e26054 |
if (isOk) {
|
|
|
7e26054 |
isyslog("screenshot: %d image%s saved", screenshotConfig.iNoOfPics, (screenshotConfig.iNoOfPics > 1) ? "s" : "");
|
|
|
7e26054 |
- const char *tmp = tr(screenshotConfig.iNoOfPics > 1 ? "OK - Images saved." : "OK - Image saved.");
|
|
|
7e26054 |
+ const char *tmp = screenshotConfig.iNoOfPics > 1 ?
|
|
|
7e26054 |
+ tr("Images successfully saved.") :
|
|
|
7e26054 |
+ tr("Image successfully saved.");
|
|
|
7e26054 |
Skins.QueueMessage(mtInfo, tmp);
|
|
|
7e26054 |
Skins.Flush();
|
|
|
7e26054 |
} else {
|
|
|
7e26054 |
@@ -120,14 +126,13 @@ void cMenuScreenshot::Show(void) {
|
|
|
7e26054 |
-------------------------------------------------------------------------------------------------*/
|
|
|
7e26054 |
|
|
|
7e26054 |
cScreenshotConfig::cScreenshotConfig(void) {
|
|
|
7e26054 |
- strcpy(sPath, "/tmp");
|
|
|
7e26054 |
+
|
|
|
7e26054 |
iFileformat = 1;
|
|
|
7e26054 |
- iQuality = 95;
|
|
|
7e26054 |
- iResX = 768;
|
|
|
7e26054 |
- iResY = 576;
|
|
|
7e26054 |
+ iQuality = 85;
|
|
|
7e26054 |
+ iResX = 0;
|
|
|
7e26054 |
+ iResY = 0;
|
|
|
7e26054 |
iNoOfPics = 1;
|
|
|
7e26054 |
iHideMenuEntry = false;
|
|
|
7e26054 |
- iUserKey = 0;
|
|
|
7e26054 |
iHideOsd = true;
|
|
|
7e26054 |
iShowDate = false;
|
|
|
7e26054 |
iDelayed = false;
|
|
|
7e26054 |
@@ -155,7 +160,6 @@ void cMenuSetupScreenshot::Store(void) {
|
|
|
7e26054 |
SetupStore("ResY", screenshotConfig.iResY);
|
|
|
7e26054 |
SetupStore("NoOfPics", screenshotConfig.iNoOfPics);
|
|
|
7e26054 |
SetupStore("HideMenuEntry", screenshotConfig.iHideMenuEntry);
|
|
|
7e26054 |
- SetupStore("UserKey", screenshotConfig.iUserKey);
|
|
|
7e26054 |
SetupStore("HideOsd", screenshotConfig.iHideOsd);
|
|
|
7e26054 |
SetupStore("ShowDate", screenshotConfig.iShowDate);
|
|
|
7e26054 |
SetupStore("Delayed", screenshotConfig.iDelayed);
|
|
|
7e26054 |
@@ -169,17 +173,17 @@ cMenuSetupScreenshot::cMenuSetupScreenshot(void) {
|
|
|
7e26054 |
iNewResY = screenshotConfig.iResY;
|
|
|
7e26054 |
iNewNoOfPics = screenshotConfig.iNoOfPics;
|
|
|
7e26054 |
iNewHideMenuEntry = screenshotConfig.iHideMenuEntry;
|
|
|
7e26054 |
- iNewUserKey = screenshotConfig.iUserKey;
|
|
|
7e26054 |
iNewHideOsd = screenshotConfig.iHideOsd;
|
|
|
7e26054 |
iNewShowDate = screenshotConfig.iShowDate;
|
|
|
7e26054 |
iNewDelayed = screenshotConfig.iDelayed;
|
|
|
7e26054 |
- char allowedChars[100];
|
|
|
7e26054 |
- sprintf(allowedChars, "%s/", tr(FileNameChars));
|
|
|
7e26054 |
+
|
|
|
7e26054 |
+ cString allowedChars = cString::sprintf("%s/", tr(FileNameChars));
|
|
|
7e26054 |
+
|
|
|
7e26054 |
Add(new cMenuEditStrItem (tr("Image directory"), sNewPath, sizeof(sNewPath), allowedChars));
|
|
|
7e26054 |
Add(new cMenuEditStraItem (tr("Fileformat"), &iNewFileformat, 2, FILEFORMATS));
|
|
|
7e26054 |
Add(new cMenuEditIntItem (tr("Image quality (1-100)"), &iNewQuality, 1, 100));
|
|
|
7e26054 |
- Add(new cMenuEditIntItem (tr("Image width (Pixel)"), &iNewResX, 1, 768));
|
|
|
7e26054 |
- Add(new cMenuEditIntItem (tr("Image height (Pixel)"), &iNewResY, 0, 576));
|
|
|
7e26054 |
+ Add(new cMenuEditIntItem (tr("Image width (Pixel)"), &iNewResX, 0, MAXOSDWIDTH));
|
|
|
7e26054 |
+ Add(new cMenuEditIntItem (tr("Image height (Pixel)"), &iNewResY, 0, MAXOSDHEIGHT));
|
|
|
7e26054 |
Add(new cMenuEditIntItem (tr("No. of pictures to take"), &iNewNoOfPics, 1, 100));
|
|
|
7e26054 |
Add(new cMenuEditBoolItem (tr("Hide mainmenu entry"), &iNewHideMenuEntry));
|
|
|
7e26054 |
// Add(new cMenuEditBoolItem (tr("Hide OSD"), &iNewHideOsd));
|
|
|
7e26054 |
@@ -223,6 +227,8 @@ bool cPluginScreenshot::Initialize(void) {
|
|
|
7e26054 |
}
|
|
|
7e26054 |
|
|
|
7e26054 |
bool cPluginScreenshot::Start(void) {
|
|
|
7e26054 |
+
|
|
|
7e26054 |
+ strcpy(screenshotConfig.sPath, cString::sprintf("%s/", cPlugin::CacheDirectory(PLUGIN_NAME_I18N)));
|
|
|
7e26054 |
// Start any background activities the plugin shall perform.
|
|
|
7e26054 |
// Make dummy picture at startup, because the first screenshot using
|
|
|
7e26054 |
// GrabImage(...) only takes a gray image.
|
|
|
7e26054 |
@@ -268,7 +274,6 @@ bool cPluginScreenshot::SetupParse(const char *Name, const char *Value) {
|
|
|
7e26054 |
else if (!strcasecmp(Name, "Fileformat")) screenshotConfig.iFileformat = atoi(Value);
|
|
|
7e26054 |
else if (!strcasecmp(Name, "NoOfPics")) screenshotConfig.iNoOfPics = atoi(Value);
|
|
|
7e26054 |
else if (!strcasecmp(Name, "HideMenuEntry")) screenshotConfig.iHideMenuEntry = atoi(Value);
|
|
|
7e26054 |
- else if (!strcasecmp(Name, "UserKey")) screenshotConfig.iUserKey = atoi(Value);
|
|
|
7e26054 |
else if (!strcasecmp(Name, "HideOsd")) screenshotConfig.iHideOsd = atoi(Value);
|
|
|
7e26054 |
else if (!strcasecmp(Name, "ShowDate")) screenshotConfig.iShowDate = atoi(Value);
|
|
|
7e26054 |
else if (!strcasecmp(Name, "Delayed")) screenshotConfig.iDelayed = atoi(Value);
|