Skip to content

Snapshot ​

cpp
#include <Media/Snapshot.h>
cpp
class Snapshot

Defined in Media/Snapshot.h:59

A snapshot of the emulator state.

Public Methods ​

ReturnNameDescription
Snapshot inlineCreates a copy of a snapshot.
Snapshot inlineReads a snapshot from a file.
Snapshot inlineReads a snapshot from a memory buffer.
SnapshotCreates an empty snapshot with the given capacity.
SnapshotTakes a snapshot of the emulator state.
SnapshotTakes a snapshot of the emulator state and compresses it.
boolisCompatiblePath virtual const inline overrideReturns true if the given path points to a snapshot file.
voiddidLoad virtual overrideCalled after the snapshot has been loaded.
std::pair< isize, isize >previewImageSize constReturns the size of the preview image (width, height).
const u32 *previewImageData constReturns the pixel data of the preview image.
time_ttimestamp constReturns the time the snapshot was taken.
boolisTooOld constReturns true if the snapshot was created by an older, incompatible version.
boolisTooNew constReturns true if the snapshot was created by a newer version.
boolisBeta constReturns true if the snapshot was created by a beta version.
boolmatches inlineReturns true if the snapshot can be restored by this version.
SnapshotHeader *getHeader const inlineReturns a pointer to the snapshot header.
const Thumbnail &getThumbnail const inlineReturns the preview image.
voidtakeScreenshotRecords a screenshot.
utl::Compressorcompressor const inlineReturns the compression method.
boolisCompressed const inlineReturns true if the snapshot is compressed.
voidcompressCompresses the snapshot with the given method.
voiduncompressUncompresses the snapshot.

Snapshot ​

inline

cpp
inline Snapshot(const Snapshot & other)

Defined in Media/Snapshot.h:72

Creates a copy of a snapshot.


Snapshot ​

inline

cpp
inline Snapshot(const fs::path & path)

Defined in Media/Snapshot.h:74

Reads a snapshot from a file.


Snapshot ​

inline

cpp
inline Snapshot(const u8 * buf, isize len)

Defined in Media/Snapshot.h:76

Reads a snapshot from a memory buffer.


Snapshot ​

cpp
Snapshot(isize capacity)

Defined in Media/Snapshot.h:78

Creates an empty snapshot with the given capacity.


Snapshot ​

cpp
Snapshot(Amiga & amiga)

Defined in Media/Snapshot.h:80

Takes a snapshot of the emulator state.


Snapshot ​

cpp
Snapshot(Amiga & amiga, utl::Compressor compressor)

Defined in Media/Snapshot.h:82

Takes a snapshot of the emulator state and compresses it.


isCompatiblePath ​

virtual const inline override

cpp
virtual inline bool isCompatiblePath(const fs::path & path) const override

Defined in Media/Snapshot.h:90

Returns true if the given path points to a snapshot file.

Reimplements ​


didLoad ​

virtual override

cpp
virtual void didLoad() override

Defined in Media/Snapshot.h:92

Called after the snapshot has been loaded.

Reimplements ​

  • AnyFile::didLoad

previewImageSize ​

const

cpp
std::pair< isize, isize > previewImageSize() const

Defined in Media/Snapshot.h:102

Returns the size of the preview image (width, height).


previewImageData ​

const

cpp
const u32 * previewImageData() const

Defined in Media/Snapshot.h:104

Returns the pixel data of the preview image.


timestamp ​

const

cpp
time_t timestamp() const

Defined in Media/Snapshot.h:106

Returns the time the snapshot was taken.


isTooOld ​

const

cpp
bool isTooOld() const

Defined in Media/Snapshot.h:110

Returns true if the snapshot was created by an older, incompatible version.


isTooNew ​

const

cpp
bool isTooNew() const

Defined in Media/Snapshot.h:112

Returns true if the snapshot was created by a newer version.


isBeta ​

const

cpp
bool isBeta() const

Defined in Media/Snapshot.h:114

Returns true if the snapshot was created by a beta version.


matches ​

inline

cpp
inline bool matches()

Defined in Media/Snapshot.h:116

Returns true if the snapshot can be restored by this version.


getHeader ​

const inline

cpp
inline SnapshotHeader * getHeader() const

Defined in Media/Snapshot.h:120

Returns a pointer to the snapshot header.


getThumbnail ​

const inline

cpp
inline const Thumbnail & getThumbnail() const

Defined in Media/Snapshot.h:124

Returns the preview image.


takeScreenshot ​

cpp
void takeScreenshot(Amiga & amiga)

Defined in Media/Snapshot.h:131

Records a screenshot.


compressor ​

const inline

cpp
inline utl::Compressor compressor() const

Defined in Media/Snapshot.h:140

Returns the compression method.


isCompressed ​

const inline

cpp
inline bool isCompressed() const

Defined in Media/Snapshot.h:144

Returns true if the snapshot is compressed.


compress ​

cpp
void compress(utl::Compressor method)

Defined in Media/Snapshot.h:148

Compresses the snapshot with the given method.


uncompress ​

cpp
void uncompress()

Defined in Media/Snapshot.h:150

Uncompresses the snapshot.

Public Static Methods ​

ReturnNameDescription
boolisCompatible staticChecks whether a file contains a snapshot.

isCompatible ​

static

cpp
static bool isCompatible(const fs::path & path)

Defined in Media/Snapshot.h:64

Checks whether a file contains a snapshot.