mirror of
https://github.com/vdr-projects/vdr.git
synced 2025-03-01 10:50:46 +00:00
- Fixed a leftover 'summary.vdr' in vdr.5 (thanks to Peter Bieringer for reporting this one). - Fixed opening recording folders in case the last replayed recording no longer exists (reported by Udo Richter). - Fixed an unjustified "Error while accessing recording!" after deleting a recording from a subfolder. - Fixed handling the '.update' file in case the video directory is not at the default location (reported by Jon Burgess). - Fixed a crash in cConfig::Load() when compiling on the PPC (thanks to Sascha Volkenandt). - Fixed the FATALERRNO macro to check for a non-zero errno value (reported by Marco Schlüßler). - Added a check against MAXOSDAREAS in cOsd::CanHandleAreas() (reported by Udo Richter). - Fixed setting current menu item if the first one is non-selectable. - cOsdItem::cOsdItem() now has a 'Selectable' parameter. - Improved displaying 'sub-title' and 'bottom text' in the CAM menu. - Added status message "Resetting CAM..." for an immediate feedback when the CAM reset has been triggered. - The CAM menu now automatically updates itself in case of a progress display (as used, for instance, when updating the firmware via satellite). - Now skipping some funny characters sent by some CAMs at the beginning of strings. - The CAM menu is now completely closed when pressing the Menu key while inside a sub menu. - Reduced MAX_CONNECT_RETRIES in ci.c to 2 (waiting too long made the whole thing appear hanging). - Added status message "Opening CAM menu..." for an immediate feedback when the CAM menu has been requested. - Speeded up initial opening of the CAM menu. - Fixed handling of menus with no selectable items. - The character 0x8A in CAM menu strings is now mapped to a real newline. - The 'sub-title' and 'bottom text' in the CAM menu can now consist of several lines. - Improved the CAM enquiry menu.
127 lines
3.2 KiB
C++
127 lines
3.2 KiB
C++
/*
|
|
* ci.h: Common Interface
|
|
*
|
|
* See the main source file 'vdr.c' for copyright information and
|
|
* how to reach the author.
|
|
*
|
|
* $Id: ci.h 1.17 2005/10/03 12:49:52 kls Exp $
|
|
*/
|
|
|
|
#ifndef __CI_H
|
|
#define __CI_H
|
|
|
|
#include <stdint.h>
|
|
#include <stdio.h>
|
|
#include "thread.h"
|
|
|
|
class cCiMMI;
|
|
|
|
class cCiMenu {
|
|
friend class cCiMMI;
|
|
private:
|
|
enum { MAX_CIMENU_ENTRIES = 64 }; ///< XXX is there a specified maximum?
|
|
cCiMMI *mmi;
|
|
cMutex mutex;
|
|
bool selectable;
|
|
char *titleText;
|
|
char *subTitleText;
|
|
char *bottomText;
|
|
char *entries[MAX_CIMENU_ENTRIES];
|
|
int numEntries;
|
|
bool AddEntry(char *s);
|
|
cCiMenu(cCiMMI *MMI, bool Selectable);
|
|
public:
|
|
~cCiMenu();
|
|
const char *TitleText(void) { return titleText; }
|
|
const char *SubTitleText(void) { return subTitleText; }
|
|
const char *BottomText(void) { return bottomText; }
|
|
const char *Entry(int n) { return n < numEntries ? entries[n] : NULL; }
|
|
int NumEntries(void) { return numEntries; }
|
|
bool Selectable(void) { return selectable; }
|
|
bool Select(int Index);
|
|
bool Cancel(void);
|
|
bool Abort(void);
|
|
bool HasUpdate(void);
|
|
};
|
|
|
|
class cCiEnquiry {
|
|
friend class cCiMMI;
|
|
private:
|
|
cCiMMI *mmi;
|
|
cMutex mutex;
|
|
char *text;
|
|
bool blind;
|
|
int expectedLength;
|
|
cCiEnquiry(cCiMMI *MMI);
|
|
public:
|
|
~cCiEnquiry();
|
|
const char *Text(void) { return text; }
|
|
bool Blind(void) { return blind; }
|
|
int ExpectedLength(void) { return expectedLength; }
|
|
bool Reply(const char *s);
|
|
bool Cancel(void);
|
|
bool Abort(void);
|
|
};
|
|
|
|
class cCiCaPmt {
|
|
friend class cCiConditionalAccessSupport;
|
|
private:
|
|
int length;
|
|
int esInfoLengthPos;
|
|
uint8_t capmt[2048]; ///< XXX is there a specified maximum?
|
|
int caDescriptorsLength;
|
|
uint8_t caDescriptors[2048];
|
|
bool streamFlag;
|
|
void AddCaDescriptors(int Length, const uint8_t *Data);
|
|
public:
|
|
cCiCaPmt(int Source, int Transponder, int ProgramNumber, const unsigned short *CaSystemIds);
|
|
bool Valid(void);
|
|
void AddPid(int Pid, uint8_t StreamType);
|
|
};
|
|
|
|
#define MAX_CI_SESSION 16 //XXX
|
|
#define MAX_CI_SLOT 16
|
|
|
|
class cCiSession;
|
|
class cCiTransportLayer;
|
|
class cCiTransportConnection;
|
|
|
|
class cCiHandler {
|
|
private:
|
|
cMutex mutex;
|
|
int fd;
|
|
int numSlots;
|
|
bool newCaSupport;
|
|
bool hasUserIO;
|
|
bool moduleReady[MAX_CI_SLOT];
|
|
cCiSession *sessions[MAX_CI_SESSION];
|
|
cCiTransportLayer *tpl;
|
|
cCiTransportConnection *tc;
|
|
int ResourceIdToInt(const uint8_t *Data);
|
|
bool Send(uint8_t Tag, int SessionId, int ResourceId = 0, int Status = -1);
|
|
cCiSession *GetSessionBySessionId(int SessionId);
|
|
cCiSession *GetSessionByResourceId(int ResourceId, int Slot);
|
|
cCiSession *CreateSession(int ResourceId);
|
|
bool OpenSession(int Length, const uint8_t *Data);
|
|
bool CloseSession(int SessionId);
|
|
int CloseAllSessions(int Slot);
|
|
cCiHandler(int Fd, int NumSlots);
|
|
public:
|
|
~cCiHandler();
|
|
static cCiHandler *CreateCiHandler(const char *FileName);
|
|
int NumSlots(void) { return numSlots; }
|
|
bool Ready(void);
|
|
bool Process(void);
|
|
bool HasUserIO(void) { return hasUserIO; }
|
|
bool EnterMenu(int Slot);
|
|
cCiMenu *GetMenu(void);
|
|
cCiEnquiry *GetEnquiry(void);
|
|
const char *GetCamName(int Slot);
|
|
const unsigned short *GetCaSystemIds(int Slot);
|
|
bool ProvidesCa(const unsigned short *CaSystemIds); //XXX Slot???
|
|
bool SetCaPmt(cCiCaPmt &CaPmt, int Slot);
|
|
bool Reset(int Slot);
|
|
};
|
|
|
|
#endif //__CI_H
|