openMSX
Public Types | Public Member Functions | Friends | List of all members
openmsx::CassettePlayer Class Reference

#include <CassettePlayer.hh>

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

Public Types

enum  State { PLAY, RECORD, STOP }
 
- Public Types inherited from openmsx::ResampledSoundDevice
enum  ResampleType { RESAMPLE_HQ, RESAMPLE_LQ, RESAMPLE_BLIP }
 

Public Member Functions

 CassettePlayer (const HardwareConfig &hwConf)
 
virtual ~CassettePlayer ()
 
virtual void setMotor (bool status, EmuTime::param time)
 Sets the cassette motor relay false = off true = on. More...
 
virtual short readSample (EmuTime::param time)
 Read wave data from cassette device. More...
 
virtual void setSignal (bool output, EmuTime::param time)
 Sets the cassette output signal false = low true = high. More...
 
virtual const std::string & getName () const
 Name used to identify this pluggable. More...
 
virtual string_ref getDescription () const
 Description for this pluggable. More...
 
virtual void plugHelper (Connector &connector, EmuTime::param time)
 
virtual void unplugHelper (EmuTime::param time)
 
virtual void generateChannels (int **bufs, unsigned num)
 Abstract method to generate the actual sound data. More...
 
template<typename Archive >
void serialize (Archive &ar, unsigned version)
 
- Public Member Functions inherited from openmsx::CassetteDevice
virtual string_ref getClass () const
 A pluggable belongs to a certain class. More...
 
- Public Member Functions inherited from openmsx::Pluggable
 Pluggable ()
 
virtual ~Pluggable ()
 
void plug (Connector &connector, EmuTime::param time)
 This method is called when this pluggable is inserted in a connector. More...
 
void unplug (EmuTime::param time)
 This method is called when this pluggable is removed from a conector. More...
 
ConnectorgetConnector () const
 Get the connector this Pluggable is plugged into. More...
 
bool isPluggedIn () const
 Returns true if this pluggable is currently plugged into a connector. More...
 
- Public Member Functions inherited from openmsx::ResampledSoundDevice
bool generateInput (int *buffer, unsigned num)
 Note: To enable various optimizations (like SSE), this method is allowed to generate up to 3 extra sample. More...
 
- Public Member Functions inherited from openmsx::SoundDevice
const std::string & getName () const
 Get the unique name that identifies this sound device. More...
 
const std::string & getDescription () const
 Gets a description of this sound device, to be presented to the user. More...
 
bool isStereo () const
 Is this a stereo device? This is set in the constructor and cannot be changed anymore. More...
 
virtual int getAmplificationFactor () const
 Get extra amplification factor for this device. More...
 
void recordChannel (unsigned channel, const Filename &filename)
 
void muteChannel (unsigned channel, bool muted)
 

Friends

class TapeCommand
 

Additional Inherited Members

- Static Public Attributes inherited from openmsx::SoundDevice
static const unsigned MAX_CHANNELS = 24
 
- Protected Member Functions inherited from openmsx::Pluggable
void setConnector (Connector *conn)
 
- Protected Member Functions inherited from openmsx::ResampledSoundDevice
 ResampledSoundDevice (MSXMotherBoard &motherBoard, string_ref name, string_ref description, unsigned channels, bool stereo=false)
 
virtual ~ResampledSoundDevice ()
 
virtual void setOutputRate (unsigned sampleRate)
 When a SoundDevice registers itself with the Mixer, the Mixer sets the required sampleRate through this method. More...
 
virtual bool updateBuffer (unsigned length, int *buffer, EmuTime::param time)
 Generate sample data. More...
 
virtual void update (const Setting &setting)
 
void createResampler ()
 
- Protected Member Functions inherited from openmsx::SoundDevice
 SoundDevice (MSXMixer &mixer, string_ref name, string_ref description, unsigned numChannels, bool stereo=false)
 Constructor. More...
 
virtual ~SoundDevice ()
 
void registerSound (const DeviceConfig &config)
 Registers this sound device with the Mixer. More...
 
void unregisterSound ()
 Unregisters this sound device with the Mixer. More...
 
void updateStream (EmuTime::param time)
 
void setInputRate (unsigned sampleRate)
 
unsigned getInputRate () const
 
bool mixChannels (int *dataOut, unsigned num)
 Calls generateChannels() and combines the output to a single channel. More...
 
const DynamicClockgetHostSampleClock () const
 See MSXMixer::getHostSampleClock(). More...
 
double getEffectiveSpeed () const
 
- Protected Member Functions inherited from openmsx::Observer< Setting >
virtual ~Observer ()
 
virtual void subjectDeleted (const Setting &)
 

Detailed Description

Definition at line 24 of file CassettePlayer.hh.

Member Enumeration Documentation

Enumerator
PLAY 
RECORD 
STOP 

Definition at line 48 of file CassettePlayer.hh.

Constructor & Destructor Documentation

openmsx::CassettePlayer::CassettePlayer ( const HardwareConfig hwConf)
explicit
openmsx::CassettePlayer::~CassettePlayer ( )
virtual

Member Function Documentation

void openmsx::CassettePlayer::generateChannels ( int **  buffers,
unsigned  num 
)
virtual

Abstract method to generate the actual sound data.

Parameters
buffersAn array of pointer to buffers. Each buffer must be big enough to hold 'num' samples.
numThe number of samples.

This method should fill each buffer with sound data that corresponds to one channel of the sound device. The same channel should each time be written to the same buffer (needed for record).

If a certain channel is muted it is allowed to set the buffer pointer to nullptr. This has exactly the same effect as filling the buffer completely with zeros, but it can be more efficient.

Implements openmsx::SoundDevice.

Definition at line 582 of file CassettePlayer.cc.

References PLAY.

string_ref openmsx::CassettePlayer::getDescription ( ) const
virtual

Description for this pluggable.

Implements openmsx::Pluggable.

Definition at line 560 of file CassettePlayer.cc.

const string & openmsx::CassettePlayer::getName ( ) const
virtual

Name used to identify this pluggable.

Reimplemented from openmsx::Pluggable.

Definition at line 554 of file CassettePlayer.cc.

Referenced by CassettePlayer(), and ~CassettePlayer().

void openmsx::CassettePlayer::plugHelper ( Connector connector,
EmuTime::param  time 
)
virtual

Implements openmsx::Pluggable.

Definition at line 569 of file CassettePlayer.cc.

short openmsx::CassettePlayer::readSample ( EmuTime::param  time)
virtual

Read wave data from cassette device.

Implements openmsx::CassetteDevice.

Definition at line 446 of file CassettePlayer.cc.

References PLAY.

template<typename Archive >
void openmsx::CassettePlayer::serialize ( Archive &  ar,
unsigned  version 
)
void openmsx::CassettePlayer::setMotor ( bool  status,
EmuTime::param  time 
)
virtual

Sets the cassette motor relay false = off true = on.

Implements openmsx::CassetteDevice.

Definition at line 428 of file CassettePlayer.cc.

void openmsx::CassettePlayer::setSignal ( bool  output,
EmuTime::param  time 
)
virtual

Sets the cassette output signal false = low true = high.

Implements openmsx::CassetteDevice.

Definition at line 458 of file CassettePlayer.cc.

void openmsx::CassettePlayer::unplugHelper ( EmuTime::param  time)
virtual

Implements openmsx::Pluggable.

Definition at line 575 of file CassettePlayer.cc.

References STOP.

Friends And Related Function Documentation

friend class TapeCommand
friend

Definition at line 150 of file CassettePlayer.hh.


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