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 &service, eDVBService *service);
55 RESULT getService(const eServiceReferenceDVB &reference, ePtr<eDVBService> &service);
58 RESULT startQuery(ePtr<iDVBChannelListQuery> &query, eDVBChannelQuery *query, 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();
76 // we have to add a possibility to invalidate here.
77 class eDVBDBQueryBase: public iDVBChannelListQuery
79 DECLARE_REF(eDVBDBQueryBase);
82 ePtr<eDVBChannelQuery> m_query;
83 eServiceReference m_source;
85 eDVBDBQueryBase(eDVBDB *db, const eServiceReference &source, eDVBChannelQuery *query);
86 virtual int compareLessEqual(const eServiceReferenceDVB &a, const eServiceReferenceDVB &b);
89 class eDVBDBQuery: public eDVBDBQueryBase
91 std::map<eServiceReferenceDVB, ePtr<eDVBService> >::iterator m_cursor;
93 eDVBDBQuery(eDVBDB *db, const eServiceReference &source, eDVBChannelQuery *query);
94 RESULT getNextResult(eServiceReferenceDVB &ref);
97 class eDVBDBBouquetQuery: public eDVBDBQueryBase
99 std::list<eServiceReference>::iterator m_cursor;
101 eDVBDBBouquetQuery(eDVBDB *db, const eServiceReference &source, eDVBChannelQuery *query);
102 RESULT getNextResult(eServiceReferenceDVB &ref);
105 class eDVBDBListQuery: public eDVBDBQueryBase
108 std::list<eServiceReferenceDVB> m_list;
109 std::list<eServiceReferenceDVB>::iterator m_cursor;
111 eDVBDBListQuery(eDVBDB *db, const eServiceReference &source, eDVBChannelQuery *query);
112 RESULT getNextResult(eServiceReferenceDVB &ref);
113 int compareLessEqual(const eServiceReferenceDVB &a, const eServiceReferenceDVB &b);
116 class eDVBDBSatellitesQuery: public eDVBDBListQuery
119 eDVBDBSatellitesQuery(eDVBDB *db, const eServiceReference &source, eDVBChannelQuery *query);
122 class eDVBDBProvidersQuery: public eDVBDBListQuery
125 eDVBDBProvidersQuery(eDVBDB *db, const eServiceReference &source, eDVBChannelQuery *query);