openATV enigma2
openATV is an open source SetTopBox Graphical user interface.
eEPGCache Class Reference

#include <epgcache.h>

Inheritance diagram for eEPGCache:
eMainloop eThread

Classes

struct  Message
 

Public Types

enum  {
  SIMILAR_BROADCASTINGS_SEARCH , EXAKT_TITLE_SEARCH , PARTIAL_TITLE_SEARCH , START_TITLE_SEARCH ,
  END_TITLE_SEARCH , PARTIAL_DESCRIPTION_SEARCH , CRID_SEARCH
}
 
enum  { CRID_EPISODE = 1 , CRID_SERIES = 2 }
 
enum  { CASE_CHECK , NO_CASE_CHECK , REGEX_CHECK }
 
enum  {
  PRIVATE =0 , NOWNEXT =1 , SCHEDULE =2 , SCHEDULE_OTHER =4 ,
  MHW =8 , FREESAT_NOWNEXT =16 , FREESAT_SCHEDULE =32 , FREESAT_SCHEDULE_OTHER =64 ,
  VIASAT =256 , NETMED_SCHEDULE =512 , NETMED_SCHEDULE_OTHER =1024 , VIRGIN_NOWNEXT =2048 ,
  VIRGIN_SCHEDULE =4096 , ATSC_EIT =8192 , OPENTV =16384 , EPG_IMPORT =0x80000000
}
 

Public Member Functions

void crossepgImportEPGv21 (std::string dbroot)
 
void clear ()
 
void save ()
 
void load ()
 
void timeUpdated ()
 
void flushEPG (int sid, int onid, int tsid)
 
void flushEPG (const uniqueEPGKey &s=uniqueEPGKey(), bool lock=true)
 
 eEPGCache ()
 
 ~eEPGCache ()
 
void setCacheFile (const char *filename)
 
RESULT startTimeQuery (const eServiceReference &service, time_t begin=-1, int minutes=-1)
 
RESULT saveEventToFile (const char *filename, const eServiceReference &service, int eit_event_id, time_t begTime, time_t endTime)
 
RESULT lookupEventId (const eServiceReference &service, int event_id, Event *&)
 
RESULT lookupEventTime (const eServiceReference &service, time_t, Event *&, int direction=0)
 Look up an event in the EPG database by service reference and time. The service reference is specified in service. The lookup time is in t. The direction specifies whether to return the event matching t, its predecessor or successor. More...
 
RESULT getNextTimeEntry (Event *&)
 
PyObject * lookupEvent (SWIG_PYOBJECT(ePyObject) list, SWIG_PYOBJECT(ePyObject) convertFunc=(PyObject *) 0)
 
const char * casetypestr (int value)
 
