Hi zusammen...
ok ich hängs jetzt einfach unten dran, wird dann aber ein etwas längerer Beitrag...
Ich hoffe das klappt wegen der Tab-Einrückung, die kommt hier immer nie so recht rüber wenn Code direkt im Beitrag steht.
Dateien anhängen geht leider immer noch nicht bei mir...
Der Patch muss mit "patch -p1 -i <dateiname>" direkt im Verzeichnis .../PLUGINS/src/tvonscreen ausgeführt werden.
diff -Nur tvonscreen-0.5.0/magazine.c tvonscreen-0.5.0-1.3.6/magazine.c
--- tvonscreen-0.5.0/magazine.c Fri Mar 5 13:28:30 2004
+++ tvonscreen-0.5.0-1.3.6/magazine.c Mon Mar 22 15:02:54 2004
@@ -14,11 +14,19 @@
int c1nr = 9999; // there should be no one with more than 9999 channels
int c2nr = 9999;
+#if VDRVERSNUM >= 10300
+ cChannel* c1 = Channels.GetByChannelID((*(const cSchedule**)p1)->ChannelID(), true);
+#else
cChannel* c1 = Channels.GetByChannelID((*(const cSchedule**)p1)->GetChannelID(), true);
+#endif
if (c1)
c1nr = c1->Number();
+#if VDRVERSNUM >= 10300
+ cChannel* c2 = Channels.GetByChannelID((*(const cSchedule**)p2)->ChannelID(), true);
+#else
cChannel* c2 = Channels.GetByChannelID((*(const cSchedule**)p2)->GetChannelID(), true);
+#endif
if (c2)
c2nr = c2->Number();
@@ -30,7 +38,11 @@
{
parent=p;
+#if VDRVERSNUM >= 10300
+ const cSchedules* Schedules = cSchedules::Schedules(_schedulesLock);
+#else
const cSchedules* Schedules = cSIProcessor::Schedules(_mutexLock);
+#endif
curmode=SHOW;
EDIT_curEvent=0;
@@ -57,7 +69,11 @@
{ // if there exist an event -> add to array
// check if we can get a channel NAME ( XXX )
// I thougt that this must always work , but doesn't
+#if VDRVERSNUM >= 10300
+ cChannel *c = Channels.GetByChannelID(Schedule->ChannelID(), true);
+#else
cChannel *c = Channels.GetByChannelID(Schedule->GetChannelID(), true);
+#endif
if (c)
{
schedArray[num] = Schedule;
@@ -73,7 +89,11 @@
int currentChannel = Channels.GetByNumber(cDevice::CurrentChannel())->Number();
for(int i=0;i<schedArrayNum;i++)
{
+#if VDRVERSNUM >= 10300
+ cChannel *channel = Channels.GetByChannelID(schedArray[i]->ChannelID(), true);
+#else
cChannel *channel = Channels.GetByChannelID(schedArray[i]->GetChannelID(), true);
+#endif
if (channel->Number()==currentChannel)
{
currentFirst=i-1;
@@ -125,7 +145,11 @@
osd->Fill(0,0,184,20,clrBlue,sched);
if (s!=NULL)
{
+#if VDRVERSNUM >= 10300
+ channel = Channels.GetByChannelID(s->ChannelID(), true);
+#else
channel = Channels.GetByChannelID(s->GetChannelID(), true);
+#endif
txt=channel->Name();
if (f3->LargeWidth(txt)>184)
f3->Text((184-f3->Width(txt))/2,0,txt,clrWhite,clrBlue,sched);
@@ -147,7 +171,11 @@
enum eDvbColor col=clrWhite;
currentChannel = Channels.GetByNumber(cDevice::CurrentChannel())->Number();
+#if VDRVERSNUM >= 10300
+ channel = Channels.GetByChannelID(s->ChannelID(), true);
+#else
channel = Channels.GetByChannelID(s->GetChannelID(), true);
+#endif
if (currentChannel==channel->Number())
{
col=clrCyan;
@@ -229,9 +257,15 @@
}
osd->Flush();
}
+#if VDRVERSNUM >= 10300
+void magazine::showSched(const cSchedule *s,cEvent **ev,tWindowHandle sched)
+{
+ cEvent *oldev=NULL,*cev=NULL;
+#else
void magazine::showSched(const cSchedule *s,cEventInfo **ev,tWindowHandle sched)
{
cEventInfo *oldev=NULL,*cev=NULL;
+#endif
int j=0;
const char *txt;
int lh=-1;
@@ -261,20 +295,32 @@
{
if (oldev)
{
+#if VDRVERSNUM >= 10300
+ txt=oldev->ShortText();
+#else
txt=oldev->GetSubtitle();
+#endif
int cc=f2->TextHeight(184-f1->Width("00:0"),txt);
if (cc<=i-j)
f2->Text(f1->Width("00:0"),(j)*f1->Height()/*+24*/,184-f1->Width("00:0"),i-j,txt,col,clrBackground,sched);
}
col=clrWhite;
+#if VDRVERSNUM >= 10300
+ if (EDIT_curEvent==cev->EventID())
+#else
if (EDIT_curEvent==cev->GetEventID())
+#endif
{
col=clrYellow;
EDIT_curEVI=i;
}
txt=cev->GetTimeString();
f1->Text(0,y,txt,col,clrBackground,sched);
+#if VDRVERSNUM >= 10300
+ txt=cev->Title();
+#else
txt=cev->GetTitle();
+#endif
j=i+f1->Text(f1->Width("00:00 "),y,184-f1->Width("00:00 "),20,txt,col,clrBackground,sched);
oldev=cev;
}
@@ -282,7 +328,11 @@
}
if (oldev)
{
+#if VDRVERSNUM >= 10300
+ txt=oldev->ShortText();
+#else
txt=oldev->GetSubtitle();
+#endif
f2->Text(f1->Width("00:0"),j*f1->Height()/*+24*/,184-f1->Width("00:0"),evnum-j,txt,col,clrBackground,sched);
}
}
@@ -307,17 +357,32 @@
showSched(s3,ev3,sched3);
}
}
+#if VDRVERSNUM >= 10300
+const cEvent *magazine::getNext(const cSchedule *s,const cEvent *e)
+{
+ const cEvent *pe = NULL;
+ time_t ref = e->StartTime();
+#else
const cEventInfo *magazine::getNext(const cSchedule *s,const cEventInfo *e)
{
const cEventInfo *pe = NULL;
time_t ref = e->GetTime();
+#endif
time_t delta = INT_MAX;
for (int i=0;i<s->NumEvents();i++)
{
+#if VDRVERSNUM >= 10300
+ const cEvent *p = s->GetEventNumber(i);
+#else
const cEventInfo *p = s->GetEventNumber(i);
+#endif
if (p!=e)
{
+#if VDRVERSNUM >= 10300
+ time_t dt = p->StartTime() - ref;
+#else
time_t dt = p->GetTime() - ref;
+#endif
if (dt > 0 && dt < delta)
{
delta = dt;
@@ -327,17 +392,32 @@
}
return pe;
}
+#if VDRVERSNUM >= 10300
+const cEvent *magazine::getPrev(const cSchedule *s,const cEvent *e)
+{
+ const cEvent *pe = NULL;
+ time_t ref = e->StartTime();
+#else
const cEventInfo *magazine::getPrev(const cSchedule *s,const cEventInfo *e)
{
const cEventInfo *pe = NULL;
time_t ref = e->GetTime();
+#endif
time_t delta = INT_MAX;
for (int i=0;i<s->NumEvents();i++)
{
+#if VDRVERSNUM >= 10300
+ const cEvent *p = s->GetEventNumber(i);
+#else
const cEventInfo *p = s->GetEventNumber(i);
+#endif
if (p!=e)
{
+#if VDRVERSNUM >= 10300
+ time_t dt = ref - p->StartTime();
+#else
time_t dt = ref - p->GetTime();
+#endif
if (dt > 0 && dt < delta)
{
delta = dt;
@@ -347,10 +427,17 @@
}
return pe;
}
+#if VDRVERSNUM >= 10300
+void magazine::calcSched(const cSchedule *s,cEvent **ev)
+{
+ const cEvent *cev=NULL;
+ const cEvent *cev2=NULL;
+#else
void magazine::calcSched(const cSchedule *s,cEventInfo **ev)
{
const cEventInfo *cev=NULL;
const cEventInfo *cev2=NULL;
+#endif
int cc=0;
for(int i=0;i<evnum;i++)
@@ -362,11 +449,19 @@
cev2=NULL;
if (cev)
{
+#if VDRVERSNUM >= 10300
+ cc=f1->TextHeight(184-f1->Width("00:00 "),cev->Title());
+ time_t t=cev->StartTime();
+ struct tm tm_r;
+ localtime_r(&t,&tm_r);
+ fullHours[i]=tm_r.tm_hour; //mzlog(0," fH[%d]=%d '%s'",i,tm_r.tm_hour,cev->Title());
+#else
cc=f1->TextHeight(184-f1->Width("00:00 "),cev->GetTitle());
time_t t=cev->GetTime();
struct tm tm_r;
localtime_r(&t,&tm_r);
fullHours[i]=tm_r.tm_hour; //mzlog(0," fH[%d]=%d '%s'",i,tm_r.tm_hour,cev->GetTitle());
+#endif
}
}
else
@@ -375,6 +470,19 @@
cev2=getNext(s,cev);
if (cev2 && cc--<=1)
{
+#if VDRVERSNUM >= 10300
+ int z=(cev2->StartTime()-currentFirstTime)*6/60/60;
+ if (z<i)
+ {
+ cev=cev2;
+ cev2=NULL;
+ cc=f1->TextHeight(184-f1->Width("00:00 "),cev->Title());
+ time_t t=cev->StartTime();
+ struct tm tm_r;
+ localtime_r(&t,&tm_r);
+ fullHours[i]=tm_r.tm_hour; //mzlog(0," fH[%d]=%d '%s'",i,tm_r.tm_hour,cev->Title());
+ }
+#else
int z=(cev2->GetTime()-currentFirstTime)*6/60/60;
if (z<i)
{
@@ -386,9 +494,14 @@
localtime_r(&t,&tm_r);
fullHours[i]=tm_r.tm_hour; //mzlog(0," fH[%d]=%d '%s'",i,tm_r.tm_hour,cev->GetTitle());
}
+#endif
}
}
+#if VDRVERSNUM >= 10300
+ ev[i]=(cEvent *)cev;
+#else
ev[i]=(cEventInfo *)cev;
+#endif
}
}
void magazine::calcScheds()
@@ -479,9 +592,15 @@
osd->Clear();
evnum=(384)/f1->Height();
+#if VDRVERSNUM >= 10300
+ ev1=new (cEvent*)[evnum];
+ ev2=new (cEvent*)[evnum];
+ ev3=new (cEvent*)[evnum];
+#else
ev1=new (cEventInfo*)[evnum];
ev2=new (cEventInfo*)[evnum];
ev3=new (cEventInfo*)[evnum];
+#endif
fullHours=new int[evnum];
showHeads();
@@ -493,9 +612,15 @@
showTimeline();
}
}
+#if VDRVERSNUM >= 10300
+cEvent **magazine::ev4ch(int p)
+{
+ cEvent **ev=NULL;
+#else
cEventInfo **magazine::ev4ch(int p)
{
cEventInfo **ev=NULL;
+#endif
if (p==currentFirst)
ev=ev1;
else if (p==currentFirst+1)
@@ -506,12 +631,20 @@
}
void magazine::searchcEvt(void)
{
+#if VDRVERSNUM >= 10300
+ cEvent **ev=ev4ch(EDIT_curChannel);
+#else
cEventInfo **ev=ev4ch(EDIT_curChannel);
+#endif
for(int i=EDIT_curEVI;i>=0;i--)
{
if (ev[i])
{
+#if VDRVERSNUM >= 10300
+ EDIT_curEvent=ev[i]->EventID();
+#else
EDIT_curEvent=ev[i]->GetEventID();
+#endif
break;
}
}
@@ -544,8 +677,13 @@
break;
case kBlue: // Umschalten
{
+#if VDRVERSNUM >= 10300
+ cEvent **ev=ev4ch(EDIT_curChannel);
+ cChannel *channel = Channels.GetByChannelID(ev[EDIT_curEVI]->ChannelID(), true);
+#else
cEventInfo **ev=ev4ch(EDIT_curChannel);
cChannel *channel = Channels.GetByChannelID(ev[EDIT_curEVI]->GetChannelID(), true);
+#endif
if (channel && cDevice::PrimaryDevice()->SwitchChannel(channel, true))
{
delete me;
@@ -559,7 +697,11 @@
{
delete me;
me=NULL;
+#if VDRVERSNUM >= 10300
+ cEvent **ev=ev4ch(EDIT_curChannel);
+#else
cEventInfo **ev=ev4ch(EDIT_curChannel);
+#endif
cTimer *timer = new cTimer(ev[EDIT_curEVI]);
cTimer *t = Timers.GetTimer(timer);
if (t)
@@ -619,7 +761,11 @@
{
if (ev1[i])
{
+#if VDRVERSNUM >= 10300
+ EDIT_curEvent=ev1[i]->EventID();
+#else
EDIT_curEvent=ev1[i]->GetEventID();
+#endif
break;
}
}
@@ -707,7 +853,11 @@
int currentChannel = Channels.GetByNumber(cDevice::CurrentChannel())->Number();
for(int i=0;i<schedArrayNum;i++)
{
+#if VDRVERSNUM >= 10300
+ cChannel *channel = Channels.GetByChannelID(schedArray[i]->ChannelID(), true);
+#else
cChannel *channel = Channels.GetByChannelID(schedArray[i]->GetChannelID(), true);
+#endif
if (channel->Number()==currentChannel)
{
currentFirst=i-1;
@@ -757,7 +907,11 @@
{
delete osd;
osd=NULL;
+#if VDRVERSNUM >= 10300
+ cEvent **ev=ev4ch(EDIT_curChannel);
+#else
cEventInfo **ev=ev4ch(EDIT_curChannel);
+#endif
me=new cMenuEvent(ev[EDIT_curEVI], true);
me->Display();
curmode=SHOW;
@@ -810,8 +964,13 @@
break;
case kUp:
{
+#if VDRVERSNUM >= 10300
+ cEvent **ev=ev4ch(EDIT_curChannel);
+ const cEvent *e=getPrev(schedArray[EDIT_curChannel],ev[EDIT_curEVI]);
+#else
cEventInfo **ev=ev4ch(EDIT_curChannel);
const cEventInfo *e=getPrev(schedArray[EDIT_curChannel],ev[EDIT_curEVI]);
+#endif
if (e)
{
@@ -821,10 +980,18 @@
found=0;
for(int i=0;i<evnum;i++)
{
+#if VDRVERSNUM >= 10300
+ if (ev[i] && ev[i]->EventID()==e->EventID())
+#else
if (ev[i] && ev[i]->GetEventID()==e->GetEventID())
+#endif
{
found=1;
+#if VDRVERSNUM >= 10300
+ EDIT_curEvent=e->EventID();
+#else
EDIT_curEvent=e->GetEventID();
+#endif
}
}
if (!found)
@@ -848,12 +1015,21 @@
break;
case kDown:
{
+#if VDRVERSNUM >= 10300
+ cEvent **ev=ev4ch(EDIT_curChannel);
+ const cEvent *e=getNext(schedArray[EDIT_curChannel],ev[EDIT_curEVI]);
+#else
cEventInfo **ev=ev4ch(EDIT_curChannel);
const cEventInfo *e=getNext(schedArray[EDIT_curChannel],ev[EDIT_curEVI]);
+#endif
if (e)
{
+#if VDRVERSNUM >= 10300
+ EDIT_curEvent=e->EventID();
+#else
EDIT_curEvent=e->GetEventID();
+#endif
int found,cc=0;
do
{
@@ -861,7 +1037,11 @@
cc++;
for(int i=0;i<evnum;i++)
{
+#if VDRVERSNUM >= 10300
+ if (ev[i] && ev[i]->EventID()==EDIT_curEvent)
+#else
if (ev[i] && ev[i]->GetEventID()==EDIT_curEvent)
+#endif
{
found=1;
}
@@ -912,7 +1092,11 @@
{
delete osd;
osd=NULL;
+#if VDRVERSNUM >= 10300
+ cEvent **ev=ev4ch(EDIT_curChannel);
+#else
cEventInfo **ev=ev4ch(EDIT_curChannel);
+#endif
cTimer *timer = new cTimer(ev[EDIT_curEVI]);
cTimer *t = Timers.GetTimer(timer);
if (t)
diff -Nur tvonscreen-0.5.0/magazine.h tvonscreen-0.5.0-1.3.6/magazine.h
--- tvonscreen-0.5.0/magazine.h Mon Mar 22 01:38:37 2004
+++ tvonscreen-0.5.0-1.3.6/magazine.h Mon Mar 22 15:00:18 2004
@@ -31,16 +31,26 @@
tWindowHandle sched1,sched2,sched3;
tWindowHandle control;
+#if VDRVERSNUM >= 10300
+ cSchedulesLock _schedulesLock;
+#else
cMutexLock _mutexLock;
+#endif
const cSchedule** schedArray;
int schedArrayNum;
int currentFirst;
time_t currentFirstTime;
int evnum;
+#if VDRVERSNUM >= 10300
+ class cEvent **ev1;
+ class cEvent **ev2;
+ class cEvent **ev3;
+#else
class cEventInfo **ev1;
class cEventInfo **ev2;
class cEventInfo **ev3;
+#endif
int *fullHours;
enum modes {SHOW,EDIT};
@@ -50,9 +60,15 @@
int EDIT_curChannel;
int EDIT_curEVI;
+#if VDRVERSNUM >= 10300
+ const class cEvent *getNext(const cSchedule *s,const cEvent *e);
+ const class cEvent *getPrev(const cSchedule *s,const cEvent *e);
+ cEvent **ev4ch(int);
+#else
const class cEventInfo *getNext(const cSchedule *s,const cEventInfo *e);
const class cEventInfo *getPrev(const cSchedule *s,const cEventInfo *e);
cEventInfo **ev4ch(int);
+#endif
void searchcEvt();
// void printHead(const cSchedule *s,tWindowHandle sched);
@@ -61,8 +77,13 @@
void showTimeline(void);
void showHeads(void);
void showScheds(void);
+#if VDRVERSNUM >= 10300
+ void showSched(const cSchedule *s,cEvent **ev,tWindowHandle sched);
+ void calcSched(const cSchedule *s,cEvent **ev);
+#else
void showSched(const cSchedule *s,cEventInfo **ev,tWindowHandle sched);
void calcSched(const cSchedule *s,cEventInfo **ev);
+#endif
void calcScheds(void);
public:
@@ -74,9 +95,17 @@
class cMenuEvent : public cOsdMenu {
private:
+#if VDRVERSNUM >= 10300
+ const class cEvent *eventInfo;
+#else
const class cEventInfo *eventInfo;
+#endif
public:
+#if VDRVERSNUM >= 10300
+ cMenuEvent(const class cEvent *EventInfo, bool CanSwitch = false);
+#else
cMenuEvent(const class cEventInfo *EventInfo, bool CanSwitch = false);
+#endif
cMenuEvent(bool Now);
virtual eOSState ProcessKey(eKeys Key);
};
Alles anzeigen