summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Mair <amair.sob@googlemail.com>2014-08-20 10:44:44 (GMT)
committerAndreas Mair <amair.sob@googlemail.com>2014-08-20 10:44:44 (GMT)
commit5e5805d05c442e787979a189dd5ca43a8f06d95e (patch)
tree741683492b43c5addce8a74fda6d6112b0ab4c47
parent5a8c236a70c45215b81d30f05a674e811b6b1bc0 (diff)
downloadvdr-plugin-extrecmenu-5e5805d05c442e787979a189dd5ca43a8f06d95e.tar.gz
vdr-plugin-extrecmenu-5e5805d05c442e787979a189dd5ca43a8f06d95e.tar.bz2
Reduced delay when opening the recordings menu if "menu category" feature is used.
-rw-r--r--HISTORY3
-rw-r--r--mymenurecordings.c30
-rw-r--r--mymenurecordings.h3
3 files changed, 30 insertions, 6 deletions
diff --git a/HISTORY b/HISTORY
index d037920..645848d 100644
--- a/HISTORY
+++ b/HISTORY
@@ -1,6 +1,9 @@
VDR Plugin 'extrecmenu' Revision History
----------------------------------------
+2014-xx-yy: Version 1.2.4
+- [amair] Reduced delay when opening the recordings menu if "menu category" feature is used.
+
2014-08-05: Version 1.2.3
- [amair] Fixed crashes that happened if a skin used the "menu category" feature. (Submitted by The Chief @vdr-portal.de).
- [amair] GoLastReplayed and ReturnToPlugin now work as expected.
diff --git a/mymenurecordings.c b/mymenurecordings.c
index c23b60a..165baf9 100644
--- a/mymenurecordings.c
+++ b/mymenurecordings.c
@@ -51,7 +51,7 @@ myMenuRecordingInfo::myMenuRecordingInfo(const cRecording *Recording, bool WithB
SetMenuCategory(mcRecordingInfo);
}
#endif
- recording = new cRecording(Recording->FileName());
+ recording=Recording;
withButtons=WithButtons;
if(withButtons)
SetHelp(tr("Button$Play"),tr("Button$Rewind"),NULL,tr("Button$Back"));
@@ -159,14 +159,14 @@ eOSState myMenuRecordingInfo::ProcessKey(eKeys Key)
}
myMenuRecordingInfo::~myMenuRecordingInfo(void) {
- delete recording;
}
// --- myMenuRecordingsItem ---------------------------------------------------
myMenuRecordingsItem::myMenuRecordingsItem(cRecording *Recording,int Level)
{
#if VDRVERSNUM >= 10733
- recording=new cRecording(Recording->FileName());;
+ recording=Recording;
+ recording_copy=NULL;
#endif
totalentries=newentries=0;
isdvd=false;
@@ -458,11 +458,23 @@ myMenuRecordingsItem::myMenuRecordingsItem(cRecording *Recording,int Level)
myMenuRecordingsItem::~myMenuRecordingsItem()
{
- delete recording;
+#if VDRVERSNUM >= 10733
+ delete recording_copy;
+#endif
free(title);
free(name);
}
+#if VDRVERSNUM >= 10733
+void myMenuRecordingsItem::rec_copy(void)
+{
+ if(mysetup.SetRecordingCat)
+ recording_copy=new cRecording(recording->FileName());
+ else
+ recording_copy=NULL;
+}
+#endif
+
void myMenuRecordingsItem::IncrementCounter(bool IsNew)
{
totalentries++;
@@ -500,7 +512,9 @@ void myMenuRecordingsItem::IncrementCounter(bool IsNew)
#if VDRVERSNUM >= 10733
void myMenuRecordingsItem::SetMenuItem(cSkinDisplayMenu *displaymenu,int index,bool current,bool selectable)
{
- if (!(mysetup.SetRecordingCat && displaymenu->SetItemRecording(recording,index,current,selectable,level,totalentries,newentries)))
+#if VDRVERSNUM >= 10733
+ if (!(recording_copy && displaymenu->SetItemRecording(recording_copy,index,current,selectable,level,totalentries,newentries)))
+#endif
displaymenu->SetItem(Text(),index,current,selectable);
}
#endif
@@ -843,6 +857,9 @@ void myMenuRecordings::Set(bool Refresh)
if(!(hidepinprotectedrecs && cStatus::MsgReplayProtected(recording,recitem->Name(),base,recitem->IsDirectory(),true)))
{
#endif
+#if VDRVERSNUM >= 10733
+ recitem->rec_copy();
+#endif
Add(recitem);
lastitem=recitem;
if(recitem->IsDirectory())
@@ -854,7 +871,10 @@ void myMenuRecordings::Set(bool Refresh)
#endif
}
else
+ {
delete recitem;
+ recitem=NULL;
+ }
if(lastitem||lastdir)
{
diff --git a/mymenurecordings.h b/mymenurecordings.h
index e05046c..a882309 100644
--- a/mymenurecordings.h
+++ b/mymenurecordings.h
@@ -3,6 +3,7 @@ class myMenuRecordingsItem:public cOsdItem
{
private:
#if VDRVERSNUM >= 10733
+ cRecording *recording_copy;
cRecording *recording;
#endif
bool dirismoving;
@@ -21,7 +22,7 @@ class myMenuRecordingsItem:public cOsdItem
const char *FileName(){return filename;}
const char *Name(){return name;}
#if VDRVERSNUM >= 10733
- cRecording *Recording(void) { return recording; }
+ inline void rec_copy(void);
#endif
bool IsDirectory(){return name!=NULL;}
bool IsPesRecording(void) const { return isPesRecording; }