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
|
@ -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;
|
||||
|
|
|
@ -24,43 +24,47 @@
|
|||
<!ATTLIST fadeInfo fadeOut NMTOKEN #REQUIRED >
|
||||
]>
|
||||
<testStorage tempFiles="file:///tmp/tempPlaylist">
|
||||
<playlist id="1" playlength="00:00:34.000" >
|
||||
<playlistElement id="101" relativeOffset="0" >
|
||||
<audioClip id="10001" playlength="00:00:11.000"
|
||||
<playlist id="0000000000000001" playlength="00:00:34.000" >
|
||||
<playlistElement id="0000000000000101" relativeOffset="0" >
|
||||
<audioClip id="0000000000010001" playlength="00:00:11.000"
|
||||
title="one"
|
||||
uri="file:var/test10001.mp3" />
|
||||
</playlistElement>
|
||||
<playlistElement id="102" relativeOffset="00:00:11.000000" >
|
||||
<audioClip id="10002" playlength="00:00:12.000000"
|
||||
<playlistElement id="0000000000000102"
|
||||
relativeOffset="00:00:11.000000" >
|
||||
<audioClip id="0000000000010002" playlength="00:00:12.000000"
|
||||
title="two"
|
||||
uri="file:var/test10002.mp3" />
|
||||
<fadeInfo id="9901" fadeIn="00:00:02.000000"
|
||||
<fadeInfo id="0000000000009901" fadeIn="00:00:02.000000"
|
||||
fadeOut="00:00:01.500000" />
|
||||
</playlistElement>
|
||||
<playlistElement id="103" relativeOffset="00:00:23.000000" >
|
||||
<playlist id="2" playlength="00:00:11.000000" >
|
||||
<playlistElement id="111" relativeOffset="0" >
|
||||
<audioClip id="10003" playlength="00:00:11.000"
|
||||
<playlistElement id="0000000000000103"
|
||||
relativeOffset="00:00:23.000000" >
|
||||
<playlist id="0000000000000002"
|
||||
playlength="00:00:11.000000" >
|
||||
<playlistElement id="0000000000000111" relativeOffset="0" >
|
||||
<audioClip id="0000000000010003"
|
||||
playlength="00:00:11.000"
|
||||
title="three"
|
||||
uri="file:var/test10003.mp3" />
|
||||
</playlistElement>
|
||||
</playlist>
|
||||
</playlistElement>
|
||||
</playlist>
|
||||
<playlist id="2" playlength="00:00:11.000000" >
|
||||
<playlistElement id="111" relativeOffset="0" >
|
||||
<audioClip id="10003" playlength="00:00:11.000"
|
||||
<playlist id="0000000000000002" playlength="00:00:11.000000" >
|
||||
<playlistElement id="0000000000000111" relativeOffset="0" >
|
||||
<audioClip id="0000000000010003" playlength="00:00:11.000"
|
||||
title="three"
|
||||
uri="file:var/test10003.mp3" />
|
||||
</playlistElement>
|
||||
</playlist>
|
||||
<audioClip id="10001" playlength="01:00:00.000"
|
||||
<audioClip id="0000000000010001" playlength="01:00:00.000"
|
||||
title="one"
|
||||
uri="file:var/test10001.mp3" />
|
||||
<audioClip id="10002" playlength="00:30:00.000"
|
||||
<audioClip id="0000000000010002" playlength="00:30:00.000"
|
||||
title="two"
|
||||
uri="file:var/test10002.mp3" />
|
||||
<audioClip id="10003" playlength="00:30:00.000"
|
||||
<audioClip id="0000000000010003" playlength="00:30:00.000"
|
||||
title="three"
|
||||
uri="file:var/test10003.mp3" />
|
||||
</testStorage>
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
|
||||
Author : $Author: fgerlits $
|
||||
Version : $Revision: 1.22 $
|
||||
Version : $Revision: 1.23 $
|
||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storage/src/TestStorageClient.cxx,v $
|
||||
|
||||
------------------------------------------------------------------------------*/
|
||||
|
@ -257,7 +257,7 @@ TestStorageClient :: acquirePlaylist(Ptr<SessionId>::Ref sessionId,
|
|||
PlaylistMap::const_iterator playlistMapIt = playlistMap.find(id->getId());
|
||||
|
||||
if (playlistMapIt == playlistMap.end()) {
|
||||
throw StorageException("no such playlist");
|
||||
throw Storage::InvalidArgumentException("no such playlist");
|
||||
}
|
||||
|
||||
Ptr<Playlist>::Ref oldPlaylist = playlistMapIt->second;
|
||||
|
@ -317,14 +317,15 @@ TestStorageClient :: acquirePlaylist(Ptr<SessionId>::Ref sessionId,
|
|||
++it;
|
||||
}
|
||||
else { // this should never happen
|
||||
Ptr<Playlist>::Ref nullPointer;
|
||||
return nullPointer;
|
||||
throw Storage::InvalidArgumentException(
|
||||
"unexpected playlist element type "
|
||||
"(neither audio clip nor playlist)");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
std::stringstream fileName;
|
||||
fileName << localTempStorage << newPlaylist->getId()->getId()
|
||||
fileName << localTempStorage << std::string(*newPlaylist->getId())
|
||||
<< "-" << std::rand() << ".smil";
|
||||
|
||||
smilDocument->write_to_file(fileName.str(), "UTF-8");
|
||||
|
@ -344,20 +345,20 @@ TestStorageClient :: releasePlaylist(Ptr<SessionId>::Ref sessionId,
|
|||
throw (StorageException)
|
||||
{
|
||||
if (! playlist->getUri()) {
|
||||
throw StorageException("playlist URI not found");
|
||||
throw Storage::InvalidArgumentException("playlist URI not found");
|
||||
}
|
||||
|
||||
|
||||
std::ifstream ifs(playlist->getUri()->substr(7).c_str());
|
||||
if (!ifs) {
|
||||
if (!ifs) { // cut of "file://"
|
||||
ifs.close();
|
||||
throw StorageException("playlist temp file not found");
|
||||
throw Storage::IOException("playlist temp file not found");
|
||||
}
|
||||
ifs.close();
|
||||
|
||||
std::remove(playlist->getUri()->substr(7).c_str());
|
||||
|
||||
int badPlaylistElements = 0;
|
||||
Playlist::const_iterator it = playlist->begin();
|
||||
std::string eMsg = "";
|
||||
Playlist::const_iterator it = playlist->begin();
|
||||
while (it != playlist->end()) {
|
||||
Ptr<PlaylistElement>::Ref plElement = it->second;
|
||||
if (plElement->getType() == PlaylistElement::AudioClipType) {
|
||||
|
@ -365,7 +366,8 @@ TestStorageClient :: releasePlaylist(Ptr<SessionId>::Ref sessionId,
|
|||
releaseAudioClip(sessionId, it->second->getAudioClip());
|
||||
}
|
||||
catch (StorageException &e) {
|
||||
++badPlaylistElements;
|
||||
eMsg += e.what();
|
||||
eMsg += "\n";
|
||||
}
|
||||
++it;
|
||||
}
|
||||
|
@ -374,23 +376,22 @@ TestStorageClient :: releasePlaylist(Ptr<SessionId>::Ref sessionId,
|
|||
releasePlaylist(sessionId, it->second->getPlaylist());
|
||||
}
|
||||
catch (StorageException &e) {
|
||||
++badPlaylistElements;
|
||||
eMsg += e.what();
|
||||
eMsg += "\n";
|
||||
}
|
||||
++it;
|
||||
}
|
||||
else { // this should never happen
|
||||
++badPlaylistElements;
|
||||
eMsg += "unexpected playlist element type\n";
|
||||
}
|
||||
}
|
||||
|
||||
Ptr<std::string>::Ref nullPointer;
|
||||
playlist->setUri(nullPointer);
|
||||
|
||||
if (badPlaylistElements) {
|
||||
std::stringstream eMsg;
|
||||
eMsg << "could not release " << badPlaylistElements
|
||||
<< " playlist elements in playlist";
|
||||
throw StorageException(eMsg.str());
|
||||
if (eMsg != "") {
|
||||
eMsg.insert(0, "some playlist elements could not be released:\n");
|
||||
throw Storage::InvalidArgumentException(eMsg);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
|
||||
Author : $Author: fgerlits $
|
||||
Version : $Revision: 1.17 $
|
||||
Version : $Revision: 1.18 $
|
||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storage/src/TestStorageClientTest.cxx,v $
|
||||
|
||||
------------------------------------------------------------------------------*/
|
||||
|
@ -129,8 +129,8 @@ void
|
|||
TestStorageClientTest :: deletePlaylistTest(void)
|
||||
throw (CPPUNIT_NS::Exception)
|
||||
{
|
||||
Ptr<UniqueId>::Ref id1(new UniqueId(1));
|
||||
Ptr<UniqueId>::Ref id2(new UniqueId(77));
|
||||
Ptr<UniqueId>::Ref id1(new UniqueId(0x1));
|
||||
Ptr<UniqueId>::Ref id2(new UniqueId(0x77));
|
||||
|
||||
try {
|
||||
tsc->deletePlaylist(dummySessionId, id2);
|
||||
|
@ -162,7 +162,7 @@ TestStorageClientTest :: getAllPlaylistsTest(void)
|
|||
CPPUNIT_ASSERT(playlistVector->size() == 2);
|
||||
|
||||
Ptr<Playlist>::Ref playlist = (*playlistVector)[0];
|
||||
CPPUNIT_ASSERT((int) (playlist->getId()->getId()) == 1);
|
||||
CPPUNIT_ASSERT((int) (playlist->getId()->getId()) == 0x1);
|
||||
}
|
||||
|
||||
|
||||
|
@ -186,8 +186,8 @@ void
|
|||
TestStorageClientTest :: audioClipTest(void)
|
||||
throw (CPPUNIT_NS::Exception)
|
||||
{
|
||||
Ptr<UniqueId>::Ref id02(new UniqueId(10002));
|
||||
Ptr<UniqueId>::Ref id77(new UniqueId(10077));
|
||||
Ptr<UniqueId>::Ref id02(new UniqueId(0x10002));
|
||||
Ptr<UniqueId>::Ref id77(new UniqueId(0x10077));
|
||||
|
||||
CPPUNIT_ASSERT(tsc->existsAudioClip(dummySessionId, id02));
|
||||
CPPUNIT_ASSERT(!tsc->existsAudioClip(dummySessionId, id77));
|
||||
|
@ -203,7 +203,7 @@ TestStorageClientTest :: audioClipTest(void)
|
|||
CPPUNIT_ASSERT(audioClipVector->size() == 3);
|
||||
|
||||
audioClip = (*audioClipVector)[0];
|
||||
CPPUNIT_ASSERT((int) (audioClip->getId()->getId()) == 10001);
|
||||
CPPUNIT_ASSERT((int) (audioClip->getId()->getId()) == 0x10001);
|
||||
|
||||
tsc->deleteAudioClip(dummySessionId, id02);
|
||||
CPPUNIT_ASSERT(!tsc->existsAudioClip(dummySessionId, id02));
|
||||
|
@ -220,8 +220,8 @@ void
|
|||
TestStorageClientTest :: acquireAudioClipTest(void)
|
||||
throw (CPPUNIT_NS::Exception)
|
||||
{
|
||||
Ptr<UniqueId>::Ref id2(new UniqueId(10002));
|
||||
Ptr<UniqueId>::Ref id77(new UniqueId(10077));
|
||||
Ptr<UniqueId>::Ref id2(new UniqueId(0x10002));
|
||||
Ptr<UniqueId>::Ref id77(new UniqueId(0x10077));
|
||||
Ptr<AudioClip>::Ref audioClip;
|
||||
|
||||
try {
|
||||
|
@ -262,8 +262,8 @@ void
|
|||
TestStorageClientTest :: acquirePlaylistTest(void)
|
||||
throw (CPPUNIT_NS::Exception)
|
||||
{
|
||||
Ptr<UniqueId>::Ref id1(new UniqueId(1));
|
||||
Ptr<UniqueId>::Ref id77(new UniqueId(77));
|
||||
Ptr<UniqueId>::Ref id1(new UniqueId(0x1));
|
||||
Ptr<UniqueId>::Ref id77(new UniqueId(0x77));
|
||||
Ptr<Playlist>::Ref playlist;
|
||||
|
||||
try {
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
|
||||
Author : $Author: fgerlits $
|
||||
Version : $Revision: 1.17 $
|
||||
Version : $Revision: 1.18 $
|
||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storage/src/WebStorageClient.cxx,v $
|
||||
|
||||
------------------------------------------------------------------------------*/
|
||||
|
@ -149,6 +149,16 @@ static const std::string smilAudioClipNodeName = "audio";
|
|||
*----------------------------------------------------------------------------*/
|
||||
static const std::string smilAudioClipUriAttrName = "src";
|
||||
|
||||
/*------------------------------------------------------------------------------
|
||||
* The name of the sub-playlist element node in the SMIL file.
|
||||
*----------------------------------------------------------------------------*/
|
||||
static const std::string smilPlaylistNodeName = "audio";
|
||||
|
||||
/*------------------------------------------------------------------------------
|
||||
* The name of the attribute containing the URI of the sub-playlist element.
|
||||
*----------------------------------------------------------------------------*/
|
||||
static const std::string smilPlaylistUriAttrName = "src";
|
||||
|
||||
|
||||
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ storage server constants: error reports */
|
||||
|
||||
|
@ -799,6 +809,7 @@ WebStorageClient :: editPlaylist(Ptr<SessionId>::Ref sessionId,
|
|||
{
|
||||
Ptr<Playlist>::Ref playlist(new Playlist(id));
|
||||
Ptr<const std::string>::Ref url, token;
|
||||
|
||||
editPlaylistGetUrl(sessionId, id, url, token);
|
||||
|
||||
try {
|
||||
|
@ -955,8 +966,79 @@ WebStorageClient :: acquirePlaylist(Ptr<SessionId>::Ref sessionId,
|
|||
Ptr<UniqueId>::Ref id) const
|
||||
throw (StorageException)
|
||||
{
|
||||
Ptr<Playlist>::Ref playlist(new Playlist);
|
||||
return playlist;
|
||||
Ptr<Playlist>::Ref oldPlaylist = getPlaylist(sessionId, id);
|
||||
|
||||
Ptr<time_duration>::Ref playlength = oldPlaylist->getPlaylength();
|
||||
Ptr<Playlist>::Ref newPlaylist(new Playlist(UniqueId::generateId(),
|
||||
playlength));
|
||||
Ptr<xmlpp::Document>::Ref
|
||||
smilDocument(new xmlpp::Document(xmlVersion));
|
||||
xmlpp::Element * smilRootNode
|
||||
= smilDocument->create_root_node(smilRootNodeName);
|
||||
smilRootNode->set_attribute(smilLanguageAttrName,
|
||||
smilLanguageAttrValue);
|
||||
smilRootNode->set_attribute(smilExtensionsAttrName,
|
||||
smilExtensionsAttrValue);
|
||||
|
||||
xmlpp::Element * smilBodyNode
|
||||
= smilRootNode->add_child(smilBodyNodeName);
|
||||
xmlpp::Element * smilSeqNode
|
||||
= smilBodyNode->add_child(smilSeqNodeName);
|
||||
|
||||
Playlist::const_iterator it = oldPlaylist->begin();
|
||||
|
||||
while (it != oldPlaylist->end()) {
|
||||
Ptr<PlaylistElement>::Ref plElement = it->second;
|
||||
Ptr<FadeInfo>::Ref fadeInfo = plElement->getFadeInfo();
|
||||
|
||||
if (plElement->getType() == PlaylistElement::AudioClipType) {
|
||||
Ptr<AudioClip>::Ref audioClip
|
||||
= acquireAudioClip(sessionId, plElement
|
||||
->getAudioClip()
|
||||
->getId());
|
||||
Ptr<time_duration>::Ref relativeOffset
|
||||
= plElement->getRelativeOffset();
|
||||
newPlaylist->addAudioClip(audioClip, relativeOffset, fadeInfo);
|
||||
|
||||
xmlpp::Element* smilAudioClipNode
|
||||
= smilSeqNode->add_child(smilAudioClipNodeName);
|
||||
smilAudioClipNode->set_attribute(
|
||||
smilAudioClipUriAttrName,
|
||||
*(audioClip->getUri()) );
|
||||
++it;
|
||||
}
|
||||
else if (plElement->getType() == PlaylistElement::PlaylistType) {
|
||||
Ptr<Playlist>::Ref playlist
|
||||
= acquirePlaylist(sessionId, plElement
|
||||
->getPlaylist()
|
||||
->getId());
|
||||
Ptr<time_duration>::Ref relativeOffset
|
||||
= plElement->getRelativeOffset();
|
||||
newPlaylist->addPlaylist(playlist, relativeOffset, fadeInfo);
|
||||
|
||||
xmlpp::Element* smilPlaylistNode
|
||||
= smilSeqNode->add_child(smilPlaylistNodeName);
|
||||
smilPlaylistNode->set_attribute(
|
||||
smilPlaylistUriAttrName,
|
||||
*(playlist->getUri()) );
|
||||
++it;
|
||||
}
|
||||
else { // this should never happen
|
||||
throw Storage::InvalidArgumentException(
|
||||
"unexpected playlist element type "
|
||||
"(neither audio clip nor playlist)");
|
||||
}
|
||||
}
|
||||
|
||||
std::stringstream fileName;
|
||||
fileName << localTempStorage << std::string(*newPlaylist->getId())
|
||||
<< "-" << std::rand() << ".smil";
|
||||
|
||||
smilDocument->write_to_file(fileName.str(), "UTF-8");
|
||||
|
||||
Ptr<std::string>::Ref playlistUri(new std::string(fileName.str()));
|
||||
newPlaylist->setUri(playlistUri);
|
||||
return newPlaylist;
|
||||
}
|
||||
|
||||
|
||||
|
@ -968,7 +1050,55 @@ WebStorageClient :: releasePlaylist(Ptr<SessionId>::Ref sessionId,
|
|||
Ptr<Playlist>::Ref playlist) const
|
||||
throw (StorageException)
|
||||
{
|
||||
if (! playlist->getUri()) {
|
||||
throw Storage::InvalidArgumentException("playlist URI not found");
|
||||
}
|
||||
|
||||
std::ifstream ifs(playlist->getUri()->substr(7).c_str());
|
||||
if (!ifs) { // cut of "file://"
|
||||
ifs.close();
|
||||
throw Storage::IOException("playlist temp file not found");
|
||||
}
|
||||
ifs.close();
|
||||
|
||||
std::remove(playlist->getUri()->substr(7).c_str());
|
||||
|
||||
std::string eMsg = "";
|
||||
Playlist::const_iterator it = playlist->begin();
|
||||
while (it != playlist->end()) {
|
||||
Ptr<PlaylistElement>::Ref plElement = it->second;
|
||||
if (plElement->getType() == PlaylistElement::AudioClipType) {
|
||||
try {
|
||||
releaseAudioClip(sessionId, it->second->getAudioClip());
|
||||
}
|
||||
catch (StorageException &e) {
|
||||
eMsg += e.what();
|
||||
eMsg += "\n";
|
||||
}
|
||||
++it;
|
||||
}
|
||||
else if (plElement->getType() == PlaylistElement::PlaylistType) {
|
||||
try {
|
||||
releasePlaylist(sessionId, it->second->getPlaylist());
|
||||
}
|
||||
catch (StorageException &e) {
|
||||
eMsg += e.what();
|
||||
eMsg += "\n";
|
||||
}
|
||||
++it;
|
||||
}
|
||||
else { // this should never happen
|
||||
eMsg += "unexpected playlist element type\n";
|
||||
}
|
||||
}
|
||||
|
||||
Ptr<std::string>::Ref nullPointer;
|
||||
playlist->setUri(nullPointer);
|
||||
|
||||
if (eMsg != "") {
|
||||
eMsg.insert(0, "some playlist elements could not be released:\n");
|
||||
throw Storage::InvalidArgumentException(eMsg);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -1094,6 +1224,9 @@ WebStorageClient :: createPlaylist(Ptr<SessionId>::Ref sessionId)
|
|||
|
||||
Ptr<UniqueId>::Ref newId(new UniqueId(std::string(
|
||||
result[createPlaylistResultParamName] )));
|
||||
// std::cerr << "\nnew id: "
|
||||
// << std::string(result[createPlaylistResultParamName]) << "\n";
|
||||
|
||||
Ptr<const std::string>::Ref url, token;
|
||||
|
||||
editPlaylistGetUrl(sessionId, newId, url, token);
|
||||
|
@ -1310,8 +1443,10 @@ WebStorageClient :: storeAudioClip(Ptr<SessionId>::Ref sessionId,
|
|||
parameters.clear();
|
||||
parameters[storeAudioClipSessionIdParamName]
|
||||
= sessionId->getId();
|
||||
parameters[storeAudioClipAudioClipIdParamName]
|
||||
if (audioClip->getId()->getId() != 0) { // ID==0 means 'please
|
||||
parameters[storeAudioClipAudioClipIdParamName] // generate new ID'
|
||||
= std::string(*audioClip->getId());
|
||||
}
|
||||
parameters[storeAudioClipMetadataParamName]
|
||||
= std::string(*audioClip->getMetadataString());
|
||||
parameters[storeAudioClipChecksumParamName]
|
||||
|
@ -1414,8 +1549,10 @@ WebStorageClient :: storeAudioClip(Ptr<SessionId>::Ref sessionId,
|
|||
if (! result.hasMember(storeAudioClipAudioClipIdParamName)
|
||||
|| result[storeAudioClipAudioClipIdParamName].getType()
|
||||
!= XmlRpcValue::TypeString
|
||||
|| std::string(result[storeAudioClipAudioClipIdParamName])
|
||||
!= std::string(*audioClip->getId())) {
|
||||
|| (audioClip->getId()->getId() != 0
|
||||
&&
|
||||
std::string(result[storeAudioClipAudioClipIdParamName])
|
||||
!= std::string(*audioClip->getId()))) {
|
||||
std::stringstream eMsg;
|
||||
eMsg << "XML-RPC method '"
|
||||
<< storeAudioClipCloseMethodName
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
|
||||
Author : $Author: fgerlits $
|
||||
Version : $Revision: 1.12 $
|
||||
Version : $Revision: 1.13 $
|
||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storage/src/WebStorageClient.h,v $
|
||||
|
||||
------------------------------------------------------------------------------*/
|
||||
|
@ -99,7 +99,7 @@ using namespace LiveSupport::Core;
|
|||
* </code></pre>
|
||||
*
|
||||
* @author $Author: fgerlits $
|
||||
* @version $Revision: 1.12 $
|
||||
* @version $Revision: 1.13 $
|
||||
*/
|
||||
class WebStorageClient :
|
||||
virtual public Configurable,
|
||||
|
@ -363,6 +363,9 @@ class WebStorageClient :
|
|||
* form <code>file:relative_path/file_name.mp3</code>. Later this
|
||||
* should be changed to an absolute URI.
|
||||
*
|
||||
* The size of the binary file must be less than 2 GB, because the
|
||||
* storage server can not deal with larger files.
|
||||
*
|
||||
* @param sessionId the session ID from the authentication client
|
||||
* @param audioClip the audio clip to store.
|
||||
* @return true if the operation was successful.
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
|
||||
Author : $Author: fgerlits $
|
||||
Version : $Revision: 1.19 $
|
||||
Version : $Revision: 1.20 $
|
||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storage/src/WebStorageClientTest.cxx,v $
|
||||
|
||||
------------------------------------------------------------------------------*/
|
||||
|
@ -185,7 +185,7 @@ WebStorageClientTest :: playlistTest(void)
|
|||
catch (StorageException &e) {
|
||||
CPPUNIT_FAIL(e.what());
|
||||
}
|
||||
CPPUNIT_ASSERT(uniqueIdVector->size() > 0);
|
||||
CPPUNIT_ASSERT(uniqueIdVector->size() >= 3);
|
||||
Ptr<UniqueId>::Ref audioClipId = uniqueIdVector->at(0);
|
||||
|
||||
Ptr<SessionId>::Ref sessionId;
|
||||
|
@ -258,8 +258,14 @@ WebStorageClientTest :: playlistTest(void)
|
|||
catch (StorageException &e) {
|
||||
CPPUNIT_FAIL(e.what());
|
||||
}
|
||||
|
||||
Ptr<time_duration>::Ref relativeOffset(new time_duration(0,0,0,0));
|
||||
playlist->addAudioClip(audioClip, relativeOffset);
|
||||
relativeOffset.reset(new time_duration(0,0,3,0));
|
||||
playlist->addAudioClip(audioClip, relativeOffset);
|
||||
relativeOffset.reset(new time_duration(0,0,6,0));
|
||||
playlist->addAudioClip(audioClip, relativeOffset);
|
||||
|
||||
CPPUNIT_ASSERT(playlist->valid()); // WARNING: side effect; fixes the
|
||||
// playlength of the playlist
|
||||
try {
|
||||
|
@ -280,6 +286,7 @@ WebStorageClientTest :: playlistTest(void)
|
|||
CPPUNIT_FAIL(e.what());
|
||||
}
|
||||
|
||||
|
||||
// test getPlaylist()
|
||||
Ptr<Playlist>::Ref newPlaylist;
|
||||
try {
|
||||
|
@ -293,6 +300,42 @@ WebStorageClientTest :: playlistTest(void)
|
|||
== playlist->getPlaylength()->total_seconds());
|
||||
// NOTE: we really ought to define == for playlists...
|
||||
|
||||
|
||||
// test acquirePlaylist() and releasePlaylist()
|
||||
try {
|
||||
newPlaylist = wsc->acquirePlaylist(sessionId, playlistIdxx);
|
||||
}
|
||||
catch (StorageException &e) {
|
||||
CPPUNIT_FAIL(e.what());
|
||||
}
|
||||
CPPUNIT_ASSERT(newPlaylist);
|
||||
CPPUNIT_ASSERT(newPlaylist->getUri());
|
||||
//std::cerr << "url:\n" << *newPlaylist->getUri() << "\n";
|
||||
|
||||
std::ifstream ifs(newPlaylist->getUri()->substr(7).c_str());
|
||||
if (!ifs) { // cut off "file://"
|
||||
ifs.close();
|
||||
CPPUNIT_FAIL("playlist temp file not found");
|
||||
}
|
||||
// std::stringstream playlistSmilFile;
|
||||
// std::string tempString;
|
||||
// while (ifs) {
|
||||
// std::getline(ifs, tempString);
|
||||
// playlistSmilFile << tempString << "\n";
|
||||
// }
|
||||
//std::cerr << "smil:\n" << playlistSmilFile.str() << "\n";
|
||||
//sleep(60);
|
||||
ifs.close();
|
||||
|
||||
try {
|
||||
wsc->releasePlaylist(sessionId, newPlaylist);
|
||||
}
|
||||
catch (StorageException &e) {
|
||||
CPPUNIT_FAIL(e.what());
|
||||
}
|
||||
CPPUNIT_ASSERT(!newPlaylist->getUri());
|
||||
|
||||
|
||||
// test deletePlaylist()
|
||||
try {
|
||||
wsc->deletePlaylist(sessionId, playlistIdxx);
|
||||
|
@ -325,13 +368,13 @@ WebStorageClientTest :: audioClipTest(void)
|
|||
catch (StorageException &e) {
|
||||
CPPUNIT_FAIL(e.what());
|
||||
}
|
||||
CPPUNIT_ASSERT(uniqueIdVector->size() > 0);
|
||||
Ptr<UniqueId>::Ref id01 = uniqueIdVector->at(0);
|
||||
CPPUNIT_ASSERT(uniqueIdVector->size() >= 2);
|
||||
Ptr<UniqueId>::Ref id01 = uniqueIdVector->at(1);
|
||||
|
||||
/* std::cout << "\nReset storage result:\n";
|
||||
for (unsigned i=0; i<uniqueIdVector->size(); i++) {
|
||||
std::cout << std::hex << std::string(*uniqueIdVector->at(i)) << std::endl;
|
||||
} */
|
||||
// std::cout << "\nReset storage result:\n";
|
||||
// for (unsigned i=0; i<uniqueIdVector->size(); i++) {
|
||||
// std::cout << std::hex << std::string(*uniqueIdVector->at(i)) << std::endl;
|
||||
// }
|
||||
|
||||
Ptr<SessionId>::Ref sessionId;
|
||||
try {
|
||||
|
|
|
@ -21,17 +21,17 @@
|
|||
<!ATTLIST fadeInfo fadeOut NMTOKEN #REQUIRED >
|
||||
]>
|
||||
|
||||
<playlist id="1" playlength="01:30:00.000">
|
||||
<playlistElement id="101" relativeOffset="0" >
|
||||
<audioClip id="10001" playlength="01:00:00.000"
|
||||
<playlist id="0000000000000001" playlength="01:30:00.000">
|
||||
<playlistElement id="0000000000000101" relativeOffset="0" >
|
||||
<audioClip id="0000000000010001" playlength="01:00:00.000"
|
||||
title="one"
|
||||
uri="file:var/test1.mp3"/>
|
||||
</playlistElement>
|
||||
<playlistElement id="102" relativeOffset="01:00:00.000" >
|
||||
<audioClip id="10002" playlength="00:30:00.000"
|
||||
<playlistElement id="0000000000000102" relativeOffset="01:00:00.000" >
|
||||
<audioClip id="0000000000010002" playlength="00:30:00.000"
|
||||
title="two"
|
||||
uri="file:var/test2.mp3"/>
|
||||
<fadeInfo id="9901" fadeIn="00:00:02.000"
|
||||
fadeOut="00:00:01.500000" />
|
||||
<fadeInfo id="0000000000009901" fadeIn="00:00:02.000"
|
||||
fadeOut="00:00:01.500000" />
|
||||
</playlistElement>
|
||||
</playlist>
|
||||
|
|
|
@ -63,22 +63,25 @@
|
|||
|
||||
<storageClientFactory>
|
||||
<testStorage tempFiles="file:///tmp/tempPlaylist">
|
||||
<playlist id="1" playlength="01:30:00.000">
|
||||
<playlistElement id="101" relativeOffset="0" >
|
||||
<audioClip id="10001" playlength="01:00:00.000"
|
||||
<playlist id="0000000000000001" playlength="01:30:00.000">
|
||||
<playlistElement id="0000000000000101" relativeOffset="0" >
|
||||
<audioClip id="0000000000010001"
|
||||
playlength="01:00:00.000"
|
||||
title="one"
|
||||
uri="file:var/test1.mp3" />
|
||||
</playlistElement>
|
||||
<playlistElement id="102" relativeOffset="01:00:00.000" >
|
||||
<audioClip id="10002" playlength="00:30:00.000"
|
||||
<playlistElement id="0000000000000102"
|
||||
relativeOffset="01:00:00.000" >
|
||||
<audioClip id="0000000000010002"
|
||||
playlength="00:30:00.000"
|
||||
title="two"
|
||||
uri="file:var/test2.mp3" />
|
||||
</playlistElement>
|
||||
</playlist>
|
||||
<audioClip id="10001" playlength="01:00:00.000"
|
||||
<audioClip id="0000000000010001" playlength="01:00:00.000"
|
||||
title="one"
|
||||
uri="file:var/test1.mp3" />
|
||||
<audioClip id="10002" playlength="00:30:00.000"
|
||||
<audioClip id="0000000000010002" playlength="00:30:00.000"
|
||||
title="two"
|
||||
uri="file:var/test2.mp3" />
|
||||
</testStorage>
|
||||
|
|
|
@ -27,22 +27,23 @@
|
|||
]>
|
||||
<storageClientFactory>
|
||||
<testStorage tempFiles="file:///tmp/tempPlaylist">
|
||||
<playlist id="1" playlength="01:30:00.000">
|
||||
<playlistElement id="101" relativeOffset="0" >
|
||||
<audioClip id="10001" playlength="01:00:00.000"
|
||||
<playlist id="0000000000000001" playlength="01:30:00.000">
|
||||
<playlistElement id="0000000000000101" relativeOffset="0" >
|
||||
<audioClip id="0000000000010001" playlength="01:00:00.000"
|
||||
title="one"
|
||||
uri="file:var/test1.mp3" />
|
||||
</playlistElement>
|
||||
<playlistElement id="102" relativeOffset="01:00:00.000" >
|
||||
<audioClip id="10002" playlength="00:30:00.000"
|
||||
<playlistElement id="0000000000000102"
|
||||
relativeOffset="01:00:00.000" >
|
||||
<audioClip id="0000000000010002" playlength="00:30:00.000"
|
||||
title="two"
|
||||
uri="file:var/test2.mp3" />
|
||||
</playlistElement>
|
||||
</playlist>
|
||||
<audioClip id="10001" playlength="01:00:00.000"
|
||||
<audioClip id="0000000000010001" playlength="01:00:00.000"
|
||||
title="one"
|
||||
uri="file:var/test1.mp3" />
|
||||
<audioClip id="10002" playlength="00:30:00.000"
|
||||
<audioClip id="0000000000010002" playlength="00:30:00.000"
|
||||
title="two"
|
||||
uri="file:var/test2.mp3" />
|
||||
</testStorage>
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
|
||||
Author : $Author: fgerlits $
|
||||
Version : $Revision: 1.8 $
|
||||
Version : $Revision: 1.9 $
|
||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/AddAudioClipToPlaylistMethodTest.cxx,v $
|
||||
|
||||
------------------------------------------------------------------------------*/
|
||||
|
@ -179,7 +179,7 @@ AddAudioClipToPlaylistMethodTest :: firstTest(void)
|
|||
parameters.clear();
|
||||
parameters["sessionId"] = sessionId->getId();
|
||||
parameters["playlistId"] = 1;
|
||||
parameters["audioClipId"] = 10001;
|
||||
parameters["audioClipId"] = 0x10001;
|
||||
parameters["relativeOffset"] = 60*60;
|
||||
rootParameter[0] = parameters;
|
||||
|
||||
|
@ -206,7 +206,7 @@ AddAudioClipToPlaylistMethodTest :: firstTest(void)
|
|||
parameters.clear();
|
||||
parameters["sessionId"] = sessionId->getId();
|
||||
parameters["playlistId"] = 1;
|
||||
parameters["audioClipId"] = 10001;
|
||||
parameters["audioClipId"] = 0x10001;
|
||||
parameters["relativeOffset"] = 90*60;
|
||||
rootParameter[0] = parameters;
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
|
||||
Author : $Author: fgerlits $
|
||||
Version : $Revision: 1.5 $
|
||||
Version : $Revision: 1.6 $
|
||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/DisplayAudioClipMethodTest.cxx,v $
|
||||
|
||||
------------------------------------------------------------------------------*/
|
||||
|
@ -173,7 +173,7 @@ DisplayAudioClipMethodTest :: firstTest(void)
|
|||
|
||||
// set up a structure for the parameter
|
||||
parameter["sessionId"] = sessionId->getId();
|
||||
parameter["audioClipId"] = 10001;
|
||||
parameter["audioClipId"] = 0x10001;
|
||||
rootParameter[0] = parameter;
|
||||
|
||||
result.clear();
|
||||
|
@ -186,7 +186,7 @@ DisplayAudioClipMethodTest :: firstTest(void)
|
|||
<< " - " << e.getMessage();
|
||||
CPPUNIT_FAIL(eMsg.str());
|
||||
}
|
||||
CPPUNIT_ASSERT(int(result["id"]) == 10001);
|
||||
CPPUNIT_ASSERT(int(result["id"]) == 0x10001);
|
||||
CPPUNIT_ASSERT(int(result["playlength"]) == (60 * 60));
|
||||
}
|
||||
|
||||
|
@ -206,7 +206,7 @@ DisplayAudioClipMethodTest :: negativeTest(void)
|
|||
|
||||
// set up a structure for the parameter
|
||||
parameter["sessionId"] = sessionId->getId();
|
||||
parameter["audioClipId"] = 9999;
|
||||
parameter["audioClipId"] = 0x9999;
|
||||
rootParameter[0] = parameter;
|
||||
|
||||
result.clear();
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
|
||||
Author : $Author: fgerlits $
|
||||
Version : $Revision: 1.5 $
|
||||
Version : $Revision: 1.6 $
|
||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/DisplayAudioClipsMethodTest.cxx,v $
|
||||
|
||||
------------------------------------------------------------------------------*/
|
||||
|
@ -188,11 +188,11 @@ DisplayAudioClipsMethodTest :: firstTest(void)
|
|||
CPPUNIT_ASSERT(result.size() == 2);
|
||||
|
||||
audioClip = result[0];
|
||||
CPPUNIT_ASSERT(int(audioClip["id"]) == 10001);
|
||||
CPPUNIT_ASSERT(int(audioClip["id"]) == 0x10001);
|
||||
CPPUNIT_ASSERT(int(audioClip["playlength"]) == 60 * 60);
|
||||
|
||||
audioClip = result[1];
|
||||
CPPUNIT_ASSERT(int(audioClip["id"]) == 10002);
|
||||
CPPUNIT_ASSERT(int(audioClip["id"]) == 0x10002);
|
||||
CPPUNIT_ASSERT(int(audioClip["playlength"]) == 30 * 60);
|
||||
}
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
|
||||
Author : $Author: fgerlits $
|
||||
Version : $Revision: 1.6 $
|
||||
Version : $Revision: 1.7 $
|
||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/RemoveAudioClipFromPlaylistMethodTest.cxx,v $
|
||||
|
||||
------------------------------------------------------------------------------*/
|
||||
|
@ -184,7 +184,7 @@ RemoveAudioClipFromPlaylistMethodTest :: firstTest(void)
|
|||
|
||||
parameters["sessionId"] = sessionId->getId();
|
||||
parameters["playlistId"] = 1;
|
||||
parameters["audioClipId"] = 10001;
|
||||
parameters["audioClipId"] = 0x10001;
|
||||
parameters["relativeOffset"] = 90*60;
|
||||
rootParameter[0] = parameters;
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
|
||||
Author : $Author: fgerlits $
|
||||
Version : $Revision: 1.3 $
|
||||
Version : $Revision: 1.4 $
|
||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/RpcAddAudioClipToPlaylistTest.cxx,v $
|
||||
|
||||
------------------------------------------------------------------------------*/
|
||||
|
@ -195,7 +195,7 @@ RpcAddAudioClipToPlaylistTest :: firstTest(void)
|
|||
|
||||
parameters["sessionId"] = sessionId->getId();
|
||||
parameters["playlistId"] = 1;
|
||||
parameters["audioClipId"] = 10001;
|
||||
parameters["audioClipId"] = 0x10001;
|
||||
parameters["relativeOffset"] = 0;
|
||||
|
||||
result.clear();
|
||||
|
@ -211,7 +211,7 @@ RpcAddAudioClipToPlaylistTest :: firstTest(void)
|
|||
parameters.clear();
|
||||
parameters["sessionId"] = sessionId->getId();
|
||||
parameters["playlistId"] = 1;
|
||||
parameters["audioClipId"] = 10001;
|
||||
parameters["audioClipId"] = 0x10001;
|
||||
parameters["relativeOffset"] = 90*60;
|
||||
|
||||
result.clear();
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
|
||||
Author : $Author: fgerlits $
|
||||
Version : $Revision: 1.4 $
|
||||
Version : $Revision: 1.5 $
|
||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/Attic/XmlRpcToolsTest.cxx,v $
|
||||
|
||||
------------------------------------------------------------------------------*/
|
||||
|
@ -140,7 +140,7 @@ XmlRpcToolsTest :: firstTest(void)
|
|||
CPPUNIT_ASSERT(int(xmlRpcPlaylist["id"]) == 1);
|
||||
CPPUNIT_ASSERT(int(xmlRpcPlaylist["playlength"]) == 90 * 60);
|
||||
|
||||
CPPUNIT_ASSERT(int(xmlRpcAudioClip["id"]) == 10001);
|
||||
CPPUNIT_ASSERT(int(xmlRpcAudioClip["id"]) == 0x10001);
|
||||
CPPUNIT_ASSERT(int(xmlRpcAudioClip["playlength"]) == 60 * 60);
|
||||
|
||||
XmlRpcValue xmlRpcPlaylistId;
|
||||
|
|
Loading…
Reference in New Issue