- add movie selector
[enigma2.git] / lib / service / servicefs.cpp
index 9db85028197bc85ecac20a5677117625f83fa681..739dd0a6707c03d8cbdc617695ca7b1aa3f4b8ea 100644 (file)
@@ -81,6 +81,7 @@ DEFINE_REF(eServiceFS);
 
 eServiceFS::eServiceFS(const char *path): path(path)
 {
+       m_list_valid = 0;
 }
 
 eServiceFS::~eServiceFS()
@@ -132,4 +133,22 @@ RESULT eServiceFS::getContent(std::list<eServiceReference> &list)
        return 0;
 }
 
+RESULT eServiceFS::getNext(eServiceReference &ptr)
+{
+       if (!m_list_valid)
+       {
+               m_list_valid = 1;
+               int res = getContent(m_list);
+               if (res)
+                       return res;
+       }
+       
+       if (!m_list.size())
+               return -ERANGE;
+       
+       ptr = m_list.front();
+       m_list.pop_front();
+       return 0;
+}
+
 eAutoInitPtr<eServiceFactoryFS> init_eServiceFactoryFS(eAutoInitNumbers::service+1, "eServiceFactoryFS");