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

#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)
 
 ~CassettePlayer ()
 
void setMotor (bool status, EmuTime::param time) override
 Sets the cassette motor relay false = off true = on. More...
 
short readSample (EmuTime::param time) override
 Read wave data from cassette device. More...
 
void setSignal (bool output, EmuTime::param time) override
 Sets the cassette output signal false = low true = high. More...
 
const std::string & getName () const override
 Name used to identify this pluggable. More...
 
string_ref getDescription () const override
 Description for this pluggable. More...
 
void plugHelper (Connector &connector, EmuTime::param time) override
 
void unplugHelper (EmuTime::param time) override
 
void generateChannels (int **bufs, unsigned num) override
 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
string_ref getClass () const finaloverride
 A pluggable belongs to a certain class. More...
 
- Public Member Functions inherited from openmsx::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
 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)
 
 ~ResampledSoundDevice ()
 
void setOutputRate (unsigned sampleRate) override
 When a SoundDevice registers itself with the Mixer, the Mixer sets the required sampleRate through this method. More...
 
bool updateBuffer (unsigned length, int *buffer, EmuTime::param time) override
 Generate sample data. More...
 
void update (const Setting &setting) override
 
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...
 
 ~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 >
 ~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 ( )

Member Function Documentation

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

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 577 of file CassettePlayer.cc.

References PLAY.

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

Description for this pluggable.

Implements openmsx::Pluggable.

Definition at line 555 of file CassettePlayer.cc.

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

Name used to identify this pluggable.

Reimplemented from openmsx::Pluggable.

Definition at line 549 of file CassettePlayer.cc.

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

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

Implements openmsx::Pluggable.

Definition at line 564 of file CassettePlayer.cc.

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

Read wave data from cassette device.

Implements openmsx::CassetteDevice.

Definition at line 441 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 
)
overridevirtual

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

Implements openmsx::CassetteDevice.

Definition at line 423 of file CassettePlayer.cc.

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

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

Implements openmsx::CassetteDevice.

Definition at line 453 of file CassettePlayer.cc.

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

Implements openmsx::Pluggable.

Definition at line 570 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: