/ MCUME_teensy / teensyspeccy / AudioPlaySystem.h
AudioPlaySystem.h
 1  #ifndef audioplaysystem_h_
 2  #define audioplaysystem_h_
 3  
 4  #ifdef HAS_SND
 5  
 6  #include "platform_config.h"
 7  
 8  //#undef HAS_T4_VGA // To force using Audio library!!
 9  
10  #ifndef HAS_T4_VGA
11  
12  #include <Audio.h>
13  
14  class AudioPlaySystem : public AudioStream
15  {
16  public:
17    AudioPlaySystem(void) : AudioStream(0, NULL) { begin(); }
18    void begin(void);
19    void setSampleParameters(float clockfreq, float samplerate);
20    void reset(void);
21    void start(void);
22    void stop(void);
23    bool isPlaying(void);
24    void sound(int C, int F, int V);    
25    void buzz(int size, int val);
26    void step(void);  
27      
28  private:
29    virtual void update(void);
30    static void snd_Mixer(short *  stream, int len );   
31  };
32  
33  #else
34  class AudioPlaySystem
35  {
36  public:
37    AudioPlaySystem(void) { };
38    void begin(void);
39    void setSampleParameters(float clockfreq, float samplerate);
40    void reset(void);
41    void start(void);
42    void stop(void);
43    bool isPlaying(void);
44    void sound(int C, int F, int V);    
45    void buzz(int size, int val);
46    void step(void);
47    static void snd_Mixer(short *  stream, int len );  
48  };
49  
50  #endif
51  
52  #endif
53  
54  #endif