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;
|
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) {
|
void cDesignerConfig::SetOSDFonts(void) {
|
||||||
fontFix = Setup.FontFix;
|
fontFix = Setup.FontFix;
|
||||||
fontOsd = Setup.FontOsd;
|
fontOsd = Setup.FontOsd;
|
||||||
|
2
config.h
2
config.h
@ -92,6 +92,7 @@ public:
|
|||||||
bool SkinChanged(void);
|
bool SkinChanged(void);
|
||||||
void SetOSDSize(void);
|
void SetOSDSize(void);
|
||||||
bool OsdSizeChanged(void);
|
bool OsdSizeChanged(void);
|
||||||
|
bool PlayModeChanged(void);
|
||||||
void SetOSDFonts(void);
|
void SetOSDFonts(void);
|
||||||
bool OsdFontsChanged(void);
|
bool OsdFontsChanged(void);
|
||||||
void SetOsdLanguage(void) { osdLanguage = Setup.OSDLanguage; };
|
void SetOsdLanguage(void) { osdLanguage = Setup.OSDLanguage; };
|
||||||
@ -118,6 +119,7 @@ public:
|
|||||||
int FPS;
|
int FPS;
|
||||||
//TemplateReload on Setup Close
|
//TemplateReload on Setup Close
|
||||||
bool setupCloseDoReload;
|
bool setupCloseDoReload;
|
||||||
|
int mode_changed;
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef DEFINE_CONFIG
|
#ifdef DEFINE_CONFIG
|
||||||
|
@ -171,6 +171,7 @@ void cSkinDesigner::ListCustomTokens(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
skindesignerapi::ISkinDisplayPlugin *cSkinDesigner::GetDisplayPlugin(int plugId) {
|
skindesignerapi::ISkinDisplayPlugin *cSkinDesigner::GetDisplayPlugin(int plugId) {
|
||||||
|
Init();
|
||||||
map<int, cViewPlugin*>::iterator hit = pluginViews.find(plugId);
|
map<int, cViewPlugin*>::iterator hit = pluginViews.find(plugId);
|
||||||
if (hit == pluginViews.end())
|
if (hit == pluginViews.end())
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -235,6 +236,14 @@ void cSkinDesigner::Init(void) {
|
|||||||
watch.Stop("templates loaded and caches created");
|
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) {
|
void cSkinDesigner::DeleteViews(void) {
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
*/
|
*/
|
||||||
#include <getopt.h>
|
#include <getopt.h>
|
||||||
#include <vdr/plugin.h>
|
#include <vdr/plugin.h>
|
||||||
|
#include <vdr/device.h>
|
||||||
|
|
||||||
#define DEFINE_CONFIG 1
|
#define DEFINE_CONFIG 1
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
@ -20,7 +21,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
static const char *VERSION = "1.2.8.4";
|
static const char *VERSION = "1.2.8.6";
|
||||||
static const char *DESCRIPTION = trNOOP("Skin Designer");
|
static const char *DESCRIPTION = trNOOP("Skin Designer");
|
||||||
|
|
||||||
class cPluginSkinDesigner : public cPlugin, public skindesignerapi::SkindesignerAPI {
|
class cPluginSkinDesigner : public cPlugin, public skindesignerapi::SkindesignerAPI {
|
||||||
@ -175,6 +176,21 @@ void cPluginSkinDesigner::Housekeeping(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void cPluginSkinDesigner::MainThreadHook(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) {
|
cString cPluginSkinDesigner::Active(void) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user