// TEMPLATE_TYPEDEF(std::list<eServiceReference>, eServiceReferenceList);
+class iMutableServiceList: public iObject
+{
+public:
+ /* adds a service to a list */
+ virtual RESULT addService(eServiceReference &ref)=0;
+ /* removes a service from a list */
+ virtual RESULT removeService(eServiceReference &ref)=0;
+ /* moves a service in a list, only if list suppports a specific sort method. */
+ /* pos is the new, absolute position from 0..size-1 */
+ virtual RESULT moveService(eServiceReference &ref, int pos)=0;
+};
+
+TEMPLATE_TYPEDEF(ePtr<iMutableServiceList>, iMutableServiceListPtr);
+
class iListableService: public iObject
{
public:
(as well as a future "active" extension) won't be possible.
*/
virtual int compareLessEqual(const eServiceReference &, const eServiceReference &)=0;
+
+ virtual SWIG_VOID(RESULT) startEdit(ePtr<iMutableServiceList> &SWIG_OUTPUT)=0;
};
TEMPLATE_TYPEDEF(ePtr<iListableService>, iListableServicePtr);
return m_query->compareLessEqual((const eServiceReferenceDVB&)a, (const eServiceReferenceDVB&)b);
}
+RESULT eDVBServiceList::startEdit(ePtr<iMutableServiceList> &res)
+{
+ if (m_parent.flags & eServiceReference::flagDirectory) // bouquet
+ {
+ ePtr<iDVBChannelList> db;
+ ePtr<eDVBResourceManager> resm;
+
+ if (eDVBResourceManager::getInstance(resm) || resm->getChannelList(db))
+ return -1;
+
+ // FIXME!
+ if (db->getBouquet(m_parent, (const eBouquet*&)m_bouquet) != 0)
+ return -1;
+
+ res = this;
+
+ return 0;
+ }
+ res = 0;
+ return -1;
+}
+
+RESULT eDVBServiceList::addService(eServiceReference &ref)
+{
+ ASSERT(m_bouquet);
+// return m_bouquet->addService(ref);
+ return -1;
+}
+
+RESULT eDVBServiceList::removeService(eServiceReference &ref)
+{
+ ASSERT(m_bouquet);
+// return m_bouquet->removeService(ref);
+ return -1;
+}
+
+RESULT eDVBServiceList::moveService(eServiceReference &ref, int pos)
+{
+ ASSERT(m_bouquet);
+
+// return m_bouquet->moveService(ref, pos);
+ return -1;
+}
+
RESULT eServiceFactoryDVB::play(const eServiceReference &ref, ePtr<iPlayableService> &ptr)
{
ePtr<eDVBService> service;
RESULT lookupService(ePtr<eDVBService> &ptr, const eServiceReference &ref);
};
-class eDVBServiceList: public iListableService
+class eBouquet;
+
+class eDVBServiceList: public iListableService, public iMutableServiceList
{
DECLARE_REF(eDVBServiceList);
public:
RESULT getContent(std::list<eServiceReference> &list);
RESULT getNext(eServiceReference &ptr);
int compareLessEqual(const eServiceReference &a, const eServiceReference &b);
+
+ RESULT startEdit(ePtr<iMutableServiceList> &);
+ RESULT addService(eServiceReference &ref);
+ RESULT removeService(eServiceReference &ref);
+ RESULT moveService(eServiceReference &ref, int pos);
private:
RESULT startQuery();
eServiceReference m_parent;
friend class eServiceFactoryDVB;
eDVBServiceList(const eServiceReference &parent);
ePtr<iDVBChannelListQuery> m_query;
+
+ /* for editing purposes. WARNING: lifetime issue! */
+ eBouquet *m_bouquet;
};
class eDVBServicePlay: public iPlayableService, public iPauseableService, public iSeekableService, public Object, public iServiceInformation
return a.path < b.path;
}
+RESULT eServiceFS::startEdit(ePtr<iMutableServiceList> &res)
+{
+ res = 0;
+ return -1;
+}
+
eAutoInitPtr<eServiceFactoryFS> init_eServiceFactoryFS(eAutoInitNumbers::service+1, "eServiceFactoryFS");
RESULT getContent(std::list<eServiceReference> &list);
RESULT getNext(eServiceReference &ptr);
int compareLessEqual(const eServiceReference &, const eServiceReference &);
+ RESULT startEdit(ePtr<iMutableServiceList> &);
};
#endif