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

	UQuickTimeAtom.h
	
 ******************************************************************************************************

	Author:			Peter Baumgartner		peter@baumgartner.com
					Achim Breidenbach		achim@boinx.com
					Michael Ehrmann			michael@boinx.com		
	
	Copyright:		© 2005-2006 by IMAGINE GbR - All Rights Reserved
					© 2005-2006 by Boinx Software - All Rights Reserved

	Abstract: Legacy class - New Projects should use BXUQuicktimeAtom.h / .m

 
 ******************************************************************************************************/
 
#if !__LP64__
 
/******************************************************************************************************
	READ ME
 ******************************************************************************************************/

	#pragma mark READ ME

	// This class provides methods for accessing values in QTAtomContainers. The methods are
	// guarded for thread-safe access...


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

	#pragma mark INCLUDES	
	
	#import <Carbon/Carbon.h>
	#import <Cocoa/Cocoa.h>
	#import <QuickTime/QuickTime.h>


	#pragma mark

/******************************************************************************************************
	UQuickTimeAtom
 ******************************************************************************************************/

	class UQuickTimeAtom
	{
		public:
		
			#pragma mark

			// Generic Accessors...
			
			static bool AtomContainerContainsAtom(QTAtomContainer inAtomContainer,QTAtomType inAtomType,QTAtom inParentAtom=0,QTAtom inCurrentChild=0);
			static bool GetDataFromAtomContainer(QTAtomContainer inAtomContainer,QTAtomType inAtomType,void* outAtomData,QTAtom inParentAtom=0,QTAtom inCurrentChild=0);
			static bool SetDataInAtomContainer(QTAtomContainer inAtomContainer,QTAtomType inAtomType,void* inAtomData,QTAtom inParentAtom=0,QTAtom inCurrentChild=0);
			static void LogAtomContainer(NSString* prefix,QTAtomContainer atomContainer,QTAtom parentAtom=0,QTAtom currentChild=0);

			// Specialized Accessors...
			
			#pragma mark

			static SCSpatialSettings GetSpatialSettingsFromAtomContainer(QTAtomContainer inAtomContainer,bool inConvertToNative);
			static SCSpatialSettings SpatialSettings_BtoN(SCSpatialSettings inSpatialSettings);
			static SCSpatialSettings SpatialSettings_NtoB(SCSpatialSettings inSpatialSettings);
			
			#pragma mark

			static SCTemporalSettings GetTemporalSettingsFromAtomContainer(QTAtomContainer inAtomContainer,bool inConvertToNative);
			static SCTemporalSettings TemporalSettings_BtoN(SCTemporalSettings inTemporalSettings);
			static SCTemporalSettings TemporalSettings_NtoB(SCTemporalSettings inTemporalSettings);
			
			#pragma mark

			static SCDataRateSettings GetDataRateSettingsFromAtomContainer(QTAtomContainer inAtomContainer,bool inConvertToNative);
			static SCDataRateSettings DataRateSettings_BtoN(SCDataRateSettings inDataRateSettings);
			static SCDataRateSettings DataRateSettings_NtoB(SCDataRateSettings inDataRateSettings);

			#pragma mark

			static double GetFrameRateFromAtomContainer(QTAtomContainer inAtomContainer);
			static bool SetFrameRateInAtomContainer(QTAtomContainer inAtomContainer,double inFrameRate);
			static int GetWidthFromAtomContainer(QTAtomContainer inAtomContainer);
			static bool SetWidthInAtomContainer(QTAtomContainer inAtomContainer,int inWidth);
			static int GetHeightFromAtomContainer(QTAtomContainer inAtomContainer);
			static bool SetHeightInAtomContainer(QTAtomContainer inAtomContainer,int inHeight);
			static NSString* GetCodecName(CodecType inCodecType);
	};

	
	
/******************************************************************************************************/
	
#endif // !_LP64
	