DiskImage Class Reference

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.
| DiskImage (int disk)
| Open an image from a device number (0='a:', 1='b:', etc...).
bool | WriteImage (const char *path)
| Extract Akai data track and write it into a regular file.
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.
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.
int | ReadInt16 (uint16_t *pData)
| Returns number of successfully read 16 Bit words.
int | ReadInt32 (uint32_t *pData)
| Returns number of successfully read 32 Bit words.
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

## Detailed Description

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.

Definition at line 109 of file Akai.h.

## Constructor & Destructor Documentation

## DiskImage() [1/2]

DiskImage::DiskImage | ( | const char * | path | ) |

Open an image from a file.

Definition at line 1266 of file Akai.cpp.

## DiskImage() [2/2]

DiskImage::DiskImage | ( | int | disk | ) |

Open an image from a device number (0='a:', 1='b:', etc...).

Definition at line 1483 of file Akai.cpp.

## ~DiskImage()

DiskImage::~DiskImage | ( |  | ) |

virtual

Definition at line 1595 of file Akai.cpp.

## Member Function Documentation

## Available()

int DiskImage::Available | ( | uint | WordSize = 1 | ) |

virtual

Definition at line 1655 of file Akai.cpp.

## GetError()

virtual uint DiskImage::GetError | ( |  | ) | const

inline virtual

Definition at line 137 of file Akai.h.

## GetPos()

int DiskImage::GetPos | ( |  | ) | const

virtual

Definition at line 1625 of file Akai.cpp.

## GetState()

akai_stream_state_t DiskImage::GetState | ( |  | ) | const

virtual

Definition at line 1618 of file Akai.cpp.

## OpenStream()

void DiskImage::OpenStream | ( | const char * | path | ) |

protected

Definition at line 1788 of file Akai.cpp.

## Read()

int DiskImage::Read | ( | void * | pData,
|  | uint | WordCount,
|  | uint | WordSize )

virtual

Returns number of successfully read words.

Definition at line 1660 of file Akai.cpp.

Referenced by ReadInt16(), ReadInt32(), ReadInt8(), and WriteImage().

## ReadInt16() [1/3]

uint16_t DiskImage::ReadInt16 | ( |  | ) |

Definition at line 1768 of file Akai.cpp.

## ReadInt16() [2/3]

int DiskImage::ReadInt16 | ( | uint16_t * | pData | ) |

Returns number of successfully read 16 Bit words.

Definition at line 1745 of file Akai.cpp.

References Read().

## ReadInt16() [3/3]

void DiskImage::ReadInt16 | ( | uint16_t * | pData,
|  | uint | WordCount )

Definition at line 1727 of file Akai.cpp.

## ReadInt32() [1/3]

uint32_t DiskImage::ReadInt32 | ( |  | ) |

Definition at line 1778 of file Akai.cpp.

## ReadInt32() [2/3]

int DiskImage::ReadInt32 | ( | uint32_t * | pData | ) |

Returns number of successfully read 32 Bit words.

Definition at line 1753 of file Akai.cpp.

References Read().

## ReadInt32() [3/3]

void DiskImage::ReadInt32 | ( | uint32_t * | pData,
|  | uint | WordCount )

Definition at line 1734 of file Akai.cpp.

## ReadInt8() [1/3]

uint8_t DiskImage::ReadInt8 | ( |  | ) |

Definition at line 1761 of file Akai.cpp.

## ReadInt8() [2/3]

int DiskImage::ReadInt8 | ( | uint8_t * | pData | ) |

Returns number of successfully read 8 Bit words.

Definition at line 1741 of file Akai.cpp.

References Read().

## ReadInt8() [3/3]

void DiskImage::ReadInt8 | ( | uint8_t * | pData,
|  | uint | WordCount )

Definition at line 1723 of file Akai.cpp.

## SetPos()

int DiskImage::SetPos | ( | int | Where,
|  | akai_stream_whence_t | Whence = akai_stream_start )

virtual

Definition at line 1630 of file Akai.cpp.

## swapBytes_16()

void DiskImage::swapBytes_16 | ( | void * | Word | ) |

inline protected

Definition at line 1901 of file Akai.cpp.

## swapBytes_32()

void DiskImage::swapBytes_32 | ( | void * | Word | ) |

inline protected

Definition at line 1908 of file Akai.cpp.

## WriteImage()

bool DiskImage::WriteImage | ( | const char * | path | ) |

Extract Akai data track and write it into a regular file.

Definition at line 1878 of file Akai.cpp.

References Read().

## Member Data Documentation

## mCluster

int DiskImage::mCluster

protected

Definition at line 155 of file Akai.h.

## mClusterSize

int DiskImage::mClusterSize

protected

Definition at line 156 of file Akai.h.

## mEndFrame

int DiskImage::mEndFrame

protected

Definition at line 160 of file Akai.h.

## mFile

int DiskImage::mFile

protected

Definition at line 151 of file Akai.h.

## mpCache

char* DiskImage::mpCache

protected

Definition at line 161 of file Akai.h.

## mPos

int DiskImage::mPos

protected

Definition at line 154 of file Akai.h.

## mRegularFile

bool DiskImage::mRegularFile

protected

Definition at line 153 of file Akai.h.

## mSize

int DiskImage::mSize

protected

Definition at line 157 of file Akai.h.

## mStartFrame

int DiskImage::mStartFrame

protected

Definition at line 159 of file Akai.h.

The documentation for this class was generated from the following files:

- Akai.h
- Akai.cpp