/******************************************************************************************************

	StMovie.h
	
 ******************************************************************************************************

	Author:			Peter Baumgartner		peter@baumgartner.com
	
	Copyright:		� 2005-2006 by IMAGINE GbR - All Rights Reserved

 ******************************************************************************************************/

	#if !__LP64__

 /******************************************************************************************************
	READ ME
 ******************************************************************************************************/

	#pragma mark READ ME

	// This convenience class wraps a QT movie, provides stack based cleanup, simple accessors,
	// and several manipluation methods...


	
/******************************************************************************************************
    INCLUDES
 ******************************************************************************************************/

	#pragma mark INCLUDES
	
	#include <Carbon/Carbon.h>
	#include <QuickTime/ImageCompression.h>
	#include <QuickTime/QuickTimeComponents.h> 


	
	#pragma mark

 /******************************************************************************************************
	StMovie
 ******************************************************************************************************/

	class StMovie
	{
		// Structors...
			
		public:
		
			#pragma mark

			StMovie(); // Create a new memory based movie
			StMovie(Movie inMovie); // Use existing movie (passing ownership to object)
			StMovie(NSString* inPath); // Open existing file based movie
			StMovie(NSString* inPath,TimeScale inTimeScale,OSType inCreator=0); // Create new file based movie
			
			~StMovie();

		// Movie Accessors...
			
		public:
		
			#pragma mark
		
			Movie GetMovie() const;
			operator Movie() const;

			DataHandler GetDataHandler() const;
			operator DataHandler() const;

		// Track Accessors...
			
		public:
		
			#pragma mark

			int GetTrackCount() const;
			int GetTrackCountForMediaType(OSType inMediaType) const;
			Track GetTrackForMediaTypeAtIndex(OSType inMediaType,int inIndex) const;

			#pragma mark

			int GetAudioTrackCount() const;
			Track GetAudioTrackAtIndex(int inIndex) const;
			OSStatus CreateNewAudioTrack(TimeScale inTimeScale,Track* outTrack=NULL,Media* outMedia=NULL);
			
			#pragma mark

			int GetVideoTrackCount() const;
			Track GetVideoTrackAtIndex(int inIndex) const;
			OSStatus CreateNewVideoTrack(int inWidth,int inHeight,int inLayer,TimeScale inTimeScale,Track* outTrack=NULL,Media* outMedia=NULL);
			
			#pragma mark

			int GetTweenTrackCount() const;
			Track GetTweenTrackAtIndex(int inIndex) const;
			OSStatus CreateNewTweenTrackForAudioTrack(Track inAudioTrack,double inTime[4],double inVolume);
			
		// Write to Disk...
			
		public:
		
			#pragma mark

			OSStatus UpdateMovieFile();
			
		// Datafields...
			
		protected:
		
			Movie _movie;
			DataHandler _dataHandler;
	};



/******************************************************************************************************/

	#endif