added acquirePlaylist() and releasePlaylist() to WebStorageClient
modified config() methods in Core (Playlist, PlaylistElement, FadeInfo, and AudioClip) to read ID as hexadecimal string & not decimal number some config xml files and tests had to be modified accordingly
This commit is contained in:
parent
31cc87b3c5
commit
f1ca8879ab
25 changed files with 335 additions and 153 deletions
|
@ -6,4 +6,4 @@
|
|||
<!ATTLIST fadeInfo fadeIn NMTOKEN #REQUIRED >
|
||||
<!ATTLIST fadeInfo fadeOut NMTOKEN #REQUIRED >
|
||||
]>
|
||||
<fadeInfo id="9901" fadeIn="00:00:02.000" fadeOut="00:00:01.500"/>
|
||||
<fadeInfo id="0000000000009901" fadeIn="00:00:02.000" fadeOut="00:00:01.500"/>
|
||||
|
|
|
@ -23,8 +23,10 @@
|
|||
|
||||
<playlist id="0000000000000001"
|
||||
playlength="00:00:34.000" >
|
||||
<playlistElement id="101" relativeOffset="0" >
|
||||
<audioClip id="10001" playlength="00:00:11.000"
|
||||
<playlistElement id="0000000000000101"
|
||||
relativeOffset="0" >
|
||||
<audioClip id="0000000000010001"
|
||||
playlength="00:00:11.000"
|
||||
title = "one"
|
||||
uri="file:var/test1.mp3" />
|
||||
</playlistElement>
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
|
||||
Author : $Author: fgerlits $
|
||||
Version : $Revision: 1.13 $
|
||||
Version : $Revision: 1.14 $
|
||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/core/src/AudioClip.cxx,v $
|
||||
|
||||
------------------------------------------------------------------------------*/
|
||||
|
@ -192,10 +192,7 @@ AudioClip :: configure(const xmlpp::Element & element)
|
|||
eMsg += idAttrName;
|
||||
throw std::invalid_argument(eMsg);
|
||||
}
|
||||
std::stringstream idStream(attribute->get_value());
|
||||
UniqueId::IdType idValue;
|
||||
idStream >> idValue;
|
||||
id.reset(new UniqueId(idValue));
|
||||
id.reset(new UniqueId(attribute->get_value()));
|
||||
}
|
||||
|
||||
if (!playlength
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
|
||||
Author : $Author: fgerlits $
|
||||
Version : $Revision: 1.6 $
|
||||
Version : $Revision: 1.7 $
|
||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/core/src/AudioClipTest.cxx,v $
|
||||
|
||||
------------------------------------------------------------------------------*/
|
||||
|
@ -102,7 +102,7 @@ AudioClipTest :: firstTest(void)
|
|||
|
||||
audioClip->configure(*root);
|
||||
|
||||
CPPUNIT_ASSERT(audioClip->getId()->getId() == 1);
|
||||
CPPUNIT_ASSERT(audioClip->getId()->getId() == 0x1);
|
||||
Ptr<const boost::posix_time::time_duration>::Ref duration
|
||||
= audioClip->getPlaylength();
|
||||
CPPUNIT_ASSERT(duration->hours() == 0);
|
||||
|
|
|
@ -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/FadeInfo.cxx,v $
|
||||
|
||||
------------------------------------------------------------------------------*/
|
||||
|
@ -92,10 +92,7 @@ FadeInfo :: configure(const xmlpp::Element & element)
|
|||
eMsg += idAttrName;
|
||||
throw std::invalid_argument(eMsg);
|
||||
}
|
||||
std::stringstream idStream(attribute->get_value());
|
||||
UniqueId::IdType idValue;
|
||||
idStream >> idValue;
|
||||
id.reset(new UniqueId(idValue));
|
||||
id.reset(new UniqueId(attribute->get_value()));
|
||||
|
||||
if (!(attribute = element.get_attribute(fadeInAttrName))) {
|
||||
std::string eMsg = "missing attribute ";
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
|
||||
Author : $Author: fgerlits $
|
||||
Version : $Revision: 1.2 $
|
||||
Version : $Revision: 1.3 $
|
||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/core/src/FadeInfoTest.cxx,v $
|
||||
|
||||
------------------------------------------------------------------------------*/
|
||||
|
@ -102,7 +102,7 @@ FadeInfoTest :: firstTest(void)
|
|||
|
||||
fadeInfo->configure(*root);
|
||||
|
||||
CPPUNIT_ASSERT(fadeInfo->getId()->getId() == 9901);
|
||||
CPPUNIT_ASSERT(fadeInfo->getId()->getId() == 0x9901);
|
||||
|
||||
Ptr<const boost::posix_time::time_duration>::Ref
|
||||
fadeIn = fadeInfo->getFadeIn();
|
||||
|
@ -118,7 +118,7 @@ FadeInfoTest :: firstTest(void)
|
|||
CPPUNIT_ASSERT(fadeOut->fractional_seconds() == 500);
|
||||
|
||||
CPPUNIT_ASSERT(*fadeInfo->getXmlString() ==
|
||||
"<fadeInfo id=\"00000000000026ad\" "
|
||||
"<fadeInfo id=\"0000000000009901\" "
|
||||
"fadeIn=\"00:00:02\" "
|
||||
"fadeOut=\"00:00:01.000500\"/>");
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
|
||||
Author : $Author: fgerlits $
|
||||
Version : $Revision: 1.20 $
|
||||
Version : $Revision: 1.21 $
|
||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/core/src/Playlist.cxx,v $
|
||||
|
||||
------------------------------------------------------------------------------*/
|
||||
|
@ -92,10 +92,7 @@ Playlist :: configure(const xmlpp::Element & element)
|
|||
eMsg += idAttrName;
|
||||
throw std::invalid_argument(eMsg);
|
||||
}
|
||||
std::stringstream idStream(attribute->get_value());
|
||||
UniqueId::IdType idValue;
|
||||
idStream >> idValue;
|
||||
id.reset(new UniqueId(idValue));
|
||||
id.reset(new UniqueId(attribute->get_value()));
|
||||
|
||||
if (!(attribute = element.get_attribute(playlengthAttrName))) {
|
||||
std::string eMsg = "missing attribute ";
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
|
||||
Author : $Author: fgerlits $
|
||||
Version : $Revision: 1.8 $
|
||||
Version : $Revision: 1.9 $
|
||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/core/src/PlaylistElement.cxx,v $
|
||||
|
||||
------------------------------------------------------------------------------*/
|
||||
|
@ -104,10 +104,7 @@ PlaylistElement :: configure(const xmlpp::Element & element)
|
|||
eMsg += idAttrName;
|
||||
throw std::invalid_argument(eMsg);
|
||||
}
|
||||
std::stringstream idStream(attribute->get_value());
|
||||
UniqueId::IdType idValue;
|
||||
idStream >> idValue;
|
||||
id.reset(new UniqueId(idValue));
|
||||
id.reset(new UniqueId(attribute->get_value()));
|
||||
|
||||
// set relative offset
|
||||
if (!(attribute = element.get_attribute(relativeOffsetAttrName))) {
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
|
||||
Author : $Author: fgerlits $
|
||||
Version : $Revision: 1.6 $
|
||||
Version : $Revision: 1.7 $
|
||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/core/src/PlaylistElementTest.cxx,v $
|
||||
|
||||
------------------------------------------------------------------------------*/
|
||||
|
@ -106,13 +106,13 @@ PlaylistElementTest :: firstTest(void)
|
|||
playlistElement->configure(*root);
|
||||
|
||||
// the playlist element
|
||||
CPPUNIT_ASSERT(playlistElement->getId()->getId() == 103);
|
||||
CPPUNIT_ASSERT(playlistElement->getId()->getId() == 0x103);
|
||||
Ptr<const time_duration>::Ref relativeOffset
|
||||
= playlistElement->getRelativeOffset();
|
||||
CPPUNIT_ASSERT(relativeOffset->total_seconds() == 11);
|
||||
|
||||
CPPUNIT_ASSERT(playlistElement->getFadeInfo()->getId()->getId()
|
||||
== 9901);
|
||||
== 0x9901);
|
||||
Ptr<const time_duration>::Ref fadeIn
|
||||
= playlistElement->getFadeInfo()
|
||||
->getFadeIn();
|
||||
|
@ -132,7 +132,7 @@ PlaylistElementTest :: firstTest(void)
|
|||
|
||||
// the playlist inside the playlist element
|
||||
CPPUNIT_ASSERT(playlistElement->getPlaylist()->getId()->getId()
|
||||
== 2);
|
||||
== 0x2);
|
||||
Ptr<Playlist>::Ref playlist = playlistElement->getPlaylist();
|
||||
Playlist::const_iterator it = playlist->begin();
|
||||
CPPUNIT_ASSERT(it != playlist->end());
|
||||
|
@ -141,7 +141,7 @@ PlaylistElementTest :: firstTest(void)
|
|||
CPPUNIT_ASSERT(it == playlist->end());
|
||||
|
||||
// the playlist element inside the playlist
|
||||
CPPUNIT_ASSERT(playlistElement->getId()->getId() == 111);
|
||||
CPPUNIT_ASSERT(playlistElement->getId()->getId() == 0x111);
|
||||
relativeOffset = playlistElement->getRelativeOffset();
|
||||
CPPUNIT_ASSERT(relativeOffset->total_seconds() == 0);
|
||||
|
||||
|
@ -149,16 +149,16 @@ PlaylistElementTest :: firstTest(void)
|
|||
== PlaylistElement::AudioClipType);
|
||||
|
||||
CPPUNIT_ASSERT(*playlistElement->getXmlString() ==
|
||||
"<playlistElement id=\"000000000000006f\" "
|
||||
"<playlistElement id=\"0000000000000111\" "
|
||||
"relativeOffset=\"00:00:00\">\n"
|
||||
"<audioClip id=\"0000000000002713\" "
|
||||
"<audioClip id=\"0000000000010003\" "
|
||||
"playlength=\"00:00:11\" "
|
||||
"title=\"three\"/>\n"
|
||||
"</playlistElement>");
|
||||
|
||||
// and the audio clip inside the playlist element
|
||||
CPPUNIT_ASSERT(playlistElement->getAudioClip()->getId()->getId()
|
||||
== 10003);
|
||||
== 0x10003);
|
||||
|
||||
// check that we can access this audio clip as a Playable instance
|
||||
CPPUNIT_ASSERT(playlistElement->getAudioClip()
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
|
||||
Author : $Author: fgerlits $
|
||||
Version : $Revision: 1.15 $
|
||||
Version : $Revision: 1.16 $
|
||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/core/src/PlaylistTest.cxx,v $
|
||||
|
||||
------------------------------------------------------------------------------*/
|
||||
|
@ -108,7 +108,7 @@ void
|
|||
PlaylistTest :: firstTest(void)
|
||||
throw (CPPUNIT_NS::Exception)
|
||||
{
|
||||
CPPUNIT_ASSERT(playlist->getId()->getId() == 1);
|
||||
CPPUNIT_ASSERT(playlist->getId()->getId() == 0x1);
|
||||
Ptr<const boost::posix_time::time_duration>::Ref duration
|
||||
= playlist->getPlaylength();
|
||||
CPPUNIT_ASSERT(duration->total_seconds() == 34);
|
||||
|
@ -117,18 +117,18 @@ PlaylistTest :: firstTest(void)
|
|||
|
||||
CPPUNIT_ASSERT(*playlist->getXmlString() ==
|
||||
"<playlist id=\"0000000000000001\" playlength=\"00:00:34\">\n"
|
||||
"<playlistElement id=\"0000000000000065\" relativeOffset=\"00:00:00\">\n"
|
||||
"<audioClip id=\"0000000000002711\" playlength=\"00:00:11\" title=\"one\"/>\n"
|
||||
"<playlistElement id=\"0000000000000101\" relativeOffset=\"00:00:00\">\n"
|
||||
"<audioClip id=\"0000000000010001\" playlength=\"00:00:11\" title=\"one\"/>\n"
|
||||
"</playlistElement>\n"
|
||||
"<playlistElement id=\"0000000000000066\" relativeOffset=\"00:00:11\">\n"
|
||||
"<audioClip id=\"0000000000002712\" playlength=\"00:00:12\" title=\"two\"/>\n"
|
||||
"<fadeInfo id=\"00000000000026ad\" fadeIn=\"00:00:02\" "
|
||||
"<playlistElement id=\"0000000000000102\" relativeOffset=\"00:00:11\">\n"
|
||||
"<audioClip id=\"0000000000010002\" playlength=\"00:00:12\" title=\"two\"/>\n"
|
||||
"<fadeInfo id=\"0000000000009901\" fadeIn=\"00:00:02\" "
|
||||
"fadeOut=\"00:00:01.500000\"/>\n"
|
||||
"</playlistElement>\n"
|
||||
"<playlistElement id=\"0000000000000067\" relativeOffset=\"00:00:23\">\n"
|
||||
"<playlistElement id=\"0000000000000103\" relativeOffset=\"00:00:23\">\n"
|
||||
"<playlist id=\"0000000000000002\" playlength=\"00:00:11\">\n"
|
||||
"<playlistElement id=\"000000000000006f\" relativeOffset=\"00:00:00\">\n"
|
||||
"<audioClip id=\"0000000000002713\" playlength=\"00:00:11\" title=\"three\"/>\n"
|
||||
"<playlistElement id=\"0000000000000111\" relativeOffset=\"00:00:00\">\n"
|
||||
"<audioClip id=\"0000000000010003\" playlength=\"00:00:11\" title=\"three\"/>\n"
|
||||
"</playlistElement>\n"
|
||||
"</playlist>\n"
|
||||
"</playlistElement>\n"
|
||||
|
@ -137,25 +137,25 @@ PlaylistTest :: firstTest(void)
|
|||
Playlist::const_iterator it = playlist->begin();
|
||||
CPPUNIT_ASSERT(it != playlist->end());
|
||||
Ptr<PlaylistElement>::Ref playlistElement = it->second;
|
||||
CPPUNIT_ASSERT(playlistElement->getId()->getId() == 101);
|
||||
CPPUNIT_ASSERT(playlistElement->getId()->getId() == 0x101);
|
||||
Ptr<const time_duration>::Ref relativeOffset
|
||||
= playlistElement->getRelativeOffset();
|
||||
CPPUNIT_ASSERT(relativeOffset->total_seconds() == 0);
|
||||
CPPUNIT_ASSERT(playlistElement->getType()
|
||||
== PlaylistElement::AudioClipType);
|
||||
CPPUNIT_ASSERT(playlistElement->getAudioClip()->getId()->getId()
|
||||
== 10001);
|
||||
== 0x10001);
|
||||
|
||||
++it;
|
||||
CPPUNIT_ASSERT(it != playlist->end());
|
||||
playlistElement = it->second;
|
||||
CPPUNIT_ASSERT(playlistElement->getId()->getId() == 102);
|
||||
CPPUNIT_ASSERT(playlistElement->getId()->getId() == 0x102);
|
||||
relativeOffset = playlistElement->getRelativeOffset();
|
||||
CPPUNIT_ASSERT(relativeOffset->total_seconds() == 11);
|
||||
CPPUNIT_ASSERT(playlistElement->getType()
|
||||
== PlaylistElement::AudioClipType);
|
||||
CPPUNIT_ASSERT(playlistElement->getAudioClip()->getId()->getId()
|
||||
== 10002);
|
||||
== 0x10002);
|
||||
|
||||
++it;
|
||||
// CPPUNIT_ASSERT(it == playlist->end());
|
||||
|
@ -198,7 +198,7 @@ void
|
|||
PlaylistTest :: audioClipTest(void)
|
||||
throw (CPPUNIT_NS::Exception)
|
||||
{
|
||||
Ptr<UniqueId>::Ref clipId(new UniqueId(20001));
|
||||
Ptr<UniqueId>::Ref clipId(new UniqueId("20001"));
|
||||
Ptr<time_duration>::Ref clipLength(new time_duration(0,30,0,0));
|
||||
Ptr<AudioClip>::Ref audioClip(new AudioClip(clipId, clipLength));
|
||||
|
||||
|
@ -229,7 +229,7 @@ PlaylistTest :: audioClipTest(void)
|
|||
CPPUNIT_ASSERT(playlistElement->getType()
|
||||
== PlaylistElement::AudioClipType);
|
||||
CPPUNIT_ASSERT(playlistElement->getAudioClip()->getId()->getId()
|
||||
== 20001);
|
||||
== 0x20001);
|
||||
|
||||
Ptr<const time_duration>::Ref otherRelativeOffset
|
||||
= playlistElement->getRelativeOffset();
|
||||
|
@ -306,7 +306,7 @@ PlaylistTest :: savedCopyTest(void)
|
|||
CPPUNIT_ASSERT(playlistElement->getType()
|
||||
== PlaylistElement::AudioClipType);
|
||||
CPPUNIT_ASSERT(playlistElement->getAudioClip()->getId()->getId()
|
||||
== 10002);
|
||||
== 0x10002);
|
||||
++it;
|
||||
CPPUNIT_ASSERT(it != playlist->end());
|
||||
++it;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue