-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.h
127 lines (103 loc) · 3 KB
/
config.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
/*
* 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 <fstream>
#include <string>
#include <vdr/i18n.h>
#include <vdr/tools.h>
namespace vdr_burn
{
// --- submux_xml ---------------------------------------------------------
template<typename T>
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<typename T>
inline
std::string submux_xml<T>::get_xml_path(int page) const
{
return proctools::format("{0}/menu-{1}.xml")
% m_item.get_paths().data % page;
}
template<typename T>
submux_xml<T>::submux_xml(const T& item):
m_item(item)
{
}
template<typename T>
void submux_xml<T>::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 << "<?xml version=\"1.0\" encoding=\"" << plugin::get_character_encoding() << "\"?>" << std::endl
<< "<subpictures>" << std::endl
<< " <stream>" << std::endl
<< " <spu force=\"yes\"" << std::endl
<< " start=\"00:00:00.00\"" << std::endl
<< " image=\"" << m_item.get_buttons_normal() << "\"" << std::endl
<< " select=\"" << m_item.get_buttons_normal() << "\"" << std::endl
<< " highlight=\"" << m_item.get_buttons_highlight(page) << "\"" << std::endl
<< " autooutline=\"infer\"" << std::endl
<< " outlinewidth=\"5\"" << std::endl
<< " autoorder=\"columns\"/>" << std::endl
<< " </stream>" << std::endl
<< "</subpictures>" << 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