From 1ec3ab371385d675f4e1b402781741c39f418297 Mon Sep 17 00:00:00 2001 From: Steve Lhomme Date: Sun, 16 Oct 2022 16:39:18 +0200 Subject: [PATCH] add the tag writer to the built examples And remove dead code. --- CMakeLists.txt | 4 + test/tags/test9.cpp | 237 -------------------------------------------- 2 files changed, 4 insertions(+), 237 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f4936d9..3b6cafb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -101,6 +101,10 @@ if(BUILD_EXAMPLES) add_executable(test8 test/mux/test8.cpp) target_link_libraries(test8 matroska) target_include_directories(test8 PRIVATE $) + + add_executable(test9 test/tags/test9.cpp) + target_link_libraries(test9 matroska) + target_include_directories(test9 PRIVATE $) endif() install(TARGETS matroska diff --git a/test/tags/test9.cpp b/test/tags/test9.cpp index 3811fc1..d6b4ace 100644 --- a/test/tags/test9.cpp +++ b/test/tags/test9.cpp @@ -96,243 +96,6 @@ int main() { *(static_cast(&GetChild(targets))) = 1234; -#if 0 - // comment of the Targets - KaxTagMultiComment &mcomB = GetChild(targets); - *(static_cast - (&GetChild(mcomB))) = - "Comment Level 5"; - - *(static_cast(&GetChild(targets))) = - 5678; - - KaxTagMultiComment &mcomA = GetChild(tag); - *(static_cast - (&GetChild(mcomA))) = - "Comment Level 3"; - - KaxTagGeneral &general = GetChild(tag); - *(static_cast(&GetChild(general))) = - L"Subject"; - *(static_cast - (&GetChild(general))) = - L"Bibliography"; - *(static_cast(&GetChild(general))) = "ger"; - KaxTagRating &rating = GetChild(general); - rating.CopyBuffer((binary *)"hallo", 5); - *(static_cast - (&GetChild(general))) = - L"Encoder"; - *(static_cast - (&GetChild(general))) = - L"EncodeSettings"; - *(static_cast - (&GetChild(general))) = - L"File"; - *(static_cast - (&GetChild(general))) = - L"ArchivalLocation"; - KaxTagKeywords &keywords1 = GetChild(general); - *(static_cast(&keywords1)) = - L"Keywords, 1"; - *(static_cast - (&GetNextChild(general, keywords1))) = - L"Keywords, 2"; - *(static_cast - (&GetChild(general))) = - L"Mood"; - KaxTagRecordLocation &recordLocation1 = - GetChild(general); - *(static_cast(&recordLocation1)) = - "RecordLocation, 1"; - *(static_cast - (&GetNextChild(general, recordLocation1))) = - "RecordLocation, 2"; - *(static_cast - (&GetChild(general))) = - L"Source"; - *(static_cast - (&GetChild(general))) = - L"SourceForm"; - *(static_cast - (&GetChild(general))) = - L"Product"; - *(static_cast - (&GetChild(general))) = - L"OriginalMediaType"; - *(static_cast - (&GetChild(general))) = - 123456; - *(static_cast - (&GetChild(general))) = - 234567; - - KaxTagGenres &genres = GetChild(tag); - *(static_cast - (&GetChild(genres))) = - "AudioGenre"; - KaxTagVideoGenre &videoGenre = GetChild(genres); - videoGenre.CopyBuffer((binary *)"hallo", 5); - *(static_cast - (&GetChild(genres))) = - "SubGenre"; - - KaxTagAudioSpecific &aspec = GetChild(tag); - KaxTagAudioEncryption &aenc = GetChild(aspec); - aenc.CopyBuffer((binary *)"hallo", 5); - *(static_cast - (&GetChild(aspec))) = - 42.0; - *(static_cast - (&GetChild(aspec))) = - 54.0; - *(static_cast - (&GetChild(aspec))) = - 23.0; - KaxTagEqualisation &aeq = GetChild(aspec); - aeq.CopyBuffer((binary *)"hallo", 5); - *(static_cast - (&GetChild(aspec))) = - 2; - *(static_cast - (&GetChild(aspec))) = - 4; - *(static_cast - (&GetChild(aspec))) = - "InitialKey"; - *(static_cast - (&GetChild(aspec))) = - "OfficialAudioFileURL"; - *(static_cast - (&GetChild(aspec))) = - "OfficialAudioSourceURL"; - - KaxTagImageSpecific &ispec = GetChild(tag); - *(static_cast - (&GetChild(ispec))) = - 42; - KaxTagCaptureLightness &clight = GetChild(ispec); - clight.CopyBuffer((binary *)"hallo", 5); - *(static_cast - (&GetChild(ispec))) = - 54; - KaxTagCaptureSharpness &csharp = GetChild(ispec); - csharp.CopyBuffer((binary *)"hallo", 5); - *(static_cast - (&GetChild(ispec))) = - L"Cropped"; - *(static_cast - (&GetChild(ispec))) = - "OriginalDimensions"; - - KaxTagMultiCommercial &mcmrcl = GetChild(tag); - KaxTagCommercial &cmrcl = GetChild(mcmrcl); - *(static_cast - (&GetChild(cmrcl))) = - 3; - *(static_cast - (&GetChild(cmrcl))) = - L"MultiCommercialAddress"; - *(static_cast - (&GetChild(cmrcl))) = - "MultiCommercialURL"; - *(static_cast - (&GetChild(cmrcl))) = - "MultiCommercialEmail"; - - KaxTagMultiPrice &mprice = GetChild(cmrcl); - *(static_cast - (&GetChild(mprice))) = - "MultiPriceCurrency"; - *(static_cast - (&GetChild(mprice))) = - 42.0; - KaxTagMultiPricePriceDate &pdate = - GetChild(mprice); - pdate.SetEpochDate(time(NULL)); - - KaxTagMultiDate &mdate = GetChild(tag); - KaxTagDate &date = GetChild(mdate); - *(static_cast - (&GetChild(date))) = - 4; - KaxTagMultiDateDateBegin &dbeg = - GetChild(date); - dbeg.SetEpochDate(time(NULL)); - KaxTagMultiDateDateEnd &dend = - GetChild(date); - dend.SetEpochDate(time(NULL)); - - KaxTagMultiEntity &ment = GetChild(tag); - KaxTagEntity &ent = GetChild(ment); - *(static_cast - (&GetChild(ent))) = - 1; - *(static_cast - (&GetChild(ent))) = - L"MultiEntityName"; - *(static_cast - (&GetChild(ent))) = - "MultiEntityURL"; - *(static_cast - (&GetChild(ent))) = - "MultiEntityEmail"; - *(static_cast - (&GetChild(ent))) = - L"MultiEntityAddress"; - - KaxTagMultiIdentifier &mident = GetChild(tag); - KaxTagIdentifier &ident = GetChild(mident); - *(static_cast - (&GetChild(ident))) = - 5; - KaxTagMultiIdentifierBinary &ibin = - GetChild(ident); - ibin.CopyBuffer((binary *)"hallo", 5); - *(static_cast - (&GetChild(ident))) = - L"MultiIdentifierString"; - - KaxTagMultiLegal &mlegal = GetChild(tag); - KaxTagLegal &legal = GetChild(mlegal); - *(static_cast - (&GetChild(legal))) = - 3; - *(static_cast - (&GetChild(legal))) = - "MultiLegalURL"; - *(static_cast - (&GetChild(legal))) = - L"MultiLegalAddress"; - - KaxTagMultiTitle &mtit = GetChild(tag); - KaxTagTitle &tit = GetChild(mtit); - *(static_cast - (&GetChild(tit))) = - 2; - *(static_cast - (&GetChild(tit))) = - L"MultiTitleName"; - *(static_cast - (&GetChild(tit))) = - L"MultiTitleSubTitle"; - *(static_cast - (&GetChild(tit))) = - L"MultiTitleEdition"; - *(static_cast - (&GetChild(tit))) = - L"MultiTitleAddress"; - *(static_cast - (&GetChild(tit))) = - "MultiTitleURL"; - *(static_cast - (&GetChild(tit))) = - "MultiTitleEmail"; - *(static_cast - (&GetChild(tit))) = - "MultiTitleLanguage"; -#endif - KaxTagSimple &stag_l1 = GetChild(tag); *(static_cast(&GetChild(stag_l1))) = L"SIMPLE_TAG_NAME_LEVEL1_1"; -- 2.40.0