2017-02-26 16:00:41 +00:00
|
|
|
#ifndef __SDLSPEAKER_H
|
|
|
|
#define __SDLSPEAKER_H
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdint.h>
|
|
|
|
#include "physicalspeaker.h"
|
|
|
|
|
2018-02-07 15:20:26 +00:00
|
|
|
#define SPEAKERQUEUESIZE 1024
|
2017-12-31 22:21:34 +00:00
|
|
|
|
2017-02-26 16:00:41 +00:00
|
|
|
class SDLSpeaker : public PhysicalSpeaker {
|
|
|
|
public:
|
|
|
|
SDLSpeaker();
|
|
|
|
virtual ~SDLSpeaker();
|
|
|
|
|
2019-02-20 22:49:51 +00:00
|
|
|
virtual void begin();
|
|
|
|
|
2017-12-31 22:21:34 +00:00
|
|
|
virtual void toggle(uint32_t c);
|
2018-01-03 01:28:47 +00:00
|
|
|
virtual void maintainSpeaker(uint32_t c, uint64_t microseconds);
|
2017-02-26 16:00:41 +00:00
|
|
|
virtual void beginMixing();
|
|
|
|
virtual void mixOutput(uint8_t v);
|
2019-02-20 22:49:51 +00:00
|
|
|
|
2017-02-26 16:00:41 +00:00
|
|
|
private:
|
2018-02-07 15:20:26 +00:00
|
|
|
uint8_t mixerValue;
|
2017-02-26 16:00:41 +00:00
|
|
|
bool toggleState;
|
2017-12-31 22:21:34 +00:00
|
|
|
|
2018-01-03 01:28:47 +00:00
|
|
|
uint64_t lastCycleCount;
|
|
|
|
uint64_t lastSampleCount;
|
2017-02-26 16:00:41 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|