MCUME/MCUME_teensy/teensypce/AudioPlaySystem.h

55 wiersze
1.0 KiB
C
Czysty Zwykły widok Historia

2019-11-03 19:55:27 +00:00
#ifndef audioplaysystem_h_
#define audioplaysystem_h_
#ifdef HAS_SND
2020-10-17 14:06:14 +00:00
#include "platform_config.h"
#undef HAS_T4_VGA // To force using Audio library!!
#ifndef HAS_T4_VGA
2019-11-03 19:55:27 +00:00
#include <Audio.h>
class AudioPlaySystem : public AudioStream
{
public:
2020-10-17 14:06:14 +00:00
AudioPlaySystem(void) : AudioStream(0, NULL) { begin(); }
void begin(void);
void setSampleParameters(float clockfreq, float samplerate);
void reset(void);
2019-11-03 19:55:27 +00:00
void start(void);
2020-10-17 14:06:14 +00:00
void stop(void);
2019-11-03 19:55:27 +00:00
bool isPlaying(void);
2020-10-17 14:06:14 +00:00
void sound(int C, int F, int V);
2019-11-03 19:55:27 +00:00
void buzz(int size, int val);
void step(void);
private:
2020-10-17 14:06:14 +00:00
virtual void update(void);
static void snd_Mixer(short * stream, int len );
};
#else
class AudioPlaySystem
{
public:
AudioPlaySystem(void) { };
void begin(void);
void setSampleParameters(float clockfreq, float samplerate);
void reset(void);
void start(void);
void stop(void);
bool isPlaying(void);
void sound(int C, int F, int V);
void buzz(int size, int val);
void step(void);
static void snd_Mixer(short * stream, int len );
2019-11-03 19:55:27 +00:00
};
2020-10-17 14:06:14 +00:00
2019-11-03 19:55:27 +00:00
#endif
#endif
2020-10-17 14:06:14 +00:00
#endif