The 'Schedule' button now shows the schedule of the current channel in the 'Now/Next' menu

This commit is contained in:
Klaus Schmidinger 2000-11-12 16:48:50 +01:00
parent 5b65773ec8
commit 5e272f9065
6 changed files with 53 additions and 17 deletions

View File

@ -287,3 +287,5 @@ Video Disk Recorder Revision History
by a timer that needs to use this specific DVB card to record an encrypted
channel, if the timer currently occupying this DVB card doesn't need the
CAM module (and thus can continue recording on a different DVB card).
- The "Yellow" button in the "What's on now/next?" menus now displays the
schedule of the current channel from that menu.

4
MANUAL
View File

@ -74,8 +74,8 @@ Video Disk Recorder User's Manual
programmes that will start next on all channels.
Inside the "What's on now/next?" menus the "Green" button toggles between
the "Now" and "Next" display, and the "Yellow" button gets you back to the
"Schedule" menu of the current channel.
the "Now" and "Next" display, and the "Yellow" button takes you to the
"Schedule" menu of the current channel in the list.
The "Red" button allows you to instantly program a timer to record the
selected programme. You will get into the "Edit Timer" menu in which

48
menu.c
View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: menu.c 1.47 2000/11/12 13:03:35 kls Exp $
* $Id: menu.c 1.48 2000/11/12 16:46:19 kls Exp $
*/
#include "menu.h"
@ -1160,11 +1160,15 @@ class cMenuWhatsOn : public cOsdMenu {
private:
eOSState Record(void);
eOSState Switch(void);
static const cEventInfo *scheduleEventInfo;
public:
cMenuWhatsOn(const cSchedules *Schedules, bool Now);
static const cEventInfo *ScheduleEventInfo(void);
virtual eOSState ProcessKey(eKeys Key);
};
const cEventInfo *cMenuWhatsOn::scheduleEventInfo = NULL;
static int CompareEventChannel(const void *p1, const void *p2)
{
return (int)( (*(const cEventInfo **)p1)->GetChannelNumber() - (*(const cEventInfo **)p2)->GetChannelNumber());
@ -1200,6 +1204,13 @@ cMenuWhatsOn::cMenuWhatsOn(const cSchedules *Schedules, bool Now)
SetHelp(tr("Record"), Now ? tr("Next") : tr("Now"), tr("Schedule"), tr("Switch"));
}
const cEventInfo *cMenuWhatsOn::ScheduleEventInfo(void)
{
const cEventInfo *ei = scheduleEventInfo;
scheduleEventInfo = NULL;
return ei;
}
eOSState cMenuWhatsOn::Switch(void)
{
cMenuWhatsOnItem *item = (cMenuWhatsOnItem *)Get(Current());
@ -1239,7 +1250,12 @@ eOSState cMenuWhatsOn::ProcessKey(eKeys Key)
if (state == osUnknown) {
switch (Key) {
case kRed: return Record();
case kYellow: return osBack;
case kYellow: {
cMenuWhatsOnItem *mi = (cMenuWhatsOnItem *)Get(Current());
if (mi)
scheduleEventInfo = mi->eventInfo;
}
return osBack;
case kBlue: return Switch();
case kOk: if (Count())
return AddSubMenu(new cMenuEvent(((cMenuWhatsOnItem *)Get(Current()))->eventInfo, true));
@ -1274,7 +1290,7 @@ private:
const cSchedules *schedules;
bool now, next;
eOSState Record(void);
void PrepareSchedule(void);
void PrepareSchedule(cChannel *Channel);
void PrepareWhatsOnNext(bool On);
public:
cMenuSchedule(void);
@ -1287,10 +1303,8 @@ cMenuSchedule::cMenuSchedule(void)
now = next = false;
cChannel *channel = Channels.GetByNumber(cDvbApi::CurrentChannel());
if (channel) {
char *buffer = NULL;
asprintf(&buffer, tr("Schedule - %s"), channel->name);
SetTitle(buffer, false);
PrepareSchedule();
schedules = cDvbApi::PrimaryDvbApi->Schedules(&threadLock);
PrepareSchedule(channel);
SetHelp(tr("Record"), tr("Now"), tr("Next"));
}
}
@ -1300,11 +1314,14 @@ static int CompareEventTime(const void *p1, const void *p2)
return (int)((*(cEventInfo **)p1)->GetTime() - (*(cEventInfo **)p2)->GetTime());
}
void cMenuSchedule::PrepareSchedule(void)
void cMenuSchedule::PrepareSchedule(cChannel *Channel)
{
schedules = cDvbApi::PrimaryDvbApi->Schedules(&threadLock);
Clear();
char *buffer = NULL;
asprintf(&buffer, tr("Schedule - %s"), Channel->name);
SetTitle(buffer, false);
if (schedules) {
const cSchedule *Schedule = schedules->GetSchedule();
const cSchedule *Schedule = Channel->pnr ? schedules->GetSchedule(Channel->pnr) : schedules->GetSchedule();
int num = Schedule->NumEvents();
const cEventInfo **pArray = (const cEventInfo **)malloc(num * sizeof(cEventInfo *));
if (pArray) {
@ -1366,8 +1383,17 @@ eOSState cMenuSchedule::ProcessKey(eKeys Key)
default: break;
}
}
else if (!HasSubMenu())
else if (!HasSubMenu()) {
now = next = false;
const cEventInfo *ei = cMenuWhatsOn::ScheduleEventInfo();
if (ei) {
cChannel *channel = Channels.GetByServiceID(ei->GetServiceID());
if (channel) {
PrepareSchedule(channel);
Display();
}
}
}
return state;
}

9
osd.c
View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: osd.c 1.12 2000/11/10 16:18:38 kls Exp $
* $Id: osd.c 1.13 2000/11/12 15:29:25 kls Exp $
*/
#include "osd.h"
@ -189,6 +189,13 @@ void cOsdMenu::DisplayCurrent(bool Current)
item->Display(current - first, Current ? clrBlack : clrWhite, Current ? clrCyan : clrBackground);
}
void cOsdMenu::Clear(void)
{
first = 0;
current = marked = -1;
cList<cOsdItem>::Clear();
}
bool cOsdMenu::SpecialItem(int idx)
{
cOsdItem *item = Get(idx);

3
osd.h
View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: osd.h 1.16 2000/11/11 14:49:29 kls Exp $
* $Id: osd.h 1.17 2000/11/12 15:27:34 kls Exp $
*/
#ifndef __OSD_H
@ -78,6 +78,7 @@ private:
const char *status;
protected:
bool visible;
virtual void Clear(void);
bool SpecialItem(int idx);
void RefreshCurrent(void);
void DisplayCurrent(bool Current);

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: tools.h 1.19 2000/11/11 15:14:40 kls Exp $
* $Id: tools.h 1.20 2000/11/12 15:27:06 kls Exp $
*/
#ifndef __TOOLS_H
@ -96,7 +96,7 @@ public:
void Del(cListObject *Object);
virtual void Move(int From, int To);
void Move(cListObject *From, cListObject *To);
void Clear(void);
virtual void Clear(void);
cListObject *Get(int Index) const;
int Count(void) const;
};