Files
Work/mediapak/Mediapak.hpp
2024-08-07 09:16:27 -04:00

46 lines
1.1 KiB
C++

#ifndef _MEDIAPAK_MEDIAPAK_HPP_
#define _MEDIAPAK_MEDIAPAK_HPP_
#ifndef _COMMON_WINDOWS_HPP_
#include <common/windows.hpp>
#endif
#ifndef _COMMON_OPENFILE_HPP_
#include <common/openfile.hpp>
#endif
#ifndef _COMMON_ARRAY_HPP_
#include <common/array.hpp>
#endif
#ifndef _SAMPLE_WAVEFORM_HPP_
#include <sample/wave.hpp>
#endif
#ifndef _MEDIAPAK_PAKENTRY_HPP_
#include <mediapak/pakentry.hpp>
#endif
class EntryInfo;
class MediaPak
{
public:
enum Mode{CreateAlways,OpenExisting,OpenAlways};
MediaPak(void);
virtual ~MediaPak();
BOOL open(const String &pathFileName,Mode openMode=OpenExisting);
void close(void);
BOOL add(const PakEntry &pakEntry);
BOOL add(const String &strPathFileName);
BOOL getEntry(PakEntry &pakEntry,DWORD entryIndex);
BOOL getEntry(WaveForm &waveForm,DWORD entryIndex);
BOOL getInfo(Array<EntryInfo> &entryInfoArray);
BOOL getInfo(EntryInfo &entryInfo,DWORD entryIndex);
DWORD entries(void)const;
BOOL isOkay(void)const;
private:
enum {HeaderMagic=0x4050414E};
MediaPak(const MediaPak &mediaPak);
MediaPak &operator=(const MediaPak &mediaPak);
FileHandle mPakFile;
DWORD mEntries;
DWORD mOffsetEntries;
};
#endif