Mixer Class Reference

`#include <mixer.h>`

Inheritance diagram for Mixer:

## Public Member Functions

| Mixer (EventContext *context)
void | event ()
void | reset ()
void | begin (short *buffer, uint_least32_t count)
void | clearSids ()
void | addSid (sidemu *chip)
sidemu * | getSid (unsigned int i) const
bool | setFastForward (int ff)
void | setVolume (int_least32_t left, int_least32_t right)
void | setStereo (bool stereo)
bool | notFinished () const
uint_least32_t | samplesGenerated () const

## Static Public Attributes

static const int_least32_t | VOLUME_MAX = 1024

## Detailed Description

This class implements the mixer.

## Constructor & Destructor Documentation

Mixer::Mixer | ( | EventContext * | context | ) |

inline

Create a new mixer.

Parameters

  context | event context

## Member Function Documentation

void Mixer::addSid | ( | sidemu * | chip | ) |

Add a SID to the mixer.

Parameters

  chip | the sid emu to add

void Mixer::begin | ( | short * | buffer,
|  | uint_least32_t | count
| ) |  |

Prepare for mixing cycle.

Parameters

  buffer | output buffer
  count | size of the buffer in samples

void Mixer::clearSids | ( |  | ) |

Remove all SIDs from the mixer.

void Mixer::event | ( |  | ) |

virtual

Timer ticking event.

Implements Event.

sidemu* Mixer::getSid | ( | unsigned int | i | ) | const

inline

Get a SID to the mixer.

Parameters

  i | the number of the SID to get

Returns
  a pointer to the requested sid emu or 0 if not found

bool Mixer::notFinished | ( |  | ) | const

inline

Check if the buffer have been filled.

void Mixer::reset | ( |  | ) |

Schedule mixer event.

uint_least32_t Mixer::samplesGenerated | ( |  | ) | const

inline

Get the number of samples generated up to now.

bool Mixer::setFastForward | ( | int | ff | ) |

Set the fast forward ratio.

Parameters

  ff | the fast forward ratio, from 1 to 32

Returns
  true if parameter is valid, false otherwise

void Mixer::setStereo | ( | bool | stereo | ) |

Set mixing mode.

Parameters

  stereo | true for stereo mode, false for mono

void Mixer::setVolume | ( | int_least32_t | left,
|  | int_least32_t | right
| ) |  |

Set mixing volumes, from 0 to VOLUME_MAX.

Parameters

  left | volume for left or mono channel
  right | volume for right channel in stereo mode

## Member Data Documentation

const int_least32_t Mixer::VOLUME_MAX = 1024

static

Maximum allowed volume, must be a power of 2

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

- mixer.h
- mixer.cpp