5 #include <lib/dvb/idvb.h>
6 #include <lib/base/eptrlist.h>
8 class ServiceDescriptionSection;
11 class eDVBDB: public iDVBChannelList
13 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);
42 RESULT removeFlags(unsigned int flagmask, eDVBChannelID chid, unsigned int orb_pos);
43 RESULT removeServices(eDVBChannelID chid, unsigned int orb_pos);
45 RESULT addChannelToList(const eDVBChannelID &id, iDVBFrontendParameters *feparm);
46 RESULT removeChannel(const eDVBChannelID &id);
48 RESULT getChannelFrontendData(const eDVBChannelID &id, ePtr<iDVBFrontendParameters> &parm);
50 RESULT addService(const eServiceReferenceDVB &service, eDVBService *service);
51 RESULT getService(const eServiceReferenceDVB &reference, ePtr<eDVBService> &service);
54 RESULT startQuery(ePtr<iDVBChannelListQuery> &query, eDVBChannelQuery *query, const eServiceReference &source);
56 RESULT getBouquet(const eServiceReference &ref, eBouquet* &bouquet);
58 void saveServicelist();
59 void loadBouquet(const char *path);
60 eServiceReference searchReference(int tsid, int onid, int sid);
64 static eDVBDB *getInstance() { return instance; }
65 void reloadServicelist();
66 void reloadBouquets();
70 // we have to add a possibility to invalidate here.
71 class eDVBDBQueryBase: public iDVBChannelListQuery
73 DECLARE_REF(eDVBDBQueryBase);
76 ePtr<eDVBChannelQuery> m_query;
77 eServiceReference m_source;
79 eDVBDBQueryBase(eDVBDB *db, const eServiceReference &source, eDVBChannelQuery *query);
80 virtual int compareLessEqual(const eServiceReferenceDVB &a, const eServiceReferenceDVB &b);
83 class eDVBDBQuery: public eDVBDBQueryBase
85 std::map<eServiceReferenceDVB, ePtr<eDVBService> >::iterator m_cursor;
87 eDVBDBQuery(eDVBDB *db, const eServiceReference &source, eDVBChannelQuery *query);
88 RESULT getNextResult(eServiceReferenceDVB &ref);
91 class eDVBDBBouquetQuery: public eDVBDBQueryBase
93 std::list<eServiceReference>::iterator m_cursor;
95 eDVBDBBouquetQuery(eDVBDB *db, const eServiceReference &source, eDVBChannelQuery *query);
96 RESULT getNextResult(eServiceReferenceDVB &ref);
99 class eDVBDBListQuery: public eDVBDBQueryBase
102 std::list<eServiceReferenceDVB> m_list;
103 std::list<eServiceReferenceDVB>::iterator m_cursor;
105 eDVBDBListQuery(eDVBDB *db, const eServiceReference &source, eDVBChannelQuery *query);
106 RESULT getNextResult(eServiceReferenceDVB &ref);
107 int compareLessEqual(const eServiceReferenceDVB &a, const eServiceReferenceDVB &b);
110 class eDVBDBSatellitesQuery: public eDVBDBListQuery
113 eDVBDBSatellitesQuery(eDVBDB *db, const eServiceReference &source, eDVBChannelQuery *query);
116 class eDVBDBProvidersQuery: public eDVBDBListQuery
119 eDVBDBProvidersQuery(eDVBDB *db, const eServiceReference &source, eDVBChannelQuery *query);