From fcb009246dbf9d77d1806396d706b0023be0258c Mon Sep 17 00:00:00 2001 From: fgerlits Date: Tue, 8 Mar 2005 12:57:10 +0000 Subject: [PATCH] added Live Support (ls:) namespace declaration to AudioClip class --- livesupport/modules/core/src/AudioClip.cxx | 36 ++++++++++++++++++---- 1 file changed, 30 insertions(+), 6 deletions(-) diff --git a/livesupport/modules/core/src/AudioClip.cxx b/livesupport/modules/core/src/AudioClip.cxx index 2715877c8..e763389ab 100644 --- a/livesupport/modules/core/src/AudioClip.cxx +++ b/livesupport/modules/core/src/AudioClip.cxx @@ -22,7 +22,7 @@ Author : $Author: fgerlits $ - Version : $Revision: 1.22 $ + Version : $Revision: 1.23 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/core/src/AudioClip.cxx,v $ ------------------------------------------------------------------------------*/ @@ -93,7 +93,7 @@ static const std::string extentElementPrefix = "dcterms"; static const std::string extentElementName = "extent"; /** - * The URI identifier for the "dcterms" prefix + * The URI identifier for the "dcterms" prefix. */ static const std::string extentElementUri = "http://purl.org/dc/terms/"; @@ -108,14 +108,27 @@ static const std::string titleElementPrefix = "dc"; static const std::string titleElementName = "title"; /** - * The URI identifier for the "dc" prefix + * The URI identifier for the "dc" prefix. */ -static const std::string titleElementUri ="http://purl.org/dc/elements/1.1/"; +static const std::string titleElementUri + = "http://purl.org/dc/elements/1.1/"; /** - * The URI identifier for the default XML namespace + * The URI identifier for the default XML namespace. */ -static const std::string defaultPrefixUri ="http://www.streamonthefly.org/"; +static const std::string defaultPrefixUri + ="http://www.streamonthefly.org/"; + +/** + * The prefix for the Live Support extension elements. + */ +static const std::string liveSupportNamespacePrefix = "ls"; + +/** + * The URI identifier for the "ls" prefix. + */ +static const std::string liveSupportNamespaceUri + = "http://mdlf.org/livesupport/elements/1.0/"; /* =============================================== local function prototypes */ @@ -477,6 +490,8 @@ AudioClip :: setMetadata(Ptr::Ref value, titleElementPrefix); metadata->set_namespace_declaration(extentElementUri, extentElementPrefix); + metadata->set_namespace_declaration(liveSupportNamespaceUri, + liveSupportNamespacePrefix); } // find the element to be modified @@ -548,6 +563,15 @@ AudioClip :: getXmlDocumentString() const throw () if (id) { rootNode->set_attribute(idAttrName, std::string(*id)); } + + xmlpp::Element* metadata = rootNode->add_child(metadataElementName); + metadata->set_namespace_declaration(defaultPrefixUri); + metadata->set_namespace_declaration(titleElementUri, + titleElementPrefix); + metadata->set_namespace_declaration(extentElementUri, + extentElementPrefix); + metadata->set_namespace_declaration(liveSupportNamespaceUri, + liveSupportNamespacePrefix); } Ptr::Ref metadataString(new Glib::ustring(