Commit a379eb71 authored by Klaus Schmidinger's avatar Klaus Schmidinger

Version 0.66

- Remote control data is now received in a separate thread, which makes things
  a lot smoother.
- Repeat and release of remote control keys is now explicitly distinguished.
- In replay mode the search forward/back and skip functions now have two modes:
  Pressing the key shortly and releasing it starts the function, and pressing it
  again stops it. Pressing and holding down the key starts the function and
  releasing the key stops it.
- The '@' character that marks an "instant recording" can now be turned off
  in the "Setup" menu (thanks to Matthias Schniedermeyer).
- Pressing the "Back" button while replaying now stops replaying and brings up
  the "Recordings" menu (suggested by Carsten Koch). This can be used to easily
  delete a recording after watching it, or to switch to a different recording.
- The "Recordings" menu now places the cursor on the last replayed recording, if
  that file still exists.
- The "Blue" button in the "Main" menu can now be used to "Resume" a previously
  stopped replay session (suggested by Martin Hammerschmid).
- The low and high LNB frequencies can now be changed in the "Setup" menu.
parent ef8fe3f0
......@@ -7,6 +7,7 @@ Carsten Koch <Carsten.Koch@icem.de>
for adding the 'epg2timers' tool (see Tools/epg2timers)
for his idea of using multiple disks (and for testing this feature)
for implementing the 'new recording' indicator
for suggesting that the "Back" button in replay mode should bring up the "Recordings" menu
Plamen Ganev <pganev@com-it.net>
for fixing the frequency offset for Hotbird channels
......@@ -31,6 +32,10 @@ Niels de Carpentier <niels@casema.net>
Martin Hammerschmid <martin@hammerschmid.com>
for suggesting to display the direct channel select input on the OSD
for suggesting to use the "Blue" button in the main menu to resume replay
Bastian Guse <bastian@nocopy.de>
for writing the FORMATS entry for timers.conf
Matthias Schniedermeyer <ms@citd.de>
for implementing the 'MarkInstantRecord' setup option.
......@@ -55,3 +55,11 @@ Video Disk Recorder File Formats
- Name of timer (will be used to name the recording)
- Summary
* setup.conf
This file contains the basic configuration options for VDR.
Each line contains one option in the format "Name = Value".
See the MANUAL file for a description of the available options.
......@@ -212,7 +212,7 @@ Video Disk Recorder Revision History
against the version 0.71 DVB driver file 'dvb.c').
- When switching channels the channel is now immediately displayed, and the
current/next information is shown as soon as it becomes available.
- No longer displaying the year in the 'Recordings' menu to saves space for the
- No longer displaying the year in the 'Recordings' menu to save space for the
title.
- The 'Recordings' menu now displays a '*' to indicate new recordings.
- Added the description of the timers.conf file to the FORMATS file (thanks to
......@@ -221,3 +221,23 @@ Video Disk Recorder Revision History
that would display only partially).
- In normal viewing mode the '0' key now toggles between the current and the
previous channel.
2000-10-08: Version 0.66
- Remote control data is now received in a separate thread, which makes things
a lot smoother.
- Repeat and release of remote control keys is now explicitly distinguished.
- In replay mode the search forward/back and skip functions now have two modes:
Pressing the key shortly and releasing it starts the function, and pressing it
again stops it. Pressing and holding down the key starts the function and
releasing the key stops it.
- The '@' character that marks an "instant recording" can now be turned off
in the "Setup" menu (thanks to Matthias Schniedermeyer).
- Pressing the "Back" button while replaying now stops replaying and brings up
the "Recordings" menu (suggested by Carsten Koch). This can be used to easily
delete a recording after watching it, or to switch to a different recording.
- The "Recordings" menu now places the cursor on the last replayed recording, if
that file still exists.
- The "Blue" button in the "Main" menu can now be used to "Resume" a previously
stopped replay session (suggested by Martin Hammerschmid).
- The low and high LNB frequencies can now be changed in the "Setup" menu.
......@@ -16,11 +16,11 @@ Video Disk Recorder User's Manual
Right Next group - - Enable Increment - Search forward
Ok Ch display Select Switch Edit Accept Play Progress disp.
Menu Menu on Menu off Menu off Menu off Menu off Menu off Menu on
Back - Menu off Main menu Main menu Discard Main menu -
Back - Menu off Main menu Main menu Discard Main menu Recordings menu
Red - Record Edit Edit - Play -
Green - - New New - - Skip -60s
Yellow - - Delete Delete - Delete Skip +60s
Blue - - Mark Mark - - Stop
Blue - Resume Mark Mark - - Stop
0..9 Ch select - - - Numeric inp. - -
* Navigating through the On Screen Menus
......@@ -90,7 +90,7 @@ Video Disk Recorder User's Manual
* Instant Recording
You can start recording the current channel by pressing the "Red" button
in the Main menu. This will create a timer event named "@channelname" that
in the "Main" menu. This will create a timer event named "@channelname" that
starts at the current time and records for two hours.
If you want to modify the recording time you need to edit the timer.
Stop instant recording by pressing the "Menu" button and selecting
......@@ -101,8 +101,10 @@ Video Disk Recorder User's Manual
All recordings are listed in the "Recordings" menu. Browse through the
list with the "Up" and "Down" button and press "Ok" (or the "Red" button)
to start playback. New recordings are marked with an '*'.
Playback can be stopped via the Main menu by selecting "Stop replaying",
Playback can be stopped via the "Main" menu by selecting "Stop replaying",
or by pressing the "Blue" button outside the menu.
A previously stopped playback session can be resumed by pressing the "Blue"
button in the "Main" menu.
* Replay Control
......@@ -118,12 +120,19 @@ Video Disk Recorder User's Manual
Right Runs playback forward or backward at a higher speed; press
again to resume normal speed. If in Pause mode, runs forward or
backward at a slower speed; press again to return to pause mode.
Pressing and holding down the button performs the function until
the button is released again.
- Green
Yellow Skips about 60 seconds back or forward.
Pressing and holding down the button performs the function until
the button is released again.
- Ok Brings up the replay progress display, which shows the date,
time and title of the recording, a progress bar and the
current and total time of the recording.
Press "Ok" again to turn off the progress display.
- Back Stops replaying and brings up the "Recordings" menu. This can be
used to easily delete a recording after watching it, or to switch
to a different recording.
* Programming the Timer
......@@ -171,7 +180,7 @@ Video Disk Recorder User's Manual
* Parameters in the "Setup" menu
Select "Setup" from the main menu to enter the setup menu. From there you can
Select "Setup" from the "Main" menu to enter the setup menu. From there you can
modify the following system parameters (note that "boolean" values will be
displayed as "no" and "yes" in the "Setup" menu, while in the setup file they
are stored as '0' and '1', respectively):
......@@ -197,3 +206,13 @@ Video Disk Recorder User's Manual
1 = dto., but the cursor remains at the bottom (top) of
the page (this mode allows for faster scrolling
through long lists).
MarkInstantRecord = 1 Defines whether an "instant recording" (started by
pressing the "Red" button in the "Main" menu) will be
marked with a '@' character to make it distinguishable
from timer recordings in the "Recordings" menu.
0 = instant recordings will not be marked
1 = instant recordings will be marked.
LnbFrequLo = 9750 The low and high LNB frequencies (in MHz)
LnbFrequHi = 10600
......@@ -4,13 +4,13 @@
# See the main source file 'vdr.c' for copyright information and
# how to reach the author.
#
# $Id: Makefile 1.12 2000/10/01 14:27:12 kls Exp $
# $Id: Makefile 1.13 2000/10/07 16:24:08 kls Exp $
DVBDIR = ../DVB
INCLUDES = -I$(DVBDIR)/driver
OBJS = config.o dvbapi.o dvbosd.o eit.o font.o interface.o menu.o osd.o\
recording.o remote.o svdrp.o tools.o vdr.o videodir.o
recording.o remote.o svdrp.o thread.o tools.o vdr.o videodir.o
OSDFONT = -adobe-helvetica-medium-r-normal--23-*-100-100-p-*-iso8859-1
......@@ -40,12 +40,13 @@ dvbapi.o : dvbapi.c config.h dvbapi.h dvbosd.h font.h interface.h svdrp.h tool
dvbosd.o : dvbosd.c dvbosd.h font.h tools.h
eit.o : eit.c eit.h tools.h
font.o : font.c font.h fontosd.c tools.h
interface.o: interface.c config.h dvbapi.h dvbosd.h eit.h font.h interface.h remote.h svdrp.h tools.h
interface.o: interface.c config.h dvbapi.h dvbosd.h eit.h font.h interface.h remote.h svdrp.h thread.h tools.h
menu.o : menu.c config.h dvbapi.h dvbosd.h font.h interface.h menu.h osd.h recording.h svdrp.h tools.h
osd.o : osd.c config.h dvbapi.h dvbosd.h font.h interface.h osd.h svdrp.h tools.h
recording.o: recording.c config.h dvbapi.h dvbosd.h font.h interface.h recording.h svdrp.h tools.h videodir.h
remote.o : remote.c config.h dvbapi.h dvbosd.h font.h remote.h tools.h
remote.o : remote.c config.h dvbapi.h dvbosd.h font.h remote.h thread.h tools.h
svdrp.o : svdrp.c config.h dvbapi.h dvbosd.h font.h interface.h svdrp.h tools.h
thread.o : thread.c thread.h
tools.o : tools.c tools.h
vdr.o : vdr.c config.h dvbapi.h dvbosd.h font.h interface.h menu.h osd.h recording.h svdrp.h tools.h videodir.h
videodir.o : videodir.c tools.h videodir.h
......@@ -53,7 +54,7 @@ videodir.o : videodir.c tools.h videodir.h
# The main program:
vdr: $(OBJS)
g++ -g -O2 $(OBJS) -lncurses -ljpeg -o vdr
g++ -g -O2 $(OBJS) -lncurses -ljpeg -lpthread -o vdr
# The font file:
......
......@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: config.c 1.23 2000/09/17 09:11:59 kls Exp $
* $Id: config.c 1.26 2000/10/08 16:10:40 kls Exp $
*/
#include "config.h"
......@@ -275,7 +275,7 @@ bool cChannel::Switch(cDvbApi *DvbApi)
}
return false;
}
Interface.Info(DvbApi->Recording() ? "Channel locked (recording)!" : name);
Interface->Info(DvbApi->Recording() ? "Channel locked (recording)!" : name);
return false;
}
......@@ -303,7 +303,7 @@ cTimer::cTimer(bool Instant)
*file = 0;
summary = NULL;
if (Instant && ch)
snprintf(file, sizeof(file), "@%s", ch->name);
snprintf(file, sizeof(file), "%s%s", Setup.MarkInstantRecord ? "@" : "", ch->name);
}
cTimer::~cTimer()
......@@ -566,7 +566,7 @@ eKeys cChannels::ShowChannel(int Number, bool Switched, bool Group)
{
cChannel *channel = Group ? Get(Number) : GetByNumber(Number);
if (channel)
return Interface.DisplayChannel(channel->number, channel->name, !Switched || Setup.ShowInfoOnChSwitch);
return Interface->DisplayChannel(channel->number, channel->name, !Switched || Setup.ShowInfoOnChSwitch);
return kNone;
}
......@@ -596,6 +596,9 @@ cSetup::cSetup(void)
PrimaryDVB = 1;
ShowInfoOnChSwitch = 1;
MenuScrollPage = 1;
MarkInstantRecord = 1;
LnbFrequLo = 9750;
LnbFrequHi = 10600;
}
bool cSetup::Parse(char *s)
......@@ -607,6 +610,9 @@ bool cSetup::Parse(char *s)
if (!strcasecmp(Name, "PrimaryDVB")) PrimaryDVB = atoi(Value);
else if (!strcasecmp(Name, "ShowInfoOnChSwitch")) ShowInfoOnChSwitch = atoi(Value);
else if (!strcasecmp(Name, "MenuScrollPage")) MenuScrollPage = atoi(Value);
else if (!strcasecmp(Name, "MarkInstantRecord")) MarkInstantRecord = atoi(Value);
else if (!strcasecmp(Name, "LnbFrequLo")) LnbFrequLo = atoi(Value);
else if (!strcasecmp(Name, "LnbFrequHi")) LnbFrequHi = atoi(Value);
else
return false;
return true;
......@@ -651,6 +657,9 @@ bool cSetup::Save(const char *FileName)
fprintf(f, "PrimaryDVB = %d\n", PrimaryDVB);
fprintf(f, "ShowInfoOnChSwitch = %d\n", ShowInfoOnChSwitch);
fprintf(f, "MenuScrollPage = %d\n", MenuScrollPage);
fprintf(f, "MarkInstantRecord = %d\n", MarkInstantRecord);
fprintf(f, "LnbFrequLo = %d\n", LnbFrequLo);
fprintf(f, "LnbFrequHi = %d\n", LnbFrequHi);
fclose(f);
isyslog(LOG_INFO, "saved setup to %s", FileName);
return true;
......
......@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: config.h 1.22 2000/10/01 14:14:18 kls Exp $
* $Id: config.h 1.27 2000/10/08 16:33:48 kls Exp $
*/
#ifndef __CONFIG_H
......@@ -17,7 +17,7 @@
#include "dvbapi.h"
#include "tools.h"
#define VDRVERSION "0.65"
#define VDRVERSION "0.66"
#define MaxBuffer 10000
......@@ -34,9 +34,17 @@ enum eKeys { // "Up" and "Down" must be the first two keys!
kYellow,
kBlue,
k0, k1, k2, k3, k4, k5, k6, k7, k8, k9,
kNone
kNone,
// The following flags are OR'd with the above codes:
k_Repeat = 0x8000,
k_Release = 0x4000,
k_Flags = k_Repeat | k_Release,
};
#define RAWKEY(k) ((k) & ~k_Flags)
#define ISRAWKEY(k) ((k) != kNone && ((k) & k_Flags) == 0)
#define NORMALKEY(k) ((k) & ~k_Repeat)
struct tKey {
eKeys type;
char *name;
......@@ -223,6 +231,9 @@ public:
int PrimaryDVB;
int ShowInfoOnChSwitch;
int MenuScrollPage;
int MarkInstantRecord;
int LnbFrequLo;
int LnbFrequHi;
cSetup(void);
bool Load(const char *FileName);
bool Save(const char *FileName = NULL);
......
......@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: dvbapi.c 1.30 2000/10/03 13:26:16 kls Exp $
* $Id: dvbapi.c 1.31 2000/10/08 16:14:45 kls Exp $
*/
#include "dvbapi.h"
......@@ -19,7 +19,7 @@ extern "C" {
#include <sys/stat.h>
#include <sys/time.h>
#include <unistd.h>
#include "dvbapi.h"
#include "config.h"
#include "interface.h"
#include "tools.h"
#include "videodir.h"
......@@ -1657,9 +1657,9 @@ bool cDvbApi::SetChannel(int FrequencyMHz, char Polarization, int Diseqc, int Sr
unsigned int freq = FrequencyMHz;
front.ttk = (freq < 11700UL) ? 0 : 1;
if (freq < 11700UL)
freq -= 9750UL;
freq -= Setup.LnbFrequLo;
else
freq -= 10600UL;
freq -= Setup.LnbFrequHi;
front.channel_flags = Ca ? DVB_CHANNEL_CA : DVB_CHANNEL_FTA;
front.pnr = Pnr;
front.freq = freq * 1000000UL;
......
......@@ -4,10 +4,11 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: dvbosd.c 1.2 2000/10/03 13:34:13 kls Exp $
* $Id: dvbosd.c 1.3 2000/10/07 14:42:48 kls Exp $
*/
#include "dvbosd.h"
#include <signal.h>
#include <sys/ioctl.h>
#include <sys/stat.h>
#include <sys/unistd.h>
......@@ -138,11 +139,16 @@ void cDvbOsd::Cmd(OSD_Command cmd, int color, int x0, int y0, int x1, int y1, co
dc.x1 = x1;
dc.y1 = y1;
dc.data = (void *)data;
// must block all signals, otherwise the command might not be fully executed
sigset_t set, oldset;
sigfillset(&set);
sigprocmask(SIG_BLOCK, &set, &oldset);
ioctl(videoDev, VIDIOCSOSDCOMMAND, &dc);
usleep(10); // XXX Workaround for a driver bug (cInterface::DisplayChannel() displayed texts at wrong places
// XXX and sometimes the OSD was no longer displayed).
// XXX Increase the value if the problem still persists on your particular system.
// TODO Check if this is still necessary with driver versions after 0.7.
sigprocmask(SIG_SETMASK, &oldset, NULL);
}
}
......
......@@ -4,43 +4,39 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: interface.c 1.21 2000/10/03 13:28:02 kls Exp $
* $Id: interface.c 1.25 2000/10/08 16:34:17 kls Exp $
*/
#include "interface.h"
#include <unistd.h>
#include "eit.h"
#include "remote.h"
cEIT EIT;
#if defined(REMOTE_RCU)
cRcIoRCU RcIo("/dev/ttyS1");
#elif defined(REMOTE_LIRC)
cRcIoLIRC RcIo("/dev/lircd");
#else
cRcIoKBD RcIo;
#endif
cInterface Interface;
cInterface *Interface = NULL;
cInterface::cInterface(void)
cInterface::cInterface(int SVDRPport)
{
open = 0;
cols[0] = 0;
keyFromWait = kNone;
rcIo = NULL;
SVDRP = NULL;
}
void cInterface::Init(int SVDRPport)
{
RcIo.SetCode(Keys.code, Keys.address);
#if defined(REMOTE_RCU)
rcIo = new cRcIoRCU("/dev/ttyS1");
#elif defined(REMOTE_LIRC)
rcIo = new cRcIoLIRC("/dev/lircd");
#else
rcIo = new cRcIoKBD;
#endif
rcIo->SetCode(Keys.code, Keys.address);
if (SVDRPport)
SVDRP = new cSVDRP(SVDRPport);
}
void cInterface::Cleanup(void)
cInterface::~cInterface()
{
delete rcIo;
delete SVDRP;
}
......@@ -58,22 +54,29 @@ void cInterface::Close(void)
cDvbApi::PrimaryDvbApi->Close();
}
unsigned int cInterface::GetCh(bool Wait)
unsigned int cInterface::GetCh(bool Wait, bool *Repeat, bool *Release)
{
if (RcIo.InputAvailable(Wait)) {
unsigned int Command;
return RcIo.GetCommand(&Command, NULL) ? Command : 0;
}
return 0;
if (open)
cDvbApi::PrimaryDvbApi->Flush();
if (!rcIo->InputAvailable())
cFile::AnyFileReady(-1, Wait ? 1000 : 0);
unsigned int Command;
return rcIo->GetCommand(&Command, Repeat, Release) ? Command : 0;
}
eKeys cInterface::GetKey(bool Wait)
{
if (open)
cDvbApi::PrimaryDvbApi->Flush();
if (SVDRP)
SVDRP->Process();
eKeys Key = keyFromWait != kNone ? keyFromWait : Keys.Get(GetCh(Wait));
eKeys Key = keyFromWait;
if (Key == kNone) {
bool Repeat = false, Release = false;
Key = Keys.Get(GetCh(Wait, &Repeat, &Release));
if (Repeat)
Key = eKeys(Key | k_Repeat);
if (Release)
Key = eKeys(Key | k_Release);
}
keyFromWait = kNone;
return Key;
}
......@@ -85,13 +88,16 @@ void cInterface::PutKey(eKeys Key)
eKeys cInterface::Wait(int Seconds, bool KeepChar)
{
eKeys Key = kNone;
if (open)
cDvbApi::PrimaryDvbApi->Flush();
RcIo.Flush(500);
if (cFile::AnyFileReady(-1, Seconds * 1000))
Key = GetKey();
if (KeepChar)
eKeys Key = kNone;
time_t timeout = time(NULL) + Seconds;
for (;;) {
Key = GetKey();
if ((Key != kNone && (RAWKEY(Key) != kOk || RAWKEY(Key) == Key)) || time(NULL) > timeout)
break;
}
if (KeepChar && ISRAWKEY(Key))
keyFromWait = Key;
return Key;
}
......@@ -220,9 +226,11 @@ void cInterface::Help(const char *Red, const char *Green, const char *Yellow, co
void cInterface::QueryKeys(void)
{
Keys.Clear();
Clear();
WriteText(1, 1, "Learning Remote Control Keys");
WriteText(1, 3, "Phase 1: Detecting RC code type");
WriteText(1, 5, "Press any key on the RC unit");
cDvbApi::PrimaryDvbApi->Flush();
#ifndef REMOTE_KBD
unsigned char Code = 0;
unsigned short Address;
......@@ -233,14 +241,16 @@ void cInterface::QueryKeys(void)
break;
#else
//TODO on screen display...
if (RcIo.DetectCode(&Code, &Address)) {
if (rcIo->DetectCode(&Code, &Address)) {
Keys.code = Code;
Keys.address = Address;
WriteText(1, 5, "RC code detected!");
WriteText(1, 6, "Do not press any key...");
RcIo.Flush(3000);
cDvbApi::PrimaryDvbApi->Flush();
rcIo->Flush(3000);
ClearEol(0, 5);
ClearEol(0, 6);
cDvbApi::PrimaryDvbApi->Flush();
break;
}
#endif
......@@ -328,7 +338,7 @@ eKeys cInterface::DisplayChannel(int Number, const char *Name, bool WithInfo)
{
// Number = 0 is used for channel group display and no EIT
if (Number)
RcIo.Number(Number);
rcIo->Number(Number);
if (Name && !Recording()) {
Open(MenuColumns, 5);
cDvbApi::PrimaryDvbApi->Fill(0, 0, MenuColumns, 1, clrBackground);
......@@ -387,7 +397,7 @@ eKeys cInterface::DisplayChannel(int Number, const char *Name, bool WithInfo)
void cInterface::DisplayRecording(int Index, bool On)
{
RcIo.SetPoints(1 << Index, On);
rcIo->SetPoints(1 << Index, On);
}
bool cInterface::Recording(void)
......
......@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: interface.h 1.13 2000/09/18 22:29:31 kls Exp $
* $Id: interface.h 1.16 2000/10/08 12:15:49 kls Exp $
*/
#ifndef __INTERFACE_H
......@@ -12,6 +12,7 @@
#include "config.h"
#include "dvbapi.h"
#include "remote.h"
#include "svdrp.h"
class cInterface {
......@@ -22,14 +23,14 @@ private:
int cols[MaxCols];
eKeys keyFromWait;
cSVDRP *SVDRP;
unsigned int GetCh(bool Wait = true);
cRcIoBase *rcIo;
unsigned int GetCh(bool Wait = true, bool *Repeat = NULL, bool *Release = NULL);
void QueryKeys(void);
void HelpButton(int Index, const char *Text, eDvbColor FgColor, eDvbColor BgColor);
eKeys Wait(int Seconds = 1, bool KeepChar = false);
public:
cInterface(void);
void Init(int SVDRPport = 0);
void Cleanup(void);
cInterface(int SVDRPport = 0);
~cInterface();
void Open(int NumCols = MenuColumns, int NumLines = MenuLines);
void Close(void);
eKeys GetKey(bool Wait = true);
......@@ -38,7 +39,7 @@ public:
void ClearEol(int x, int y, eDvbColor Color = clrBackground);
void SetCols(int *c);
void Write(int x, int y, const char *s, eDvbColor FgColor = clrWhite, eDvbColor BgColor = clrBackground);
void WriteText(int x, int y, const char *s, eDvbColor FgColor = clrWhite, eDvbColor BgColor = clrBlack);
void WriteText(int x, int y, const char *s, eDvbColor FgColor = clrWhite, eDvbColor BgColor = clrBackground);
void Title(const char *s);
void Status(const char *s, eDvbColor FgColor = clrBlack, eDvbColor BgColor = clrCyan);
void Info(const char *s);
......@@ -51,6 +52,6 @@ public:
bool Recording(void);
};
extern cInterface Interface;
extern cInterface *Interface;
#endif //__INTERFACE_H
This diff is collapsed.
......@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: menu.h 1.10 2000/09/10 14:42:20 kls Exp $
* $Id: menu.h 1.12 2000/10/08 15:21:52 kls Exp $
*/
#ifndef _MENU_H
......@@ -14,6 +14,7 @@
#include "dvbapi.h"
#include "osd.h"
#include "recording.h"
class cMenuMain : public cOsdMenu {
private:
......@@ -34,6 +35,17 @@ public:
virtual eOSState ProcessKey(eKeys Key);
};
class cMenuRecordings : public cOsdMenu {
private:
cRecordings Recordings;
eOSState Play(void);
eOSState Del(void);
eOSState Summary(void);
public:
cMenuRecordings(void);
virtual eOSState ProcessKey(eKeys Key);
};
class cRecordControl {
private:
cDvbApi *dvbApi;
......@@ -72,6 +84,8 @@ public:
virtual eOSState ProcessKey(eKeys Key);
bool Visible(void) { return visible; }
static void SetRecording(const char *FileName, const char *Title);
static const char *LastReplayed(void);
static void ClearLastReplayed(const char *FileName);
};
#endif //_MENU_H
......@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: osd.c 1.7 2000/09/10 08:24:50 kls Exp $
* $Id: osd.c 1.9 2000/10/08 12:20:34 kls Exp $
*/
#include "osd.h"
......@@ -64,7 +64,7 @@ void cOsdItem::Display(int Offset, eDvbColor FgColor, eDvbColor BgColor)
if (Offset >= 0)
offset = Offset;
if (offset >= 0)
Interface.WriteText(0, offset + 2, text, userColor ? fgColor : FgColor, userColor ? bgColor : BgColor);
Interface->WriteText(0, offset + 2, text, userColor ? fgColor : FgColor, userColor ? bgColor : BgColor);
}
eOSState cOsdItem::ProcessKey(eKeys Key)
......@@ -88,7 +88,7 @@ cOsdMenu::cOsdMenu(char *Title, int c0, int c1, int c2, int c3, int c4)
subMenu = NULL;
helpRed = helpGreen = helpYellow = helpBlue = NULL;
status = NULL;
Interface.Open();
Interface->Open();
}
cOsdMenu::~cOsdMenu()
......@@ -96,8 +96,8 @@ cOsdMenu::~cOsdMenu()
delete title;
delete subMenu;
delete status;
Interface.Clear();
Interface.Close();
Interface->Clear();
Interface->Close();
}
void cOsdMenu::SetStatus(const char *s)
......@@ -105,7 +105,7 @@ void cOsdMenu::SetStatus(const char *s)
delete status;
status = s ? strdup(s) : NULL;
if (visible)
Interface.Status(status);
Interface->Status(status);
}
void cOsdMenu::SetHelp(const char *Red, const char *Green, const char *Yellow, const char *Blue)
......@@ -117,7 +117,7 @@ void cOsdMenu::SetHelp(const char *Red, const char *Green, const char *Yellow, c
helpBlue = Blue;
if (visible)
Display();
//XXX Interface.Help(helpRed, helpGreen, helpYellow, helpBlue);
//XXX Interface->Help(helpRed, helpGreen, helpYellow, helpBlue);
//XXX must clear unused button areas!
}
......@@ -140,10 +140,10 @@ void cOsdMenu::Add(cOsdItem *Item, bool Current)
void cOsdMenu::Display(void)
{
visible = true;
Interface.Clear();
Interface.SetCols(cols);
Interface.Title(title);
Interface.Help(helpRed, helpGreen, helpYellow, helpBlue);
Interface->Clear();
Interface->SetCols(cols);
Interface->Title(title);
Interface->Help(helpRed, helpGreen, helpYellow, helpBlue);
int count = Count();
if (count > 0) {
if (current < 0)
......@@ -164,7 +164,7 @@ void cOsdMenu::Display(void)
break;
}
}
Interface.Status(status);
Interface->Status(status);
}
void cOsdMenu::RefreshCurrent(void)
......@@ -274,7 +274,9 @@ eOSState cOsdMenu::ProcessKey(eKeys Key)
return state;
}
switch (Key) {
case kUp|k_Repeat:
case kUp: CursorUp(); break;
case kDown|k_Repeat:
case kDown: CursorDown(); break;
case kBack: return osBack;
case kOk: if (marked >= 0) {
......
......@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: recording.c 1.18 2000/10/03 12:39:28 kls Exp $
* $Id: recording.c 1.19 2000/10/08 12:20:53 kls Exp $
*/
#define _GNU_SOURCE
......@@ -254,7 +254,7 @@ bool cRecordings::Load(bool Deleted)
result = Count() > 0;
}
else
Interface.Error("Error while opening pipe!");
Interface->Error("Error while opening pipe!");
delete cmd;
return result;
}
......
This diff is collapsed.
......@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: remote.h 1.10 2000/10/03 10:45:35 kls Exp $
* $Id: remote.h 1.13 2000/10/08 12:11:34 kls Exp $
*/
#ifndef __REMOTE_H
......@@ -12,26 +12,25 @@
#include <stdio.h>
#include <time.h>
#include "thread.h"
#include "tools.h"
class cRcIoBase {
protected:
time_t t;
int firstTime, lastTime;
unsigned int lastCommand;
cRcIoBase(void);
virtual ~cRcIoBase();
public:
enum { modeH = 'h', modeB = 'b', modeS = 's' };
virtual ~cRcIoBase();
virtual bool SetCode(unsigned char Code, unsigned short Address) { return true; }
virtual bool SetMode(unsigned char Mode) { return true; }
virtual bool Number(int n, bool Hex = false) { return true; }
virtual void SetPoints(unsigned char Dp, bool On) {}
virtual bool String(char *s) { return true; }
virtual bool DetectCode(unsigned char *Code, unsigned short *Address) { return true; }
virtual void Flush(int WaitMs = 0) = 0;
virtual bool InputAvailable(bool Wait = false) = 0;
virtual bool GetCommand(unsigned int *Command, unsigned short *Address = NULL) = 0;
virtual void Flush(int WaitMs = 0) {}
virtual bool InputAvailable(void) = 0;
virtual bool GetCommand(unsigned int *Command = NULL, bool *Repeat = NULL, bool *Release = NULL) = 0;
};
#if defined REMOTE_KBD
......@@ -43,23 +42,27 @@ public:
cRcIoKBD(void);
virtual ~cRcIoKBD();
virtual void Flush(int WaitMs = 0);
virtual bool InputAvailable(bool Wait = false);
virtual bool GetCommand(unsigned int *Command, unsigned short *Address = NULL);
virtual bool InputAvailable(void);
virtual bool GetCommand(unsigned int *Command = NULL, bool *Repeat = NULL, bool *Release = NULL);
};