2007-09-03 02:33:47 +02:00
/*
DeleteClip ( Test ) - removing an Clip - MObject from the Session
2008-03-10 04:25:03 +01:00
Copyright ( C ) Lumiera . org
2008 , Hermann Vosseler < Ichthyostega @ web . de >
2007-09-03 02:33:47 +02:00
This program 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 .
This program 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 this program ; if not , write to the Free Software
Foundation , Inc . , 675 Mass Ave , Cambridge , MA 0213 9 , USA .
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2008-12-18 04:47:41 +01:00
# include "lib/test/run.hpp"
2007-09-25 23:39:46 +02:00
# include "proc/assetmanager.hpp"
2007-09-27 23:26:54 +02:00
# include "proc/mobject/session.hpp"
# include "proc/mobject/session/edl.hpp" // TODO: really neded?
2007-09-25 23:39:46 +02:00
# include "proc/mobject/session/testsession1.hpp"
2007-11-14 10:10:52 +01:00
# include "proc/mobject/session/clip.hpp" // TODO: really neded?
2008-12-18 04:47:41 +01:00
//#include "lib/util.hpp"
2007-09-03 02:33:47 +02:00
//#include <boost/format.hpp>
# include <iostream>
//using boost::format;
using std : : string ;
using std : : cout ;
2007-09-27 23:26:54 +02:00
using proc_interface : : AssetManager ;
using proc_interface : : PAsset ;
using proc_interface : : IDA ;
2007-09-03 02:33:47 +02:00
2007-11-14 10:10:52 +01:00
using std : : tr1 : : dynamic_pointer_cast ; /// TODO only temp
2009-06-09 09:05:19 +02:00
namespace mobject {
namespace session {
namespace test {
/*******************************************************************
* @ test removing a test clip from the EDL .
* @ see mobject : : session : : Clip
* @ see mobject : : session : : EDL
*/
class DeleteClip_test : public Test
2007-09-03 02:33:47 +02:00
{
2009-06-09 09:05:19 +02:00
virtual void
run ( Arg )
2007-09-03 02:33:47 +02:00
{
2009-06-09 09:05:19 +02:00
buildTestsession1 ( ) ;
PSess sess = Session : : current ;
AssetManager & aMang = AssetManager : : instance ( ) ;
UNIMPLEMENTED ( " typesafe searching for MObjects in the EDL " ) ;
# if false /////////////////////////////////////////////////////////////////////////////////////////////////////TODO: work out how to search within EDL!!
PClipMO clipPlacement = sess - > currEDL ( ) . find ( SESSION1_CLIP ) ;
// global Var asigned in buildTestsession1()
PMedia media = clipPlacement - > getMedia ( ) ;
IDA clipAID = media - > getID ( ) ;
ASSERT ( clipPlacement ) ;
sess - > remove ( clipPlacement ) ;
ASSERT ( ! sess - > currEDL ( ) . find ( SESSION1_CLIP ) ) ; // EDL forgot the Clip/Placement
ASSERT ( ! aMang . known ( clipAID ) ) ; // corresponding Clip Asset has disappeared
ASSERT ( ! clipPlacement - > getMedia ( ) ) ; // internal cross-links removed
# endif /////////////////////////////////////////////////////////////////////////////////////////////////////TODO: work out how to search within EDL!!
}
} ;
2007-11-14 10:10:52 +01:00
2007-09-03 02:33:47 +02:00
2009-06-09 09:05:19 +02:00
/** Register this test class... */
LAUNCHER ( DeleteClip_test , " function session " ) ;
} } } // namespace mobject::session::test