libgig
3.3.0.svn20
|
Accessing AKAI image either from file or a drive (i.e. More...
#include <Akai.h>
Public Member Functions | |
DiskImage (const char *path) | |
Open an image from a file. More... | |
DiskImage (int disk) | |
Open an image from a device number (0='a:', 1='b:', etc...). More... | |
bool | WriteImage (const char *path) |
Extract Akai data track and write it into a regular file. More... | |
virtual | ~DiskImage () |
virtual akai_stream_state_t | GetState () const |
virtual int | GetPos () const |
virtual int | SetPos (int Where, akai_stream_whence_t Whence=akai_stream_start) |
virtual int | Available (uint WordSize=1) |
virtual int | Read (void *pData, uint WordCount, uint WordSize) |
Returns number of successfully read words. More... | |
void | ReadInt8 (uint8_t *pData, uint WordCount) |
void | ReadInt16 (uint16_t *pData, uint WordCount) |
void | ReadInt32 (uint32_t *pData, uint WordCount) |
int | ReadInt8 (uint8_t *pData) |
Returns number of successfully read 8 Bit words. More... | |
int | ReadInt16 (uint16_t *pData) |
Returns number of successfully read 16 Bit words. More... | |
int | ReadInt32 (uint32_t *pData) |
Returns number of successfully read 32 Bit words. More... | |
uint8_t | ReadInt8 () |
uint16_t | ReadInt16 () |
uint32_t | ReadInt32 () |
virtual uint | GetError () const |
Protected Member Functions | |
void | OpenStream (const char *path) |
void | swapBytes_16 (void *Word) |
void | swapBytes_32 (void *Word) |
Protected Attributes | |
int | mFile |
bool | mRegularFile |
int | mPos |
int | mCluster |
int | mClusterSize |
int | mSize |
int | mStartFrame |
int | mEndFrame |
char * | mpCache |
Accessing AKAI image either from file or a drive (i.e.
CDROM).
This class implements a hardware abstraction layer, providing an abstract streaming API to read from AKAI data images, no matter if the AKAI image is already available as image file or whether the respective hardware drive needs to be accessed directly (i.e. CDROM drive, ZIP drive). So the main task of this class is isolating operating system dependent file/hardware access.
DiskImage::DiskImage | ( | const char * | path | ) |
DiskImage::DiskImage | ( | int | disk | ) |
Open an image from a device number (0='a:', 1='b:', etc...).
Definition at line 1481 of file Akai.cpp.
References mClusterSize, mFile, mSize, and OpenStream().
|
virtual |
|
virtual |
|
virtual |
|
virtual |
Definition at line 1616 of file Akai.cpp.
References akai_stream_closed, akai_stream_end_reached, akai_stream_ready, mFile, mPos, and mSize.
|
protected |
Definition at line 1786 of file Akai.cpp.
References CD_FRAMESIZE, DISK_CLUSTER_SIZE, mClusterSize, mEndFrame, mFile, mpCache, mRegularFile, mSize, and mStartFrame.
Referenced by DiskImage().
|
virtual |
Returns number of successfully read words.
Definition at line 1658 of file Akai.cpp.
References mCluster, mClusterSize, mFile, mpCache, mPos, mRegularFile, mSize, and mStartFrame.
Referenced by AkaiProgram::Load(), AkaiSample::LoadHeader(), AkaiDiskElement::ReadDirEntry(), AkaiDiskElement::ReadFAT(), ReadInt16(), ReadInt32(), ReadInt8(), and WriteImage().
void DiskImage::ReadInt16 | ( | uint16_t * | pData, |
uint | WordCount | ||
) |
Definition at line 1725 of file Akai.cpp.
References ReadInt16().
Referenced by AkaiDisk::GetPartitionCount(), AkaiProgram::Load(), AkaiSample::LoadHeader(), AkaiSample::LoadSampleData(), AkaiSample::Read(), and AkaiDiskElement::ReadDirEntry().
int DiskImage::ReadInt16 | ( | uint16_t * | pData | ) |
Returns number of successfully read 16 Bit words.
Definition at line 1743 of file Akai.cpp.
References Read(), and swapBytes_16().
uint16_t DiskImage::ReadInt16 | ( | ) |
Definition at line 1766 of file Akai.cpp.
References Read(), and swapBytes_16().
Referenced by ReadInt16().
void DiskImage::ReadInt32 | ( | uint32_t * | pData, |
uint | WordCount | ||
) |
Definition at line 1732 of file Akai.cpp.
References ReadInt32().
Referenced by AkaiSample::LoadHeader().
int DiskImage::ReadInt32 | ( | uint32_t * | pData | ) |
Returns number of successfully read 32 Bit words.
Definition at line 1751 of file Akai.cpp.
References Read(), and swapBytes_32().
uint32_t DiskImage::ReadInt32 | ( | ) |
Definition at line 1776 of file Akai.cpp.
References Read(), and swapBytes_32().
Referenced by ReadInt32().
void DiskImage::ReadInt8 | ( | uint8_t * | pData, |
uint | WordCount | ||
) |
Definition at line 1721 of file Akai.cpp.
References Read().
Referenced by AkaiProgram::Load(), and AkaiSample::LoadHeader().
int DiskImage::ReadInt8 | ( | uint8_t * | pData | ) |
|
virtual |
Definition at line 1628 of file Akai.cpp.
References akai_stream_curpos, akai_stream_end, akai_stream_start, mPos, and mSize.
Referenced by AkaiDisk::GetPartitionCount(), AkaiProgram::Load(), AkaiSample::LoadHeader(), AkaiSample::LoadSampleData(), AkaiSample::Read(), AkaiDiskElement::ReadDirEntry(), AkaiDiskElement::ReadFAT(), and WriteImage().
|
inlineprotected |
Definition at line 1899 of file Akai.cpp.
Referenced by ReadInt16().
|
inlineprotected |
Definition at line 1906 of file Akai.cpp.
Referenced by ReadInt32().
bool DiskImage::WriteImage | ( | const char * | path | ) |
|
protected |
Definition at line 155 of file Akai.h.
Referenced by DiskImage(), OpenStream(), and Read().
|
protected |
Definition at line 159 of file Akai.h.
Referenced by OpenStream().
|
protected |
Definition at line 150 of file Akai.h.
Referenced by DiskImage(), GetState(), OpenStream(), Read(), WriteImage(), and ~DiskImage().
|
protected |
Definition at line 160 of file Akai.h.
Referenced by OpenStream(), Read(), and ~DiskImage().
|
protected |
Definition at line 153 of file Akai.h.
Referenced by Available(), GetPos(), GetState(), Read(), and SetPos().
|
protected |
Definition at line 152 of file Akai.h.
Referenced by OpenStream(), and Read().
|
protected |
Definition at line 156 of file Akai.h.
Referenced by Available(), DiskImage(), GetState(), OpenStream(), Read(), and SetPos().
|
protected |
Definition at line 158 of file Akai.h.
Referenced by OpenStream(), and Read().