Separate out SPL/SPLEntry; start trying to make player read SPLs sensibly.
[dcpomatic.git] / src / lib / spl.h
index 5e1bd47b2acdeaf5a6a35d3fe5ec887f73ec2c62..b93a93041c2087d48c556c95234c9b9643b9ec38 100644 (file)
 
 */
 
-#ifndef DCPOMATIC_SPL_H
-#define DCPOMATIC_SPL_H
+#include "spl_entry.h"
 
-#include <boost/filesystem.hpp>
-
-class SPLEntry;
+class ContentStore;
 
 class SPL
 {
 public:
-       SPL () {}
-       SPL (boost::filesystem::path file);
+       void add (SPLEntry e) {
+               _spl.push_back (e);
+       }
 
-       void as_xml (boost::filesystem::path file) const;
+       void remove (std::size_t index) {
+               _spl.erase (_spl.begin() + index);
+       }
 
-       std::string name;
-       std::list<SPLEntry> playlist;
-};
+       std::vector<SPLEntry> const & get () const {
+               return _spl;
+       }
+
+       SPLEntry & operator[] (std::size_t index) {
+               return _spl[index];
+       }
+
+       SPLEntry const & operator[] (std::size_t index) const {
+               return _spl[index];
+       }
 
-#endif
+       bool read (boost::filesystem::path path, ContentStore* store);
+       void write (boost::filesystem::path path) const;
+
+       std::string name () const {
+               return _name;
+       }
+
+private:
+       std::string _name;
+       std::vector<SPLEntry> _spl;
+};