PyObject * search (SWIG_PYOBJECT(ePyObject))
 
 SWIG_VOID (RESULT) lookupEventId(const eServiceReference &service
 
 SWIG_VOID (RESULT) lookupEventTime(const eServiceReference &service
 
 SWIG_VOID (RESULT) getNextTimeEntry(ePtr< eServiceEvent > &SWIG_OUTPUT)
 
void setEpgmaxdays (unsigned int epgmaxdays)
 
void setEpgHistorySeconds (time_t seconds)
 
void setEpgSources (unsigned int mask)
 
unsigned int getEpgSources ()
 
unsigned int getEpgmaxdays ()
 
void submitEventData (const std::vector< eServiceReferenceDVB > &serviceRefs, long start, long duration, const char *title, const char *short_summary, const char *long_description, std::vector< uint8_t > event_types, std::vector< eit_parental_rating > parental_ratings, uint16_t event_id=0)
 Import EPG events into the EPG database. More...
 
void importEvents (SWIG_PYOBJECT(ePyObject) serviceReferences, SWIG_PYOBJECT(ePyObject) list)
 Import EPG events from Python into the EPG database. Each event in the list is added to each service in the serviceReferences list. More...
 
void importEvent (SWIG_PYOBJECT(ePyObject) serviceReference, SWIG_PYOBJECT(ePyObject) list)
 Import EPG events from Python into the EPG database. Each event in the list is added to each service in the serviceReferences list. More...
 
- Public Member Functions inherited from eMainloop
 eMainloop ()
 
virtual ~eMainloop ()
 
void quit (int ret=0)
 
int iterate (unsigned int timeout=0, PyObject **res=0, SWIG_PYOBJECT(ePyObject) additional=(PyObject *) 0)
 
int runLoop ()
 
PyObject * poll (SWIG_PYOBJECT(ePyObject) dict, SWIG_PYOBJECT(ePyObject) timeout)
 
void interruptPoll ()
 
void reset ()
 

Static Public Member Functions

static eEPGCachegetInstance ()
 

Public Attributes

eFixedMessagePump< Messagemessages
 
int event_id
 
int ePtr< eServiceEvent > & SWIG_OUTPUT
 
 time_t
 
ePtr< eServiceEvent > & SWIG_OUTPUT
 
ePtr< eServiceEvent > int direction =0)
 

Friends

struct eventData
 
class eEPGChannelData
 
class eEPGTransponderDataReader
 

Additional Inherited Members

- Protected Member Functions inherited from eMainloop
virtual int _poll (struct pollfd *fds, nfds_t nfds, int timeout)
 

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
SIMILAR_BROADCASTINGS_SEARCH 
EXAKT_TITLE_SEARCH 
PARTIAL_TITLE_SEARCH 
START_TITLE_SEARCH 
END_TITLE_SEARCH 
PARTIAL_DESCRIPTION_SEARCH 
CRID_SEARCH 

◆ anonymous enum

anonymous enum
Enumerator
CRID_EPISODE 
CRID_SERIES 

◆ anonymous enum

anonymous enum
Enumerator
CASE_CHECK 
NO_CASE_CHECK 
REGEX_CHECK 

◆ anonymous enum

anonymous enum
Enumerator
PRIVATE 
NOWNEXT 
SCHEDULE 
SCHEDULE_OTHER 
MHW 
FREESAT_NOWNEXT 
FREESAT_SCHEDULE 
FREESAT_SCHEDULE_OTHER 
VIASAT 
NETMED_SCHEDULE 
NETMED_SCHEDULE_OTHER 
VIRGIN_NOWNEXT 
VIRGIN_SCHEDULE 
ATSC_EIT 
OPENTV 
EPG_IMPORT 

Constructor & Destructor Documentation

◆ eEPGCache()

eEPGCache::eEPGCache ( )

◆ ~eEPGCache()

eEPGCache::~eEPGCache ( )

Member Function Documentation

◆ casetypestr()

const char * eEPGCache::casetypestr ( int  value)

◆ clear()

void eEPGCache::clear ( )

◆ crossepgImportEPGv21()

void eEPGCache::crossepgImportEPGv21 ( std::string  dbroot)

◆ flushEPG() [1/2]

void eEPGCache::flushEPG ( const uniqueEPGKey s = uniqueEPGKey(),
bool  lock = true 
)

◆ flushEPG() [2/2]

void eEPGCache::flushEPG ( int  sid,
int  onid,
int  tsid 
)

◆ getEpgmaxdays()

unsigned int eEPGCache::getEpgmaxdays ( )

◆ getEpgSources()

unsigned int eEPGCache::getEpgSources ( )

◆ getInstance()

static eEPGCache* eEPGCache::getInstance ( )
inlinestatic

◆ getNextTimeEntry()

RESULT eEPGCache::getNextTimeEntry ( Event *&  result)

◆ importEvent()

void eEPGCache::importEvent ( SWIG_PYOBJECT(ePyObject serviceReference,
SWIG_PYOBJECT(ePyObject list 
)

Import EPG events from Python into the EPG database. Each event in the list is added to each service in the serviceReferences list.

Parameters
serviceReferencesAny of: a single service reference string; a list of service reference strings; a single tuple with DVB triplet or a list of tuples with DVB triplets. A DVB triplet is (onid, tsid, sid)
listEither a list or a tuple of EPG events. Each event is a tuple of at least 6 elements:
  1. start time (long)
  2. duration (int)
  3. event title (string)
  4. short description (string)
  5. extended description (string)
  6. event type (byte) or list or tuple of event types
  7. optional event ID (int), if not supplied, it will default to 0, which implies an an auto-generated ID based on the start time.
  8. optional list or tuple of tuples (country[string 3 bytes], parental_rating [byte]).
Returns
void

◆ importEvents()

void eEPGCache::importEvents ( SWIG_PYOBJECT(ePyObject serviceReferences,
SWIG_PYOBJECT(ePyObject list 
)

Import EPG events from Python into the EPG database. Each event in the list is added to each service in the serviceReferences list.

Parameters
serviceReferencesAny of: a single service reference string; a list of service reference strings; a single tuple with DVB triplet or a list of tuples with DVB triplets. A DVB triplet is (onid, tsid, sid)
listEither a list or a tuple of EPG events. Each event is a tuple of at least 6 elements:
  1. start time (long)
  2. duration (int)
  3. event title (string)
  4. short description (string)
  5. extended description (string)
  6. event type (byte) or list or tuple of event types
  7. optional event ID (int), if not supplied, it will default to 0, which implies an an auto-generated ID based on the start time.
  8. optional list or tuple of tuples (country[string 3 bytes], parental_rating [byte]).
Returns
void

◆ load()

void eEPGCache::load ( )

◆ lookupEvent()

PyObject * eEPGCache::lookupEvent ( SWIG_PYOBJECT(ePyObject list,
SWIG_PYOBJECT(ePyObject convertFunc = (PyObject*)0 
)

◆ lookupEventId()

RESULT eEPGCache::lookupEventId ( const eServiceReference service,
int  event_id,
Event *&  result 
)

◆ lookupEventTime()

RESULT eEPGCache::lookupEventTime ( const eServiceReference service,
time_t  t,
Event *&  result,
int  direction = 0 
)

Look up an event in the EPG database by service reference and time. The service reference is specified in service. The lookup time is in t. The direction specifies whether to return the event matching t, its predecessor or successor.

Parameters
serviceas an eServiceReference.
tthe lookup time. If t == -1, look up the current time.
resultthe matched event, if one is found.
directionThe event offset from the match. direction > 0 return the earliest event that starts after t. direction == 0 return the event that spans t. If t is spanned by a gap in the EPG, return None. direction < 0 return the event immediately before the event that spans t. * If t is spanned by a gap in the EPG, return the event immediately before the gap.
Returns
0 for successful match and valid data in result, -1 for unsuccessful. In a call from Python, a return of -1 corresponds to a return value of None.

◆ save()

void eEPGCache::save ( )

◆ saveEventToFile()

RESULT eEPGCache::saveEventToFile ( const char *  filename,
const eServiceReference service,
int  eit_event_id,
time_t  begTime,
time_t  endTime 
)

◆ search()

PyObject * eEPGCache::search ( SWIG_PYOBJECT(ePyObject )

◆ setCacheFile()

void eEPGCache::setCacheFile ( const char *  filename)

◆ setEpgHistorySeconds()

void eEPGCache::setEpgHistorySeconds ( time_t  seconds)

◆ setEpgmaxdays()

void eEPGCache::setEpgmaxdays ( unsigned int  epgmaxdays)

◆ setEpgSources()

void eEPGCache::setEpgSources ( unsigned int  mask)

◆ startTimeQuery()

RESULT eEPGCache::startTimeQuery ( const eServiceReference service,
time_t  begin = -1,
int  minutes = -1 
)

◆ submitEventData()

void eEPGCache::submitEventData ( const std::vector< eServiceReferenceDVB > &  serviceRefs,
long  start,
long  duration,
const char *  title,
const char *  short_summary,
const char *  long_description,
std::vector< uint8_t >  event_types,
std::vector< eit_parental_rating parental_ratings,
uint16_t  event_id = 0 
)

Import EPG events into the EPG database.

Parameters
serviceRefslist of services that will receive this event
startstart time of the event
durationduration of the event
titletitle of the event. Must not be NULL.
short_summarysummary of the event
long_descriptionfull description of the event
event_typesvector of event type/genre classification
parental_ratingsvector of parental rating country/rating pairs
eventIdoptional EIT event id, defaults to 0 = auto-generated hash based on start time
Returns
void

◆ SWIG_VOID() [1/3]

eEPGCache::SWIG_VOID ( RESULT  ) &

◆ SWIG_VOID() [2/3]

eEPGCache::SWIG_VOID ( RESULT  ) const &

◆ SWIG_VOID() [3/3]

eEPGCache::SWIG_VOID ( RESULT  ) const &

◆ timeUpdated()

void eEPGCache::timeUpdated ( )

Friends And Related Function Documentation

◆ eEPGChannelData

friend class eEPGChannelData
friend

◆ eEPGTransponderDataReader

friend class eEPGTransponderDataReader
friend

◆ eventData

friend struct eventData
friend

Member Data Documentation

◆ direction

ePtr<eServiceEvent> int eEPGCache::direction =0)

◆ event_id

int eEPGCache::event_id

◆ messages

eFixedMessagePump<Message> eEPGCache::messages

◆ SWIG_OUTPUT [1/2]

int ePtr<eServiceEvent>& eEPGCache::SWIG_OUTPUT

◆ SWIG_OUTPUT [2/2]

ePtr<eServiceEvent>& eEPGCache::SWIG_OUTPUT

◆ time_t

eEPGCache::time_t

The documentation for this class was generated from the following files: