/* * See the files COPYING and README for copyright information and how to reach * the author. * * $Id: config.h,v 1.12 2006/09/16 18:33:36 lordjaxom Exp $ */ #ifndef VDR_BURN_CONFIG_H #define VDR_BURN_CONFIG_H #include "burn.h" #include "common.h" #include "etsi-const.h" #include "jobs.h" #include "proctools/format.h" #include "proctools/logger.h" #include #include #include #include namespace vdr_burn { // --- submux_xml --------------------------------------------------------- template class submux_xml { public: submux_xml(const T& item); void write(int page); std::string get_xml_path(int page) const; private: const T& m_item; }; template inline std::string submux_xml::get_xml_path(int page) const { return proctools::format("{0}/menu-{1}.xml") % m_item.get_paths().data % page; } template submux_xml::submux_xml(const T& item): m_item(item) { } template void submux_xml::write(int page) { std::string path = get_xml_path(page); std::ofstream f(path.c_str(), std::ios::out); if (!f) { proctools::logger::error(proctools::format("couldn't create {0}") % path); return; } f << "" << std::endl << "" << std::endl << " " << std::endl << " " << std::endl << " " << std::endl << "" << std::endl; } // --- dvdauthor_xml ----------------------------------------------------- class dvdauthor_xml { public: dvdauthor_xml(const job& job_); void write(); std::string get_xml_path() const; std::string get_author_path() const; static std::string get_author_path(const job& job_); protected: // static const char* get_video_format(etsi_const::component_type::type type_); static std::string get_video_aspect(track_info::aspectratio typeBits); static std::string get_audio_language(int language); void write_main_menu(); void write_title_menu(recording_list::const_iterator rec); private: const job& m_job; std::ofstream m_file; }; inline std::string dvdauthor_xml::get_xml_path() const { return proctools::format("{0}/dvd.xml") % m_job.get_paths().data; } inline std::string dvdauthor_xml::get_author_path() const { return get_author_path(m_job); } inline std::string dvdauthor_xml::get_author_path(const job& job_) { return proctools::format("{0}/DVDAUTHOR") % job_.get_paths().data; } } #endif // VDR_BURN_CONFIG_H