mirror of
https://projects.vdr-developer.org/git/vdr-plugin-skindesigner.git
synced 2023-10-19 17:58:31 +02:00
Refresh imgCache if OsdProvider was changed (Thanks to lnj @vdr-portal.de)
This commit is contained in:
parent
df8c8e2993
commit
bc9cb23ed7
10
config.c
10
config.c
@ -462,6 +462,16 @@ bool cDesignerConfig::OsdSizeChanged(void) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// If softhddevice is suspended, it gives the video size 0x0
|
||||
// We use this for detect a play mode change and drop the cache, because it is corrupted after being suspended
|
||||
bool cDesignerConfig::PlayModeChanged(void) {
|
||||
if (mode_changed) {
|
||||
mode_changed = 0;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void cDesignerConfig::SetOSDFonts(void) {
|
||||
fontFix = Setup.FontFix;
|
||||
fontOsd = Setup.FontOsd;
|
||||
|
2
config.h
2
config.h
@ -92,6 +92,7 @@ public:
|
||||
bool SkinChanged(void);
|
||||
void SetOSDSize(void);
|
||||
bool OsdSizeChanged(void);
|
||||
bool PlayModeChanged(void);
|
||||
void SetOSDFonts(void);
|
||||
bool OsdFontsChanged(void);
|
||||
void SetOsdLanguage(void) { osdLanguage = Setup.OSDLanguage; };
|
||||
@ -118,6 +119,7 @@ public:
|
||||
int FPS;
|
||||
//TemplateReload on Setup Close
|
||||
bool setupCloseDoReload;
|
||||
int mode_changed;
|
||||
};
|
||||
|
||||
#ifdef DEFINE_CONFIG
|
||||
|
11
designer.c
11
designer.c
@ -171,6 +171,7 @@ void cSkinDesigner::ListCustomTokens(void) {
|
||||
}
|
||||
|
||||
skindesignerapi::ISkinDisplayPlugin *cSkinDesigner::GetDisplayPlugin(int plugId) {
|
||||
Init();
|
||||
map<int, cViewPlugin*>::iterator hit = pluginViews.find(plugId);
|
||||
if (hit == pluginViews.end())
|
||||
return NULL;
|
||||
@ -194,7 +195,7 @@ void cSkinDesigner::Init(void) {
|
||||
config.SetOSDFonts();
|
||||
}
|
||||
dsyslog("skindesigner: initializing skin %s", skin.c_str());
|
||||
|
||||
|
||||
config.CheckDecimalPoint();
|
||||
plgManager->Reset();
|
||||
|
||||
@ -235,6 +236,14 @@ void cSkinDesigner::Init(void) {
|
||||
watch.Stop("templates loaded and caches created");
|
||||
}
|
||||
}
|
||||
else if (config.PlayModeChanged())
|
||||
{
|
||||
dsyslog ("skindesigner: drop image cache");
|
||||
if (imgCache)
|
||||
delete imgCache;
|
||||
imgCache = new cImageCache();
|
||||
imgCache->SetPathes();
|
||||
}
|
||||
}
|
||||
|
||||
void cSkinDesigner::DeleteViews(void) {
|
||||
|
@ -7,6 +7,7 @@
|
||||
*/
|
||||
#include <getopt.h>
|
||||
#include <vdr/plugin.h>
|
||||
#include <vdr/device.h>
|
||||
|
||||
#define DEFINE_CONFIG 1
|
||||
#include "config.h"
|
||||
@ -20,7 +21,7 @@
|
||||
#endif
|
||||
|
||||
|
||||
static const char *VERSION = "1.2.8.4";
|
||||
static const char *VERSION = "1.2.8.6";
|
||||
static const char *DESCRIPTION = trNOOP("Skin Designer");
|
||||
|
||||
class cPluginSkinDesigner : public cPlugin, public skindesignerapi::SkindesignerAPI {
|
||||
@ -175,6 +176,21 @@ void cPluginSkinDesigner::Housekeeping(void) {
|
||||
}
|
||||
|
||||
void cPluginSkinDesigner::MainThreadHook(void) {
|
||||
int w, h;
|
||||
double a;
|
||||
static int mode;
|
||||
cDevice::PrimaryDevice()->GetVideoSize(w, h, a);
|
||||
|
||||
if (!w && !h && !mode) {
|
||||
mode = 1;
|
||||
config.mode_changed = 1;
|
||||
dsyslog("skindesigner: w %d h %d mode changed to %d\n", w, h, mode);
|
||||
}
|
||||
else if (w && h && mode) {
|
||||
mode = 0;
|
||||
config.mode_changed = 1;
|
||||
dsyslog("skindesigner: w %d h %d mode changed to %d\n", w, h, mode);
|
||||
}
|
||||
}
|
||||
|
||||
cString cPluginSkinDesigner::Active(void) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user