5 #include <lib/dvb/idvb.h>
6 #include <lib/base/eptrlist.h>
8 class ServiceDescriptionSection;
11 class eDVBDB: public iDVBChannelList
14 static eDVBDB *instance;
15 friend class eDVBDBQuery;
16 friend class eDVBDBBouquetQuery;
17 friend class eDVBDBSatellitesQuery;
18 friend class eDVBDBProvidersQuery;
22 ePtr<iDVBFrontendParameters> m_frontendParameters;
25 std::map<eDVBChannelID, channel> m_channels;
27 std::map<eServiceReferenceDVB, ePtr<eDVBService> > m_services;
29 std::map<std::string, eBouquet> m_bouquets;
36 RESULT removeFlags(unsigned int flagmask, int dvb_namespace=-1, int tsid=-1, int onid=-1, unsigned int orb_pos=0xFFFFFFFF);
37 RESULT removeServices(int dvb_namespace=-1, int tsid=-1, int onid=-1, unsigned int orb_pos=0xFFFFFFFF);
38 RESULT removeService(const eServiceReference &service);
39 RESULT addFlag(const eServiceReference &service, unsigned int flagmask);
40 RESULT removeFlag(const eServiceReference &service, unsigned int flagmask);
41 PyObject *readSatellites(SWIG_PYOBJECT(ePyObject) sat_list, SWIG_PYOBJECT(ePyObject) sat_dict, SWIG_PYOBJECT(ePyObject) tp_dict);
42 PyObject *readTerrestrials(SWIG_PYOBJECT(ePyObject) ter_list, SWIG_PYOBJECT(ePyObject) tp_dict);
43 PyObject *readCables(SWIG_PYOBJECT(ePyObject) cab_list, SWIG_PYOBJECT(ePyObject) tp_dict);
45 RESULT removeFlags(unsigned int flagmask, eDVBChannelID chid, unsigned int orb_pos);
46 RESULT removeServices(eDVBChannelID chid, unsigned int orb_pos);
47 RESULT removeServices(iDVBFrontendParameters *feparm);
49 RESULT addChannelToList(const eDVBChannelID &id, iDVBFrontendParameters *feparm);
50 RESULT removeChannel(const eDVBChannelID &id);
52 RESULT getChannelFrontendData(const eDVBChannelID &id, ePtr<iDVBFrontendParameters> &parm);
54 RESULT addService(const eServiceReferenceDVB &referenc, eDVBService *service);
55 RESULT getService(const eServiceReferenceDVB &reference, ePtr<eDVBService> &service);
58 RESULT startQuery(ePtr<iDVBChannelListQuery> &query, eDVBChannelQuery *q, const eServiceReference &source);
60 RESULT getBouquet(const eServiceReference &ref, eBouquet* &bouquet);
62 void loadBouquet(const char *path);
63 eServiceReference searchReference(int tsid, int onid, int sid);
67 void loadServicelist(const char *filename);
68 static eDVBDB *getInstance() { return instance; }
69 void reloadServicelist();
70 void saveServicelist();
71 void saveServicelist(const char *file);
72 void reloadBouquets();
73 void parseServiceData(ePtr<eDVBService> s, std::string str);
77 // we have to add a possibility to invalidate here.
78 class eDVBDBQueryBase: public iDVBChannelListQuery
80 DECLARE_REF(eDVBDBQueryBase);
83 ePtr<eDVBChannelQuery> m_query;
84 eServiceReference m_source;
86 eDVBDBQueryBase(eDVBDB *db, const eServiceReference &source, eDVBChannelQuery *query);
87 virtual int compareLessEqual(const eServiceReferenceDVB &a, const eServiceReferenceDVB &b);
90 class eDVBDBQuery: public eDVBDBQueryBase
92 std::map<eServiceReferenceDVB, ePtr<eDVBService> >::iterator m_cursor;
94 eDVBDBQuery(eDVBDB *db, const eServiceReference &source, eDVBChannelQuery *query);
95 RESULT getNextResult(eServiceReferenceDVB &ref);
98 class eDVBDBBouquetQuery: public eDVBDBQueryBase
100 std::list<eServiceReference>::iterator m_cursor;
102 eDVBDBBouquetQuery(eDVBDB *db, const eServiceReference &source, eDVBChannelQuery *query);
103 RESULT getNextResult(eServiceReferenceDVB &ref);
106 class eDVBDBListQuery: public eDVBDBQueryBase
109 std::list<eServiceReferenceDVB> m_list;
110 std::list<eServiceReferenceDVB>::iterator m_cursor;
112 eDVBDBListQuery(eDVBDB *db, const eServiceReference &source, eDVBChannelQuery *query);
113 RESULT getNextResult(eServiceReferenceDVB &ref);
114 int compareLessEqual(const eServiceReferenceDVB &a, const eServiceReferenceDVB &b);
117 class eDVBDBSatellitesQuery: public eDVBDBListQuery
120 eDVBDBSatellitesQuery(eDVBDB *db, const eServiceReference &source, eDVBChannelQuery *query);
123 class eDVBDBProvidersQuery: public eDVBDBListQuery
126 eDVBDBProvidersQuery(eDVBDB *db, const eServiceReference &source, eDVBChannelQuery *query);