Commit 85b8e41e authored by Klaus Schmidinger's avatar Klaus Schmidinger

Version 0.04

- Changed name from 'osm' to 'vdr' to avoid mixups with the 'oms' program that
  appears to be in use with DVD replay.
- Implemented a channel display in the top menu line.
- Implemented replay progress display (press "Ok" when replaying to bring it up).
- Implemented direct channel selecting by pressing the numeric keys.
- Added several 'const' keywords to please stricter compilers.
- The repeat function for the remote control no longer adapts dynamically
  to the timing of the RCU (this sometimes caused the repeat function to
  kick in too early).
- Channel selection is now blocked when recording or replaying.
- Improved process handling.
parent 37250a05
......@@ -14,10 +14,3 @@ Video Disk Recorder - Known Bugs
Haven't figured out yet how to ensure that it switches back to
the current channel.
* Every now and then the on-screen display shows nothing but
"noise". If that occurs, I have to stop the 'osm' program
and do a 'make reload' for the card driver. After that it
works fine again.
Presumably this is a problem in the card driver or firmware?
Or could it be a problem with the hardware?
Does anybody else observe this?
Video Disk Recorder OSM Revision History
----------------------------------------
Video Disk Recorder Revision History
------------------------------------
2000-02-19: Version 0.01 (Initial revision).
......@@ -18,3 +18,17 @@ Video Disk Recorder OSM Revision History
able to store some 18 hours in full quality, so we don't really need that).
- Termination signals are now caught and the program cleans up before exiting.
- Support for CICAM.
2000-04-24: Version 0.04
- Changed name from 'osm' to 'vdr' to avoid mixups with the 'oms' program that
appears to be in use with DVD replay.
- Implemented a channel display in the top menu line.
- Implemented replay progress display (press "Ok" when replaying to bring it up).
- Implemented direct channel selecting by pressing the numeric keys.
- Added several 'const' keywords to please stricter compilers.
- The repeat function for the remote control no longer adapts dynamically
to the timing of the RCU (this sometimes caused the repeat function to
kick in too early).
- Channel selection is now blocked when recording or replaying.
- Improved process handling.
Installation of the Video Disk Recorder
---------------------------------------
Compiling and running the program:
----------------------------------
Make sure the files from this package are located in a
directory that is "parallel" to the DVB directory of the
driver source for the Siemens DVB-S PCI card (refer to
http://linuxtv.org/dvb/siemens_dvb.html for more information
about that driver). For example, if the DVB driver was
extracted into the directory /home/kls/vdr/DVB, then this
package should be extracted into /home/kls/vdr/VDR.
This program requires the card driver version 0.04 or higher
to work properly.
After extracting the package, change into the VDR directory
and type 'make'. This should produce an executable file
named 'vdr', which can be run after the DVB driver has been
installed.
There are two macros you can use to customize the 'vdr' program
at compile time. Adding "DEBUG_REMOTE=1" to the 'make' call
will use the PC's keyboard as input device instead of the "Remote
Control Unit" (see http://www.cadsoft.de/people/kls/vdr/remote.htm).
Adding "DEBUG_OSD=1" will use the PC screen (or current window)
to display texts instead of the DVB card's on-screen display
interface. These modes are useful when testing new menus if you
only have a remote connection to the VDR (which, in my case, is
located in the living room and has neither a monitor nor a keyboard).
The video data directory:
-------------------------
All recordings are written into directories below "/video". Please
make sure this directory exists, and that the user who runs the 'vdr'
program has read and write access to that directory.
If you prefer a different location for your video files, you can change
the value of 'BaseDir' in recording.c.
Note that the file system need not be 64-bit proof, since the 'vdr'
program splits video files into chunks of about 1GB. You should use
a disk with several gigabytes of free space. One GB can store roughly
half an hour of video data.
Configuration files:
--------------------
There are three configuration files that hold information about
channels, remote control keys and timers. These files are currrently
assumed to be located in the directory from which the 'vdr' program
was started (this will become configurable later). The configuration
files can be edited with any text editor, or will be written by the
'vdr' program if any changes are made inside the on-screen menus.
The meaning of the data entries may still vary in future releases,
so for the moment please look at the source code (config.c) to see
the meaning of the various fields.
Learning the remote control keys:
---------------------------------
There is no default 'keys.conf' file, so if you compile the program
without 'DEBUG_REMOTE=1' you will have to go through a "teach-in"
session that allows the program to learn your remote control codes.
It will first attempt to determine the basic data transfer mode and
timing of your remote control unit, and then will ask you to press one
key after the other so that it can learn the various key codes. You will
at least need to provide an "Up" and a "Down" key, so that you can switch
channels. The rest of the key definitions is optional, but the more keys
you define, the more you will be able to navigate through the menus and
control recording/replaying.
If the program has been built with "DEBUG_REMOTE=1", it will use the
key configuration file 'keys-pc.conf', so that you won't loose data
when switching between normal and debug mode.
The default PC key assignments are:
Up, Down, Left, Right Crsr keys in numeric block
Menu '5' in numeric block
Ok Enter
Back Backspace
0..9 '0'..'9' in top row
Red, Green, Yellow, Blue 'F1'..'F4'
Record 'r'
Pause 'p'
Stop 's'
Begin 'B'
SearchForward 'f'
SearchBack 'b'
SkipForward 'PgDn' in numeric block
SkipBack 'PgUp' in numeric block
If you prefer different key assignments, simply delete the file
'keys-pc.conf' and restart 'vdr' to get into learning mode.
Video Disk Recorder User's Manual
---------------------------------
* Navigating through the On Screen Menus
The "Main" menu can be called up with the "Menu" key of your remote
control unit. The "Up" and "Down" keys are used to select a specific
item. The "Left" and "Right" keys can be used to change options, and
the numeric keys allow direct input of numeric data. The "Ok" key
confirms any changes (or switches to a channel in the "Channels" menu).
The "Back" key goes back one level in the menu structure, discarding
any changes that might have been made in the current menu.
In the "Timers" menu, the current timer can be enabled or disabled with
the "Right" or "Left" key, respectively (enabled timers are marked with ">").
"Ok" here opens the "Edit timer" menu.
Textual options, like channel names or recording file names, can be edited
by pressing the "Right" button (which puts brackets around the current
character as in "[R]TL"), selecting the desired character position with
"Left" and "Right", and changing the character with the "Up" and "Down"
keys. "Ok" then confirms the changes.
The "Red", "Green", "Yellow" and "Blue" buttons have special meanings
in the various menus and are listed at the bottom of the on-screen-display.
At any point in the menu system, pressing the "Menu" key again will
immediately leave the menu system.
* Selecting a Channel
You can select a channel either by pressing the "Up" or "Down" key (while
no On Screen Menu is displayed), or browsing through the channel list in
the menu and pressing "Ok" on the desired channel.
There are three ways to select a channel:
1. With no On Screen Menu displayed press the "Up" or "Down" key to switch
to the next higher or lower channel.
2. Press the "Menu" button to bring up the On Screen Menu, select "Channels"
and browse through the list with the "Up" and "Down" key; to switch to the
selected channel press "Ok".
2. Directly type in the channel number with the numeric keys ('0'..'9');
if no key is pressed for about half a second, the digits collected so
far will define the channel number.
After switching to a different channel the channel number and name, as well
as the current time are displayed at the top of the screen. This line
automatically goes away after about two seconds, or if any key is pressed.
To bring up the channel display without switching channels you can press
the "Ok" button.
* Instant Recording
You can start recording the current channel by pressing the "Record"
button. This will create a timer event named "instant" that start
button. This will create a timer event named "instant" 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 disabling or deleting the timer.
......@@ -23,6 +62,8 @@ Video Disk Recorder User's Manual
* Replay Control
The following keys have the listed meaning in Replay mode:
- "Begin" Positions to beginning of the recording and starts playback
from there.
- "Pause" Halts playback at the current frame. Press again to continue
......@@ -32,6 +73,10 @@ Video Disk Recorder User's Manual
- "Search" Runs playback forward or backward at a higher speed. Press
again to resume normal speed.
- "Skip" Skips about 60 seconds forward or backward.
- "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.
* Programming the Timer
......
#
# Makefile for the On Screen Menu of the Video Disk Recorder
#
# See the main source file 'osm.c' for copyright information and
# See the main source file 'vdr.c' for copyright information and
# how to reach the author.
#
# $Id: Makefile 1.2 2000/03/05 13:51:57 kls Exp $
# $Id: Makefile 1.3 2000/04/24 09:44:10 kls Exp $
OBJS = config.o dvbapi.o interface.o menu.o osd.o recording.o remote.o tools.o osm.o
OBJS = config.o dvbapi.o interface.o menu.o osd.o recording.o remote.o tools.o vdr.o
ifdef DEBUG_REMOTE
DEFINES += -DDEBUG_REMOTE
......@@ -19,20 +19,20 @@ endif
%.o: %.c
g++ -g -O2 -Wall -c $(DEFINES) $<
all: osm
all: vdr
config.o : config.c config.h dvbapi.h interface.h tools.h
dvbapi.o : dvbapi.c config.h dvbapi.h interface.h tools.h
interface.o: interface.c config.h dvbapi.h interface.h remote.h tools.h
menu.o : menu.c config.h dvbapi.h interface.h menu.h osd.h recording.h tools.h
osd.o : osd.c config.h dvbapi.h interface.h osd.h tools.h
osm.o : osm.c config.h dvbapi.h interface.h menu.h osd.h recording.h tools.h
vdr.o : vdr.c config.h dvbapi.h interface.h menu.h osd.h recording.h tools.h
recording.o: recording.c config.h dvbapi.h interface.h recording.h tools.h
remote.o : remote.c remote.h tools.h
tools.o : tools.c tools.h
osm: $(OBJS)
g++ -g -O2 $(OBJS) -lncurses -o osm
vdr: $(OBJS)
g++ -g -O2 $(OBJS) -lncurses -o vdr
clean:
-rm $(OBJS) osm
-rm $(OBJS) vdr
......@@ -7,6 +7,12 @@ of the LinuxTV project (http://linuxtv.org).
For details about the "Video Disk Recorder" project please
refer to http://www.cadsoft.de/people/kls/vdr.
There is also a remote control unit described on those
Web pages, which can be used within this program.
Please see the INSTALL file for details on how to install
this program on your computer.
The author can be contacted at kls@cadsoft.de.
Yet another "set-top-box"?
......@@ -25,112 +31,6 @@ of commercial set-top-boxes usually are a lot more fancy than
the ones in this system, but here we have the full source code
and can modify the menus in whatever way desired.
Compiling and running the program:
----------------------------------
Make sure the files from this package are located in a
directory that is "parallel" to the DVB directory of the
driver source for the Siemens DVB-S PCI card (refer to
http://linuxtv.org/dvb/siemens_dvb.html for more information
about that driver). For example, if the DVB driver was
extracted into the directory /home/kls/vdr/DVB, then this
package should be extracted into /home/kls/vdr/OSM.
This program requires the card driver version 0.04 or higher
to work properly.
After extracting the package, change into the OSM directory
and type 'make'. This should produce an executable file
named 'osm', which can be run after the DVB driver has been
installed.
There are two macros you can use to customize the 'osm' program
at compile time. Adding "DEBUG_REMOTE=1" to the 'make' call
will use the PC's keyboard as input device instead of the "Remote
Control Unit" (see http://www.cadsoft.de/people/kls/vdr/remote.htm).
Adding "DEBUG_OSD=1" will use the PC screen (or current window)
to display texts instead of the DVB card's on-screen display
interface. These modes are useful when testing new menus if you
only have a remote connection to the VDR (which, in my case, is
located in the living room and has neither a monitor nor a keyboard).
Configuration files:
--------------------
There are three configuration files that hold information about
channels, remote control keys and timers. These files are currrently
assumed to be located in the directory from which the 'osm' program
was started (this will become configurable later). The configuration
files can be edited with any text editor, or will be written by the
'osm' program if any changes are made inside the on-screen menus.
The meaning of the data entries may still vary in future releases,
so for the moment please look at the source code (config.c) to see
the meaning of the various fields.
Learning the remote control keys:
---------------------------------
There is no default 'keys.conf' file, so if you compile the program
without 'DEBUG_REMOTE=1' you will have to go through a "teach-in"
session that allows the program to learn your remote control codes.
It will first attempt to determine the basic data transfer mode and
timing of your remote control unit, and then will ask you to press one
key after the other so that it can learn the various key codes. You will
at least need to provide an "Up" and a "Down" key, so that you can switch
channels. The rest of the key definitions is optional, but the more keys
you define, the more you will be able to navigate through the menus and
control recording/replaying.
If the program has been built with "DEBUG_REMOTE=1", it will use the
key configuration file 'keys-pc.conf', so that you won't loose data
when switching between normal and debug mode.
The default PC key assignments are:
Up, Down, Left, Right Crsr keys in numeric block
Menu '5' in numeric block
Ok Enter
Back Backspace
0..9 '0'..'9' in top row
Red, Green, Yellow, Blue 'F1'..'F4'
Record 'r'
Pause 'p'
Stop 's'
Begin 'B'
SearchForward 'f'
SearchBack 'b'
SkipForward 'PgDn' in numeric block
SkipBack 'PgUp' in numeric block
If you prefer different key assignments, simply delete the file
'keys-pc.conf' and restart 'osm' to get into learning mode.
Navigating through the On Screen Menus:
---------------------------------------
The "Main" menu can be called up with the "Menu" key of your remote
control unit. The "Up" and "Down" keys are used to select a specific
item. The "Left" and "Right" keys can be used to change options, and
the numeric keys allow direct input of numeric data. The "Ok" key
confirms any changes (or switches to a channel in the "Channels" menu).
The "Back" key goes back one level in the menu structure, discarding
any changes that might have been made in the current menu.
In the "Timers" menu, the current timer can be enabled or disabled with
the "Right" or "Left" key, respectively (enabled timers are marked with ">").
"Ok" here opens the "Edit timer" menu.
Textual options, like channel names or recording file names, can be edited
by pressing the "Right" button (which puts brackets around the current
character as in "[R]TL"), selecting the desired character position with
"Left" and "Right", and changing the character with the "Up" and "Down"
keys. "Ok" then confirms the changes.
The "Red", "Green", "Yellow" and "Blue" buttons have special meanings
in the various menus and are listed at the bottom of the on-screen-display.
At any point in the menu system, pressing the "Menu" key again will
immediately leave the menu system.
What do you think?
------------------
......
TODO list for the Video Disk Recorder project
---------------------------------------------
* Channel select via numeric keys.
* Make it work with two DVB-S PCI cards to allow simultaneous
recording of one programme, while replaying another programme
(or maybe the same one, but time delayed).
......@@ -10,7 +9,5 @@ TODO list for the Video Disk Recorder project
* Implement "on-disk editing" to allow "cutting out" of certain
scenes in order to archive them (or, reversely, cut out
commercial breaks).
* Implement on-screen display of replay progress (progress bar
and/or time index).
* Implement channel scanning.
* Better support for encrypted channels.
/*
* config.c: Configuration file handling
*
* See the main source file 'osm.c' for copyright information and
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: config.c 1.3 2000/04/15 12:48:00 kls Exp $
* $Id: config.c 1.5 2000/04/24 09:44:15 kls Exp $
*/
#include "config.h"
......@@ -206,7 +206,6 @@ bool cChannel::Switch(void)
if (!DvbApi.Recording()) {
isyslog(LOG_INFO, "switching to channel %d", Index() + 1);
CurrentChannel = Index();
Interface.DisplayChannel(CurrentChannel + 1, name);
for (int i = 3; --i;) {
if (DvbApi.SetChannel(frequency, polarization, diseqc, srate, vpid, apid, ca, pnr))
return true;
......
/*
* config.h: Configuration file handling
*
* See the main source file 'osm.c' for copyright information and
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: config.h 1.3 2000/04/15 12:44:23 kls Exp $
* $Id: config.h 1.4 2000/04/24 09:44:17 kls Exp $
*/
#ifndef __CONFIG_H
......
This diff is collapsed.
/*
* dvbapi.h: Interface to the DVB driver
*
* See the main source file 'osm.c' for copyright information and
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: dvbapi.h 1.3 2000/04/15 13:36:10 kls Exp $
* $Id: dvbapi.h 1.8 2000/04/24 15:31:07 kls Exp $
*/
#ifndef __DVBAPI_H
......@@ -21,6 +21,9 @@ typedef unsigned char __u8;
#include <stdio.h>
#include "../DVB/driver/dvb.h"
#define MenuLines 15
#define MenuColumns 40
enum eDvbColor { clrBackground,
#ifndef DEBUG_OSD
clrOBSOLETE, //FIXME apparently color '1' can't be used as FgColor with e.g. clrRed as BgColor???
......@@ -66,6 +69,14 @@ public:
void ClrEol(int x, int y, eDvbColor color = clrBackground);
void Text(int x, int y, const char *s, eDvbColor colorFg = clrWhite, eDvbColor colorBg = clrBackground);
// Progress Display facilities
private:
int lastProgress;
char *replayTitle;
public:
bool ShowProgress(bool Initial = false);
// Channel facilities
bool SetChannel(int FrequencyMHz, char Polarization, int Diseqc, int Srate, int Vpid, int Apid, int Ca, int Pnr);
......@@ -78,13 +89,13 @@ private:
dvbFastForward,
dvbFastRewind,
dvbSkip,
dvbGetIndex,
};
bool isMainProcess;
pid_t pidRecord, pidReplay;
int fromRecord, toRecord;
int fromReplay, toReplay;
void SetReplayMode(int Mode);
void KillProcess(pid_t pid);
public:
bool Recording(void);
// Returns true if we are currently recording.
......@@ -102,10 +113,11 @@ public:
// returned.
void StopRecord(void);
// Stops the current recording session (if any).
bool StartReplay(const char *FileName);
bool StartReplay(const char *FileName, const char *Title = NULL);
// Starts replaying the given file.
// If there is already a replay session active, it will be stopped
// and the new file will be played back.
// If provided Title will be used in the progress display.
void StopReplay(void);
// Stops the current replay session (if any).
void PauseReplay(void);
......@@ -119,6 +131,7 @@ public:
// The sign of 'Seconds' determines the direction in which to skip.
// Use a very large negative value to go all the way back to the
// beginning of the recording.
bool GetIndex(int *Current, int *Total = NULL);
};
#endif //__DVBAPI_H
/*
* interface.c: Abstract user interface layer
*
* See the main source file 'osm.c' for copyright information and
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: interface.c 1.3 2000/04/15 17:38:11 kls Exp $
* $Id: interface.c 1.6 2000/04/24 09:44:23 kls Exp $
*/
#include "interface.h"
#include <unistd.h>
#include "remote.h"
#define MenuLines 15
#define MenuColumns 40
#ifndef DEBUG_REMOTE
cRcIo RcIo("/dev/ttyS1");
#endif
......@@ -26,6 +23,7 @@ cInterface::cInterface(void)
{
open = 0;
cols[0] = 0;
keyFromWait = kNone;
}
void cInterface::Init(void)
......@@ -35,10 +33,10 @@ void cInterface::Init(void)
#endif
}
void cInterface::Open(void)
void cInterface::Open(int NumCols, int NumLines)
{
if (!open++)
DvbApi.Open(MenuColumns, MenuLines);
DvbApi.Open(NumCols, NumLines);
}
void cInterface::Close(void)
......@@ -49,35 +47,45 @@ void cInterface::Close(void)
DvbApi.Close();
}
unsigned int cInterface::GetCh(void)
unsigned int cInterface::GetCh(bool Wait)
{
#ifdef DEBUG_REMOTE
timeout(Wait ? 1000 :10);
int c = getch();
return (c > 0) ? c : 0;
#else
//XXX #ifdef DEBUG_OSD
//XXX wrefresh(window);//XXX
//XXX #endif
unsigned int Command;
return RcIo.GetCommand(&Command) ? Command : 0;
#ifdef DEBUG_OSD
timeout(0);
getch(); // just to make 'ncurses' display the window:
#endif
if (Wait || RcIo.InputAvailable()) {
unsigned int Command;
return RcIo.GetCommand(&Command, NULL) ? Command : 0;
}
return 0;
#endif
}
eKeys cInterface::GetKey(void)
eKeys cInterface::GetKey(bool Wait)
{
return Keys.Get(GetCh());
eKeys Key = keyFromWait != kNone ? keyFromWait : Keys.Get(GetCh(Wait));
keyFromWait = kNone;
return Key;
}
eKeys cInterface::Wait(int Seconds)
eKeys cInterface::Wait(int Seconds, bool KeepChar)
{
int t0 = time_ms();
eKeys Key = kNone;
while (time_ms() - t0 < Seconds * 1000) {
eKeys Key = GetKey();
Key = GetKey();
if (Key != kNone)
return Key;
break;
}
return kNone;
if (KeepChar)
keyFromWait = Key;
return Key;
}
void cInterface::Clear(void)
......@@ -312,8 +320,20 @@ void cInterface::LearnKeys(void)
void cInterface::DisplayChannel(int Number, const char *Name)
{
//TODO
#ifndef DEBUG_REMOTE
RcIo.Number(Number);
#endif
if (Name) {
Open(MenuColumns, 1);
char buffer[MenuColumns + 1];
snprintf(buffer, sizeof(buffer), "%d %s", Number, Name ? Name : "");
Write(0, 0, buffer);
time_t t = time(NULL);
struct tm *now = localtime(&t);
snprintf(buffer, sizeof(buffer), "%02d:%02d", now->tm_hour, now->tm_min);
Write(-5, 0, buffer);
if (Wait(2, true) == kOk)
GetKey();
Close();
}
}
/*
* interface.h: Abstract user interface layer
*
* See the main source file 'osm.c' for copyright information and
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: interface.h 1.3 2000/03/19 14:03:28 kls Exp $
* $Id: interface.h 1.7 2000/04/24 09:44:25 kls Exp $
*/
#ifndef __INTERFACE_H
......@@ -19,16 +19,17 @@ public:
private:
int open;
int cols[MaxCols];
unsigned int GetCh(void);
eKeys keyFromWait;
unsigned int GetCh(bool Wait = true);
void QueryKeys(void);
void HelpButton(int Index, const char *Text, eDvbColor FgColor, eDvbColor BgColor);
eKeys Wait(int Seconds = 1);
eKeys Wait(int Seconds = 1, bool KeepChar = false);
public:
cInterface(void);
void Init(void);
void Open(void);
void Open(int NumCols = MenuColumns, int NumLines = MenuLines);
void Close(void);
eKeys GetKey(void);
eKeys GetKey(bool Wait = true);
void Clear(void);
void ClearEol(int x, int y, eDvbColor Color = clrBackground);
void SetCols(int *c);
......@@ -41,7 +42,7 @@ public:
bool Confirm(const char *s);
void Help(const char *Red, const char *Green = NULL, const char *Yellow = NULL, const char *Blue = NULL);
void LearnKeys(void);
void DisplayChannel(int Number, const char *Name);
void DisplayChannel(int Number, const char *Name = NULL);
};
extern cInterface Interface;
......
/*
* menu.c: The actual menu implementations
*
* See the main source file 'osm.c' for copyright information and
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: menu.c 1.3 2000/04/15 15:07:36 kls Exp $
* $Id: menu.c 1.8 2000/04/24 15:32:11 kls Exp $
*/
#include "menu.h"
......@@ -428,7 +428,7 @@ void cMenuEditStrItem::Set(void)
char buf[1000];
if (pos >= 0) {
strncpy(buf, value, pos);
char *s = value[pos] != ' ' ? value + pos + 1 : "";
const char *s = value[pos] != ' ' ? value + pos + 1 : "";
snprintf(buf + pos, sizeof(buf) - pos - 2, "[%c]%s", *(value + pos), s);
SetValue(buf);
}
......@@ -915,16 +915,7 @@ cMenuRecordingItem::cMenuRecordingItem(cRecording *Recording)
void cMenuRecordingItem::Set(void)
{
char *buffer = NULL;
struct tm *t = localtime(&recording->start);
asprintf(&buffer, "%02d.%02d.%04d\t%02d:%02d\t%s",
t->tm_mday,
t->tm_mon + 1,
t->tm_year + 1900,
t->tm_hour,
t->tm_min,
recording->name);
SetText(buffer, false);
SetText(recording->Title('\t'));
}
// --- cMenuRecordings -------------------------------------------------------
......@@ -957,7 +948,7 @@ eOSState cMenuRecordings::Play(void)
cMenuRecordingItem *ri = (cMenuRecordingItem *)Get(Current());
if (ri) {
//XXX what if this recording's file is currently in use???
if (ri->recording->Play())
if (DvbApi.StartReplay(ri->recording->FileName(), ri->recording->Title()))
return osEnd;
}
return osContinue;
......@@ -1022,3 +1013,36 @@ eOSState cMenuMain::ProcessKey(eKeys Key)
return state;
}
// --- cReplayDisplay --------------------------------------------------------
cReplayDisplay::cReplayDisplay(void)
{
Interface.Open(MenuColumns, -3);
shown = DvbApi.ShowProgress(true);
}
cReplayDisplay::~cReplayDisplay()
{
Interface.Close();
}
eKeys cReplayDisplay::ProcessKey(eKeys Key)
{
if (!DvbApi.Replaying())
return kOk; // will turn off replay display
shown = DvbApi.ShowProgress(!shown);
switch (Key) {
case kBegin:
case kPause:
case kStop:
case kSearchBack:
case kSearchForward:
case kSkipBack:
case kSkipForward: break; // will be done in main loop
case kMenu: break; // allow direct switching to menu
case kOk: break; // switches off replay display
default: Key = kNone; // ignore anything not explicitly known here
}
return Key;
}
/*
* menu.h: The actual menu implementations
*
* See the main source file 'osm.c' for copyright information and
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.