X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;ds=sidebyside;f=generate_dvd.hpp;fp=generate_dvd.hpp;h=8ce8f7b89e97f1ef1285e640d00de990b3c5c5b4;hb=3fb06bde35cdcd9864329517f4548e1c5f0ad97c;hp=0000000000000000000000000000000000000000;hpb=ddc364c6916166aab0d2341e42efb35f925aada5;p=videolink.git diff --git a/generate_dvd.hpp b/generate_dvd.hpp new file mode 100644 index 0000000..8ce8f7b --- /dev/null +++ b/generate_dvd.hpp @@ -0,0 +1,78 @@ +// Copyright 2005-6 Ben Hutchings . +// See the file "COPYING" for licence details. + +#ifndef INC_GENERATE_DVD_HPP +#define INC_GENERATE_DVD_HPP + +#include +#include + +#include + +#include "temp_file.hpp" + +// Description of menus and titles to go on a DVD. + +struct dvd_contents +{ + enum pgc_type { unknown_pgc, menu_pgc, title_pgc }; + + // Reference to some PGC (program chain). + struct pgc_ref + { + explicit pgc_ref(pgc_type type = unknown_pgc, + int index = -1, + int sub_index = 0) + : type(type), index(index), sub_index(sub_index) + {} + bool operator==(const pgc_ref & other) const + { + return type == other.type && index == other.index; + } + bool operator!=(const pgc_ref & other) const + { + return !(*this == other); + } + + pgc_type type; // Menu or title reference? + unsigned index; // Menu or title index (within resp. vector) + unsigned sub_index; // Button or chapter number (1-based; 0 if + // unspecified; not compared!) + }; + + // Menu definition. + struct menu + { + menu(); + + // Temporary file in which the menu VOB should be generated. + // This is created as an empty file and then closed. + boost::shared_ptr vob_temp; + + // References to the menus and titles that the menu buttons + // are meant to link to, in the same order as the buttons. + std::vector entries; + }; + + // Title definition. This is currently just an XML fragment + // consisting of one of more elements. It is included + // directly within the corresponding element in the file + // passed to dvdauthor. + struct title + { + explicit title(const std::string & vob_list) + : vob_list(vob_list) + {} + + std::string vob_list; + }; + + std::vector menus; + std::vector titles; +}; + +// Use dvdauthor to generate a DVD filesystem with the given contents. +void generate_dvd(const dvd_contents & contents, + const std::string & output_dir); + +#endif // !INC_GENERATE_DVD_HPP