added FadeInfo methods
This commit is contained in:
parent
b2e359ac21
commit
8e121e1a47
26 changed files with 1617 additions and 56 deletions
|
@ -21,7 +21,7 @@
|
|||
#
|
||||
#
|
||||
# Author : $Author: fgerlits $
|
||||
# Version : $Revision: 1.8 $
|
||||
# Version : $Revision: 1.9 $
|
||||
# Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/core/etc/Makefile.in,v $
|
||||
#
|
||||
# @configure_input@
|
||||
|
@ -86,10 +86,12 @@ LDFLAGS = @LDFLAGS@ -L${USR_LIB_DIR} -L${LIB_DIR}
|
|||
#-------------------------------------------------------------------------------
|
||||
CORE_LIB_OBJS = ${TMP_DIR}/UniqueId.o \
|
||||
${TMP_DIR}/AudioClip.o \
|
||||
${TMP_DIR}/FadeInfo.o \
|
||||
${TMP_DIR}/PlaylistElement.o \
|
||||
${TMP_DIR}/Playlist.o
|
||||
|
||||
TEST_RUNNER_OBJS = ${TMP_DIR}/AudioClipTest.o \
|
||||
${TMP_DIR}/FadeInfoTest.o \
|
||||
${TMP_DIR}/PlaylistElementTest.o \
|
||||
${TMP_DIR}/PlaylistTest.o \
|
||||
${TMP_DIR}/TestRunner.o
|
||||
|
|
9
livesupport/modules/core/etc/fadeInfo.xml
Normal file
9
livesupport/modules/core/etc/fadeInfo.xml
Normal file
|
@ -0,0 +1,9 @@
|
|||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<!DOCTYPE fadeInfo [
|
||||
|
||||
<!ELEMENT fadeInfo EMPTY >
|
||||
<!ATTLIST fadeInfo id NMTOKEN #REQUIRED >
|
||||
<!ATTLIST fadeInfo fadeIn NMTOKEN #REQUIRED >
|
||||
<!ATTLIST fadeInfo fadeOut NMTOKEN #REQUIRED >
|
||||
]>
|
||||
<fadeInfo id="9901" fadeIn="00:00:02.000" fadeOut="00:00:01.500"/>
|
|
@ -5,20 +5,27 @@
|
|||
<!ATTLIST playlist id NMTOKEN #REQUIRED >
|
||||
<!ATTLIST playlist playlength NMTOKEN #REQUIRED >
|
||||
|
||||
<!ELEMENT playlistElement (audioClip) >
|
||||
<!ELEMENT playlistElement (audioClip, fadeInfo?) >
|
||||
<!ATTLIST playlistElement id NMTOKEN #REQUIRED >
|
||||
<!ATTLIST playlistElement relativeOffset NMTOKEN #REQUIRED >
|
||||
|
||||
<!ELEMENT audioClip EMPTY >
|
||||
<!ATTLIST audioClip id NMTOKEN #REQUIRED >
|
||||
<!ATTLIST audioClip playlength NMTOKEN #REQUIRED >
|
||||
|
||||
<!ELEMENT fadeInfo EMPTY >
|
||||
<!ATTLIST fadeInfo id NMTOKEN #REQUIRED >
|
||||
<!ATTLIST fadeInfo fadeIn NMTOKEN #REQUIRED >
|
||||
<!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"/>
|
||||
<playlistElement id="101" relativeOffset="0" >
|
||||
<audioClip id="10001" playlength="01:00:00.000"/>
|
||||
</playlistElement>
|
||||
<playlistElement id="102" relativeOffset="01:00:00.000" >
|
||||
<audioClip id="10002" playlength="00:30:00.000"/>
|
||||
<playlistElement id="102" relativeOffset="01:00:00.000" >
|
||||
<audioClip id="10002" playlength="00:30:00.000"/>
|
||||
<fadeInfo id="9901" fadeIn="00:00:02.000"
|
||||
fadeOut="00:00:01.500000" />
|
||||
</playlistElement>
|
||||
</playlist>
|
||||
|
|
|
@ -1,15 +1,21 @@
|
|||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<!DOCTYPE playlistElement [
|
||||
|
||||
<!ELEMENT playlistElement (audioClip) >
|
||||
<!ELEMENT playlistElement (audioClip, fadeInfo?) >
|
||||
<!ATTLIST playlistElement id NMTOKEN #REQUIRED >
|
||||
<!ATTLIST playlistElement relativeOffset NMTOKEN #REQUIRED >
|
||||
|
||||
<!ELEMENT audioClip EMPTY >
|
||||
<!ATTLIST audioClip id NMTOKEN #REQUIRED >
|
||||
<!ATTLIST audioClip playlength NMTOKEN #REQUIRED >
|
||||
|
||||
<!ELEMENT fadeInfo EMPTY >
|
||||
<!ATTLIST fadeInfo id NMTOKEN #REQUIRED >
|
||||
<!ATTLIST fadeInfo fadeIn NMTOKEN #REQUIRED >
|
||||
<!ATTLIST fadeInfo fadeOut NMTOKEN #REQUIRED >
|
||||
]>
|
||||
|
||||
<playlistElement id="707" relativeOffset="00:12:34.000" >
|
||||
<audioClip id="10001" playlength="01:00:00.000"/>
|
||||
</playlistElement>
|
||||
<audioClip id="10001" playlength="01:00:00.000" />
|
||||
<fadeInfo id="9901" fadeIn="00:00:02.000" fadeOut="00:00:01.500000" />
|
||||
</playlistElement >
|
||||
|
|
|
@ -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/include/LiveSupport/Core/AudioClip.h,v $
|
||||
|
||||
------------------------------------------------------------------------------*/
|
||||
|
@ -72,7 +72,7 @@ using namespace boost::posix_time;
|
|||
* in a Playlist.
|
||||
*
|
||||
* @author $Author: fgerlits $
|
||||
* @version $Revision: 1.2 $
|
||||
* @version $Revision: 1.3 $
|
||||
*/
|
||||
class AudioClip : public Configurable
|
||||
{
|
||||
|
@ -169,7 +169,7 @@ class AudioClip : public Configurable
|
|||
/**
|
||||
* Return the total playing length for this audio clip.
|
||||
*
|
||||
* @return the playing length of this audio clip, in milliseconds.
|
||||
* @return the playing length of this audio clip, in microseconds.
|
||||
*/
|
||||
Ptr<const time_duration>::Ref
|
||||
getPlaylength(void) const throw ()
|
||||
|
|
216
livesupport/modules/core/include/LiveSupport/Core/FadeInfo.h
Normal file
216
livesupport/modules/core/include/LiveSupport/Core/FadeInfo.h
Normal file
|
@ -0,0 +1,216 @@
|
|||
/*------------------------------------------------------------------------------
|
||||
|
||||
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: fgerlits $
|
||||
Version : $Revision: 1.1 $
|
||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/core/include/LiveSupport/Core/FadeInfo.h,v $
|
||||
|
||||
------------------------------------------------------------------------------*/
|
||||
#ifndef LiveSupport_Core_FadeInfo_h
|
||||
#define LiveSupport_Core_FadeInfo_h
|
||||
|
||||
#ifndef __cplusplus
|
||||
#error This is a C++ include file
|
||||
#endif
|
||||
|
||||
|
||||
/* ============================================================ include files */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "configure.h"
|
||||
#endif
|
||||
|
||||
#include <stdexcept>
|
||||
#include <string>
|
||||
#include <libxml++/libxml++.h>
|
||||
#include <boost/date_time/posix_time/posix_time.hpp>
|
||||
|
||||
#include "LiveSupport/Core/Ptr.h"
|
||||
#include "LiveSupport/Core/UniqueId.h"
|
||||
#include "LiveSupport/Core/Configurable.h"
|
||||
|
||||
|
||||
namespace LiveSupport {
|
||||
namespace Core {
|
||||
|
||||
using namespace std;
|
||||
using namespace boost::posix_time;
|
||||
|
||||
/* ================================================================ constants */
|
||||
|
||||
|
||||
/* =================================================================== macros */
|
||||
|
||||
|
||||
/* =============================================================== data types */
|
||||
|
||||
/**
|
||||
* A class representing fade in / fade out information of a playlist element.
|
||||
* These are contained in a PlaylistElement, a list of which, in turn, is
|
||||
* contained in a Playlist.
|
||||
*
|
||||
* @author $Author: fgerlits $
|
||||
* @version $Revision: 1.1 $
|
||||
*/
|
||||
class FadeInfo : public Configurable
|
||||
{
|
||||
private:
|
||||
/**
|
||||
* The name of the configuration XML elmenent used by FadeInfo.
|
||||
*/
|
||||
static const std::string configElementNameStr;
|
||||
|
||||
/**
|
||||
* The unique id of the fade info.
|
||||
*/
|
||||
Ptr<UniqueId>::Ref id;
|
||||
|
||||
/**
|
||||
* The length of fade in period.
|
||||
*/
|
||||
Ptr<time_duration>::Ref fadeIn;
|
||||
|
||||
/**
|
||||
* The length of fade out period.
|
||||
*/
|
||||
Ptr<time_duration>::Ref fadeOut;
|
||||
|
||||
|
||||
public:
|
||||
/**
|
||||
* Default constructor.
|
||||
*/
|
||||
FadeInfo(void) throw ()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a fade info instance by specifying all details.
|
||||
* This is used for testing purposes.
|
||||
*
|
||||
* @param id the id of the fade info.
|
||||
* @param fadeIn the length of the fade in period.
|
||||
* @param fadeOut the length of the fade in period.
|
||||
*/
|
||||
FadeInfo(Ptr<UniqueId>::Ref id,
|
||||
Ptr<time_duration>::Ref fadeIn,
|
||||
Ptr<time_duration>::Ref fadeOut) throw()
|
||||
{
|
||||
this->id = id;
|
||||
this->fadeIn = fadeIn;
|
||||
this->fadeOut = fadeOut;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a fade info instance by specifying the fade in and fade out.
|
||||
*
|
||||
* @param fadeIn the length of the fade in period.
|
||||
* @param fadeOut the length of the fade in period.
|
||||
*/
|
||||
FadeInfo(Ptr<time_duration>::Ref fadeIn,
|
||||
Ptr<time_duration>::Ref fadeOut) throw()
|
||||
{
|
||||
this->id = UniqueId::generateId();
|
||||
this->fadeIn = fadeIn;
|
||||
this->fadeOut = fadeOut;
|
||||
}
|
||||
|
||||
/**
|
||||
* A virtual destructor, as this class has virtual functions.
|
||||
*/
|
||||
virtual
|
||||
~FadeInfo(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 configElementNameStr;
|
||||
}
|
||||
|
||||
/**
|
||||
* Configure the object based on the XML element supplied.
|
||||
* The supplied element is expected to be of the name
|
||||
* returned by configElementName().
|
||||
*
|
||||
* @param element the XML element to configure the object from.
|
||||
* @exception std::invalid_argument if the supplied XML element
|
||||
* contains bad configuraiton information
|
||||
*/
|
||||
virtual void
|
||||
configure(const xmlpp::Element & element)
|
||||
throw (std::invalid_argument);
|
||||
|
||||
/**
|
||||
* Return the id of the fade info instance.
|
||||
*
|
||||
* @return the unique id of the fade info instance.
|
||||
*/
|
||||
Ptr<const UniqueId>::Ref
|
||||
getId(void) const throw ()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the length of the fade in period.
|
||||
*
|
||||
* @return the length of the fade in period, in microseconds.
|
||||
*/
|
||||
Ptr<const time_duration>::Ref
|
||||
getFadeIn(void) const throw ()
|
||||
{
|
||||
return fadeIn;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the length of the fade in period.
|
||||
*
|
||||
* @return the length of the fade in period, in microseconds.
|
||||
*/
|
||||
Ptr<const time_duration>::Ref
|
||||
getFadeOut(void) const throw ()
|
||||
{
|
||||
return fadeOut;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/* ================================================= external data structures */
|
||||
|
||||
|
||||
/* ====================================================== function prototypes */
|
||||
|
||||
|
||||
} // namespace Core
|
||||
} // namespace LiveSupport
|
||||
|
||||
#endif // LiveSupport_Core_FadeInfo_h
|
||||
|
|
@ -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/include/LiveSupport/Core/Playlist.h,v $
|
||||
|
||||
------------------------------------------------------------------------------*/
|
||||
|
@ -71,7 +71,7 @@ using namespace boost::posix_time;
|
|||
* the playlist.
|
||||
*
|
||||
* @author $Author: fgerlits $
|
||||
* @version $Revision: 1.8 $
|
||||
* @version $Revision: 1.9 $
|
||||
*/
|
||||
class Playlist : public Configurable
|
||||
{
|
||||
|
@ -203,7 +203,7 @@ class Playlist : public Configurable
|
|||
/**
|
||||
* Return the total playing length for this playlist.
|
||||
*
|
||||
* @return the playling length of this playlist, in milliseconds.
|
||||
* @return the playling length of this playlist, in microseconds.
|
||||
*/
|
||||
Ptr<const time_duration>::Ref
|
||||
getPlaylength(void) const throw ()
|
||||
|
@ -278,18 +278,50 @@ class Playlist : public Configurable
|
|||
return elementList->end();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get an iterator pointing to a playlist element at a given
|
||||
* relative offset.
|
||||
* @param relativeOffset (a pointer to) the relative offset where
|
||||
* the playlist element is.
|
||||
* @return a constant iterator to the playlist element if it exists,
|
||||
* or playlist->end() if it does not.
|
||||
*/
|
||||
const_iterator
|
||||
find(Ptr<const time_duration>::Ref relativeOffset) const
|
||||
throw ()
|
||||
{
|
||||
return elementList->find(*relativeOffset);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a new audio clip to the playlist.
|
||||
*
|
||||
* @param audioClip the new audio clip to be added
|
||||
* @param relativeOffset the start of the audio clip, relative
|
||||
* to the start of the playlist
|
||||
* @param audioClip the new audio clip to be added
|
||||
* @param fadeInfo the fade in / fade out info (optional)
|
||||
* @exception std::invalid_argument if the playlist already contains
|
||||
* an audio clip with the same relative offset
|
||||
*/
|
||||
void
|
||||
addAudioClip(Ptr<AudioClip>::Ref audioClip,
|
||||
Ptr<time_duration>::Ref relativeOffset)
|
||||
Ptr<time_duration>::Ref relativeOffset,
|
||||
Ptr<FadeInfo>::Ref fadeInfo
|
||||
= Ptr<FadeInfo>::Ref())
|
||||
throw (std::invalid_argument);
|
||||
|
||||
/**
|
||||
* Set the fade in / fade out info for a playlist element.
|
||||
*
|
||||
* @param relativeOffset the start of the playlist element, relative
|
||||
* to the start of the playlist
|
||||
* @param fadeInfo the new fade in / fade out info
|
||||
* @exception std::invalid_argument if there is no playlist element
|
||||
* at the given relative offset
|
||||
*/
|
||||
void
|
||||
setFadeInfo(Ptr<time_duration>::Ref relativeOffset,
|
||||
Ptr<FadeInfo>::Ref fadeInfo)
|
||||
throw (std::invalid_argument);
|
||||
|
||||
/**
|
||||
|
|
|
@ -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/PlaylistElement.h,v $
|
||||
|
||||
------------------------------------------------------------------------------*/
|
||||
|
@ -50,6 +50,7 @@
|
|||
#include "LiveSupport/Core/UniqueId.h"
|
||||
#include "LiveSupport/Core/Configurable.h"
|
||||
#include "LiveSupport/Core/AudioClip.h"
|
||||
#include "LiveSupport/Core/FadeInfo.h"
|
||||
|
||||
|
||||
namespace LiveSupport {
|
||||
|
@ -73,7 +74,7 @@ using namespace LiveSupport::Core;
|
|||
* An item in a playlist.
|
||||
*
|
||||
* @author $Author: fgerlits $
|
||||
* @version $Revision: 1.3 $
|
||||
* @version $Revision: 1.4 $
|
||||
*/
|
||||
class PlaylistElement : public Configurable
|
||||
{
|
||||
|
@ -98,6 +99,11 @@ class PlaylistElement : public Configurable
|
|||
*/
|
||||
Ptr<AudioClip>::Ref audioClip;
|
||||
|
||||
/**
|
||||
* The fade in / fade out info associated with the entry.
|
||||
*/
|
||||
Ptr<FadeInfo>::Ref fadeInfo;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
|
@ -112,38 +118,44 @@ class PlaylistElement : public Configurable
|
|||
* Create a playlist element by specifying all details.
|
||||
* This is used for testing purposes.
|
||||
*
|
||||
* @param id the id of the entry.
|
||||
* @param audioClipId the ID of the audio clip associated
|
||||
* with the playlist element.
|
||||
* @param id the id of the entry.
|
||||
* @param relativeOffset the start time of this element, relative to
|
||||
* the start of the playlist.
|
||||
* @param audioClip (a pointer to) the audio clip associated
|
||||
* with the playlist element.
|
||||
*/
|
||||
PlaylistElement(Ptr<UniqueId>::Ref id,
|
||||
Ptr<time_duration>::Ref relativeOffset,
|
||||
Ptr<AudioClip>::Ref audioClip)
|
||||
Ptr<AudioClip>::Ref audioClip,
|
||||
Ptr<FadeInfo>::Ref fadeInfo
|
||||
= Ptr<FadeInfo>::Ref())
|
||||
throw ()
|
||||
{
|
||||
this->id = id;
|
||||
this->relativeOffset = relativeOffset;
|
||||
this->audioClip = audioClip;
|
||||
this->fadeInfo = fadeInfo;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new playlist element, with a new UniqueId,
|
||||
* to be added to a playlist.
|
||||
*
|
||||
* @param audioClipId the ID of the audio clip associated
|
||||
* with the playlist element.
|
||||
* @param relativeOffset the start time of this element, relative to
|
||||
* the start of the playlist.
|
||||
* @param audioClip (a pointer to) the audio clip associated
|
||||
* with the playlist element.
|
||||
*/
|
||||
PlaylistElement(Ptr<time_duration>::Ref relativeOffset,
|
||||
Ptr<AudioClip>::Ref audioClip)
|
||||
Ptr<AudioClip>::Ref audioClip,
|
||||
Ptr<FadeInfo>::Ref fadeInfo
|
||||
= Ptr<FadeInfo>::Ref())
|
||||
throw ()
|
||||
{
|
||||
this->id = UniqueId::generateId();
|
||||
this->relativeOffset = relativeOffset;
|
||||
this->audioClip = audioClip;
|
||||
this->fadeInfo = fadeInfo;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -212,6 +224,28 @@ class PlaylistElement : public Configurable
|
|||
return audioClip;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the fade info associated with the playlist element.
|
||||
*
|
||||
* @param fadeInfo the fade info to be associated with the element.
|
||||
*/
|
||||
void
|
||||
setFadeInfo(Ptr<FadeInfo>::Ref fadeInfo) throw ()
|
||||
{
|
||||
this->fadeInfo = fadeInfo;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the fade info associated with the playlist element.
|
||||
*
|
||||
* @return the fade info associated with the element.
|
||||
*/
|
||||
Ptr<const FadeInfo>::Ref
|
||||
getFadeInfo(void) const throw ()
|
||||
{
|
||||
return fadeInfo;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
|
116
livesupport/modules/core/src/FadeInfo.cxx
Normal file
116
livesupport/modules/core/src/FadeInfo.cxx
Normal file
|
@ -0,0 +1,116 @@
|
|||
/*------------------------------------------------------------------------------
|
||||
|
||||
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: fgerlits $
|
||||
Version : $Revision: 1.1 $
|
||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/core/src/FadeInfo.cxx,v $
|
||||
|
||||
------------------------------------------------------------------------------*/
|
||||
|
||||
/* ============================================================ include files */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "configure.h"
|
||||
#endif
|
||||
|
||||
#include <sstream>
|
||||
|
||||
#include "LiveSupport/Core/FadeInfo.h"
|
||||
|
||||
using namespace boost::posix_time;
|
||||
|
||||
using namespace LiveSupport::Core;
|
||||
|
||||
/* =================================================== local data structures */
|
||||
|
||||
|
||||
/* ================================================ local constants & macros */
|
||||
|
||||
/*------------------------------------------------------------------------------
|
||||
* The name of the config element for this class
|
||||
*----------------------------------------------------------------------------*/
|
||||
const std::string FadeInfo::configElementNameStr = "fadeInfo";
|
||||
|
||||
/**
|
||||
* The name of the attribute to get the id of the audio clip.
|
||||
*/
|
||||
static const std::string idAttrName = "id";
|
||||
|
||||
/**
|
||||
* The name of the attribute to get the fade in.
|
||||
*/
|
||||
static const std::string fadeInAttrName = "fadeIn";
|
||||
|
||||
/**
|
||||
* The name of the attribute to get the fade out.
|
||||
*/
|
||||
static const std::string fadeOutAttrName = "fadeOut";
|
||||
|
||||
|
||||
/* =============================================== local function prototypes */
|
||||
|
||||
|
||||
/* ============================================================= module code */
|
||||
|
||||
/*------------------------------------------------------------------------------
|
||||
* Create a fade info object based on an XML element.
|
||||
*----------------------------------------------------------------------------*/
|
||||
void
|
||||
FadeInfo :: configure(const xmlpp::Element & element)
|
||||
throw (std::invalid_argument)
|
||||
{
|
||||
if (element.get_name() != configElementNameStr) {
|
||||
std::string eMsg = "bad configuration element ";
|
||||
eMsg += element.get_name();
|
||||
throw std::invalid_argument(eMsg);
|
||||
}
|
||||
|
||||
const xmlpp::Attribute * attribute;
|
||||
std::stringstream strStr;
|
||||
unsigned long int idValue;
|
||||
|
||||
if (!(attribute = element.get_attribute(idAttrName))) {
|
||||
std::string eMsg = "missing attribute ";
|
||||
eMsg += idAttrName;
|
||||
throw std::invalid_argument(eMsg);
|
||||
}
|
||||
strStr.str(attribute->get_value());
|
||||
strStr >> idValue;
|
||||
id.reset(new UniqueId(idValue));
|
||||
|
||||
if (!(attribute = element.get_attribute(fadeInAttrName))) {
|
||||
std::string eMsg = "missing attribute ";
|
||||
eMsg += idAttrName;
|
||||
throw std::invalid_argument(eMsg);
|
||||
}
|
||||
fadeIn.reset(new time_duration(
|
||||
duration_from_string(attribute->get_value())));
|
||||
|
||||
if (!(attribute = element.get_attribute(fadeOutAttrName))) {
|
||||
std::string eMsg = "missing attribute ";
|
||||
eMsg += idAttrName;
|
||||
throw std::invalid_argument(eMsg);
|
||||
}
|
||||
fadeOut.reset(new time_duration(
|
||||
duration_from_string(attribute->get_value())));
|
||||
}
|
129
livesupport/modules/core/src/FadeInfoTest.cxx
Normal file
129
livesupport/modules/core/src/FadeInfoTest.cxx
Normal file
|
@ -0,0 +1,129 @@
|
|||
/*------------------------------------------------------------------------------
|
||||
|
||||
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: fgerlits $
|
||||
Version : $Revision: 1.1 $
|
||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/core/src/FadeInfoTest.cxx,v $
|
||||
|
||||
------------------------------------------------------------------------------*/
|
||||
|
||||
/* ============================================================ include files */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "configure.h"
|
||||
#endif
|
||||
|
||||
#if HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#else
|
||||
#error "Need unistd.h"
|
||||
#endif
|
||||
|
||||
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
|
||||
#include "LiveSupport/Core/FadeInfo.h"
|
||||
#include "FadeInfoTest.h"
|
||||
|
||||
|
||||
using namespace std;
|
||||
using namespace LiveSupport::Core;
|
||||
|
||||
/* =================================================== local data structures */
|
||||
|
||||
|
||||
/* ================================================ local constants & macros */
|
||||
|
||||
CPPUNIT_TEST_SUITE_REGISTRATION(FadeInfoTest);
|
||||
|
||||
/**
|
||||
* The name of the configuration file for the audio clip.
|
||||
*/
|
||||
static const std::string configFileName = "etc/fadeInfo.xml";
|
||||
|
||||
|
||||
/* =============================================== local function prototypes */
|
||||
|
||||
|
||||
/* ============================================================= module code */
|
||||
|
||||
/*------------------------------------------------------------------------------
|
||||
* Set up the test environment
|
||||
*----------------------------------------------------------------------------*/
|
||||
void
|
||||
FadeInfoTest :: setUp(void) throw ()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
/*------------------------------------------------------------------------------
|
||||
* Clean up the test environment
|
||||
*----------------------------------------------------------------------------*/
|
||||
void
|
||||
FadeInfoTest :: tearDown(void) throw ()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
/*------------------------------------------------------------------------------
|
||||
* Test to see if the singleton Hello object is accessible
|
||||
*----------------------------------------------------------------------------*/
|
||||
void
|
||||
FadeInfoTest :: firstTest(void)
|
||||
throw (CPPUNIT_NS::Exception)
|
||||
{
|
||||
try {
|
||||
Ptr<xmlpp::DomParser>::Ref parser(
|
||||
new xmlpp::DomParser(configFileName, true));
|
||||
const xmlpp::Document * document = parser->get_document();
|
||||
const xmlpp::Element * root = document->get_root_node();
|
||||
Ptr<FadeInfo>::Ref fadeInfo(new FadeInfo());
|
||||
|
||||
fadeInfo->configure(*root);
|
||||
|
||||
CPPUNIT_ASSERT(fadeInfo->getId()->getId() == 9901);
|
||||
|
||||
Ptr<const boost::posix_time::time_duration>::Ref
|
||||
fadeIn = fadeInfo->getFadeIn();
|
||||
CPPUNIT_ASSERT(fadeIn->hours() == 0);
|
||||
CPPUNIT_ASSERT(fadeIn->minutes() == 0);
|
||||
CPPUNIT_ASSERT(fadeIn->seconds() == 2);
|
||||
|
||||
Ptr<const boost::posix_time::time_duration>::Ref
|
||||
fadeOut = fadeInfo->getFadeOut();
|
||||
CPPUNIT_ASSERT(fadeOut->hours() == 0);
|
||||
CPPUNIT_ASSERT(fadeOut->minutes() == 0);
|
||||
CPPUNIT_ASSERT(fadeOut->seconds() == 1);
|
||||
CPPUNIT_ASSERT(fadeOut->fractional_seconds() == 500);
|
||||
|
||||
} catch (std::invalid_argument &e) {
|
||||
std::string eMsg = "semantic error in configuration file:\n";
|
||||
eMsg += e.what();
|
||||
CPPUNIT_FAIL(eMsg);
|
||||
} catch (xmlpp::exception &e) {
|
||||
std::string eMsg = "error parsing configuration file:\n";
|
||||
eMsg += e.what();
|
||||
CPPUNIT_FAIL(eMsg);
|
||||
}
|
||||
}
|
107
livesupport/modules/core/src/FadeInfoTest.h
Normal file
107
livesupport/modules/core/src/FadeInfoTest.h
Normal file
|
@ -0,0 +1,107 @@
|
|||
/*------------------------------------------------------------------------------
|
||||
|
||||
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: fgerlits $
|
||||
Version : $Revision: 1.1 $
|
||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/core/src/FadeInfoTest.h,v $
|
||||
|
||||
------------------------------------------------------------------------------*/
|
||||
#ifndef FadeInfoTest_h
|
||||
#define FadeInfoTest_h
|
||||
|
||||
#ifndef __cplusplus
|
||||
#error This is a C++ include file
|
||||
#endif
|
||||
|
||||
|
||||
/* ============================================================ include files */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "configure.h"
|
||||
#endif
|
||||
|
||||
#include <cppunit/extensions/HelperMacros.h>
|
||||
|
||||
|
||||
namespace LiveSupport {
|
||||
namespace Core {
|
||||
|
||||
/* ================================================================ constants */
|
||||
|
||||
|
||||
/* =================================================================== macros */
|
||||
|
||||
|
||||
/* =============================================================== data types */
|
||||
|
||||
/**
|
||||
* Unit test for the FadeInfo class.
|
||||
*
|
||||
* @author $Author: fgerlits $
|
||||
* @version $Revision: 1.1 $
|
||||
* @see FadeInfo
|
||||
*/
|
||||
class FadeInfoTest : public CPPUNIT_NS::TestFixture
|
||||
{
|
||||
CPPUNIT_TEST_SUITE(FadeInfoTest);
|
||||
CPPUNIT_TEST(firstTest);
|
||||
CPPUNIT_TEST_SUITE_END();
|
||||
|
||||
protected:
|
||||
|
||||
/**
|
||||
* A simple test.
|
||||
*
|
||||
* @exception CPPUNIT_NS::Exception on test failures.
|
||||
*/
|
||||
void
|
||||
firstTest(void) throw (CPPUNIT_NS::Exception);
|
||||
|
||||
|
||||
public:
|
||||
|
||||
/**
|
||||
* Set up the environment for the test case.
|
||||
*/
|
||||
void
|
||||
setUp(void) throw ();
|
||||
|
||||
/**
|
||||
* Clean up the environment after the test case.
|
||||
*/
|
||||
void
|
||||
tearDown(void) throw ();
|
||||
};
|
||||
|
||||
|
||||
/* ================================================= external data structures */
|
||||
|
||||
|
||||
/* ====================================================== function prototypes */
|
||||
|
||||
|
||||
} // namespace Core
|
||||
} // namespace LiveSupport
|
||||
|
||||
#endif // FadeInfoTest_h
|
||||
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
|
||||
Author : $Author: fgerlits $
|
||||
Version : $Revision: 1.7 $
|
||||
Version : $Revision: 1.8 $
|
||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/core/src/Playlist.cxx,v $
|
||||
|
||||
------------------------------------------------------------------------------*/
|
||||
|
@ -149,7 +149,8 @@ Playlist::addPlaylistElement(Ptr<PlaylistElement>::Ref playlistElement)
|
|||
*----------------------------------------------------------------------------*/
|
||||
void
|
||||
Playlist::addAudioClip(Ptr<AudioClip>::Ref audioClip,
|
||||
Ptr<time_duration>::Ref relativeOffset)
|
||||
Ptr<time_duration>::Ref relativeOffset,
|
||||
Ptr<FadeInfo>::Ref fadeInfo)
|
||||
throw (std::invalid_argument)
|
||||
{
|
||||
if (elementList->find(*relativeOffset) != elementList->end()) {
|
||||
|
@ -158,12 +159,31 @@ Playlist::addAudioClip(Ptr<AudioClip>::Ref audioClip,
|
|||
}
|
||||
|
||||
Ptr<PlaylistElement>::Ref playlistElement(new PlaylistElement(
|
||||
relativeOffset, audioClip));
|
||||
relativeOffset, audioClip, fadeInfo));
|
||||
|
||||
(*elementList)[*relativeOffset] = playlistElement;
|
||||
}
|
||||
|
||||
|
||||
/*------------------------------------------------------------------------------
|
||||
* Change the fade in / fade out info of a playlist element.
|
||||
*----------------------------------------------------------------------------*/
|
||||
void
|
||||
Playlist::setFadeInfo(Ptr<time_duration>::Ref relativeOffset,
|
||||
Ptr<FadeInfo>::Ref fadeInfo)
|
||||
throw (std::invalid_argument)
|
||||
{
|
||||
PlaylistElementListType::iterator it = elementList->find(*relativeOffset);
|
||||
|
||||
if (it == elementList->end()) {
|
||||
std::string eMsg = "no audio clip at this relative offset";
|
||||
throw std::invalid_argument(eMsg);
|
||||
}
|
||||
|
||||
it->second->setFadeInfo(fadeInfo);
|
||||
}
|
||||
|
||||
|
||||
/*------------------------------------------------------------------------------
|
||||
* Remove an audio clip from the playlist.
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
|
|
@ -20,9 +20,9 @@
|
|||
along with LiveSupport; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
|
||||
|
||||
Author : $Author: fgerlits $
|
||||
Version : $Revision: 1.3 $
|
||||
Version : $Revision: 1.4 $
|
||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/core/src/PlaylistElement.cxx,v $
|
||||
|
||||
------------------------------------------------------------------------------*/
|
||||
|
@ -35,7 +35,6 @@
|
|||
|
||||
#include <sstream>
|
||||
|
||||
#include "LiveSupport/Core/UniqueId.h"
|
||||
#include "LiveSupport/Core/PlaylistElement.h"
|
||||
|
||||
using namespace boost::posix_time;
|
||||
|
@ -63,10 +62,15 @@ static const std::string idAttrName = "id";
|
|||
static const std::string relativeOffsetAttrName = "relativeOffset";
|
||||
|
||||
/**
|
||||
* The name of the (audio clip) child element of the playlist element.
|
||||
* The name of the audio clip child element of the playlist element.
|
||||
*/
|
||||
static const std::string audioClipElementName = "audioClip";
|
||||
|
||||
/**
|
||||
* The name of the fade info child element of the playlist element.
|
||||
*/
|
||||
static const std::string fadeInfoElementName = "fadeInfo";
|
||||
|
||||
|
||||
/* =============================================== local function prototypes */
|
||||
|
||||
|
@ -86,6 +90,7 @@ PlaylistElement :: configure(const xmlpp::Element & element)
|
|||
throw std::invalid_argument(eMsg);
|
||||
}
|
||||
|
||||
// set id
|
||||
const xmlpp::Attribute * attribute;
|
||||
std::stringstream strStr;
|
||||
UniqueId::IdType idValue;
|
||||
|
@ -99,6 +104,7 @@ PlaylistElement :: configure(const xmlpp::Element & element)
|
|||
strStr >> idValue;
|
||||
id.reset(new UniqueId(idValue));
|
||||
|
||||
// set relative offset
|
||||
if (!(attribute = element.get_attribute(relativeOffsetAttrName))) {
|
||||
std::string eMsg = "missing attribute ";
|
||||
eMsg += relativeOffsetAttrName;
|
||||
|
@ -107,6 +113,7 @@ PlaylistElement :: configure(const xmlpp::Element & element)
|
|||
relativeOffset.reset(new time_duration(
|
||||
duration_from_string(attribute->get_value())));
|
||||
|
||||
// set audio clip
|
||||
xmlpp::Node::NodeList childNodes
|
||||
= element.get_children(audioClipElementName);
|
||||
xmlpp::Node::NodeList::iterator it = childNodes.begin();
|
||||
|
@ -121,7 +128,7 @@ PlaylistElement :: configure(const xmlpp::Element & element)
|
|||
const xmlpp::Element * audioClipElement
|
||||
= dynamic_cast<const xmlpp::Element*> (*it);
|
||||
audioClip.reset(new AudioClip);
|
||||
audioClip->configure(*audioClipElement); // may throw exception
|
||||
audioClip->configure(*audioClipElement); // may throw exception
|
||||
|
||||
++it;
|
||||
if (it != childNodes.end()) {
|
||||
|
@ -130,4 +137,25 @@ PlaylistElement :: configure(const xmlpp::Element & element)
|
|||
eMsg += " XML element";
|
||||
throw std::invalid_argument(eMsg);
|
||||
}
|
||||
|
||||
// set fade info
|
||||
childNodes = element.get_children(fadeInfoElementName);
|
||||
it = childNodes.begin();
|
||||
|
||||
if (it == childNodes.end()) { // no fade info is OK
|
||||
return;
|
||||
}
|
||||
|
||||
const xmlpp::Element * fadeInfoElement
|
||||
= dynamic_cast<const xmlpp::Element*> (*it);
|
||||
fadeInfo.reset(new FadeInfo);
|
||||
fadeInfo->configure(*fadeInfoElement); // may throw exception
|
||||
|
||||
++it;
|
||||
if (it != childNodes.end()) {
|
||||
std::string eMsg = "more than one ";
|
||||
eMsg += fadeInfoElementName;
|
||||
eMsg += " XML element";
|
||||
throw std::invalid_argument(eMsg);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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/PlaylistElementTest.cxx,v $
|
||||
|
||||
------------------------------------------------------------------------------*/
|
||||
|
@ -111,6 +111,17 @@ PlaylistElementTest :: firstTest(void)
|
|||
CPPUNIT_ASSERT(relativeOffset->total_seconds() == 12*60 + 34);
|
||||
CPPUNIT_ASSERT(playlistElement->getAudioClip()->getId()->getId()
|
||||
== 10001);
|
||||
CPPUNIT_ASSERT(playlistElement->getFadeInfo()->getId()->getId()
|
||||
== 9901);
|
||||
Ptr<const time_duration>::Ref fadeIn
|
||||
= playlistElement->getFadeInfo()
|
||||
->getFadeIn();
|
||||
CPPUNIT_ASSERT(fadeIn->total_milliseconds() == 2000);
|
||||
|
||||
Ptr<const time_duration>::Ref fadeOut
|
||||
= playlistElement->getFadeInfo()
|
||||
->getFadeOut();
|
||||
CPPUNIT_ASSERT(fadeOut->total_milliseconds() == 1500);
|
||||
|
||||
} catch (std::invalid_argument &e) {
|
||||
std::string eMsg = "semantic error in configuration file:\n";
|
||||
|
|
|
@ -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/PlaylistTest.cxx,v $
|
||||
|
||||
------------------------------------------------------------------------------*/
|
||||
|
@ -285,3 +285,72 @@ PlaylistTest :: savedCopyTest(void)
|
|||
catch (std::logic_error &e) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*------------------------------------------------------------------------------
|
||||
* Test to see if we can add a fade info
|
||||
*----------------------------------------------------------------------------*/
|
||||
void
|
||||
PlaylistTest :: fadeInfoTest(void)
|
||||
throw (CPPUNIT_NS::Exception)
|
||||
{
|
||||
Playlist::const_iterator it = playlist->begin();
|
||||
CPPUNIT_ASSERT(it != playlist->end());
|
||||
Ptr<PlaylistElement>::Ref playlistElement = it->second;
|
||||
CPPUNIT_ASSERT(playlistElement->getFadeInfo().get() == 0);
|
||||
|
||||
++it;
|
||||
CPPUNIT_ASSERT(it != playlist->end());
|
||||
playlistElement = it->second;
|
||||
CPPUNIT_ASSERT(playlistElement->getFadeInfo()->getFadeIn()
|
||||
->total_milliseconds() == 2000);
|
||||
CPPUNIT_ASSERT(playlistElement->getFadeInfo()->getFadeOut()
|
||||
->total_milliseconds() == 1500);
|
||||
|
||||
++it;
|
||||
CPPUNIT_ASSERT(it == playlist->end());
|
||||
|
||||
Ptr<time_duration>::Ref relativeOffset (new time_duration(0,0,0,0));
|
||||
Ptr<time_duration>::Ref fadeIn (new time_duration(0,0,3,200000));
|
||||
Ptr<time_duration>::Ref fadeOut(new time_duration(0,0,4,0));
|
||||
Ptr<FadeInfo>::Ref fadeInfo(new FadeInfo(fadeIn, fadeOut));
|
||||
|
||||
try {
|
||||
playlist->setFadeInfo(relativeOffset, fadeInfo);
|
||||
}
|
||||
catch (std::invalid_argument &e) {
|
||||
CPPUNIT_FAIL("could not add new fade info");
|
||||
}
|
||||
|
||||
it = playlist->begin();
|
||||
playlistElement = it->second;
|
||||
CPPUNIT_ASSERT(playlistElement->getFadeInfo()->getFadeIn()
|
||||
->total_milliseconds() == 3200);
|
||||
CPPUNIT_ASSERT(playlistElement->getFadeInfo()->getFadeOut()
|
||||
->total_milliseconds() == 4000);
|
||||
|
||||
relativeOffset.reset(new time_duration(1,00,0,0));
|
||||
|
||||
try {
|
||||
playlist->setFadeInfo(relativeOffset, fadeInfo);
|
||||
}
|
||||
catch (std::invalid_argument &e) {
|
||||
CPPUNIT_FAIL("could not update fade info");
|
||||
}
|
||||
|
||||
++it;
|
||||
playlistElement = it->second;
|
||||
CPPUNIT_ASSERT(playlistElement->getFadeInfo()->getFadeIn()
|
||||
->total_milliseconds() == 3200);
|
||||
CPPUNIT_ASSERT(playlistElement->getFadeInfo()->getFadeOut()
|
||||
->total_milliseconds() == 4000);
|
||||
|
||||
relativeOffset.reset(new time_duration(0,18,0,0));
|
||||
|
||||
try {
|
||||
playlist->setFadeInfo(relativeOffset, fadeInfo);
|
||||
CPPUNIT_FAIL("allowed to set fade info for non-existent element");
|
||||
}
|
||||
catch (std::invalid_argument &e) {
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
|
||||
Author : $Author: fgerlits $
|
||||
Version : $Revision: 1.5 $
|
||||
Version : $Revision: 1.6 $
|
||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/core/src/PlaylistTest.h,v $
|
||||
|
||||
------------------------------------------------------------------------------*/
|
||||
|
@ -58,7 +58,7 @@ namespace Core {
|
|||
* Unit test for the UploadPlaylistMetohd class.
|
||||
*
|
||||
* @author $Author: fgerlits $
|
||||
* @version $Revision: 1.5 $
|
||||
* @version $Revision: 1.6 $
|
||||
* @see Playlist
|
||||
*/
|
||||
class PlaylistTest : public CPPUNIT_NS::TestFixture
|
||||
|
@ -68,6 +68,7 @@ class PlaylistTest : public CPPUNIT_NS::TestFixture
|
|||
CPPUNIT_TEST(lockTest);
|
||||
CPPUNIT_TEST(audioClipTest);
|
||||
CPPUNIT_TEST(savedCopyTest);
|
||||
CPPUNIT_TEST(fadeInfoTest);
|
||||
CPPUNIT_TEST_SUITE_END();
|
||||
|
||||
private:
|
||||
|
@ -111,6 +112,14 @@ class PlaylistTest : public CPPUNIT_NS::TestFixture
|
|||
void
|
||||
savedCopyTest(void) throw (CPPUNIT_NS::Exception);
|
||||
|
||||
/**
|
||||
* Trying to add a new fade info.
|
||||
*
|
||||
* @exception CPPUNIT_NS::Exception on test failures.
|
||||
*/
|
||||
void
|
||||
fadeInfoTest(void) throw (CPPUNIT_NS::Exception);
|
||||
|
||||
|
||||
public:
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue