added (provisional) URI field to AudioClip

This commit is contained in:
fgerlits 2004-11-05 17:32:54 +00:00
parent 7a1f319439
commit ecd2c3d55c
5 changed files with 30 additions and 27 deletions

View File

@ -4,5 +4,6 @@
<!ELEMENT audioClip EMPTY >
<!ATTLIST audioClip id NMTOKEN #REQUIRED >
<!ATTLIST audioClip playlength NMTOKEN #REQUIRED >
<!ATTLIST audioClip uri CDATA #REQUIRED >
]>
<audioClip id="1" playlength="00:18:30.000"/>
<audioClip id="1" playlength="00:18:30.000" uri="file:var/test1.mp3" />

View File

@ -12,6 +12,7 @@
<!ELEMENT audioClip EMPTY >
<!ATTLIST audioClip id NMTOKEN #REQUIRED >
<!ATTLIST audioClip playlength NMTOKEN #REQUIRED >
<!ATTLIST audioClip uri CDATA #REQUIRED >
<!ELEMENT fadeInfo EMPTY >
<!ATTLIST fadeInfo id NMTOKEN #REQUIRED >
@ -21,10 +22,10 @@
<playlist id="1" playlength="01:30:00.000">
<playlistElement id="101" relativeOffset="0" >
<audioClip id="10001" playlength="01:00:00.000"/>
<audioClip id="10001" playlength="01:00:00.000" uri="file:var/test1.mp3"/>
</playlistElement>
<playlistElement id="102" relativeOffset="01:00:00.000" >
<audioClip id="10002" playlength="00:30:00.000"/>
<audioClip id="10002" playlength="00:30:00.000" uri="file:var/test2.mp3"/>
<fadeInfo id="9901" fadeIn="00:00:02.000"
fadeOut="00:00:01.500000" />
</playlistElement>

View File

@ -8,6 +8,7 @@
<!ELEMENT audioClip EMPTY >
<!ATTLIST audioClip id NMTOKEN #REQUIRED >
<!ATTLIST audioClip playlength NMTOKEN #REQUIRED >
<!ATTLIST audioClip uri CDATA #REQUIRED >
<!ELEMENT fadeInfo EMPTY >
<!ATTLIST fadeInfo id NMTOKEN #REQUIRED >
@ -16,6 +17,6 @@
]>
<playlistElement id="707" relativeOffset="00:12:34.000" >
<audioClip id="10001" playlength="01:00:00.000" />
<audioClip id="10001" playlength="01:00:00.000" uri="file:var/test1.mp3" />
<fadeInfo id="9901" fadeIn="00:00:02.000" fadeOut="00:00:01.500000" />
</playlistElement >

View File

@ -22,7 +22,7 @@
Author : $Author: fgerlits $
Version : $Revision: 1.3 $
Version : $Revision: 1.4 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/core/include/LiveSupport/Core/AudioClip.h,v $
------------------------------------------------------------------------------*/
@ -72,7 +72,7 @@ using namespace boost::posix_time;
* in a Playlist.
*
* @author $Author: fgerlits $
* @version $Revision: 1.3 $
* @version $Revision: 1.4 $
*/
class AudioClip : public Configurable
{
@ -93,9 +93,9 @@ class AudioClip : public Configurable
Ptr<time_duration>::Ref playlength;
/**
* The title of the audio clip.
* The location of the audio clip.
*/
// Ptr<string>::Ref title;
Ptr<string>::Ref uri;
public:
@ -114,12 +114,12 @@ class AudioClip : public Configurable
* @param playlength the playing length of the audio clip.
*/
AudioClip(Ptr<UniqueId>::Ref id,
Ptr<time_duration>::Ref playlength) throw()
// Ptr<string>::Ref title) throw ()
Ptr<time_duration>::Ref playlength,
Ptr<string>::Ref uri = Ptr<string>::Ref()) throw ()
{
this->id = id;
this->playlength = playlength;
// this->title = title;
this->uri = uri;
}
/**
@ -178,15 +178,15 @@ class AudioClip : public Configurable
}
/**
* Return the title of this audio clip.
* Return the URI of this audio clip.
*
* @return the title of this audio clip.
* @return the URI of this audio clip.
*/
// Ptr<const string>::Ref
// getTitle(void) const throw ()
// {
// return title;
// }
Ptr<const string>::Ref
getUri(void) const throw ()
{
return uri;
}
};

View File

@ -22,7 +22,7 @@
Author : $Author: fgerlits $
Version : $Revision: 1.3 $
Version : $Revision: 1.4 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/core/src/AudioClip.cxx,v $
------------------------------------------------------------------------------*/
@ -57,9 +57,9 @@ const std::string AudioClip::configElementNameStr = "audioClip";
static const std::string idAttrName = "id";
/**
* The name of the attribute to get the title of the audio clip.
* The name of the attribute to get the URI of the audio clip.
*/
//static const std::string titleAttrName = "title";
static const std::string uriAttrName = "uri";
/**
* The name of the attribute to get the playlength of the audio clip.
@ -96,15 +96,15 @@ AudioClip :: configure(const xmlpp::Element & element)
strStr.str(attribute->get_value());
strStr >> idValue;
id.reset(new UniqueId(idValue));
/*
if (!(attribute = element.get_attribute(titleAttrName))) {
if (!(attribute = element.get_attribute(uriAttrName))) {
std::string eMsg = "Missing attribute ";
eMsg += idAttrName;
eMsg += uriAttrName;
throw std::invalid_argument(eMsg);
}
std::string titleValue = attribute->get_value();
title.reset(new std::string(titleValue));
*/
std::string uriValue = attribute->get_value();
uri.reset(new std::string(uriValue));
if (!(attribute = element.get_attribute(playlengthAttrName))) {
std::string eMsg = "missing attribute ";
eMsg += idAttrName;