1 // Copyright 2005-6 Ben Hutchings <ben@decadentplace.org.uk>.
2 // See the file "COPYING" for licence details.
4 #ifndef INC_GENERATE_DVD_HPP
5 #define INC_GENERATE_DVD_HPP
10 #include <boost/shared_ptr.hpp>
12 #include "temp_file.hpp"
14 // Description of menus and titles to go on a DVD.
18 enum pgc_type { unknown_pgc, menu_pgc, title_pgc };
20 // Reference to some PGC (program chain).
23 explicit pgc_ref(pgc_type type = unknown_pgc,
26 : type(type), index(index), sub_index(sub_index)
28 bool operator==(const pgc_ref & other) const
30 return type == other.type && index == other.index;
32 bool operator!=(const pgc_ref & other) const
34 return !(*this == other);
37 pgc_type type; // Menu or title reference?
38 unsigned index; // Menu or title index (within resp. vector)
39 unsigned sub_index; // Button or chapter number (1-based; 0 if
40 // unspecified; not compared!)
48 // Temporary file in which the menu VOB should be generated.
49 // This is created as an empty file and then closed.
50 boost::shared_ptr<temp_file> vob_temp;
52 // References to the menus and titles that the menu buttons
53 // are meant to link to, in the same order as the buttons.
54 std::vector<pgc_ref> entries;
57 // Title definition. This is currently just an XML fragment
58 // consisting of one of more <vob> elements. It is included
59 // directly within the corresponding <pgc> element in the file
60 // passed to dvdauthor.
63 explicit title(const std::string & vob_list)
70 std::vector<menu> menus;
71 std::vector<title> titles;
74 // Use dvdauthor to generate a DVD filesystem with the given contents.
75 void generate_dvd(const dvd_contents & contents,
76 const std::string & output_dir);
78 #endif // !INC_GENERATE_DVD_HPP