/*************************************************
*           BK Emulator v3.9 for Windows         *
*************************************************/

/*
File: TapeUnit.h
Version: 1.0.0
Written by: Yuriy Kalmykov <kalmykov@stoik.com>
    Copyright (c) 2002-2004 Yuriy Kalmykov

    BK Emulator is a program emulated hardware environment for running
code for BK 0010(01) in different configurations.

    This code may be used in compiled form in any way you desire.
This file or it's parts can't be redistributed without the authors
written consent, but can be modified for your private needs.
    Providing that this notice and the authors name and all copyright
notices remains intact.

    Please, an email me to know how you are using it and where. You can
ask me for any information about this below code or any attendant
knowledge.

    This file is provided "as is" with no expressed or implied warranty.
The author accepts no liability for any damage or loss of business that
this product may cause.
*/


// 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);
};

