// TapeUnit.h: interface for the CTapeUnit class.
//


#pragma once


class CTapeUnit
{
		enum            {UNKNOWN = -1};

		int             m_nType;
		int             m_nAddress;
		int             m_nLength;
		int             m_nMSTime;
		DWORD           m_nWaveLength;
		bool            m_bCRC;
		CString         m_strName;
		CString         m_strPath;

		bool            IsFileWave(CString &strPath);
		bool            IsFileMSF(CString &strPath);
		bool            IsFileBin(CString &strPath);

	public:
		enum            {TYPE_NONE = -1, TYPE_BIN = 0, TYPE_WAV, TYPE_MSF, TYPE_TMP};

		CTapeUnit();
		CTapeUnit(CTapeUnit &tapeUnit);
		virtual ~CTapeUnit();

		CTapeUnit       &operator= (CTapeUnit &tapeUnit);

		bool            SetFile(CString &strPath);
		bool            SetTmpFile(CString &strPath);

		int             GetType()
		{
			return m_nType;
		}
		int             GetAddress()
		{
			return m_nAddress;
		}
		int             GetLength()
		{
			return m_nLength;
		}
		int             GetTime()
		{
			return m_nMSTime;
		}
		DWORD           GetWaveLength()
		{
			return m_nWaveLength;
		}
		bool            GetCRC()
		{
			return m_bCRC;
		}
		CString         GetName() const
		{
			return m_strName;
		}
		CString         GetPath() const
		{
			return m_strPath;
		}

		bool            RetrieveInfo();
		bool            SaveAs(CString &strPath, int type);
};

