mirror of
https://github.com/vdr-projects/vdr.git
synced 2025-03-01 10:50:46 +00:00
- The new "Setup" menu allows the user to configure several parameters to his/her personal taste (see MANUAL for details). - Workaround for a driver timing problem in cDvbApi::Cmd(), which sometimes caused the OSD to no longer be displayed (thanks to Niels de Carpentier). - Added the '-m486' option to the compiler call. - If a channel name contains a colon (':') it is now replaced with a '|' in channels.conf. - Not everybody appears to like the "page scrolling" mechanism introduced by Heino Goldenstein in version 0.61, so this is now configurable via the "Setup" menu. - The new 'dvbrc2vdr' tool (thanks to Plamen Ganev!) can be used to convert 'dvbrc' channel files into 'vdr' format. - Channels can now be "grouped" (thanks to Plamen Ganev!). See MANUAL for details. There is currently no mechanism to define and maintain "Channel groups" via the menu, so you'll have to insert "Channel group" control lines into your 'channels.conf' file manually (for example with a text editor). - Started a new file named FORMATS with a description of the various file formats used by VDR. - The "Primary DVB interface" can now be chosen via the "Setup" menu. - Display of the "current/next" information when switching channels can now be disabled via the "Setup" menu. - The "current/next" display now only shows those lines that actually contain information. - When directly selecting a channel by entering the channel number, the digits entered so far together with the name of that channel are displayed on the OSD (suggested by Martin Hammerschmid).
163 lines
5.3 KiB
C++
163 lines
5.3 KiB
C++
/*
|
|
* dvbapi.h: Interface to the DVB driver
|
|
*
|
|
* See the main source file 'vdr.c' for copyright information and
|
|
* how to reach the author.
|
|
*
|
|
* $Id: dvbapi.h 1.14 2000/09/10 10:03:29 kls Exp $
|
|
*/
|
|
|
|
#ifndef __DVBAPI_H
|
|
#define __DVBAPI_H
|
|
|
|
// FIXME: these should be defined in ../DVB/driver/dvb.h!!!
|
|
typedef unsigned int __u32;
|
|
typedef unsigned short __u16;
|
|
typedef unsigned char __u8;
|
|
|
|
#if defined(DEBUG_OSD) || defined(REMOTE_KBD)
|
|
#include <ncurses.h>
|
|
#endif
|
|
#include <stdio.h>
|
|
#include <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???
|
|
clrBlack,
|
|
#else
|
|
clrBlack = clrBackground,
|
|
#endif
|
|
clrRed,
|
|
clrGreen,
|
|
clrYellow,
|
|
clrBlue,
|
|
clrMagenta,
|
|
clrCyan,
|
|
clrWhite,
|
|
};
|
|
|
|
class cDvbApi {
|
|
private:
|
|
int videoDev;
|
|
cDvbApi(const char *FileName);
|
|
public:
|
|
~cDvbApi();
|
|
|
|
#define MAXDVBAPI 2
|
|
static int NumDvbApis;
|
|
private:
|
|
static cDvbApi *dvbApi[MAXDVBAPI];
|
|
public:
|
|
static cDvbApi *PrimaryDvbApi;
|
|
static bool SetPrimaryDvbApi(int n);
|
|
// Sets the primary DVB device to 'n' (which must be in the range
|
|
// 1...NumDvbApis) and returns true if this was possible.
|
|
static cDvbApi *GetDvbApi(int Ca = 0);
|
|
// Selects a free DVB device, starting with the highest device number
|
|
// (but avoiding, if possible, the PrimaryDvbApi).
|
|
// If Ca is not 0, the device with the given number will be returned
|
|
// if it is not currently recording.
|
|
int Index(void);
|
|
// Returns the index of this DvbApi.
|
|
static bool Init(void);
|
|
// Initializes the DVB API and probes for existing DVB devices.
|
|
// Must be called before accessing any DVB functions.
|
|
static void Cleanup(void);
|
|
// Closes down all DVB devices.
|
|
// Must be called at the end of the program.
|
|
|
|
// On Screen Display facilities
|
|
|
|
private:
|
|
enum { charWidth = 12, // average character width
|
|
lineHeight = 27 // smallest text height
|
|
};
|
|
#ifdef DEBUG_OSD
|
|
WINDOW *window;
|
|
enum { MaxColorPairs = 16 };
|
|
int colorPairs[MaxColorPairs];
|
|
void SetColor(eDvbColor colorFg, eDvbColor colorBg = clrBackground);
|
|
#endif
|
|
int cols, rows;
|
|
void Cmd(OSD_Command cmd, int color = 0, int x0 = 0, int y0 = 0, int x1 = 0, int y1 = 0, const void *data = NULL);
|
|
public:
|
|
void Open(int w, int h);
|
|
void Close(void);
|
|
void Clear(void);
|
|
void Fill(int x, int y, int w, int h, eDvbColor color = clrBackground);
|
|
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, lastTotal;
|
|
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);
|
|
|
|
// Record/Replay facilities
|
|
|
|
private:
|
|
enum { dvbStop = 1, // let's not have 0 as a command
|
|
dvbPause,
|
|
dvbPlay,
|
|
dvbForward,
|
|
dvbBackward,
|
|
dvbSkip,
|
|
dvbGetIndex,
|
|
};
|
|
pid_t pidRecord, pidReplay;
|
|
int fromRecord, toRecord;
|
|
int fromReplay, toReplay;
|
|
void SetReplayMode(int Mode);
|
|
public:
|
|
bool Recording(void);
|
|
// Returns true if we are currently recording.
|
|
bool Replaying(void);
|
|
// Returns true if we are currently replaying.
|
|
bool StartRecord(const char *FileName);
|
|
// Starts recording the current channel into the given file.
|
|
// In order to be able to record longer movies,
|
|
// a numerical suffix will be appended to the file name. The inital
|
|
// value of that suffix will be larger than any existing file under
|
|
// the given name, thus allowing an interrupted recording to continue
|
|
// gracefully.
|
|
// Returns true if recording was started successfully.
|
|
// If there is already a recording session active, false will be
|
|
// returned.
|
|
void StopRecord(void);
|
|
// Stops the current recording session (if any).
|
|
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 Stop(void);
|
|
// Stops the current replay session (if any).
|
|
void Pause(void);
|
|
// Pauses the current replay session, or resumes a paused session.
|
|
void Play(void);
|
|
// Resumes normal replay mode.
|
|
void Forward(void);
|
|
// Runs the current replay session forward at a higher speed.
|
|
void Backward(void);
|
|
// Runs the current replay session backwards at a higher speed.
|
|
void Skip(int Seconds);
|
|
// Skips the given number of seconds in the current replay session.
|
|
// 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
|