Import.
[libdcp.git] / src / dcp.h
1 /*
2     Copyright (C) 2012 Carl Hetherington <cth@carlh.net>
3
4     This program is free software; you can redistribute it and/or modify
5     it under the terms of the GNU General Public License as published by
6     the Free Software Foundation; either version 2 of the License, or
7     (at your option) any later version.
8
9     This program is distributed in the hope that it will be useful,
10     but WITHOUT ANY WARRANTY; without even the implied warranty of
11     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12     GNU General Public License for more details.
13
14     You should have received a copy of the GNU General Public License
15     along with this program; if not, write to the Free Software
16     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17
18 */
19
20 #include <string>
21 #include <list>
22 #include <boost/shared_ptr.hpp>
23
24 namespace libdcp
25 {
26
27 class Asset;    
28
29 class DCP
30 {
31 public:
32         enum ContentType
33         {
34                 FEATURE,
35                 SHORT,
36                 TRAILER,
37                 TEST,
38                 TRANSITIONAL,
39                 RATING,
40                 TEASER,
41                 POLICY,
42                 PUBLIC_SERVICE_ANNOUNCEMENT,
43                 ADVERTISEMENT
44         };
45         
46         DCP (std::string, std::string, ContentType, int, int);
47
48         void add_sound_asset (std::list<std::string> const &);
49         void add_picture_asset (std::list<std::string> const &, int, int);
50
51         void write_xml () const;
52
53 private:
54
55         std::string write_cpl (std::string) const;
56         std::string write_pkl (std::string, std::string, std::string, int) const;
57         void write_volindex () const;
58         void write_assetmap (std::string, int, std::string, int) const;
59
60         static std::string content_type_string (ContentType);
61
62         std::string _directory;
63         std::string _name;
64         ContentType _content_type;
65         int _fps;
66         int _length;
67         std::list<boost::shared_ptr<Asset> > _assets;
68
69         std::string _date;
70 };
71
72 }