Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#ifndef TIIO_3GP_H
Toshihiro Shimizu 890ddd
#define TIIO_3GP_H
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#ifdef __LP64__
Toshihiro Shimizu 890ddd
#include "tiio_3gp_proxy.h"
Toshihiro Shimizu 890ddd
#else
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#include <carbon carbon.h=""></carbon>
Toshihiro Shimizu 890ddd
#include <quicktime movies.h=""></quicktime>
Toshihiro Shimizu 890ddd
#include <quicktime imagecompression.h=""></quicktime>
Toshihiro Shimizu 890ddd
#include <quicktime quicktimecomponents.h=""></quicktime>
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#include "tquicktime.h"
Toshihiro Shimizu 890ddd
#include "tthreadmessage.h"
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#include "tlevel_io.h"
Toshihiro Shimizu 890ddd
#include "tthread.h"
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
class TImageWriter3gp;
Toshihiro Shimizu 890ddd
class TImageReader3gp;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
bool IsQuickTimeInstalled();
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
class TLevelWriter3gp : public TLevelWriter
Toshihiro Shimizu 890ddd
{
Toshihiro Shimizu 890ddd
public:
Toshihiro Shimizu 890ddd
	TLevelWriter3gp(const TFilePath &path, TPropertyGroup *winfo);
Toshihiro Shimizu 890ddd
	~TLevelWriter3gp();
Toshihiro Shimizu 890ddd
	TImageWriterP getFrameWriter(TFrameId fid);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	bool m_initDone;
Toshihiro Shimizu 890ddd
	int m_IOError;
Toshihiro Shimizu 890ddd
	Handle m_dataRef;
Toshihiro Shimizu 890ddd
	Handle m_hMovieData;
Toshihiro Shimizu 890ddd
	Handle m_soundDataRef;
Toshihiro Shimizu 890ddd
	Handle m_hSoundMovieData;
Toshihiro Shimizu 890ddd
	MovieExportComponent m_myExporter;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void save(const TImageP &img, int frameIndex);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
private:
Toshihiro Shimizu 890ddd
	Movie m_movie;
Toshihiro Shimizu 890ddd
	Track m_videoTrack;
Toshihiro Shimizu 890ddd
	Media m_videoMedia;
Toshihiro Shimizu 890ddd
	GWorldPtr m_gworld;
Toshihiro Shimizu 890ddd
	PixMapHandle m_pixmap;
Toshihiro Shimizu 890ddd
	Handle m_compressedData;
Toshihiro Shimizu 890ddd
	short m_refNum;
Toshihiro Shimizu 890ddd
	UCHAR m_cancelled;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	PixelXRGB *buf;
Toshihiro Shimizu 890ddd
	int buf_lx;
Toshihiro Shimizu 890ddd
	int buf_ly;
Toshihiro Shimizu 890ddd
	TThread::Mutex m_mutex;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
public:
Toshihiro Shimizu 890ddd
	static TLevelWriter *create(const TFilePath &f, TPropertyGroup *winfo)
Toshihiro Shimizu 890ddd
	{
Toshihiro Shimizu 890ddd
		return new TLevelWriter3gp(f, winfo);
Toshihiro Shimizu 890ddd
	};
Toshihiro Shimizu 890ddd
	void saveSoundTrack(TSoundTrack *st);
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
class TLevelReader3gp : public TLevelReader
Toshihiro Shimizu 890ddd
{
Toshihiro Shimizu 890ddd
public:
Toshihiro Shimizu 890ddd
	TLevelReader3gp(const TFilePath &path);
Toshihiro Shimizu 890ddd
	~TLevelReader3gp();
Toshihiro Shimizu 890ddd
	TImageReaderP getFrameReader(TFrameId fid);
Toshihiro Shimizu 890ddd
	//friend class TImageReader3gp;
Toshihiro Shimizu 890ddd
	TLevelP loadInfo();
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void load(const TRasterP &rasP, int frameIndex, const TPoint &pos, int shrinkX = 1, int shrinkY = 1);
Toshihiro Shimizu 890ddd
	TDimension getSize() const { return TDimension(m_lx, m_ly); }
Toshihiro Shimizu 890ddd
	TRect getBBox() const { return TRect(0, 0, m_lx - 1, m_ly - 1); }
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	int m_IOError;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
private:
Toshihiro Shimizu 890ddd
	short m_refNum;
Toshihiro Shimizu 890ddd
	Movie m_movie;
Toshihiro Shimizu 890ddd
	short m_resId;
Toshihiro Shimizu 890ddd
	Track m_track;
Toshihiro Shimizu 890ddd
	long m_depth;
Toshihiro Shimizu 890ddd
	vector<timevalue> currentTimes;</timevalue>
Toshihiro Shimizu 890ddd
	int m_lx, m_ly;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
public:
Toshihiro Shimizu 890ddd
	static TLevelReader *create(const TFilePath &f)
Toshihiro Shimizu 890ddd
	{
Toshihiro Shimizu 890ddd
		return new TLevelReader3gp(f);
Toshihiro Shimizu 890ddd
	};
Toshihiro Shimizu 890ddd
	TThread::Mutex m_mutex;
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//------------------------------------------------------------------------------
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
/*
Toshihiro Shimizu 890ddd
class TWriterInfo3gp : public TWriterInfo {
Toshihiro Shimizu 890ddd
friend class TLevelWriter3gp;
Toshihiro Shimizu 890ddd
public:
Toshihiro Shimizu 890ddd
  static TWriterInfo *create(const string &ext);
Toshihiro Shimizu 890ddd
  ~TWriterInfo3gp();
Toshihiro Shimizu 890ddd
  TWriterInfo *clone() const;
Toshihiro Shimizu 890ddd
private:
Toshihiro Shimizu 890ddd
  TWriterInfo3gp();
Toshihiro Shimizu 890ddd
  
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
  TWriterInfo3gp(const TWriterInfo3gp&);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
  TWriterInfo3gp&operator=(const TWriterInfo3gp&);   // not implemented
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
  typedef map<int, codecq=""> CodecTable;</int,>
Toshihiro Shimizu 890ddd
  typedef map<int, codectype=""> QualityTable;</int,>
Toshihiro Shimizu 890ddd
  CodecTable m_codecTable;
Toshihiro Shimizu 890ddd
  QualityTable m_qualityTable;
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
*/
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#endif //!__LP64__
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#endif //TIIO_3gp_H