more changes for service groups (replacement for zapping alternatives
[enigma2.git] / lib / service / iservice.h
index 25935b2f161c27bb1a18ed955f764bafe1d1b4c7..40997c028f21a73728add33a3904bc165bce2593 100644 (file)
@@ -39,7 +39,8 @@ public:
                shouldSort=8,                   // should be ASCII-sorted according to service_name. great for directories.
                hasSortKey=16,          // has a sort key in data[3]. not having a sort key implies 0.
                sort1=32,                                       // sort key is 1 instead of 0
-               isMarker=64                     // Marker
+               isMarker=64,                    // Marker
+               isGroup=128                     // is a group of services
        };
        int flags; // flags will NOT be compared.
 
@@ -137,12 +138,12 @@ public:
                data[3]=data3;
                data[4]=data4;
        }
+#endif
        eServiceReference(int type, int flags, const std::string &path)
                : type(type), flags(flags), path(path)
        {
                memset(data, 0, sizeof(data));
        }
-#endif
        eServiceReference(const std::string &string);
        std::string toString() const;
        std::string toCompareString() const;
@@ -184,6 +185,22 @@ SWIG_ALLOW_OUTPUT_SIMPLE(eServiceReference);
 
 extern PyObject *New_eServiceReference(const eServiceReference &ref); // defined in enigma_python.i
 
+#ifndef SWIG
+#ifdef PYTHON_REFCOUNT_DEBUG
+inline ePyObject Impl_New_eServiceReference(const char* file, int line, const eServiceReference &ref)
+{
+       return ePyObject(New_eServiceReference(ref), file, line);
+}
+#define NEW_eServiceReference(ref) Impl_New_eServiceReference(__FILE__, __LINE__, ref)
+#else
+inline ePyObject Impl_New_eServiceReference(const eServiceReference &ref)
+{
+       return New_eServiceReference(ref);
+}
+#define NEW_eServiceReference(ref) Impl_New_eServiceReference(ref)
+#endif
+#endif // SWIG
+
 typedef long long pts_t;
 
        /* the reason we have the servicereference as additional argument is
@@ -222,7 +239,7 @@ public:
        virtual int getLength(const eServiceReference &ref);
        virtual SWIG_VOID(RESULT) getEvent(const eServiceReference &ref, ePtr<eServiceEvent> &SWIG_OUTPUT, time_t start_time=-1);
                // returns true when not implemented
-       virtual bool isPlayable(const eServiceReference &ref, const eServiceReference &ignore);
+       virtual int isPlayable(const eServiceReference &ref, const eServiceReference &ignore);
 
        virtual int getInfo(const eServiceReference &ref, int w);
        virtual std::string getInfoString(const eServiceReference &ref,int w);
@@ -582,6 +599,22 @@ inline PyObject *PyFrom(ePtr<iRecordableService> &c)
        return New_iRecordableServicePtr(c);
 }
 
+#ifndef SWIG
+#ifdef PYTHON_REFCOUNT_DEBUG
+inline ePyObject Impl_New_iRecordableServicePtr(const char* file, int line, const ePtr<iRecordableService> &ptr)
+{
+       return ePyObject(New_iRecordableServicePtr(ptr), file, line);
+}
+#define NEW_iRecordableServicePtr(ptr) Impl_New_iRecordableServicePtr(__FILE__, __LINE__, ptr)
+#else
+inline ePyObject Impl_New_iRecordableServicePtr(const ePtr<iRecordableService> &ptr)
+{
+       return New_iRecordableServicePtr(ptr);
+}
+#define NEW_iRecordableServicePtr(ptr) Impl_New_iRecordableServicePtr(ptr)
+#endif
+#endif // SWIG
+
 // TEMPLATE_TYPEDEF(std::list<eServiceReference>, eServiceReferenceList);
 
 class iMutableServiceList: public iObject