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. More...
 
unsigned getBytes () const
 Returns the number of bytes (not samples) written so far. More...
 
void flush ()
 Flush data to file and update header. More...
 

Protected Member Functions

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

Protected Attributes

File file
 
unsigned bytes = 0
 

Detailed Description

Base class for writing WAV files.

Definition at line 15 of file WavWriter.hh.

Constructor & Destructor Documentation

◆ WavWriter()

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

Definition at line 13 of file WavWriter.cc.

References openmsx::DiskImageUtils::format().

◆ ~WavWriter()

openmsx::WavWriter::~WavWriter ( )
protected

Definition at line 51 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 66 of file WavWriter.cc.

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

Referenced by ~WavWriter().

◆ getBytes()

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

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

Definition at line 24 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 20 of file WavWriter.hh.

References bytes.

Member Data Documentation

◆ bytes

unsigned openmsx::WavWriter::bytes = 0
protected

Definition at line 38 of file WavWriter.hh.

Referenced by flush(), getBytes(), isEmpty(), openmsx::Wav16Writer::write(), and ~WavWriter().

◆ file

File openmsx::WavWriter::file
protected

Definition at line 37 of file WavWriter.hh.

Referenced by flush(), openmsx::Wav16Writer::write(), and ~WavWriter().


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