mirror of
https://projects.vdr-developer.org/git/vdr-plugin-skindesigner.git
synced 2023-10-19 17:58:31 +02:00
fixed crash in drawing devices
This commit is contained in:
parent
03f3789ee9
commit
7a0e0b11ae
@ -46,6 +46,8 @@ cSkinDisplayChannel *cSkinDesigner::DisplayChannel(bool WithInfo) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
cSkinDisplayMenu *cSkinDesigner::DisplayMenu(void) {
|
cSkinDisplayMenu *cSkinDesigner::DisplayMenu(void) {
|
||||||
|
if (init)
|
||||||
|
return NULL;
|
||||||
if (!useBackupSkin) {
|
if (!useBackupSkin) {
|
||||||
cSDDisplayMenu *displayMenu = NULL;
|
cSDDisplayMenu *displayMenu = NULL;
|
||||||
Init();
|
Init();
|
||||||
|
@ -196,11 +196,11 @@
|
|||||||
{devices[channelid]} ID of the currently tuned channel
|
{devices[channelid]} ID of the currently tuned channel
|
||||||
{devices[source]} source of the currently tuned channel
|
{devices[source]} source of the currently tuned channel
|
||||||
-->
|
-->
|
||||||
<devices>
|
<devices condition="{showdevices}" >
|
||||||
<area condition="{showdevices}" x="70%" y="30%" width="30%" height="{areaheight}/12 * {numdevices}" layer="1">
|
<area x="70%" y="30%" width="30%" height="{areaheight}/12 * {numdevices}" layer="1">
|
||||||
<fill color="{clrTransBlack}"/>
|
<fill color="{clrTransBlack}"/>
|
||||||
</area>
|
</area>
|
||||||
<area condition="{showdevices}" x="70%" y="30%" width="30%" height="{areaheight}/12 * {numdevices}" layer="2">
|
<area x="70%" y="30%" width="30%" height="{areaheight}/12 * {numdevices}" layer="2">
|
||||||
<loop name="devices" x="0" y="0" orientation="vertical" columnwidth="{areawidth}" rowheight="{areaheight} / {numdevices}" overflow="cut">
|
<loop name="devices" x="0" y="0" orientation="vertical" columnwidth="{areawidth}" rowheight="{areaheight} / {numdevices}" overflow="cut">
|
||||||
<drawtext name="label" x="5" y="0" font="{light}" fontsize="{rowheight}*0.35" color="{clrWhite}" text="{devices[num]}: {devices[type]}" />
|
<drawtext name="label" x="5" y="0" font="{light}" fontsize="{rowheight}*0.35" color="{clrWhite}" text="{devices[num]}: {devices[type]}" />
|
||||||
<drawtext condition="{devices[hascam]}" x="{width(label)} + 15" y="0" font="{light}" fontsize="{rowheight}*0.35" color="{clrWhite}" text="(CAM {devices[cam]})" />
|
<drawtext condition="{devices[hascam]}" x="{width(label)} + 15" y="0" font="{light}" fontsize="{rowheight}*0.35" color="{clrWhite}" text="(CAM {devices[cam]})" />
|
||||||
|
@ -240,7 +240,7 @@
|
|||||||
{devices[channelid]} ID of the currently tuned channel
|
{devices[channelid]} ID of the currently tuned channel
|
||||||
{devices[source]} source of the currently tuned channel
|
{devices[source]} source of the currently tuned channel
|
||||||
-->
|
-->
|
||||||
<devices>
|
<devices condition="{showdevices}">
|
||||||
<area x="75%" y="48%" width="25%" height="{areaheight}/12 * {numdevices}" layer="1">
|
<area x="75%" y="48%" width="25%" height="{areaheight}/12 * {numdevices}" layer="1">
|
||||||
<fill color="{clrTransBlack}"/>
|
<fill color="{clrTransBlack}"/>
|
||||||
</area>
|
</area>
|
||||||
|
@ -21,7 +21,7 @@ cViewHelpers::~cViewHelpers() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void cViewHelpers::InitDevices(void) {
|
void cViewHelpers::InitDevices(void) {
|
||||||
int numDevices = cDevice::NumDevices();
|
numDevices = cDevice::NumDevices();
|
||||||
lastSignalStrength = new int[numDevices];
|
lastSignalStrength = new int[numDevices];
|
||||||
lastSignalQuality = new int[numDevices];
|
lastSignalQuality = new int[numDevices];
|
||||||
recDevices = new bool[numDevices];
|
recDevices = new bool[numDevices];
|
||||||
@ -34,9 +34,6 @@ void cViewHelpers::InitDevices(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool cViewHelpers::SetDevices(bool initial, map<string,int> *intTokens, vector<map<string,string> > *devices) {
|
bool cViewHelpers::SetDevices(bool initial, map<string,int> *intTokens, vector<map<string,string> > *devices) {
|
||||||
#ifdef DOPROFILE
|
|
||||||
cStopWatch watch("SetDevices");
|
|
||||||
#endif
|
|
||||||
if (!initial) {
|
if (!initial) {
|
||||||
//check if drawing is necessary
|
//check if drawing is necessary
|
||||||
bool changed = false;
|
bool changed = false;
|
||||||
@ -46,23 +43,13 @@ bool cViewHelpers::SetDevices(bool initial, map<string,int> *intTokens, vector<m
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
int signalStrength = device->SignalStrength();
|
int signalStrength = device->SignalStrength();
|
||||||
#ifdef DOPROFILE
|
|
||||||
watch.Report(*cString::sprintf("SignalStrength() device %d", i));
|
|
||||||
#endif
|
|
||||||
int signalQuality = device->SignalQuality();
|
int signalQuality = device->SignalQuality();
|
||||||
#ifdef DOPROFILE
|
|
||||||
watch.Report(*cString::sprintf("SignalQuality() device %d", i));
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if ((signalStrength != lastSignalStrength[i]) || (signalQuality != lastSignalQuality[i])) {
|
if ((signalStrength != lastSignalStrength[i]) || (signalQuality != lastSignalQuality[i])) {
|
||||||
changed = true;
|
changed = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!changed) {
|
if (!changed) {
|
||||||
#ifdef DOPROFILE
|
|
||||||
watch.Stop("SetDevices End");
|
|
||||||
#endif
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -109,13 +96,7 @@ bool cViewHelpers::SetDevices(bool initial, map<string,int> *intTokens, vector<m
|
|||||||
deviceVals.insert(pair< string, string >("devices[hascam]", "0"));
|
deviceVals.insert(pair< string, string >("devices[hascam]", "0"));
|
||||||
}
|
}
|
||||||
int signalStrength = device->SignalStrength();
|
int signalStrength = device->SignalStrength();
|
||||||
#ifdef DOPROFILE
|
|
||||||
watch.Report(*cString::sprintf("SignalStrength() device %d", i));
|
|
||||||
#endif
|
|
||||||
int signalQuality = device->SignalQuality();
|
int signalQuality = device->SignalQuality();
|
||||||
#ifdef DOPROFILE
|
|
||||||
watch.Report(*cString::sprintf("SignalQuality() device %d", i));
|
|
||||||
#endif
|
|
||||||
stringstream strCamNumber;
|
stringstream strCamNumber;
|
||||||
strCamNumber << camNumber;
|
strCamNumber << camNumber;
|
||||||
deviceVals.insert(pair< string, string >("devices[cam]", strCamNumber.str()));
|
deviceVals.insert(pair< string, string >("devices[cam]", strCamNumber.str()));
|
||||||
@ -157,9 +138,6 @@ bool cViewHelpers::SetDevices(bool initial, map<string,int> *intTokens, vector<m
|
|||||||
}
|
}
|
||||||
|
|
||||||
intTokens->insert(pair<string, int>("numdevices", actualNumDevices));
|
intTokens->insert(pair<string, int>("numdevices", actualNumDevices));
|
||||||
#ifdef DOPROFILE
|
|
||||||
watch.Stop("SetDevices End");
|
|
||||||
#endif
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user