Main Page Modules Namespace List Class Hierarchy Alphabetical List Compound List File List Namespace Members Compound Members File Members Related Pages

# deWAV.hpp

Go to the documentation of this file.

    00001 ///////////////////////////////////////////////////////////////////////////////
    00002 /// @file deWAV.hpp
    00003 ///
    00004 /// @brief Destiny Sound System WAV file
    00005 ///
    00006 /// @author paradoxnj
    00007 ///
    00008 /// This file is the intellectual property of Novus Delta, LLC.. Usage of the
    00009 /// contents of this file is subject to the Destiny3D Member License which
    00010 /// can be found at http://www.destiny3d.com.  Any other usage is prohibited.
    00011 ///
    00012 /// This file is distributed "AS IS" without warranty of any kind.  Novus
    00013 /// Delta, LLC. does not guarantee the fitness of the contents of this file
    00014 /// for any particular purpose.
    00015 ///
    00016 /// Copyright (C) 2001-2003 Novus Delta, LLC. All Rights Reserved.
    00017 ///
    00018 /// <hr>
    00019 ///                                 Change History
    00020 /// <hr>
    00021 ///
    00022 /// @date Jan 2002
    00023 /// @author paradoxnj
    00024 /// @remarks Creation
    00025 ///
    00026 ///////////////////////////////////////////////////////////////////////////////
    00027
    00028 #ifndef DEWAV_HPP
    00029 #define DEWAV_HPP
    00030
    00031 #include "deSound_priv.hpp"
    00032
    00033 class IdeFile;
    00034 class IdeFSReal;
    00035
    00036 #pragma pack(push, 2)
    00037 struct RiffHeader
    00038 {
    00039     long    Tag;
    00040     long    Size;
    00041 };
    00042 struct WaveFormatInfo
    00043 {
    00044     short                           FormatTag;
    00045     short                           Channels;
    00046     long                            SampleRate;
    00047     long                            BytesPerSec;
    00048     short                           BlockAlign;
    00049     short                           BitsPerSample;
    00050 };
    00051 #pragma pack(pop)
    00052
    00053 class deWAV : public deSoundData
    00054 {
    00055 public:
    00056     deWAV();
    00057     deWAV(const char *filename);
    00058     virtual ~deWAV();
    00059
    00060 private:
    00061     WaveFormatInfo              m_WaveHeader;
    00062     long                        m_DataOffset;
    00063     long                        m_DataSize;
    00064     IdeFSReal                   *m_pSourceSystem;
    00065     IdeFile                     *m_pSource;
    00066
    00067     int                         m_InterfaceType;
    00068     int                         m_RefCount;
    00069
    00070 public:
    00071     void                        *GetRscInterface(long interface_id);
    00072
    00073     deBoolean                   Initialize(const char *filename);
    00074     void                        Destroy();
    00075
    00076     void                        GetFormat(WAVEFORMATEX *format);
    00077     u32                         GetLength() { return m_DataSize; }
    00078     int                         GetDataChunk(void *ptr, long size, s32 DataOffset);
    00079     uint8                       *GetAllData();
    00080
    00081     deBoolean                   AtEndOfStream();
    00082     void                        SetPosition(long NewPos);
    00083
    00084     int                         GetType()       {   return m_InterfaceType;     }
    00085
    00086     IdeResourceBase             *MakeCopy();
    00087 };
    00088
    00089 #endif