summaryrefslogtreecommitdiff
path: root/dvbapi.h
diff options
context:
space:
mode:
authorKlaus Schmidinger <kls (at) cadsoft (dot) de>2000-11-19 18:00:00 +0100
committerKlaus Schmidinger <kls (at) cadsoft (dot) de>2000-11-19 18:00:00 +0100
commit9aa2cda494d7af2733362de78234441a25959e86 (patch)
treea057edf79f3177b3ae1930e111df52cb90f95283 /dvbapi.h
parenta69b3211dc4f9b34eef440067d5ba304fbfbad94 (diff)
downloadvdr-patch-lnbsharing-9aa2cda494d7af2733362de78234441a25959e86.tar.gz
vdr-patch-lnbsharing-9aa2cda494d7af2733362de78234441a25959e86.tar.bz2
Version 0.68vdr-0.68
- Date and time in the title of an event info page are now always right adjusted. - The 'current channel' is now handled device specific (in case there is more than one DVB card). - The 'SetSystemTime' option in the "Setup" menu is now shown as "yes/no". - Implemented "internationalization" (see 'i18n.c' for information on how to add new languages). Thanks to Miha Setina for translating the OSD texts to the Slovenian language. - Fixed learning keys on the PC keyboard (display oscillated). - Fixed a timing problem with OSD refresh and SVDRP. - Avoiding multiple definitions of the same timer in the "Schedule" menu (this could happen when pressing the "Red" button while editing the timer). - There can now be a configuration file named 'commands.conf' that defines commands that can be executed through the "Main" menu's "Commands" option (see FORMATS for details on how to define these commands). - Added a 'fixed' font for use with the output of system commands. - The 'Priority' parameter of the timers is now also used to interrupt a low priority timer recording if a higher priority timer wants to record. - A timer recording on a DVB card with a CAM module will now be interrupted 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. - All DVB cards in a multi-card system now write their EIT information into the same data structure. - If there is more than one DVB card in the system, the non-primary cards are now used to periodically scan through the channels in order to keep the EPG info up-to-date. Scanning kicks in after 60 seconds of user inactivity (timeout in order to keep user interactions instantaneously) and each channel that has the 'pnr' parameter defined in 'channels.conf' is switched to for 20 seconds. If there is only one DVB card in the system, that card will start scanning after 5 hours (configurable through the "Setup" menu) of user inactivity and will switch back to the channel it originally displayed at the first sign of user activity. Any scanning will only occur if that particular card is not currently recording or replaying. - Now shifting the 'Subtitle' info into the 'ExtendedDescription' on stations that don't send the EIT information correctly (like, e.g., 'VOX'). - Implemented a 10 seconds latency when removing files. - Fixed unwanted reaction on the "Green" and "Yellow" button in the "Event" display. - Implemented 'Transfer Mode' to display video data from the DVB card that actually can receive a certain channel on the primary interface. This is currently in an early state and may still cause some problems, but it appears to work nice already.
Diffstat (limited to 'dvbapi.h')
-rw-r--r--dvbapi.h68
1 files changed, 60 insertions, 8 deletions
diff --git a/dvbapi.h b/dvbapi.h
index 16a2b7a..f6640ff 100644
--- a/dvbapi.h
+++ b/dvbapi.h
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: dvbapi.h 1.20 2000/11/01 09:18:50 kls Exp $
+ * $Id: dvbapi.h 1.26 2000/11/19 14:09:41 kls Exp $
*/
#ifndef __DVBAPI_H
@@ -42,10 +42,11 @@ public:
bool Save(int Index);
};
+class cTransferBuffer;
+
class cDvbApi {
private:
int videoDev;
- cSIProcessor *siProcessor;
cDvbApi(const char *VideoFileName, const char *VbiFileName);
public:
~cDvbApi();
@@ -59,11 +60,15 @@ public:
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);
+ static cDvbApi *GetDvbApi(int Ca, int Priority);
// 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.
+ // If Ca is not 0, the device with the given number will be returned.
+ // If all DVB devices are currently recording, the one recording the
+ // lowest priority timer (if any) that is lower than the given Priority
+ // will be returned.
+ // The caller must check whether the returned DVB device is actually
+ // recording and stop recording if necessary.
int Index(void);
// Returns the index of this DvbApi.
static bool Init(void);
@@ -75,6 +80,9 @@ public:
// EIT facilities
+private:
+ cSIProcessor *siProcessor;
+public:
const cSchedules *Schedules(cThreadLock *ThreadLock) const;
// Caller must provide a cThreadLock which has to survive the entire
// time the returned cSchedules is accessed. Once the cSchedules is no
@@ -124,6 +132,8 @@ public:
void ClrEol(int x, int y, eDvbColor color = clrBackground);
int CellWidth(void);
int Width(unsigned char c);
+ int WidthInCells(const char *s);
+ eDvbFont SetFont(eDvbFont Font);
void Text(int x, int y, const char *s, eDvbColor colorFg = clrWhite, eDvbColor colorBg = clrBackground);
void Flush(void);
@@ -137,7 +147,26 @@ public:
// Channel facilities
- bool SetChannel(int FrequencyMHz, char Polarization, int Diseqc, int Srate, int Vpid, int Apid, int Ca, int Pnr);
+private:
+ int currentChannel;
+public:
+ bool SetChannel(int ChannelNumber, int FrequencyMHz, char Polarization, int Diseqc, int Srate, int Vpid, int Apid, int Ca, int Pnr);
+ static int CurrentChannel(void) { return PrimaryDvbApi ? PrimaryDvbApi->currentChannel : 0; }
+ int Channel(void) { return currentChannel; }
+
+ // Transfer facilities
+
+private:
+ cTransferBuffer *transferBuffer;
+ cDvbApi *transferringFromDvbApi;
+public:
+ bool Transferring(void);
+ // Returns true if we are currently transferring video data.
+private:
+ cDvbApi *StartTransfer(int TransferToVideoDev);
+ // Starts transferring video data from this DVB device to TransferToVideoDev.
+ void StopTransfer(void);
+ // Stops transferring video data (in case a transfer is currently active).
// Record/Replay facilities
@@ -153,14 +182,23 @@ private:
pid_t pidRecord, pidReplay;
int fromRecord, toRecord;
int fromReplay, toReplay;
+ int ca;
+ int priority;
void SetReplayMode(int Mode);
+protected:
+ int Ca(void) { return ca; }
+ // Returns the ca of the current recording session (0..MAXDVBAPI).
+ int Priority(void) { return priority; }
+ // Returns the priority of the current recording session (0..99),
+ // or -1 if no recording is currently active.
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.
+ bool StartRecord(const char *FileName, int Ca, int Priority);
+ // Starts recording the current channel into the given file, with
+ // the given ca and priority.
// 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
@@ -194,4 +232,18 @@ public:
bool GetIndex(int *Current, int *Total = NULL);
};
+class cEITScanner {
+private:
+ enum { ActivityTimeout = 60,
+ ScanTimeout = 20
+ };
+ time_t lastScan, lastActivity;
+ int currentChannel, lastChannel;
+public:
+ cEITScanner(void);
+ bool Active(void) { return currentChannel; }
+ void Activity(void);
+ void Process(void);
+ };
+
#endif //__DVBAPI_H