openMSX
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
openmsx::WavWriter Class Reference

Base class for writing WAV files. More...

#include <WavWriter.hh>

Inheritance diagram for openmsx::WavWriter:
Inheritance graph
[legend]
Collaboration diagram for openmsx::WavWriter:
Collaboration graph
[legend]

Public Member Functions

bool isEmpty () const
 Returns false if there has been data written to the wav image.
 
uint32_t getBytes () const
 Returns the number of bytes (not samples) written so far.
 
void flush ()
 Flush data to file and update header.
 

Protected Member Functions

 WavWriter (const Filename &filename, unsigned channels, unsigned bits, unsigned frequency)
 
 ~WavWriter ()
 

Protected Attributes

File file
 
uint32_t bytes = 0
 

Detailed Description

Base class for writing WAV files.

Definition at line 17 of file WavWriter.hh.

Constructor & Destructor Documentation

◆ WavWriter()

openmsx::WavWriter::WavWriter ( const Filename filename,
unsigned  channels,
unsigned  bits,
unsigned  frequency 
)
protected

◆ ~WavWriter()

openmsx::WavWriter::~WavWriter ( )
protected

Definition at line 55 of file WavWriter.cc.

References bytes, file, flush(), and openmsx::File::write().

Member Function Documentation

◆ flush()

void openmsx::WavWriter::flush ( )

Flush data to file and update header.

Try to make (possibly) incomplete file already usable for external programs.

Definition at line 70 of file WavWriter.cc.

References bytes, file, openmsx::File::flush(), openmsx::File::getSize(), openmsx::File::seek(), and openmsx::File::write().

Referenced by ~WavWriter().

◆ getBytes()

uint32_t openmsx::WavWriter::getBytes ( ) const
inline

Returns the number of bytes (not samples) written so far.

Definition at line 26 of file WavWriter.hh.

References bytes.

◆ isEmpty()

bool openmsx::WavWriter::isEmpty ( ) const
inline

Returns false if there has been data written to the wav image.

Definition at line 22 of file WavWriter.hh.

References bytes.

Member Data Documentation

◆ bytes

uint32_t openmsx::WavWriter::bytes = 0
protected

◆ file

File openmsx::WavWriter::file
protected

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