]> git.decadent.org.uk Git - videolink.git/blob - generate_dvd.hpp
Use ffmpeg by default since it seems to work if we use pause correctly.
[videolink.git] / generate_dvd.hpp
1 // Copyright 2005-6 Ben Hutchings <ben@decadentplace.org.uk>.
2 // See the file "COPYING" for licence details.
3
4 #ifndef INC_GENERATE_DVD_HPP
5 #define INC_GENERATE_DVD_HPP
6
7 #include <string>
8 #include <vector>
9
10 #include <boost/shared_ptr.hpp>
11
12 #include "temp_file.hpp"
13 #include "vob_list.hpp"
14
15 // Description of menus and titles to go on a DVD.
16
17 struct dvd_contents
18 {
19     enum pgc_type { unknown_pgc,  menu_pgc, title_pgc };
20
21     // Reference to some PGC (program chain).
22     struct pgc_ref
23     {
24         explicit pgc_ref(pgc_type type = unknown_pgc,
25                          int index = -1,
26                          int sub_index = 0)
27                 : type(type), index(index), sub_index(sub_index)
28             {}
29         bool operator==(const pgc_ref & other) const
30             {
31                 return type == other.type && index == other.index;
32             }
33         bool operator!=(const pgc_ref & other) const
34             {
35                 return !(*this == other);
36             }
37             
38         pgc_type type;      // Menu or title reference?
39         unsigned index;     // Menu or title index (within resp. vector)
40         unsigned sub_index; // Button or chapter number (1-based; 0 if
41                             // unspecified; not compared!)
42     };
43
44     // Menu definition.
45     struct menu
46     {
47         menu();
48
49         // Temporary file in which the menu VOB should be generated.
50         // This is created as an empty file and then closed.
51         boost::shared_ptr<temp_file> vob_temp;
52
53         // References to the menus and titles that the menu buttons
54         // are meant to link to, in the same order as the buttons.
55         std::vector<pgc_ref> entries;
56     };
57
58     std::vector<menu> menus;
59     std::vector<vob_list> titles;
60 };
61
62 // Use dvdauthor to generate a DVD filesystem with the given contents.
63 void generate_dvd(const dvd_contents & contents,
64                   const std::string & output_dir);
65
66 #endif // !INC_GENERATE_DVD_HPP