- work on actions
[enigma2.git] / lib / dvb / idvb.h
index c4ae488dc311684c586fb512615560ae0c25c7ec..4d728b4c65971fbeef189edd34b4ea8b92b07325 100644 (file)
@@ -1,6 +1,14 @@
 #ifndef __dvb_idvb_h
 #define __dvb_idvb_h
 
+#include <config.h>
+#if HAVE_DVB_API_VERSION < 3
+#include <ost/frontend.h>
+#define FRONTENDPARAMETERS FrontendParameters
+#else
+#include <linux/dvb/frontend.h>
+#define FRONTENDPARAMETERS struct dvb_frontend_parameters
+#endif
 #include <lib/base/object.h>
 #include <lib/base/ebase.h>
 #include <lib/service/service.h>
@@ -131,7 +139,7 @@ struct eServiceReferenceDVB: public eServiceReference
                setTransportStreamID(chid.transport_stream_id);
        }
        
-       void getChannelID(eDVBChannelID &chid)
+       void getChannelID(eDVBChannelID &chid) const
        {
                chid = eDVBChannelID(getDVBNamespace(), getTransportStreamID(), getOriginalNetworkID());
        }
@@ -143,17 +151,90 @@ struct eServiceReferenceDVB: public eServiceReference
 };
 
 
+////////////////// TODO: we need an interface here, but what exactly?
+
+#include <set>
+// btw, still implemented in db.cpp. FIX THIS, TOO.
+
+class eDVBChannelQuery;
+
+class eDVBService: public iStaticServiceInformation
+{
+       DECLARE_REF;
+public:
+       eDVBService();
+       std::string m_service_name;
+       std::string m_provider_name;
+       
+       int m_flags;
+       std::set<int> m_ca;
+       std::map<int,int> m_cache;
+       virtual ~eDVBService();
+       
+       eDVBService &operator=(const eDVBService &);
+       
+       // iStaticServiceInformation
+       RESULT getName(const eServiceReference &ref, std::string &name);
+       
+       // for filtering:
+       int checkFilter(const eServiceReferenceDVB &ref, const eDVBChannelQuery &query);
+};
+
+//////////////////
+
 class iDVBChannel;
 class iDVBDemux;
 class iDVBFrontendParameters;
 
-class iDVBChannelList: public virtual iObject
+class iDVBChannelListQuery: public iObject
 {
 public:
+       virtual RESULT getNextResult(eServiceReferenceDVB &ref)=0;
+};
+
+class eDVBChannelQuery: public iObject
+{
+       DECLARE_REF;
+public:
+       enum
+       {
+               tName,
+               tProvider,
+               tType,
+               tBouquet,
+               tSatellitePosition,
+               tChannelID,
+               tAND,
+               tOR
+       };
+       
+       int m_type;
+       int m_inverse;
+       
+       std::string m_string;
+       int m_int;
+       eDVBChannelID m_channelid;
+       
+       static RESULT compile(ePtr<eDVBChannelQuery> &res, std::string query);
+       
+       ePtr<eDVBChannelQuery> m_p1, m_p2;
+};
+
+class iDVBChannelList: public iObject
+{
+public:
+       virtual RESULT addChannelToList(const eDVBChannelID &id, iDVBFrontendParameters *feparm)=0;
+       virtual RESULT removeChannel(const eDVBChannelID &id)=0;
+       
        virtual RESULT getChannelFrontendData(const eDVBChannelID &id, ePtr<iDVBFrontendParameters> &parm)=0;
+       
+       virtual RESULT addService(const eServiceReferenceDVB &service, eDVBService *service)=0;
+       virtual RESULT getService(const eServiceReferenceDVB &reference, ePtr<eDVBService> &service)=0;
+
+       virtual RESULT startQuery(ePtr<iDVBChannelListQuery> &query, eDVBChannelQuery *query)=0;
 };
 
-class iDVBResourceManager: public virtual iObject
+class iDVBResourceManager: public iObject
 {
 public:
        /*
@@ -214,7 +295,7 @@ struct eDVBFrontendParametersTerrestrial
        void set(const TerrestrialDeliverySystemDescriptor  &);
 };
 
-class iDVBFrontendParameters: public virtual iObject
+class iDVBFrontendParameters: public iObject
 {
 public:
        virtual RESULT getSystem(int &type) const = 0;
@@ -236,7 +317,7 @@ struct eDVBDiseqcCommand
 
 class iDVBSatelliteEquipmentControl;
 
-class iDVBFrontend: public virtual iObject
+class iDVBFrontend: public iObject
 {
 public:
        enum {
@@ -267,7 +348,7 @@ public:
 class iDVBSatelliteEquipmentControl: public iObject
 {
 public:
-       virtual RESULT prepare(iDVBFrontend &frontend, struct dvb_frontend_parameters &parm, eDVBFrontendParametersSatellite &sat)=0;
+       virtual RESULT prepare(iDVBFrontend &frontend, FRONTENDPARAMETERS &parm, eDVBFrontendParametersSatellite &sat)=0;
 };
 
 struct eDVBCIRouting
@@ -275,7 +356,7 @@ struct eDVBCIRouting
        int enabled;
 };
 
-class iDVBChannel: public virtual iObject
+class iDVBChannel: public iObject
 {
 public:
        enum
@@ -302,7 +383,7 @@ public:
 class iDVBSectionReader;
 class iTSMPEGDecoder;
 
-class iDVBDemux: public virtual iObject
+class iDVBDemux: public iObject
 {
 public:
        virtual RESULT createSectionReader(eMainloop *context, ePtr<iDVBSectionReader> &reader)=0;