Support for KaxTagMultiLegalContent.

This commit is contained in:
Moritz Bunkus 2003-07-25 11:30:06 +00:00
parent aedc5f75e7
commit 1c2274cff3
7 changed files with 43 additions and 10 deletions

View File

@ -118,6 +118,7 @@
<Type>3</Type>
<URL>URL</URL>
<Address>Address</Address>
<Content>(C) Content</Content>
</Legal>
</MultiLegal>

View File

@ -159,8 +159,9 @@
Type,
URL*,
Address?,
Content?,
MultiComment*)>
<!element LegalType (#PCDATA)>
<!element Content (#PCDATA)>
<!element MultiTitle (Title+)>
<!element Title (

View File

@ -2660,6 +2660,16 @@ bool process_file(const char *file_name) {
l_URL.ReadData(es->I_O());
show_element(l5, 5, "URL: %s", string(l_URL).c_str());
} else if (EbmlId(*l5) ==
KaxTagMultiLegalContent::
ClassInfos.GlobalId) {
KaxTagMultiLegalContent &l_content =
*static_cast<KaxTagMultiLegalContent *>(l5);
l_content.ReadData(es->I_O());
str = UTFstring_to_cstr(UTFstring(l_content));
show_element(l5, 5, "Content: %s", str);
safefree(str);
} else if (!is_ebmlvoid(l5, 5, upper_lvl_el) &&
!parse_multicomment(es, l5, 5, upper_lvl_el,
l6))

View File

@ -106,6 +106,7 @@ using namespace libmatroska;
#define E_MultiLegal 69
#define E_Legal 70
#define E_LegalType 71
#define E_LegalContent 80
#define E_MultiTitle 72
#define E_Title 73
#define E_TitleType 74
@ -115,6 +116,8 @@ using namespace libmatroska;
#define E_CommentName 78
#define E_Comments 79
// MAX: 80
typedef struct {
XML_Parser parser;

View File

@ -496,6 +496,9 @@ void end_level4(parser_data_t *pdata, const char *name) {
else if (!strcmp(name, "Address"))
el_get_utf8string(pdata, &GetChild<KaxTagMultiLegalAddress>
(*pdata->legal));
else if (!strcmp(name, "Content"))
el_get_utf8string(pdata, &GetChild<KaxTagMultiLegalContent>
(*pdata->legal));
} else if (parent == E_Title) {
if (!strcmp(name, "Type"))

View File

@ -203,7 +203,8 @@ void start_level3(parser_data_t *pdata, const char *name) {
pdata->track_uid = &GetEmptyChild<KaxTagTrackUID>(*pdata->targets);
else
pdata->track_uid =
&GetNextEmptyChild<KaxTagTrackUID>(*pdata->targets, *pdata->track_uid);
&GetNextEmptyChild<KaxTagTrackUID>(*pdata->targets,
*pdata->track_uid);
pdata->parents->push_back(E_TrackUID);
} else if (!strcmp(name, "ChapterUID")) {
if (pdata->chapter_uid == NULL)
@ -249,7 +250,8 @@ void start_level3(parser_data_t *pdata, const char *name) {
pdata->keywords = &GetEmptyChild<KaxTagKeywords>(*pdata->general);
else
pdata->keywords =
&GetNextEmptyChild<KaxTagKeywords>(*pdata->general, *pdata->keywords);
&GetNextEmptyChild<KaxTagKeywords>(*pdata->general,
*pdata->keywords);
pdata->parents->push_back(E_Keywords);
} else if (!strcmp(name, "Mood")) {
check_instances(pdata->general, KaxTagMood);
@ -292,14 +294,16 @@ void start_level3(parser_data_t *pdata, const char *name) {
pdata->audio_genre = &GetEmptyChild<KaxTagAudioGenre>(*pdata->genres);
else
pdata->audio_genre =
&GetNextEmptyChild<KaxTagAudioGenre>(*pdata->genres, *pdata->audio_genre);
&GetNextEmptyChild<KaxTagAudioGenre>(*pdata->genres,
*pdata->audio_genre);
pdata->parents->push_back(E_AudioGenre);
} else if (!strcmp(name, "VideoGenre")) {
if (pdata->video_genre == NULL)
pdata->video_genre = &GetEmptyChild<KaxTagVideoGenre>(*pdata->genres);
else
pdata->video_genre =
&GetNextEmptyChild<KaxTagVideoGenre>(*pdata->genres, *pdata->video_genre);
&GetNextEmptyChild<KaxTagVideoGenre>(*pdata->genres,
*pdata->video_genre);
pdata->parents->push_back(E_VideoGenre);
} else if (!strcmp(name, "SubGenre")) {
check_instances(pdata->genres, KaxTagSubGenre);
@ -481,7 +485,8 @@ void start_level4(parser_data_t *pdata, const char *name) {
pdata->m_price = &GetEmptyChild<KaxTagMultiPrice>(*pdata->commercial);
else
pdata->m_price =
&GetNextEmptyChild<KaxTagMultiPrice>(*pdata->commercial, *pdata->m_price);
&GetNextEmptyChild<KaxTagMultiPrice>(*pdata->commercial,
*pdata->m_price);
pdata->parents->push_back(E_MultiPrice);
} else
perror_nochild();
@ -515,7 +520,8 @@ void start_level4(parser_data_t *pdata, const char *name) {
pdata->e_url = &GetEmptyChild<KaxTagMultiEntityURL>(*pdata->entity);
else
pdata->e_url =
&GetNextEmptyChild<KaxTagMultiEntityURL>(*pdata->entity, *pdata->e_url);
&GetNextEmptyChild<KaxTagMultiEntityURL>(*pdata->entity,
*pdata->e_url);
pdata->parents->push_back(E_URL);
} else if (!strcmp(name, "Email")) {
if (pdata->e_email == NULL)
@ -558,11 +564,15 @@ void start_level4(parser_data_t *pdata, const char *name) {
pdata->l_url = &GetEmptyChild<KaxTagMultiLegalURL>(*pdata->legal);
else
pdata->l_url =
&GetNextEmptyChild<KaxTagMultiLegalURL>(*pdata->legal, *pdata->l_url);
&GetNextEmptyChild<KaxTagMultiLegalURL>(*pdata->legal,
*pdata->l_url);
pdata->parents->push_back(E_URL);
} else if (!strcmp(name, "Address")) {
check_instances(pdata->legal, KaxTagMultiLegalAddress);
pdata->parents->push_back(E_Address);
} else if (!strcmp(name, "Content")) {
check_instances(pdata->legal, KaxTagMultiLegalContent);
pdata->parents->push_back(E_LegalContent);
} else
perror_nochild();
@ -589,14 +599,16 @@ void start_level4(parser_data_t *pdata, const char *name) {
pdata->t_url = &GetEmptyChild<KaxTagMultiTitleURL>(*pdata->title);
else
pdata->t_url =
&GetNextEmptyChild<KaxTagMultiTitleURL>(*pdata->title, *pdata->t_url);
&GetNextEmptyChild<KaxTagMultiTitleURL>(*pdata->title,
*pdata->t_url);
pdata->parents->push_back(E_URL);
} else if (!strcmp(name, "Email")) {
if (pdata->t_email == NULL)
pdata->t_email = &GetEmptyChild<KaxTagMultiTitleEmail>(*pdata->title);
else
pdata->t_email =
&GetNextEmptyChild<KaxTagMultiTitleEmail>(*pdata->title, *pdata->t_email);
&GetNextEmptyChild<KaxTagMultiTitleEmail>(*pdata->title,
*pdata->t_email);
pdata->parents->push_back(E_Email);
} else if (!strcmp(name, "Language")) {
check_instances(pdata->title, KaxTagMultiTitleLanguage);

View File

@ -204,6 +204,9 @@ static void handle_level4(EbmlElement *e) {
else if (is_id(KaxTagMultiLegalAddress))
pr_us("Address");
else if (is_id(KaxTagMultiLegalContent))
pr_us("Content");
else if (is_id(KaxTagMultiTitleType))
pr_ui("Type");