adding more metadata checking stuff; this fixes #1802
This commit is contained in:
parent
df89686c16
commit
0bab7b928a
|
@ -143,7 +143,9 @@ CORE_LIB_OBJS = ${TMP_DIR}/UniqueId.o \
|
|||
${TMP_DIR}/FileTools.o \
|
||||
${TMP_DIR}/AsyncState.o \
|
||||
${TMP_DIR}/MetadataConstraint.o \
|
||||
${TMP_DIR}/NumericConstraint.o
|
||||
${TMP_DIR}/NumericConstraint.o \
|
||||
${TMP_DIR}/NumericRangeConstraint.o \
|
||||
${TMP_DIR}/EnumerationConstraint.o
|
||||
|
||||
TEST_RUNNER_OBJS = ${TMP_DIR}/TestRunner.o \
|
||||
${TMP_DIR}/FileToolsTest.o \
|
||||
|
|
|
@ -12,153 +12,201 @@
|
|||
<!ELEMENT constraint (value*) >
|
||||
<!ATTLIST constraint type NMTOKEN #REQUIRED >
|
||||
|
||||
<!ELEMENT value (CDATA) >
|
||||
<!ELEMENT value (#PCDATA) >
|
||||
|
||||
]>
|
||||
|
||||
<metadataTypeContainer>
|
||||
<metadataType dcName = "dc:title"
|
||||
id3Tag = "TIT2"
|
||||
localizationKey = "title"
|
||||
tab = "main"
|
||||
<metadataType dcName = "dc:title"
|
||||
id3Tag = "TIT2"
|
||||
localizationKey = "title"
|
||||
tab = "main"
|
||||
/>
|
||||
<metadataType dcName = "dc:creator"
|
||||
id3Tag = "TPE1"
|
||||
localizationKey = "creator"
|
||||
<metadataType dcName = "dc:creator"
|
||||
id3Tag = "TPE1"
|
||||
localizationKey = "creator"
|
||||
tab = "main"
|
||||
/>
|
||||
<metadataType dcName = "dc:source"
|
||||
id3Tag = "TALB"
|
||||
localizationKey = "album"
|
||||
<metadataType dcName = "dc:source"
|
||||
id3Tag = "TALB"
|
||||
localizationKey = "album"
|
||||
tab = "music"
|
||||
/>
|
||||
<metadataType dcName = "ls:year"
|
||||
id3Tag = "TYER"
|
||||
localizationKey = "year" >
|
||||
<constraint type = "numeric" />
|
||||
<metadataType dcName = "ls:year"
|
||||
id3Tag = "TYER"
|
||||
localizationKey = "year"
|
||||
tab = "music" >
|
||||
<constraint type = "numericRange" >
|
||||
<value>0</value>
|
||||
<value>3000</value>
|
||||
</constraint>
|
||||
</metadataType>
|
||||
<metadataType dcName = "dc:type"
|
||||
id3Tag = "TCON"
|
||||
localizationKey = "genre"
|
||||
<metadataType dcName = "dc:type"
|
||||
id3Tag = "TCON"
|
||||
localizationKey = "genre"
|
||||
tab = "main"
|
||||
/>
|
||||
<metadataType dcName = "dc:description"
|
||||
id3Tag = "COMM"
|
||||
localizationKey = "description"
|
||||
<metadataType dcName = "dc:description"
|
||||
id3Tag = "COMM"
|
||||
localizationKey = "description"
|
||||
tab = "main"
|
||||
/>
|
||||
<metadataType dcName = "dc:format"
|
||||
localizationKey = "format"
|
||||
/>
|
||||
<metadataType dcName = "ls:bpm"
|
||||
id3Tag = "TBPM"
|
||||
localizationKey = "bpm" >
|
||||
<constraint type = "numeric" />
|
||||
<metadataType dcName = "dc:format"
|
||||
localizationKey = "format" >
|
||||
<constraint type = "enumeration" >
|
||||
<value>mp3</value>
|
||||
<value>mpeg</value>
|
||||
<value>ogg</value>
|
||||
</constraint>
|
||||
</metadataType>
|
||||
<metadataType dcName = "ls:rating"
|
||||
id3Tag = "POPM"
|
||||
localizationKey = "rating"
|
||||
/>
|
||||
<metadataType dcName = "dcterms:extent"
|
||||
localizationKey = "length"
|
||||
/>
|
||||
<metadataType dcName = "ls:encoded_by"
|
||||
id3Tag = "TENC"
|
||||
localizationKey = "encoded_by"
|
||||
/>
|
||||
<metadataType dcName = "ls:track_num"
|
||||
id3Tag = "TRCK"
|
||||
localizationKey = "track_number" >
|
||||
<constraint type = "numeric" />
|
||||
<metadataType dcName = "ls:bpm"
|
||||
id3Tag = "TBPM"
|
||||
localizationKey = "bpm"
|
||||
tab = "music" >
|
||||
<constraint type = "numeric" />
|
||||
</metadataType>
|
||||
<metadataType dcName = "ls:disc_num"
|
||||
id3Tag = "TPOS"
|
||||
localizationKey = "disc_number" >
|
||||
<constraint type = "numeric" />
|
||||
<metadataType dcName = "ls:rating"
|
||||
id3Tag = "POPM"
|
||||
localizationKey = "rating"
|
||||
tab = "music"
|
||||
/>
|
||||
<metadataType dcName = "dcterms:extent"
|
||||
localizationKey = "length"
|
||||
/>
|
||||
<metadataType dcName = "ls:encoded_by"
|
||||
id3Tag = "TENC"
|
||||
localizationKey = "encoded_by"
|
||||
tab = "music"
|
||||
/>
|
||||
<metadataType dcName = "ls:track_num"
|
||||
id3Tag = "TRCK"
|
||||
localizationKey = "track_number"
|
||||
tab = "music" >
|
||||
<constraint type = "numeric" />
|
||||
</metadataType>
|
||||
<metadataType dcName = "ls:mood"
|
||||
id3Tag = "TMOO"
|
||||
localizationKey = "mood"
|
||||
/>
|
||||
<metadataType dcName = "dc:publisher"
|
||||
id3Tag = "TPUB"
|
||||
localizationKey = "publishing_label"
|
||||
/>
|
||||
<metadataType dcName = "ls:composer"
|
||||
id3Tag = "TCOM"
|
||||
localizationKey = "composer"
|
||||
/>
|
||||
<metadataType dcName = "ls:bitrate"
|
||||
localizationKey = "bitrate"
|
||||
/>
|
||||
<metadataType dcName = "ls:channels"
|
||||
localizationKey = "channels" >
|
||||
<constraint type = "numeric" />
|
||||
<metadataType dcName = "ls:disc_num"
|
||||
id3Tag = "TPOS"
|
||||
localizationKey = "disc_number"
|
||||
tab = "music" >
|
||||
<constraint type = "numeric" />
|
||||
</metadataType>
|
||||
<metadataType dcName = "ls:samplerate"
|
||||
localizationKey = "sample_rate" >
|
||||
<constraint type = "numeric" />
|
||||
<metadataType dcName = "ls:mood"
|
||||
id3Tag = "TMOO"
|
||||
localizationKey = "mood"
|
||||
tab = "music"
|
||||
/>
|
||||
<metadataType dcName = "dc:publisher"
|
||||
id3Tag = "TPUB"
|
||||
localizationKey = "publishing_label"
|
||||
tab = "music"
|
||||
/>
|
||||
<metadataType dcName = "ls:composer"
|
||||
id3Tag = "TCOM"
|
||||
localizationKey = "composer"
|
||||
tab = "music"
|
||||
/>
|
||||
<metadataType dcName = "ls:bitrate"
|
||||
localizationKey = "bitrate"
|
||||
tab = "music" >
|
||||
<constraint type = "numeric" />
|
||||
</metadataType>
|
||||
<metadataType dcName = "ls:encoder"
|
||||
id3Tag = "TSSE"
|
||||
localizationKey = "encoding_software"
|
||||
<metadataType dcName = "ls:channels"
|
||||
localizationKey = "channels"
|
||||
tab = "music"
|
||||
/>
|
||||
<metadataType dcName = "ls:crc"
|
||||
localizationKey = "checksum"
|
||||
<metadataType dcName = "ls:samplerate"
|
||||
localizationKey = "sample_rate"
|
||||
tab = "music" >
|
||||
<constraint type = "numeric" />
|
||||
</metadataType>
|
||||
<metadataType dcName = "ls:encoder"
|
||||
id3Tag = "TSSE"
|
||||
localizationKey = "encoding_software"
|
||||
tab = "music"
|
||||
/>
|
||||
<metadataType dcName = "ls:lyrics"
|
||||
localizationKey = "lyrics"
|
||||
<metadataType dcName = "ls:crc"
|
||||
localizationKey = "checksum"
|
||||
/>
|
||||
<metadataType dcName = "ls:orchestra"
|
||||
id3Tag = "TPE2"
|
||||
localizationKey = "orchestra_or_band"
|
||||
<metadataType dcName = "ls:lyrics"
|
||||
localizationKey = "lyrics"
|
||||
tab = "music"
|
||||
/>
|
||||
<metadataType dcName = "ls:conductor"
|
||||
id3Tag = "TPE3"
|
||||
localizationKey = "conductor"
|
||||
<metadataType dcName = "ls:orchestra"
|
||||
id3Tag = "TPE2"
|
||||
localizationKey = "orchestra_or_band"
|
||||
tab = "music"
|
||||
/>
|
||||
<metadataType dcName = "ls:lyricist"
|
||||
id3Tag = "TEXT"
|
||||
localizationKey = "lyricist"
|
||||
<metadataType dcName = "ls:conductor"
|
||||
id3Tag = "TPE3"
|
||||
localizationKey = "conductor"
|
||||
tab = "music"
|
||||
/>
|
||||
<metadataType dcName = "ls:originallyricist"
|
||||
id3Tag = "TOLY"
|
||||
localizationKey = "original_lyricist"
|
||||
<metadataType dcName = "ls:lyricist"
|
||||
id3Tag = "TEXT"
|
||||
localizationKey = "lyricist"
|
||||
tab = "music"
|
||||
/>
|
||||
<metadataType dcName = "ls:radiostationname"
|
||||
id3Tag = "TRSN"
|
||||
localizationKey = "radio_station_name"
|
||||
<metadataType dcName = "ls:originallyricist"
|
||||
id3Tag = "TOLY"
|
||||
localizationKey = "original_lyricist"
|
||||
tab = "music"
|
||||
/>
|
||||
<metadataType dcName = "ls:audiofileinfourl"
|
||||
id3Tag = "WOAF"
|
||||
localizationKey = "audio_file_info_url"
|
||||
<metadataType dcName = "ls:radiostationname"
|
||||
id3Tag = "TRSN"
|
||||
localizationKey = "radio_station_name"
|
||||
/>
|
||||
<metadataType dcName = "ls:artisturl"
|
||||
id3Tag = "WOAR"
|
||||
localizationKey = "artist_url"
|
||||
<metadataType dcName = "ls:audiofileinfourl"
|
||||
id3Tag = "WOAF"
|
||||
localizationKey = "audio_file_info_url"
|
||||
/>
|
||||
<metadataType dcName = "ls:audiosourceurl"
|
||||
id3Tag = "WOAS"
|
||||
localizationKey = "audio_source_url"
|
||||
<metadataType dcName = "ls:artisturl"
|
||||
id3Tag = "WOAR"
|
||||
localizationKey = "artist_url"
|
||||
/>
|
||||
<metadataType dcName = "ls:radiostationurl"
|
||||
id3Tag = "WORS"
|
||||
localizationKey = "radio_station_url"
|
||||
<metadataType dcName = "ls:audiosourceurl"
|
||||
id3Tag = "WOAS"
|
||||
localizationKey = "audio_source_url"
|
||||
/>
|
||||
<metadataType dcName = "ls:buycdurl"
|
||||
id3Tag = "WPAY"
|
||||
localizationKey = "buy_cd_url"
|
||||
<metadataType dcName = "ls:radiostationurl"
|
||||
id3Tag = "WORS"
|
||||
localizationKey = "radio_station_url"
|
||||
/>
|
||||
<metadataType dcName = "ls:isrcnumber"
|
||||
id3Tag = "TSRC"
|
||||
localizationKey = "isrc_number"
|
||||
<metadataType dcName = "ls:buycdurl"
|
||||
id3Tag = "WPAY"
|
||||
localizationKey = "buy_cd_url"
|
||||
/>
|
||||
<metadataType dcName = "ls:catalognumber"
|
||||
localizationKey = "catalog_number"
|
||||
<metadataType dcName = "ls:isrcnumber"
|
||||
id3Tag = "TSRC"
|
||||
localizationKey = "isrc_number"
|
||||
/>
|
||||
<metadataType dcName = "ls:originalartist"
|
||||
id3Tag = "TOPE"
|
||||
localizationKey = "original_artist"
|
||||
<metadataType dcName = "ls:catalognumber"
|
||||
localizationKey = "catalog_number"
|
||||
/>
|
||||
<metadataType dcName = "dc:rights"
|
||||
id3Tag = "TCOP"
|
||||
localizationKey = "copyright"
|
||||
<metadataType dcName = "ls:originalartist"
|
||||
id3Tag = "TOPE"
|
||||
localizationKey = "original_artist"
|
||||
tab = "music"
|
||||
/>
|
||||
<metadataType dcName = "dc:rights"
|
||||
id3Tag = "TCOP"
|
||||
localizationKey = "copyright"
|
||||
tab = "music"
|
||||
/>
|
||||
<metadataType dcName = "dcterms:temporal"
|
||||
localizationKey = "report_date_time"
|
||||
tab = "voice"
|
||||
/>
|
||||
<metadataType dcName = "dcterms:spatial"
|
||||
localizationKey = "report_location"
|
||||
tab = "voice"
|
||||
/>
|
||||
<metadataType dcName = "dcterms:entity"
|
||||
localizationKey = "report_organizations"
|
||||
tab = "voice"
|
||||
/>
|
||||
<metadataType dcName = "dc:subject"
|
||||
localizationKey = "subject"
|
||||
tab = "voice"
|
||||
/>
|
||||
</metadataTypeContainer>
|
||||
|
||||
|
|
|
@ -248,15 +248,15 @@ class MetadataTypeContainer : public Configurable,
|
|||
* If the metadata type has no constraints, it returns true.
|
||||
* If the constraint throws an exception, it returns false.
|
||||
*
|
||||
* @param dcName the metadata type, by its Dublin Core name.
|
||||
* @param value the value to be checked against the constraint.
|
||||
* @param dcName the metadata type, by its Dublin Core name.
|
||||
* @return true if the value satisfies the constraint.
|
||||
* @exception std::invalid_argument if no metadata type exists
|
||||
* with the suplied name.
|
||||
*/
|
||||
bool
|
||||
check(const Glib::ustring & dcName,
|
||||
Ptr<const Glib::ustring>::Ref value)
|
||||
check(Ptr<const Glib::ustring>::Ref value,
|
||||
const Glib::ustring & dcName)
|
||||
throw (std::invalid_argument);
|
||||
};
|
||||
|
||||
|
|
|
@ -0,0 +1,134 @@
|
|||
/*------------------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 2004 Media Development Loan Fund
|
||||
|
||||
This file is part of the LiveSupport project.
|
||||
http://livesupport.campware.org/
|
||||
To report bugs, send an e-mail to bugs@campware.org
|
||||
|
||||
LiveSupport is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
LiveSupport is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with LiveSupport; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
|
||||
Author : $Author$
|
||||
Version : $Revision$
|
||||
Location : $URL$
|
||||
|
||||
------------------------------------------------------------------------------*/
|
||||
|
||||
/* ============================================================ include files */
|
||||
|
||||
#include "EnumerationConstraint.h"
|
||||
|
||||
|
||||
using namespace LiveSupport::Core;
|
||||
|
||||
/* =================================================== local data structures */
|
||||
|
||||
|
||||
/* ================================================ local constants & macros */
|
||||
|
||||
namespace {
|
||||
|
||||
/*------------------------------------------------------------------------------
|
||||
* The value of the type attribute for this class.
|
||||
*----------------------------------------------------------------------------*/
|
||||
const std::string typeAttributeValue = "enumeration";
|
||||
|
||||
}
|
||||
|
||||
|
||||
/* =============================================== local function prototypes */
|
||||
|
||||
|
||||
/* ============================================================= module code */
|
||||
|
||||
/*------------------------------------------------------------------------------
|
||||
* Create a constraint element object based on an XML element.
|
||||
*----------------------------------------------------------------------------*/
|
||||
void
|
||||
EnumerationConstraint :: configure(const xmlpp::Element & element)
|
||||
throw (std::invalid_argument)
|
||||
{
|
||||
if (element.get_name() != getConfigElementName()) {
|
||||
throw std::invalid_argument("bad configuration element "
|
||||
+ element.get_name());
|
||||
}
|
||||
|
||||
const xmlpp::Attribute* typeAttribute;
|
||||
if (!(typeAttribute = element.get_attribute(typeAttributeName))) {
|
||||
throw std::invalid_argument("missing attribute " + typeAttributeName);
|
||||
}
|
||||
std::string type = typeAttribute->get_value();
|
||||
|
||||
if (type != typeAttributeValue) {
|
||||
throw std::invalid_argument(typeAttributeValue
|
||||
+ " constraint configured with a"
|
||||
+ " constraint element of type "
|
||||
+ type);
|
||||
}
|
||||
|
||||
xmlpp::Node::NodeList childNodes = element.get_children(valueElementName);
|
||||
xmlpp::Node::NodeList::iterator it = childNodes.begin();
|
||||
|
||||
if (it == childNodes.end()) {
|
||||
throw std::invalid_argument("empty enumeration constraint");
|
||||
}
|
||||
|
||||
for (; it != childNodes.end(); ++it) {
|
||||
readValue(*it);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*------------------------------------------------------------------------------
|
||||
* Read an enumeration value from an XML node.
|
||||
*----------------------------------------------------------------------------*/
|
||||
void
|
||||
EnumerationConstraint :: readValue(const xmlpp::Node * node)
|
||||
throw (std::invalid_argument)
|
||||
{
|
||||
const xmlpp::Element * valueElement
|
||||
= dynamic_cast<const xmlpp::Element*> (node);
|
||||
if (valueElement) {
|
||||
allowedValues.push_back(valueElement->get_child_text()
|
||||
->get_content() );
|
||||
} else {
|
||||
throw std::invalid_argument("bad sub-element found in constraint");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*------------------------------------------------------------------------------
|
||||
* Check that the given value satisfies the constraint.
|
||||
*----------------------------------------------------------------------------*/
|
||||
bool
|
||||
EnumerationConstraint :: check(Ptr<const Glib::ustring>::Ref value) const
|
||||
throw (std::logic_error)
|
||||
{
|
||||
if (!value) {
|
||||
throw std::logic_error("EnumerationConstraint::check() called with "
|
||||
"a 0 pointer value");
|
||||
}
|
||||
|
||||
ListType::const_iterator it;
|
||||
for (it = allowedValues.begin(); it != allowedValues.end(); ++it) {
|
||||
if (*it == *value) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
|
@ -0,0 +1,174 @@
|
|||
/*------------------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 2004 Media Development Loan Fund
|
||||
|
||||
This file is part of the LiveSupport project.
|
||||
http://livesupport.campware.org/
|
||||
To report bugs, send an e-mail to bugs@campware.org
|
||||
|
||||
LiveSupport is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
LiveSupport is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with LiveSupport; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
|
||||
Author : $Author$
|
||||
Version : $Revision$
|
||||
Location : $URL$
|
||||
|
||||
------------------------------------------------------------------------------*/
|
||||
#ifndef LiveSupport_Core_EnumerationConstraint_h
|
||||
#define LiveSupport_Core_EnumerationConstraint_h
|
||||
|
||||
#ifndef __cplusplus
|
||||
#error This is a C++ include file
|
||||
#endif
|
||||
|
||||
|
||||
/* ============================================================ include files */
|
||||
|
||||
#include "LiveSupport/Core/MetadataConstraint.h"
|
||||
|
||||
|
||||
namespace LiveSupport {
|
||||
namespace Core {
|
||||
|
||||
|
||||
/* ================================================================ constants */
|
||||
|
||||
|
||||
/* =================================================================== macros */
|
||||
|
||||
|
||||
/* =============================================================== data types */
|
||||
|
||||
/**
|
||||
* A class for representing a metadata constraint allowing only strings from
|
||||
* a given list of values.
|
||||
*
|
||||
* This is a concrete subclass of MetadataConstraint. Do not explicitly
|
||||
* instantiate this class; create a MetadataConstraint object instead, and
|
||||
* configure it with an XML element with the appropriate type attribute.
|
||||
*
|
||||
* This object has to be configured with an XML configuration element
|
||||
* called constraint. This may look like the following:
|
||||
*
|
||||
* <pre><code>
|
||||
* <constraint type = "enumeration">
|
||||
* <value>Monday</value>
|
||||
* ...
|
||||
* <value>Sunday</value>
|
||||
* </constraint>
|
||||
* </code></pre>
|
||||
*
|
||||
* A metadata type with this kind of constraint can only accept one of the
|
||||
* strings listed in the value elements (in a case-sensitive way).
|
||||
*
|
||||
* The DTD for the expected XML element looks like the following:
|
||||
*
|
||||
* <pre><code>
|
||||
* <!ELEMENT constraint (value+) >
|
||||
* <!ATTLIST constraint type "enumeration" #FIXED >
|
||||
* <!ELEMENT value (#PCDATA) >
|
||||
* </code></pre>
|
||||
*
|
||||
* @author $Author$
|
||||
* @version $Revision$
|
||||
* @see EnumerationConstraintContainer
|
||||
*/
|
||||
class EnumerationConstraint : public MetadataConstraint
|
||||
{
|
||||
private:
|
||||
/**
|
||||
* The type for storing the enumeration values.
|
||||
*/
|
||||
typedef std::vector<Glib::ustring> ListType;
|
||||
|
||||
/**
|
||||
* The list of allowed enumeration values.
|
||||
*/
|
||||
ListType allowedValues;
|
||||
|
||||
/**
|
||||
* Read an enumeration value from an XML node.
|
||||
*
|
||||
* @param node the node containing the value.
|
||||
* @exception std::invalid_argument if the XML node is not
|
||||
* of the expected form.
|
||||
*/
|
||||
void
|
||||
readValue(const xmlpp::Node * node) throw (std::invalid_argument);
|
||||
|
||||
|
||||
public:
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
EnumerationConstraint() throw ()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* A virtual destructor, as this class has virtual functions.
|
||||
*/
|
||||
virtual
|
||||
~EnumerationConstraint(void) throw ()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the name of the XML element this object expects
|
||||
* to be sent to a call to configure().
|
||||
*
|
||||
* @return the name of the expected XML configuration element.
|
||||
*/
|
||||
static const std::string
|
||||
getConfigElementName(void) throw ()
|
||||
{
|
||||
return MetadataConstraint::getConfigElementName();
|
||||
}
|
||||
|
||||
/**
|
||||
* Configure the metadata object based on an XML configuration element.
|
||||
*
|
||||
* @param elemen the XML configuration element.
|
||||
* @exception std::invalid_argument of the supplied XML element
|
||||
* contains bad configuration information
|
||||
*/
|
||||
virtual void
|
||||
configure(const xmlpp::Element &element)
|
||||
throw (std::invalid_argument);
|
||||
|
||||
/**
|
||||
* Check that the given value satisfies the constraint.
|
||||
*
|
||||
* @param value the value to be checked against the constraint.
|
||||
* @return true if the value satisfies the constraint.
|
||||
* @exception std::logic_error if the parameter is a 0 pointer.
|
||||
*/
|
||||
virtual bool
|
||||
check(Ptr<const Glib::ustring>::Ref value) const
|
||||
throw (std::logic_error);
|
||||
};
|
||||
|
||||
|
||||
/* ================================================= external data structures */
|
||||
|
||||
|
||||
/* ====================================================== function prototypes */
|
||||
|
||||
|
||||
} // namespace Core
|
||||
} // namespace LiveSupport
|
||||
|
||||
#endif // LiveSupport_Core_EnumerationConstraint_h
|
||||
|
|
@ -29,8 +29,11 @@
|
|||
|
||||
/* ============================================================ include files */
|
||||
|
||||
#include "LiveSupport/Core/MetadataConstraint.h"
|
||||
#include "NumericConstraint.h"
|
||||
#include "NumericRangeConstraint.h"
|
||||
#include "EnumerationConstraint.h"
|
||||
|
||||
#include "LiveSupport/Core/MetadataConstraint.h"
|
||||
|
||||
|
||||
using namespace LiveSupport::Core;
|
||||
|
@ -83,6 +86,14 @@ MetadataConstraint :: configure(const xmlpp::Element & element)
|
|||
concreteConstraint.reset(new NumericConstraint());
|
||||
concreteConstraint->configure(element);
|
||||
|
||||
} else if (type == "numericRange") {
|
||||
concreteConstraint.reset(new NumericRangeConstraint());
|
||||
concreteConstraint->configure(element);
|
||||
|
||||
} else if (type == "enumeration") {
|
||||
concreteConstraint.reset(new EnumerationConstraint());
|
||||
concreteConstraint->configure(element);
|
||||
|
||||
} else {
|
||||
throw std::invalid_argument("unknown metadata constraint" + type);
|
||||
}
|
||||
|
|
|
@ -161,8 +161,8 @@ MetadataTypeContainer :: getById3Tag(const Glib::ustring id3Tag)
|
|||
* Check that the given value satisfies the constraint of a metadata type.
|
||||
*----------------------------------------------------------------------------*/
|
||||
bool
|
||||
MetadataTypeContainer :: check(const Glib::ustring & dcName,
|
||||
Ptr<const Glib::ustring>::Ref value)
|
||||
MetadataTypeContainer :: check(Ptr<const Glib::ustring>::Ref value,
|
||||
const Glib::ustring & dcName)
|
||||
throw (std::invalid_argument)
|
||||
{
|
||||
Ptr<const MetadataType>::Ref metadataType = getByDcName(dcName);
|
||||
|
|
|
@ -314,16 +314,30 @@ MetadataTypeContainerTest :: constraintTest(void)
|
|||
{
|
||||
// test the case of no constraint; everything is OK
|
||||
Ptr<Glib::ustring>::Ref title;
|
||||
CPPUNIT_ASSERT(!container->check("dc:title", title)); // except a 0 pointer
|
||||
CPPUNIT_ASSERT(!container->check(title, "dc:title")); // except a 0 pointer
|
||||
title.reset(new Glib::ustring("Some title"));
|
||||
CPPUNIT_ASSERT(container->check("dc:title", title));
|
||||
CPPUNIT_ASSERT(container->check(title, "dc:title"));
|
||||
|
||||
// test the numeric constraint; [0-9]+ required
|
||||
Ptr<Glib::ustring>::Ref bpm(new Glib::ustring ("1000"));
|
||||
CPPUNIT_ASSERT(container->check(bpm, "ls:bpm"));
|
||||
bpm->assign("2000 or more");
|
||||
CPPUNIT_ASSERT(!container->check(bpm, "ls:bpm"));
|
||||
bpm->assign("");
|
||||
CPPUNIT_ASSERT(!container->check(bpm, "ls:bpm"));
|
||||
|
||||
// test the numeric range constraint; [0-9]+ required, between 0 and 3000
|
||||
Ptr<Glib::ustring>::Ref year(new Glib::ustring ("1000"));
|
||||
CPPUNIT_ASSERT(container->check("ls:bpm", year));
|
||||
year->assign("2000 or more");
|
||||
CPPUNIT_ASSERT(!container->check("ls:bpm", year));
|
||||
year->assign("");
|
||||
CPPUNIT_ASSERT(!container->check("ls:bpm", year));
|
||||
CPPUNIT_ASSERT(container->check(year, "ls:year"));
|
||||
year->assign("1066 AD");
|
||||
CPPUNIT_ASSERT(!container->check(year, "ls:year"));
|
||||
year->assign("20066");
|
||||
CPPUNIT_ASSERT(!container->check(year, "ls:year"));
|
||||
|
||||
// test the enumeration constraint; "mp3", "mpeg" or "ogg" are allowed
|
||||
Ptr<Glib::ustring>::Ref format(new Glib::ustring ("mp3"));
|
||||
CPPUNIT_ASSERT(container->check(format, "dc:format"));
|
||||
format->assign("wma");
|
||||
CPPUNIT_ASSERT(!container->check(format, "dc:format"));
|
||||
}
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@ using namespace LiveSupport::Core;
|
|||
namespace {
|
||||
|
||||
/*------------------------------------------------------------------------------
|
||||
* The value of the type attribute for this class
|
||||
* The value of the type attribute for this class.
|
||||
*----------------------------------------------------------------------------*/
|
||||
const std::string typeAttributeValue = "numeric";
|
||||
|
||||
|
@ -61,7 +61,7 @@ void
|
|||
NumericConstraint :: configure(const xmlpp::Element & element)
|
||||
throw (std::invalid_argument)
|
||||
{
|
||||
if (element.get_name() != MetadataConstraint::getConfigElementName()) {
|
||||
if (element.get_name() != getConfigElementName()) {
|
||||
throw std::invalid_argument("bad configuration element "
|
||||
+ element.get_name());
|
||||
}
|
||||
|
@ -73,8 +73,10 @@ NumericConstraint :: configure(const xmlpp::Element & element)
|
|||
std::string type = typeAttribute->get_value();
|
||||
|
||||
if (type != typeAttributeValue) {
|
||||
throw std::invalid_argument("numeric constraint configured with a "
|
||||
"constraint element of type " + type);
|
||||
throw std::invalid_argument(typeAttributeValue
|
||||
+ " constraint configured with a"
|
||||
+ " constraint element of type "
|
||||
+ type);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -54,8 +54,8 @@ namespace Core {
|
|||
/**
|
||||
* A class for representing a numeric metadata constraint.
|
||||
*
|
||||
* This is a concrete subclass of NumericConstraint. Do not explicitly
|
||||
* instantiate this class; create a NumericConstraint object instead, and
|
||||
* This is a concrete subclass of MetadataConstraint. Do not explicitly
|
||||
* instantiate this class; create a MetadataConstraint object instead, and
|
||||
* configure it with an XML element with the appropriate type attribute.
|
||||
*
|
||||
* This object has to be configured with an XML configuration element
|
||||
|
@ -81,13 +81,6 @@ namespace Core {
|
|||
*/
|
||||
class NumericConstraint : public MetadataConstraint
|
||||
{
|
||||
private:
|
||||
/**
|
||||
* The name of the configuration XML element used by NumericConstraint.
|
||||
*/
|
||||
static const std::string configElementNameStr;
|
||||
|
||||
|
||||
public:
|
||||
/**
|
||||
* Constructor.
|
||||
|
@ -113,7 +106,7 @@ class NumericConstraint : public MetadataConstraint
|
|||
static const std::string
|
||||
getConfigElementName(void) throw ()
|
||||
{
|
||||
return configElementNameStr;
|
||||
return MetadataConstraint::getConfigElementName();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -0,0 +1,161 @@
|
|||
/*------------------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 2004 Media Development Loan Fund
|
||||
|
||||
This file is part of the LiveSupport project.
|
||||
http://livesupport.campware.org/
|
||||
To report bugs, send an e-mail to bugs@campware.org
|
||||
|
||||
LiveSupport is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
LiveSupport is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with LiveSupport; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
|
||||
Author : $Author$
|
||||
Version : $Revision$
|
||||
Location : $URL$
|
||||
|
||||
------------------------------------------------------------------------------*/
|
||||
|
||||
/* ============================================================ include files */
|
||||
|
||||
#include <sstream>
|
||||
|
||||
#include "NumericConstraint.h"
|
||||
|
||||
#include "NumericRangeConstraint.h"
|
||||
|
||||
|
||||
using namespace LiveSupport::Core;
|
||||
|
||||
/* =================================================== local data structures */
|
||||
|
||||
|
||||
/* ================================================ local constants & macros */
|
||||
|
||||
namespace {
|
||||
|
||||
/*------------------------------------------------------------------------------
|
||||
* The value of the type attribute for this class.
|
||||
*----------------------------------------------------------------------------*/
|
||||
const std::string typeAttributeValue = "numericRange";
|
||||
|
||||
}
|
||||
|
||||
|
||||
/* =============================================== local function prototypes */
|
||||
|
||||
|
||||
/* ============================================================= module code */
|
||||
|
||||
/*------------------------------------------------------------------------------
|
||||
* Create a constraint element object based on an XML element.
|
||||
*----------------------------------------------------------------------------*/
|
||||
void
|
||||
NumericRangeConstraint :: configure(const xmlpp::Element & element)
|
||||
throw (std::invalid_argument)
|
||||
{
|
||||
if (element.get_name() != getConfigElementName()) {
|
||||
throw std::invalid_argument("bad configuration element "
|
||||
+ element.get_name());
|
||||
}
|
||||
|
||||
const xmlpp::Attribute* typeAttribute;
|
||||
if (!(typeAttribute = element.get_attribute(typeAttributeName))) {
|
||||
throw std::invalid_argument("missing attribute " + typeAttributeName);
|
||||
}
|
||||
std::string type = typeAttribute->get_value();
|
||||
|
||||
if (type != typeAttributeValue) {
|
||||
throw std::invalid_argument(typeAttributeValue
|
||||
+ " constraint configured with a"
|
||||
+ " constraint element of type "
|
||||
+ type);
|
||||
}
|
||||
|
||||
xmlpp::Node::NodeList childNodes = element.get_children(valueElementName);
|
||||
xmlpp::Node::NodeList::iterator it = childNodes.begin();
|
||||
|
||||
if (it != childNodes.end()) {
|
||||
minValue = readNumberFromNode(*it);
|
||||
} else {
|
||||
throw std::invalid_argument("sub-element not found in constraint");
|
||||
}
|
||||
|
||||
++it;
|
||||
if (it != childNodes.end()) {
|
||||
maxValue = readNumberFromNode(*it);
|
||||
} else {
|
||||
throw std::invalid_argument("sub-element not found in constraint");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*------------------------------------------------------------------------------
|
||||
* Read a number from an xml element.
|
||||
*----------------------------------------------------------------------------*/
|
||||
NumericRangeConstraint :: ValueType
|
||||
NumericRangeConstraint :: readNumberFromNode(
|
||||
const xmlpp::Node * node) const
|
||||
throw (std::invalid_argument)
|
||||
{
|
||||
const xmlpp::Element * valueElement
|
||||
= dynamic_cast<const xmlpp::Element*> (node);
|
||||
if (valueElement) {
|
||||
Ptr<Glib::ustring>::Ref value(new Glib::ustring(
|
||||
valueElement->get_child_text()
|
||||
->get_content() ));
|
||||
return readNumber(value);
|
||||
} else {
|
||||
throw std::invalid_argument("bad sub-element found in constraint");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*------------------------------------------------------------------------------
|
||||
* Read a number from a string.
|
||||
*----------------------------------------------------------------------------*/
|
||||
NumericRangeConstraint :: ValueType
|
||||
NumericRangeConstraint :: readNumber(
|
||||
Ptr<const Glib::ustring>::Ref value) const
|
||||
throw (std::invalid_argument)
|
||||
{
|
||||
NumericConstraint numericConstraint;
|
||||
if (!numericConstraint.check(value)) {
|
||||
throw std::invalid_argument("bad number found in constraint");
|
||||
}
|
||||
|
||||
std::istringstream valueStream(*value);
|
||||
ValueType valueNumber;
|
||||
valueStream >> valueNumber;
|
||||
|
||||
return valueNumber;
|
||||
}
|
||||
|
||||
|
||||
/*------------------------------------------------------------------------------
|
||||
* Check that the given value satisfies the constraint.
|
||||
*----------------------------------------------------------------------------*/
|
||||
bool
|
||||
NumericRangeConstraint :: check(Ptr<const Glib::ustring>::Ref value) const
|
||||
throw (std::logic_error)
|
||||
{
|
||||
ValueType valueNumber = readNumber(value);
|
||||
|
||||
if (valueNumber >= minValue && valueNumber <= maxValue) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,194 @@
|
|||
/*------------------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 2004 Media Development Loan Fund
|
||||
|
||||
This file is part of the LiveSupport project.
|
||||
http://livesupport.campware.org/
|
||||
To report bugs, send an e-mail to bugs@campware.org
|
||||
|
||||
LiveSupport is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
LiveSupport is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with LiveSupport; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
|
||||
Author : $Author$
|
||||
Version : $Revision$
|
||||
Location : $URL$
|
||||
|
||||
------------------------------------------------------------------------------*/
|
||||
#ifndef LiveSupport_Core_NumericRangeConstraint_h
|
||||
#define LiveSupport_Core_NumericRangeConstraint_h
|
||||
|
||||
#ifndef __cplusplus
|
||||
#error This is a C++ include file
|
||||
#endif
|
||||
|
||||
|
||||
/* ============================================================ include files */
|
||||
|
||||
#include "LiveSupport/Core/MetadataConstraint.h"
|
||||
|
||||
|
||||
namespace LiveSupport {
|
||||
namespace Core {
|
||||
|
||||
|
||||
/* ================================================================ constants */
|
||||
|
||||
|
||||
/* =================================================================== macros */
|
||||
|
||||
|
||||
/* =============================================================== data types */
|
||||
|
||||
/**
|
||||
* A class for representing a metadata constraint which allows numbers between
|
||||
* two given values (inclusive).
|
||||
*
|
||||
* This is a concrete subclass of MetadataConstraint. Do not explicitly
|
||||
* instantiate this class; create a MetadataConstraint object instead, and
|
||||
* configure it with an XML element with the appropriate type attribute.
|
||||
*
|
||||
* This object has to be configured with an XML configuration element
|
||||
* called constraint. This may look like the following:
|
||||
*
|
||||
* <pre><code>
|
||||
* <constraint type = "numericRange">
|
||||
* <value>1</value>
|
||||
* <value>12</value>
|
||||
* </constraint>
|
||||
* </code></pre>
|
||||
*
|
||||
* A metadata type with this kind of constraint can only accept (decimal,
|
||||
* non-negative) integer values, i.e., [0-9]+, which are greater than or
|
||||
* equal to the first value given, and less than or equal to the second
|
||||
* value given.
|
||||
*
|
||||
* The DTD for the expected XML element looks like the following:
|
||||
*
|
||||
* <pre><code>
|
||||
* <!ELEMENT constraint (value, value) >
|
||||
* <!ATTLIST constraint type "numericRange" #FIXED >
|
||||
* <!ELEMENT value (#PCDATA) >
|
||||
* </code></pre>
|
||||
*
|
||||
* @author $Author$
|
||||
* @version $Revision$
|
||||
* @see NumericRangeConstraintContainer
|
||||
*/
|
||||
class NumericRangeConstraint : public MetadataConstraint
|
||||
{
|
||||
private:
|
||||
/**
|
||||
* The integer type used by the constraint.
|
||||
*/
|
||||
typedef unsigned long long ValueType;
|
||||
|
||||
/**
|
||||
* The smallest value allowed by the constraint.
|
||||
*/
|
||||
ValueType minValue;
|
||||
|
||||
/**
|
||||
* The largest value allowed by the constraint.
|
||||
*/
|
||||
ValueType maxValue;
|
||||
|
||||
/**
|
||||
* Read a number from an XML node.
|
||||
*
|
||||
* @param node the node containing the number.
|
||||
* @return the number read from the node.
|
||||
* @exception std::invalid_argument if the XML node is not
|
||||
* of the expected form.
|
||||
*/
|
||||
ValueType
|
||||
readNumberFromNode(const xmlpp::Node * node) const
|
||||
throw (std::invalid_argument);
|
||||
|
||||
/**
|
||||
* Read a number from a string.
|
||||
*
|
||||
* @param value the string containing the number.
|
||||
* @return the number read from the string.
|
||||
* @exception std::invalid_argument if the string does not contain
|
||||
* a number.
|
||||
*/
|
||||
ValueType
|
||||
readNumber(Ptr<const Glib::ustring>::Ref value) const
|
||||
throw (std::invalid_argument);
|
||||
|
||||
|
||||
public:
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
NumericRangeConstraint() throw ()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* A virtual destructor, as this class has virtual functions.
|
||||
*/
|
||||
virtual
|
||||
~NumericRangeConstraint(void) throw ()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the name of the XML element this object expects
|
||||
* to be sent to a call to configure().
|
||||
*
|
||||
* @return the name of the expected XML configuration element.
|
||||
*/
|
||||
static const std::string
|
||||
getConfigElementName(void) throw ()
|
||||
{
|
||||
return MetadataConstraint::getConfigElementName();
|
||||
}
|
||||
|
||||
/**
|
||||
* Configure the metadata object based on an XML configuration element.
|
||||
*
|
||||
* @param elemen the XML configuration element.
|
||||
* @exception std::invalid_argument of the supplied XML element
|
||||
* contains bad configuration information
|
||||
*/
|
||||
virtual void
|
||||
configure(const xmlpp::Element &element)
|
||||
throw (std::invalid_argument);
|
||||
|
||||
/**
|
||||
* Check that the given value satisfies the constraint.
|
||||
*
|
||||
* @param value the value to be checked against the constraint.
|
||||
* @return true if the value satisfies the constraint.
|
||||
* @exception std::logic_error if the parameter is a 0 pointer.
|
||||
*/
|
||||
virtual bool
|
||||
check(Ptr<const Glib::ustring>::Ref value) const
|
||||
throw (std::logic_error);
|
||||
};
|
||||
|
||||
|
||||
/* ================================================= external data structures */
|
||||
|
||||
|
||||
/* ====================================================== function prototypes */
|
||||
|
||||
|
||||
} // namespace Core
|
||||
} // namespace LiveSupport
|
||||
|
||||
#endif // LiveSupport_Core_NumericRangeConstraint_h
|
||||
|
|
@ -89,20 +89,25 @@
|
|||
<!ELEMENT gstreamerPlayer EMPTY >
|
||||
<!ATTLIST gstreamerPlayer audioDevice CDATA #IMPLIED >
|
||||
|
||||
<!ELEMENT metadataTypeContainer (metadataType+) >
|
||||
|
||||
<!ELEMENT stationLogo EMPTY >
|
||||
<!ATTLIST stationLogo path CDATA #REQUIRED >
|
||||
|
||||
<!ELEMENT testAudioUrl EMPTY >
|
||||
<!ATTLIST testAudioUrl path CDATA #REQUIRED >
|
||||
|
||||
<!ELEMENT metadataType EMPTY >
|
||||
<!ELEMENT metadataTypeContainer (metadataType+) >
|
||||
|
||||
<!ELEMENT metadataType (constraint?) >
|
||||
<!ATTLIST metadataType dcName NMTOKEN #REQUIRED >
|
||||
<!ATTLIST metadataType id3Tag CDATA #IMPLIED >
|
||||
<!ATTLIST metadataType localizationKey NMTOKEN #REQUIRED >
|
||||
<!ATTLIST metadataType localizationKey CDATA #REQUIRED >
|
||||
<!ATTLIST metadataType tab NMTOKEN #IMPLIED >
|
||||
|
||||
<!ELEMENT constraint (value*) >
|
||||
<!ATTLIST constraint type NMTOKEN #REQUIRED >
|
||||
|
||||
<!ELEMENT value (#PCDATA) >
|
||||
|
||||
<!ELEMENT keyboardShortcutList (keyboardShortcutContainer*) >
|
||||
<!ELEMENT keyboardShortcutContainer (keyboardShortcut+) >
|
||||
<!ATTLIST keyboardShortcutContainer windowName CDATA #REQUIRED >
|
||||
|
@ -178,182 +183,196 @@
|
|||
<testAudioUrl path = "file://var/testAudio.ogg" />
|
||||
|
||||
<metadataTypeContainer>
|
||||
<metadataType dcName = "dc:title"
|
||||
id3Tag = "TIT2"
|
||||
localizationKey = "title"
|
||||
tab = "main"
|
||||
<metadataType dcName = "dc:title"
|
||||
id3Tag = "TIT2"
|
||||
localizationKey = "title"
|
||||
tab = "main"
|
||||
/>
|
||||
<metadataType dcName = "dc:creator"
|
||||
id3Tag = "TPE1"
|
||||
localizationKey = "creator"
|
||||
tab = "main"
|
||||
<metadataType dcName = "dc:creator"
|
||||
id3Tag = "TPE1"
|
||||
localizationKey = "creator"
|
||||
tab = "main"
|
||||
/>
|
||||
<metadataType dcName = "dc:source"
|
||||
id3Tag = "TALB"
|
||||
localizationKey = "album"
|
||||
tab = "music"
|
||||
<metadataType dcName = "dc:source"
|
||||
id3Tag = "TALB"
|
||||
localizationKey = "album"
|
||||
tab = "music"
|
||||
/>
|
||||
<metadataType dcName = "ls:year"
|
||||
id3Tag = "TYER"
|
||||
localizationKey = "year"
|
||||
tab = "music"
|
||||
<metadataType dcName = "ls:year"
|
||||
id3Tag = "TYER"
|
||||
localizationKey = "year"
|
||||
tab = "music" >
|
||||
<constraint type = "numericRange" >
|
||||
<value>0</value>
|
||||
<value>3000</value>
|
||||
</constraint>
|
||||
</metadataType>
|
||||
<metadataType dcName = "dc:type"
|
||||
id3Tag = "TCON"
|
||||
localizationKey = "genre"
|
||||
tab = "main"
|
||||
/>
|
||||
<metadataType dcName = "dc:type"
|
||||
id3Tag = "TCON"
|
||||
localizationKey = "genre"
|
||||
tab = "main"
|
||||
<metadataType dcName = "dc:description"
|
||||
id3Tag = "COMM"
|
||||
localizationKey = "description"
|
||||
tab = "main"
|
||||
/>
|
||||
<metadataType dcName = "dc:description"
|
||||
id3Tag = "COMM"
|
||||
localizationKey = "description"
|
||||
tab = "main"
|
||||
<metadataType dcName = "dc:format"
|
||||
localizationKey = "format" >
|
||||
<constraint type = "enumeration" >
|
||||
<value>mp3</value>
|
||||
<value>mpeg</value>
|
||||
<value>ogg</value>
|
||||
</constraint>
|
||||
</metadataType>
|
||||
<metadataType dcName = "ls:bpm"
|
||||
id3Tag = "TBPM"
|
||||
localizationKey = "bpm"
|
||||
tab = "music" >
|
||||
<constraint type = "numeric" />
|
||||
</metadataType>
|
||||
<metadataType dcName = "ls:rating"
|
||||
id3Tag = "POPM"
|
||||
localizationKey = "rating"
|
||||
tab = "music"
|
||||
/>
|
||||
<metadataType dcName = "dc:format"
|
||||
localizationKey = "format"
|
||||
<metadataType dcName = "dcterms:extent"
|
||||
localizationKey = "length"
|
||||
/>
|
||||
<metadataType dcName = "ls:bpm"
|
||||
id3Tag = "TBPM"
|
||||
localizationKey = "bpm"
|
||||
tab = "music"
|
||||
<metadataType dcName = "ls:encoded_by"
|
||||
id3Tag = "TENC"
|
||||
localizationKey = "encoded_by"
|
||||
tab = "music"
|
||||
/>
|
||||
<metadataType dcName = "ls:rating"
|
||||
id3Tag = "POPM"
|
||||
localizationKey = "rating"
|
||||
tab = "music"
|
||||
<metadataType dcName = "ls:track_num"
|
||||
id3Tag = "TRCK"
|
||||
localizationKey = "track_number"
|
||||
tab = "music" >
|
||||
<constraint type = "numeric" />
|
||||
</metadataType>
|
||||
<metadataType dcName = "ls:disc_num"
|
||||
id3Tag = "TPOS"
|
||||
localizationKey = "disc_number"
|
||||
tab = "music" >
|
||||
<constraint type = "numeric" />
|
||||
</metadataType>
|
||||
<metadataType dcName = "ls:mood"
|
||||
id3Tag = "TMOO"
|
||||
localizationKey = "mood"
|
||||
tab = "music"
|
||||
/>
|
||||
<metadataType dcName = "dcterms:extent"
|
||||
localizationKey = "length"
|
||||
<metadataType dcName = "dc:publisher"
|
||||
id3Tag = "TPUB"
|
||||
localizationKey = "publishing_label"
|
||||
tab = "music"
|
||||
/>
|
||||
<metadataType dcName = "ls:encoded_by"
|
||||
id3Tag = "TENC"
|
||||
localizationKey = "encoded_by"
|
||||
tab = "music"
|
||||
<metadataType dcName = "ls:composer"
|
||||
id3Tag = "TCOM"
|
||||
localizationKey = "composer"
|
||||
tab = "music"
|
||||
/>
|
||||
<metadataType dcName = "ls:track_num"
|
||||
id3Tag = "TRCK"
|
||||
localizationKey = "track_number"
|
||||
tab = "music"
|
||||
<metadataType dcName = "ls:bitrate"
|
||||
localizationKey = "bitrate"
|
||||
tab = "music" >
|
||||
<constraint type = "numeric" />
|
||||
</metadataType>
|
||||
<metadataType dcName = "ls:channels"
|
||||
localizationKey = "channels"
|
||||
tab = "music"
|
||||
/>
|
||||
<metadataType dcName = "ls:disc_num"
|
||||
id3Tag = "TPOS"
|
||||
localizationKey = "disc_number"
|
||||
tab = "music"
|
||||
<metadataType dcName = "ls:samplerate"
|
||||
localizationKey = "sample_rate"
|
||||
tab = "music" >
|
||||
<constraint type = "numeric" />
|
||||
</metadataType>
|
||||
<metadataType dcName = "ls:encoder"
|
||||
id3Tag = "TSSE"
|
||||
localizationKey = "encoding_software"
|
||||
tab = "music"
|
||||
/>
|
||||
<metadataType dcName = "ls:mood"
|
||||
id3Tag = "TMOO"
|
||||
localizationKey = "mood"
|
||||
tab = "music"
|
||||
<metadataType dcName = "ls:crc"
|
||||
localizationKey = "checksum"
|
||||
/>
|
||||
<metadataType dcName = "dc:publisher"
|
||||
id3Tag = "TPUB"
|
||||
localizationKey = "publishing_label"
|
||||
tab = "music"
|
||||
<metadataType dcName = "ls:lyrics"
|
||||
localizationKey = "lyrics"
|
||||
tab = "music"
|
||||
/>
|
||||
<metadataType dcName = "ls:composer"
|
||||
id3Tag = "TCOM"
|
||||
localizationKey = "composer"
|
||||
tab = "music"
|
||||
<metadataType dcName = "ls:orchestra"
|
||||
id3Tag = "TPE2"
|
||||
localizationKey = "orchestra_or_band"
|
||||
tab = "music"
|
||||
/>
|
||||
<metadataType dcName = "ls:bitrate"
|
||||
localizationKey = "bitrate"
|
||||
tab = "music"
|
||||
<metadataType dcName = "ls:conductor"
|
||||
id3Tag = "TPE3"
|
||||
localizationKey = "conductor"
|
||||
tab = "music"
|
||||
/>
|
||||
<metadataType dcName = "ls:channels"
|
||||
localizationKey = "channels"
|
||||
tab = "music"
|
||||
<metadataType dcName = "ls:lyricist"
|
||||
id3Tag = "TEXT"
|
||||
localizationKey = "lyricist"
|
||||
tab = "music"
|
||||
/>
|
||||
<metadataType dcName = "ls:samplerate"
|
||||
localizationKey = "sample_rate"
|
||||
tab = "music"
|
||||
<metadataType dcName = "ls:originallyricist"
|
||||
id3Tag = "TOLY"
|
||||
localizationKey = "original_lyricist"
|
||||
tab = "music"
|
||||
/>
|
||||
<metadataType dcName = "ls:encoder"
|
||||
id3Tag = "TSSE"
|
||||
localizationKey = "encoding_software"
|
||||
tab = "music"
|
||||
<metadataType dcName = "ls:radiostationname"
|
||||
id3Tag = "TRSN"
|
||||
localizationKey = "radio_station_name"
|
||||
/>
|
||||
<metadataType dcName = "ls:crc"
|
||||
localizationKey = "checksum"
|
||||
<metadataType dcName = "ls:audiofileinfourl"
|
||||
id3Tag = "WOAF"
|
||||
localizationKey = "audio_file_info_url"
|
||||
/>
|
||||
<metadataType dcName = "ls:lyrics"
|
||||
localizationKey = "lyrics"
|
||||
tab = "music"
|
||||
<metadataType dcName = "ls:artisturl"
|
||||
id3Tag = "WOAR"
|
||||
localizationKey = "artist_url"
|
||||
/>
|
||||
<metadataType dcName = "ls:orchestra"
|
||||
id3Tag = "TPE2"
|
||||
localizationKey = "orchestra_or_band"
|
||||
tab = "music"
|
||||
<metadataType dcName = "ls:audiosourceurl"
|
||||
id3Tag = "WOAS"
|
||||
localizationKey = "audio_source_url"
|
||||
/>
|
||||
<metadataType dcName = "ls:conductor"
|
||||
id3Tag = "TPE3"
|
||||
localizationKey = "conductor"
|
||||
tab = "music"
|
||||
<metadataType dcName = "ls:radiostationurl"
|
||||
id3Tag = "WORS"
|
||||
localizationKey = "radio_station_url"
|
||||
/>
|
||||
<metadataType dcName = "ls:lyricist"
|
||||
id3Tag = "TEXT"
|
||||
localizationKey = "lyricist"
|
||||
tab = "music"
|
||||
<metadataType dcName = "ls:buycdurl"
|
||||
id3Tag = "WPAY"
|
||||
localizationKey = "buy_cd_url"
|
||||
/>
|
||||
<metadataType dcName = "ls:originallyricist"
|
||||
id3Tag = "TOLY"
|
||||
localizationKey = "original_lyricist"
|
||||
tab = "music"
|
||||
<metadataType dcName = "ls:isrcnumber"
|
||||
id3Tag = "TSRC"
|
||||
localizationKey = "isrc_number"
|
||||
/>
|
||||
<metadataType dcName = "ls:radiostationname"
|
||||
id3Tag = "TRSN"
|
||||
localizationKey = "radio_station_name"
|
||||
<metadataType dcName = "ls:catalognumber"
|
||||
localizationKey = "catalog_number"
|
||||
/>
|
||||
<metadataType dcName = "ls:audiofileinfourl"
|
||||
id3Tag = "WOAF"
|
||||
localizationKey = "audio_file_info_url"
|
||||
<metadataType dcName = "ls:originalartist"
|
||||
id3Tag = "TOPE"
|
||||
localizationKey = "original_artist"
|
||||
tab = "music"
|
||||
/>
|
||||
<metadataType dcName = "ls:artisturl"
|
||||
id3Tag = "WOAR"
|
||||
localizationKey = "artist_url"
|
||||
<metadataType dcName = "dc:rights"
|
||||
id3Tag = "TCOP"
|
||||
localizationKey = "copyright"
|
||||
tab = "music"
|
||||
/>
|
||||
<metadataType dcName = "ls:audiosourceurl"
|
||||
id3Tag = "WOAS"
|
||||
localizationKey = "audio_source_url"
|
||||
<metadataType dcName = "dcterms:temporal"
|
||||
localizationKey = "report_date_time"
|
||||
tab = "voice"
|
||||
/>
|
||||
<metadataType dcName = "ls:radiostationurl"
|
||||
id3Tag = "WORS"
|
||||
localizationKey = "radio_station_url"
|
||||
<metadataType dcName = "dcterms:spatial"
|
||||
localizationKey = "report_location"
|
||||
tab = "voice"
|
||||
/>
|
||||
<metadataType dcName = "ls:buycdurl"
|
||||
id3Tag = "WPAY"
|
||||
localizationKey = "buy_cd_url"
|
||||
<metadataType dcName = "dcterms:entity"
|
||||
localizationKey = "report_organizations"
|
||||
tab = "voice"
|
||||
/>
|
||||
<metadataType dcName = "ls:isrcnumber"
|
||||
id3Tag = "TSRC"
|
||||
localizationKey = "isrc_number"
|
||||
/>
|
||||
<metadataType dcName = "ls:catalognumber"
|
||||
localizationKey = "catalog_number"
|
||||
/>
|
||||
<metadataType dcName = "ls:originalartist"
|
||||
id3Tag = "TOPE"
|
||||
localizationKey = "original_artist"
|
||||
tab = "music"
|
||||
/>
|
||||
<metadataType dcName = "dc:rights"
|
||||
id3Tag = "TCOP"
|
||||
localizationKey = "copyright"
|
||||
tab = "music"
|
||||
/>
|
||||
<metadataType dcName = "dcterms:temporal"
|
||||
localizationKey = "report_date_time"
|
||||
tab = "voice"
|
||||
/>
|
||||
<metadataType dcName = "dcterms:spatial"
|
||||
localizationKey = "report_location"
|
||||
tab = "voice"
|
||||
/>
|
||||
<metadataType dcName = "dcterms:entity"
|
||||
localizationKey = "report_organizations"
|
||||
tab = "voice"
|
||||
/>
|
||||
<metadataType dcName = "dc:subject"
|
||||
localizationKey = "subject"
|
||||
tab = "voice"
|
||||
<metadataType dcName = "dc:subject"
|
||||
localizationKey = "subject"
|
||||
tab = "voice"
|
||||
/>
|
||||
</metadataTypeContainer>
|
||||
|
||||
|
|
|
@ -89,20 +89,25 @@
|
|||
<!ELEMENT gstreamerPlayer EMPTY >
|
||||
<!ATTLIST gstreamerPlayer audioDevice CDATA #IMPLIED >
|
||||
|
||||
<!ELEMENT metadataTypeContainer (metadataType+) >
|
||||
|
||||
<!ELEMENT stationLogo EMPTY >
|
||||
<!ATTLIST stationLogo path CDATA #REQUIRED >
|
||||
|
||||
<!ELEMENT testAudioUrl EMPTY >
|
||||
<!ATTLIST testAudioUrl path CDATA #REQUIRED >
|
||||
|
||||
<!ELEMENT metadataType EMPTY >
|
||||
<!ELEMENT metadataTypeContainer (metadataType+) >
|
||||
|
||||
<!ELEMENT metadataType (constraint?) >
|
||||
<!ATTLIST metadataType dcName NMTOKEN #REQUIRED >
|
||||
<!ATTLIST metadataType id3Tag CDATA #IMPLIED >
|
||||
<!ATTLIST metadataType localizationKey NMTOKEN #REQUIRED >
|
||||
<!ATTLIST metadataType localizationKey CDATA #REQUIRED >
|
||||
<!ATTLIST metadataType tab NMTOKEN #IMPLIED >
|
||||
|
||||
<!ELEMENT constraint (value*) >
|
||||
<!ATTLIST constraint type NMTOKEN #REQUIRED >
|
||||
|
||||
<!ELEMENT value (#PCDATA) >
|
||||
|
||||
<!ELEMENT keyboardShortcutList (keyboardShortcutContainer*) >
|
||||
<!ELEMENT keyboardShortcutContainer (keyboardShortcut+) >
|
||||
<!ATTLIST keyboardShortcutContainer windowName CDATA #REQUIRED >
|
||||
|
@ -177,182 +182,196 @@
|
|||
<testAudioUrl path = "file://ls_var_dir/LiveSupport/testAudio.ogg" />
|
||||
|
||||
<metadataTypeContainer>
|
||||
<metadataType dcName = "dc:title"
|
||||
id3Tag = "TIT2"
|
||||
localizationKey = "title"
|
||||
tab = "main"
|
||||
<metadataType dcName = "dc:title"
|
||||
id3Tag = "TIT2"
|
||||
localizationKey = "title"
|
||||
tab = "main"
|
||||
/>
|
||||
<metadataType dcName = "dc:creator"
|
||||
id3Tag = "TPE1"
|
||||
localizationKey = "creator"
|
||||
tab = "main"
|
||||
<metadataType dcName = "dc:creator"
|
||||
id3Tag = "TPE1"
|
||||
localizationKey = "creator"
|
||||
tab = "main"
|
||||
/>
|
||||
<metadataType dcName = "dc:source"
|
||||
id3Tag = "TALB"
|
||||
localizationKey = "album"
|
||||
tab = "music"
|
||||
<metadataType dcName = "dc:source"
|
||||
id3Tag = "TALB"
|
||||
localizationKey = "album"
|
||||
tab = "music"
|
||||
/>
|
||||
<metadataType dcName = "ls:year"
|
||||
id3Tag = "TYER"
|
||||
localizationKey = "year"
|
||||
tab = "music"
|
||||
<metadataType dcName = "ls:year"
|
||||
id3Tag = "TYER"
|
||||
localizationKey = "year"
|
||||
tab = "music" >
|
||||
<constraint type = "numericRange" >
|
||||
<value>0</value>
|
||||
<value>3000</value>
|
||||
</constraint>
|
||||
</metadataType>
|
||||
<metadataType dcName = "dc:type"
|
||||
id3Tag = "TCON"
|
||||
localizationKey = "genre"
|
||||
tab = "main"
|
||||
/>
|
||||
<metadataType dcName = "dc:type"
|
||||
id3Tag = "TCON"
|
||||
localizationKey = "genre"
|
||||
tab = "main"
|
||||
<metadataType dcName = "dc:description"
|
||||
id3Tag = "COMM"
|
||||
localizationKey = "description"
|
||||
tab = "main"
|
||||
/>
|
||||
<metadataType dcName = "dc:description"
|
||||
id3Tag = "COMM"
|
||||
localizationKey = "description"
|
||||
tab = "main"
|
||||
<metadataType dcName = "dc:format"
|
||||
localizationKey = "format" >
|
||||
<constraint type = "enumeration" >
|
||||
<value>mp3</value>
|
||||
<value>mpeg</value>
|
||||
<value>ogg</value>
|
||||
</constraint>
|
||||
</metadataType>
|
||||
<metadataType dcName = "ls:bpm"
|
||||
id3Tag = "TBPM"
|
||||
localizationKey = "bpm"
|
||||
tab = "music" >
|
||||
<constraint type = "numeric" />
|
||||
</metadataType>
|
||||
<metadataType dcName = "ls:rating"
|
||||
id3Tag = "POPM"
|
||||
localizationKey = "rating"
|
||||
tab = "music"
|
||||
/>
|
||||
<metadataType dcName = "dc:format"
|
||||
localizationKey = "format"
|
||||
<metadataType dcName = "dcterms:extent"
|
||||
localizationKey = "length"
|
||||
/>
|
||||
<metadataType dcName = "ls:bpm"
|
||||
id3Tag = "TBPM"
|
||||
localizationKey = "bpm"
|
||||
tab = "music"
|
||||
<metadataType dcName = "ls:encoded_by"
|
||||
id3Tag = "TENC"
|
||||
localizationKey = "encoded_by"
|
||||
tab = "music"
|
||||
/>
|
||||
<metadataType dcName = "ls:rating"
|
||||
id3Tag = "POPM"
|
||||
localizationKey = "rating"
|
||||
tab = "music"
|
||||
<metadataType dcName = "ls:track_num"
|
||||
id3Tag = "TRCK"
|
||||
localizationKey = "track_number"
|
||||
tab = "music" >
|
||||
<constraint type = "numeric" />
|
||||
</metadataType>
|
||||
<metadataType dcName = "ls:disc_num"
|
||||
id3Tag = "TPOS"
|
||||
localizationKey = "disc_number"
|
||||
tab = "music" >
|
||||
<constraint type = "numeric" />
|
||||
</metadataType>
|
||||
<metadataType dcName = "ls:mood"
|
||||
id3Tag = "TMOO"
|
||||
localizationKey = "mood"
|
||||
tab = "music"
|
||||
/>
|
||||
<metadataType dcName = "dcterms:extent"
|
||||
localizationKey = "length"
|
||||
<metadataType dcName = "dc:publisher"
|
||||
id3Tag = "TPUB"
|
||||
localizationKey = "publishing_label"
|
||||
tab = "music"
|
||||
/>
|
||||
<metadataType dcName = "ls:encoded_by"
|
||||
id3Tag = "TENC"
|
||||
localizationKey = "encoded_by"
|
||||
tab = "music"
|
||||
<metadataType dcName = "ls:composer"
|
||||
id3Tag = "TCOM"
|
||||
localizationKey = "composer"
|
||||
tab = "music"
|
||||
/>
|
||||
<metadataType dcName = "ls:track_num"
|
||||
id3Tag = "TRCK"
|
||||
localizationKey = "track_number"
|
||||
tab = "music"
|
||||
<metadataType dcName = "ls:bitrate"
|
||||
localizationKey = "bitrate"
|
||||
tab = "music" >
|
||||
<constraint type = "numeric" />
|
||||
</metadataType>
|
||||
<metadataType dcName = "ls:channels"
|
||||
localizationKey = "channels"
|
||||
tab = "music"
|
||||
/>
|
||||
<metadataType dcName = "ls:disc_num"
|
||||
id3Tag = "TPOS"
|
||||
localizationKey = "disc_number"
|
||||
tab = "music"
|
||||
<metadataType dcName = "ls:samplerate"
|
||||
localizationKey = "sample_rate"
|
||||
tab = "music" >
|
||||
<constraint type = "numeric" />
|
||||
</metadataType>
|
||||
<metadataType dcName = "ls:encoder"
|
||||
id3Tag = "TSSE"
|
||||
localizationKey = "encoding_software"
|
||||
tab = "music"
|
||||
/>
|
||||
<metadataType dcName = "ls:mood"
|
||||
id3Tag = "TMOO"
|
||||
localizationKey = "mood"
|
||||
tab = "music"
|
||||
<metadataType dcName = "ls:crc"
|
||||
localizationKey = "checksum"
|
||||
/>
|
||||
<metadataType dcName = "dc:publisher"
|
||||
id3Tag = "TPUB"
|
||||
localizationKey = "publishing_label"
|
||||
tab = "music"
|
||||
<metadataType dcName = "ls:lyrics"
|
||||
localizationKey = "lyrics"
|
||||
tab = "music"
|
||||
/>
|
||||
<metadataType dcName = "ls:composer"
|
||||
id3Tag = "TCOM"
|
||||
localizationKey = "composer"
|
||||
tab = "music"
|
||||
<metadataType dcName = "ls:orchestra"
|
||||
id3Tag = "TPE2"
|
||||
localizationKey = "orchestra_or_band"
|
||||
tab = "music"
|
||||
/>
|
||||
<metadataType dcName = "ls:bitrate"
|
||||
localizationKey = "bitrate"
|
||||
tab = "music"
|
||||
<metadataType dcName = "ls:conductor"
|
||||
id3Tag = "TPE3"
|
||||
localizationKey = "conductor"
|
||||
tab = "music"
|
||||
/>
|
||||
<metadataType dcName = "ls:channels"
|
||||
localizationKey = "channels"
|
||||
tab = "music"
|
||||
<metadataType dcName = "ls:lyricist"
|
||||
id3Tag = "TEXT"
|
||||
localizationKey = "lyricist"
|
||||
tab = "music"
|
||||
/>
|
||||
<metadataType dcName = "ls:samplerate"
|
||||
localizationKey = "sample_rate"
|
||||
tab = "music"
|
||||
<metadataType dcName = "ls:originallyricist"
|
||||
id3Tag = "TOLY"
|
||||
localizationKey = "original_lyricist"
|
||||
tab = "music"
|
||||
/>
|
||||
<metadataType dcName = "ls:encoder"
|
||||
id3Tag = "TSSE"
|
||||
localizationKey = "encoding_software"
|
||||
tab = "music"
|
||||
<metadataType dcName = "ls:radiostationname"
|
||||
id3Tag = "TRSN"
|
||||
localizationKey = "radio_station_name"
|
||||
/>
|
||||
<metadataType dcName = "ls:crc"
|
||||
localizationKey = "checksum"
|
||||
<metadataType dcName = "ls:audiofileinfourl"
|
||||
id3Tag = "WOAF"
|
||||
localizationKey = "audio_file_info_url"
|
||||
/>
|
||||
<metadataType dcName = "ls:lyrics"
|
||||
localizationKey = "lyrics"
|
||||
tab = "music"
|
||||
<metadataType dcName = "ls:artisturl"
|
||||
id3Tag = "WOAR"
|
||||
localizationKey = "artist_url"
|
||||
/>
|
||||
<metadataType dcName = "ls:orchestra"
|
||||
id3Tag = "TPE2"
|
||||
localizationKey = "orchestra_or_band"
|
||||
tab = "music"
|
||||
<metadataType dcName = "ls:audiosourceurl"
|
||||
id3Tag = "WOAS"
|
||||
localizationKey = "audio_source_url"
|
||||
/>
|
||||
<metadataType dcName = "ls:conductor"
|
||||
id3Tag = "TPE3"
|
||||
localizationKey = "conductor"
|
||||
tab = "music"
|
||||
<metadataType dcName = "ls:radiostationurl"
|
||||
id3Tag = "WORS"
|
||||
localizationKey = "radio_station_url"
|
||||
/>
|
||||
<metadataType dcName = "ls:lyricist"
|
||||
id3Tag = "TEXT"
|
||||
localizationKey = "lyricist"
|
||||
tab = "music"
|
||||
<metadataType dcName = "ls:buycdurl"
|
||||
id3Tag = "WPAY"
|
||||
localizationKey = "buy_cd_url"
|
||||
/>
|
||||
<metadataType dcName = "ls:originallyricist"
|
||||
id3Tag = "TOLY"
|
||||
localizationKey = "original_lyricist"
|
||||
tab = "music"
|
||||
<metadataType dcName = "ls:isrcnumber"
|
||||
id3Tag = "TSRC"
|
||||
localizationKey = "isrc_number"
|
||||
/>
|
||||
<metadataType dcName = "ls:radiostationname"
|
||||
id3Tag = "TRSN"
|
||||
localizationKey = "radio_station_name"
|
||||
<metadataType dcName = "ls:catalognumber"
|
||||
localizationKey = "catalog_number"
|
||||
/>
|
||||
<metadataType dcName = "ls:audiofileinfourl"
|
||||
id3Tag = "WOAF"
|
||||
localizationKey = "audio_file_info_url"
|
||||
<metadataType dcName = "ls:originalartist"
|
||||
id3Tag = "TOPE"
|
||||
localizationKey = "original_artist"
|
||||
tab = "music"
|
||||
/>
|
||||
<metadataType dcName = "ls:artisturl"
|
||||
id3Tag = "WOAR"
|
||||
localizationKey = "artist_url"
|
||||
<metadataType dcName = "dc:rights"
|
||||
id3Tag = "TCOP"
|
||||
localizationKey = "copyright"
|
||||
tab = "music"
|
||||
/>
|
||||
<metadataType dcName = "ls:audiosourceurl"
|
||||
id3Tag = "WOAS"
|
||||
localizationKey = "audio_source_url"
|
||||
<metadataType dcName = "dcterms:temporal"
|
||||
localizationKey = "report_date_time"
|
||||
tab = "voice"
|
||||
/>
|
||||
<metadataType dcName = "ls:radiostationurl"
|
||||
id3Tag = "WORS"
|
||||
localizationKey = "radio_station_url"
|
||||
<metadataType dcName = "dcterms:spatial"
|
||||
localizationKey = "report_location"
|
||||
tab = "voice"
|
||||
/>
|
||||
<metadataType dcName = "ls:buycdurl"
|
||||
id3Tag = "WPAY"
|
||||
localizationKey = "buy_cd_url"
|
||||
<metadataType dcName = "dcterms:entity"
|
||||
localizationKey = "report_organizations"
|
||||
tab = "voice"
|
||||
/>
|
||||
<metadataType dcName = "ls:isrcnumber"
|
||||
id3Tag = "TSRC"
|
||||
localizationKey = "isrc_number"
|
||||
/>
|
||||
<metadataType dcName = "ls:catalognumber"
|
||||
localizationKey = "catalog_number"
|
||||
/>
|
||||
<metadataType dcName = "ls:originalartist"
|
||||
id3Tag = "TOPE"
|
||||
localizationKey = "original_artist"
|
||||
tab = "music"
|
||||
/>
|
||||
<metadataType dcName = "dc:rights"
|
||||
id3Tag = "TCOP"
|
||||
localizationKey = "copyright"
|
||||
tab = "music"
|
||||
/>
|
||||
<metadataType dcName = "dcterms:temporal"
|
||||
localizationKey = "report_date_time"
|
||||
tab = "voice"
|
||||
/>
|
||||
<metadataType dcName = "dcterms:spatial"
|
||||
localizationKey = "report_location"
|
||||
tab = "voice"
|
||||
/>
|
||||
<metadataType dcName = "dcterms:entity"
|
||||
localizationKey = "report_organizations"
|
||||
tab = "voice"
|
||||
/>
|
||||
<metadataType dcName = "dc:subject"
|
||||
localizationKey = "subject"
|
||||
tab = "voice"
|
||||
<metadataType dcName = "dc:subject"
|
||||
localizationKey = "subject"
|
||||
tab = "voice"
|
||||
/>
|
||||
</metadataTypeContainer>
|
||||
|
||||
|
|
|
@ -89,20 +89,25 @@
|
|||
<!ELEMENT gstreamerPlayer EMPTY >
|
||||
<!ATTLIST gstreamerPlayer audioDevice CDATA #IMPLIED >
|
||||
|
||||
<!ELEMENT metadataTypeContainer (metadataType+) >
|
||||
|
||||
<!ELEMENT stationLogo EMPTY >
|
||||
<!ATTLIST stationLogo path CDATA #REQUIRED >
|
||||
|
||||
<!ELEMENT testAudioUrl EMPTY >
|
||||
<!ATTLIST testAudioUrl path CDATA #REQUIRED >
|
||||
|
||||
<!ELEMENT metadataType EMPTY >
|
||||
<!ELEMENT metadataTypeContainer (metadataType+) >
|
||||
|
||||
<!ELEMENT metadataType (constraint?) >
|
||||
<!ATTLIST metadataType dcName NMTOKEN #REQUIRED >
|
||||
<!ATTLIST metadataType id3Tag CDATA #IMPLIED >
|
||||
<!ATTLIST metadataType localizationKey NMTOKEN #REQUIRED >
|
||||
<!ATTLIST metadataType localizationKey CDATA #REQUIRED >
|
||||
<!ATTLIST metadataType tab NMTOKEN #IMPLIED >
|
||||
|
||||
<!ELEMENT constraint (value*) >
|
||||
<!ATTLIST constraint type NMTOKEN #REQUIRED >
|
||||
|
||||
<!ELEMENT value (#PCDATA) >
|
||||
|
||||
<!ELEMENT keyboardShortcutList (keyboardShortcutContainer*) >
|
||||
<!ELEMENT keyboardShortcutContainer (keyboardShortcut+) >
|
||||
<!ATTLIST keyboardShortcutContainer windowName CDATA #REQUIRED >
|
||||
|
@ -177,182 +182,196 @@
|
|||
<testAudioUrl path = "file:var/testAudio.ogg" />
|
||||
|
||||
<metadataTypeContainer>
|
||||
<metadataType dcName = "dc:title"
|
||||
id3Tag = "TIT2"
|
||||
localizationKey = "title"
|
||||
tab = "main"
|
||||
<metadataType dcName = "dc:title"
|
||||
id3Tag = "TIT2"
|
||||
localizationKey = "title"
|
||||
tab = "main"
|
||||
/>
|
||||
<metadataType dcName = "dc:creator"
|
||||
id3Tag = "TPE1"
|
||||
localizationKey = "creator"
|
||||
tab = "main"
|
||||
<metadataType dcName = "dc:creator"
|
||||
id3Tag = "TPE1"
|
||||
localizationKey = "creator"
|
||||
tab = "main"
|
||||
/>
|
||||
<metadataType dcName = "dc:source"
|
||||
id3Tag = "TALB"
|
||||
localizationKey = "album"
|
||||
tab = "music"
|
||||
<metadataType dcName = "dc:source"
|
||||
id3Tag = "TALB"
|
||||
localizationKey = "album"
|
||||
tab = "music"
|
||||
/>
|
||||
<metadataType dcName = "ls:year"
|
||||
id3Tag = "TYER"
|
||||
localizationKey = "year"
|
||||
tab = "music"
|
||||
<metadataType dcName = "ls:year"
|
||||
id3Tag = "TYER"
|
||||
localizationKey = "year"
|
||||
tab = "music" >
|
||||
<constraint type = "numericRange" >
|
||||
<value>0</value>
|
||||
<value>3000</value>
|
||||
</constraint>
|
||||
</metadataType>
|
||||
<metadataType dcName = "dc:type"
|
||||
id3Tag = "TCON"
|
||||
localizationKey = "genre"
|
||||
tab = "main"
|
||||
/>
|
||||
<metadataType dcName = "dc:type"
|
||||
id3Tag = "TCON"
|
||||
localizationKey = "genre"
|
||||
tab = "main"
|
||||
<metadataType dcName = "dc:description"
|
||||
id3Tag = "COMM"
|
||||
localizationKey = "description"
|
||||
tab = "main"
|
||||
/>
|
||||
<metadataType dcName = "dc:description"
|
||||
id3Tag = "COMM"
|
||||
localizationKey = "description"
|
||||
tab = "main"
|
||||
<metadataType dcName = "dc:format"
|
||||
localizationKey = "format" >
|
||||
<constraint type = "enumeration" >
|
||||
<value>mp3</value>
|
||||
<value>mpeg</value>
|
||||
<value>ogg</value>
|
||||
</constraint>
|
||||
</metadataType>
|
||||
<metadataType dcName = "ls:bpm"
|
||||
id3Tag = "TBPM"
|
||||
localizationKey = "bpm"
|
||||
tab = "music" >
|
||||
<constraint type = "numeric" />
|
||||
</metadataType>
|
||||
<metadataType dcName = "ls:rating"
|
||||
id3Tag = "POPM"
|
||||
localizationKey = "rating"
|
||||
tab = "music"
|
||||
/>
|
||||
<metadataType dcName = "dc:format"
|
||||
localizationKey = "format"
|
||||
<metadataType dcName = "dcterms:extent"
|
||||
localizationKey = "length"
|
||||
/>
|
||||
<metadataType dcName = "ls:bpm"
|
||||
id3Tag = "TBPM"
|
||||
localizationKey = "bpm"
|
||||
tab = "music"
|
||||
<metadataType dcName = "ls:encoded_by"
|
||||
id3Tag = "TENC"
|
||||
localizationKey = "encoded_by"
|
||||
tab = "music"
|
||||
/>
|
||||
<metadataType dcName = "ls:rating"
|
||||
id3Tag = "POPM"
|
||||
localizationKey = "rating"
|
||||
tab = "music"
|
||||
<metadataType dcName = "ls:track_num"
|
||||
id3Tag = "TRCK"
|
||||
localizationKey = "track_number"
|
||||
tab = "music" >
|
||||
<constraint type = "numeric" />
|
||||
</metadataType>
|
||||
<metadataType dcName = "ls:disc_num"
|
||||
id3Tag = "TPOS"
|
||||
localizationKey = "disc_number"
|
||||
tab = "music" >
|
||||
<constraint type = "numeric" />
|
||||
</metadataType>
|
||||
<metadataType dcName = "ls:mood"
|
||||
id3Tag = "TMOO"
|
||||
localizationKey = "mood"
|
||||
tab = "music"
|
||||
/>
|
||||
<metadataType dcName = "dcterms:extent"
|
||||
localizationKey = "length"
|
||||
<metadataType dcName = "dc:publisher"
|
||||
id3Tag = "TPUB"
|
||||
localizationKey = "publishing_label"
|
||||
tab = "music"
|
||||
/>
|
||||
<metadataType dcName = "ls:encoded_by"
|
||||
id3Tag = "TENC"
|
||||
localizationKey = "encoded_by"
|
||||
tab = "music"
|
||||
<metadataType dcName = "ls:composer"
|
||||
id3Tag = "TCOM"
|
||||
localizationKey = "composer"
|
||||
tab = "music"
|
||||
/>
|
||||
<metadataType dcName = "ls:track_num"
|
||||
id3Tag = "TRCK"
|
||||
localizationKey = "track_number"
|
||||
tab = "music"
|
||||
<metadataType dcName = "ls:bitrate"
|
||||
localizationKey = "bitrate"
|
||||
tab = "music" >
|
||||
<constraint type = "numeric" />
|
||||
</metadataType>
|
||||
<metadataType dcName = "ls:channels"
|
||||
localizationKey = "channels"
|
||||
tab = "music"
|
||||
/>
|
||||
<metadataType dcName = "ls:disc_num"
|
||||
id3Tag = "TPOS"
|
||||
localizationKey = "disc_number"
|
||||
tab = "music"
|
||||
<metadataType dcName = "ls:samplerate"
|
||||
localizationKey = "sample_rate"
|
||||
tab = "music" >
|
||||
<constraint type = "numeric" />
|
||||
</metadataType>
|
||||
<metadataType dcName = "ls:encoder"
|
||||
id3Tag = "TSSE"
|
||||
localizationKey = "encoding_software"
|
||||
tab = "music"
|
||||
/>
|
||||
<metadataType dcName = "ls:mood"
|
||||
id3Tag = "TMOO"
|
||||
localizationKey = "mood"
|
||||
tab = "music"
|
||||
<metadataType dcName = "ls:crc"
|
||||
localizationKey = "checksum"
|
||||
/>
|
||||
<metadataType dcName = "dc:publisher"
|
||||
id3Tag = "TPUB"
|
||||
localizationKey = "publishing_label"
|
||||
tab = "music"
|
||||
<metadataType dcName = "ls:lyrics"
|
||||
localizationKey = "lyrics"
|
||||
tab = "music"
|
||||
/>
|
||||
<metadataType dcName = "ls:composer"
|
||||
id3Tag = "TCOM"
|
||||
localizationKey = "composer"
|
||||
tab = "music"
|
||||
<metadataType dcName = "ls:orchestra"
|
||||
id3Tag = "TPE2"
|
||||
localizationKey = "orchestra_or_band"
|
||||
tab = "music"
|
||||
/>
|
||||
<metadataType dcName = "ls:bitrate"
|
||||
localizationKey = "bitrate"
|
||||
tab = "music"
|
||||
<metadataType dcName = "ls:conductor"
|
||||
id3Tag = "TPE3"
|
||||
localizationKey = "conductor"
|
||||
tab = "music"
|
||||
/>
|
||||
<metadataType dcName = "ls:channels"
|
||||
localizationKey = "channels"
|
||||
tab = "music"
|
||||
<metadataType dcName = "ls:lyricist"
|
||||
id3Tag = "TEXT"
|
||||
localizationKey = "lyricist"
|
||||
tab = "music"
|
||||
/>
|
||||
<metadataType dcName = "ls:samplerate"
|
||||
localizationKey = "sample_rate"
|
||||
tab = "music"
|
||||
<metadataType dcName = "ls:originallyricist"
|
||||
id3Tag = "TOLY"
|
||||
localizationKey = "original_lyricist"
|
||||
tab = "music"
|
||||
/>
|
||||
<metadataType dcName = "ls:encoder"
|
||||
id3Tag = "TSSE"
|
||||
localizationKey = "encoding_software"
|
||||
tab = "music"
|
||||
<metadataType dcName = "ls:radiostationname"
|
||||
id3Tag = "TRSN"
|
||||
localizationKey = "radio_station_name"
|
||||
/>
|
||||
<metadataType dcName = "ls:crc"
|
||||
localizationKey = "checksum"
|
||||
<metadataType dcName = "ls:audiofileinfourl"
|
||||
id3Tag = "WOAF"
|
||||
localizationKey = "audio_file_info_url"
|
||||
/>
|
||||
<metadataType dcName = "ls:lyrics"
|
||||
localizationKey = "lyrics"
|
||||
tab = "music"
|
||||
<metadataType dcName = "ls:artisturl"
|
||||
id3Tag = "WOAR"
|
||||
localizationKey = "artist_url"
|
||||
/>
|
||||
<metadataType dcName = "ls:orchestra"
|
||||
id3Tag = "TPE2"
|
||||
localizationKey = "orchestra_or_band"
|
||||
tab = "music"
|
||||
<metadataType dcName = "ls:audiosourceurl"
|
||||
id3Tag = "WOAS"
|
||||
localizationKey = "audio_source_url"
|
||||
/>
|
||||
<metadataType dcName = "ls:conductor"
|
||||
id3Tag = "TPE3"
|
||||
localizationKey = "conductor"
|
||||
tab = "music"
|
||||
<metadataType dcName = "ls:radiostationurl"
|
||||
id3Tag = "WORS"
|
||||
localizationKey = "radio_station_url"
|
||||
/>
|
||||
<metadataType dcName = "ls:lyricist"
|
||||
id3Tag = "TEXT"
|
||||
localizationKey = "lyricist"
|
||||
tab = "music"
|
||||
<metadataType dcName = "ls:buycdurl"
|
||||
id3Tag = "WPAY"
|
||||
localizationKey = "buy_cd_url"
|
||||
/>
|
||||
<metadataType dcName = "ls:originallyricist"
|
||||
id3Tag = "TOLY"
|
||||
localizationKey = "original_lyricist"
|
||||
tab = "music"
|
||||
<metadataType dcName = "ls:isrcnumber"
|
||||
id3Tag = "TSRC"
|
||||
localizationKey = "isrc_number"
|
||||
/>
|
||||
<metadataType dcName = "ls:radiostationname"
|
||||
id3Tag = "TRSN"
|
||||
localizationKey = "radio_station_name"
|
||||
<metadataType dcName = "ls:catalognumber"
|
||||
localizationKey = "catalog_number"
|
||||
/>
|
||||
<metadataType dcName = "ls:audiofileinfourl"
|
||||
id3Tag = "WOAF"
|
||||
localizationKey = "audio_file_info_url"
|
||||
<metadataType dcName = "ls:originalartist"
|
||||
id3Tag = "TOPE"
|
||||
localizationKey = "original_artist"
|
||||
tab = "music"
|
||||
/>
|
||||
<metadataType dcName = "ls:artisturl"
|
||||
id3Tag = "WOAR"
|
||||
localizationKey = "artist_url"
|
||||
<metadataType dcName = "dc:rights"
|
||||
id3Tag = "TCOP"
|
||||
localizationKey = "copyright"
|
||||
tab = "music"
|
||||
/>
|
||||
<metadataType dcName = "ls:audiosourceurl"
|
||||
id3Tag = "WOAS"
|
||||
localizationKey = "audio_source_url"
|
||||
<metadataType dcName = "dcterms:temporal"
|
||||
localizationKey = "report_date_time"
|
||||
tab = "voice"
|
||||
/>
|
||||
<metadataType dcName = "ls:radiostationurl"
|
||||
id3Tag = "WORS"
|
||||
localizationKey = "radio_station_url"
|
||||
<metadataType dcName = "dcterms:spatial"
|
||||
localizationKey = "report_location"
|
||||
tab = "voice"
|
||||
/>
|
||||
<metadataType dcName = "ls:buycdurl"
|
||||
id3Tag = "WPAY"
|
||||
localizationKey = "buy_cd_url"
|
||||
<metadataType dcName = "dcterms:entity"
|
||||
localizationKey = "report_organizations"
|
||||
tab = "voice"
|
||||
/>
|
||||
<metadataType dcName = "ls:isrcnumber"
|
||||
id3Tag = "TSRC"
|
||||
localizationKey = "isrc_number"
|
||||
/>
|
||||
<metadataType dcName = "ls:catalognumber"
|
||||
localizationKey = "catalog_number"
|
||||
/>
|
||||
<metadataType dcName = "ls:originalartist"
|
||||
id3Tag = "TOPE"
|
||||
localizationKey = "original_artist"
|
||||
tab = "music"
|
||||
/>
|
||||
<metadataType dcName = "dc:rights"
|
||||
id3Tag = "TCOP"
|
||||
localizationKey = "copyright"
|
||||
tab = "music"
|
||||
/>
|
||||
<metadataType dcName = "dcterms:temporal"
|
||||
localizationKey = "report_date_time"
|
||||
tab = "voice"
|
||||
/>
|
||||
<metadataType dcName = "dcterms:spatial"
|
||||
localizationKey = "report_location"
|
||||
tab = "voice"
|
||||
/>
|
||||
<metadataType dcName = "dcterms:entity"
|
||||
localizationKey = "report_organizations"
|
||||
tab = "voice"
|
||||
/>
|
||||
<metadataType dcName = "dc:subject"
|
||||
localizationKey = "subject"
|
||||
tab = "voice"
|
||||
<metadataType dcName = "dc:subject"
|
||||
localizationKey = "subject"
|
||||
tab = "voice"
|
||||
/>
|
||||
</metadataTypeContainer>
|
||||
|
||||
|
|
|
@ -438,6 +438,9 @@ UploadFileWindow :: onUploadButtonClicked(void) throw ()
|
|||
void
|
||||
UploadFileWindow :: uploadAudioClip(void) throw ()
|
||||
{
|
||||
Ptr<MetadataTypeContainer>::Ref
|
||||
metadataTypes = gLiveSupport->getMetadataTypeContainer();
|
||||
|
||||
for (unsigned int i=0; i < metadataKeys.size(); ++i) {
|
||||
Ptr<const Glib::ustring>::Ref metadataKey = metadataKeys[i];
|
||||
Gtk::Entry * metadataEntry = metadataEntries[i];
|
||||
|
@ -445,7 +448,17 @@ UploadFileWindow :: uploadAudioClip(void) throw ()
|
|||
Ptr<const Glib::ustring>::Ref metadataValue(new Glib::ustring(
|
||||
metadataEntry->get_text() ));
|
||||
if (*metadataValue != "") {
|
||||
audioClip->setMetadata(metadataValue, *metadataKey);
|
||||
if (metadataTypes->check(metadataValue, *metadataKey)) {
|
||||
audioClip->setMetadata(metadataValue, *metadataKey);
|
||||
} else {
|
||||
Ptr<const MetadataType>::Ref
|
||||
metadata = metadataTypes->getByDcName(*metadataKey);
|
||||
Ptr<const Glib::ustring>::Ref
|
||||
localizedName = metadata->getLocalizedName();
|
||||
statusBar->set_text(*formatMessage("badMetadataMsg",
|
||||
*localizedName));
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -459,6 +472,7 @@ UploadFileWindow :: uploadAudioClip(void) throw ()
|
|||
gLiveSupport->uploadAudioClip(audioClip);
|
||||
} catch (XmlRpcException &e) {
|
||||
statusBar->set_text(e.what());
|
||||
std::cerr << e.what();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -128,6 +128,7 @@ root:table
|
|||
unsupportedFileTypeMsg:string
|
||||
{ "Unsupported file type." }
|
||||
missingTitleMsg:string { "Please enter a title." }
|
||||
badMetadataMsg:string { "Invalid data for {0}." }
|
||||
}
|
||||
|
||||
simplePlaylistManagementWindow:table
|
||||
|
|
Loading…
Reference in New Issue