• Main Page
  • Classes
  • Files
  • File List
  • File Members

qeaudio.h

Go to the documentation of this file.
00001 //
00002 // begin license header
00003 //  
00004 // This file is part of Terk and TerkOS.
00005 //
00006 // All Terk and TerkOS source code is provided under the terms of the 
00007 // GNU General Public License v2 (http://www.gnu.org/licenses/gpl-2.0.html).  
00008 // Those wishing to use Terk and TerkOS source code, software and/or
00009 // technologies under different licensing terms should contact us at 
00010 // [email protected]. Such licensing terms are available for
00011 // all portions of the Terk and TerkOS codebase presented here.
00012 //
00013 // end license header
00014 //
00015 
00016 #ifndef __QEAUDIO_H__
00017 #define __QEAUDIO_H__
00018 
00019 #include <stdio.h>
00020 #include <unistd.h>
00021 #include <sys/time.h>
00022 #include <pthread.h>
00023 #include <stdlib.h>
00024 #include <errno.h>
00025 #include <string.h>
00026 
00027 #include <queue>
00028 #include <map>
00029 
00030 #include "singleton.h"
00031 #include "9302hw.h"
00032 
00033 #define QEAUDIO_RETURN_OK                          0
00034 #define QEAUDIO_RETURN_ERROR                      -1
00035 
00036 #define QEAUDIO_DEFAULT_ADDR                       0xfe0
00037 #define QEAUDIO_MODE_TONE                          1
00038 #define QEAUDIO_MODE_WAVE                          2
00039 #define QEAUDIO_MODE_OFF                           0
00040 
00057 class CQEAudioController
00058 {
00059 public:
00063   SINGLETON(CQEAudioController);
00064 
00070   void SetVolume(unsigned char vol);
00071 
00081   int PlayTone(unsigned short frequency, int duration);
00082 
00089   int PlayClip(const char clip[], int length);
00090 
00097   int PlayClip(const char *filename);         
00098 
00104   int Talk(const char *string);
00105 
00106 private:
00107   C9302Hardware *m_p9302hw; 
00108   CQEAudioController();
00109   ~CQEAudioController();
00110 
00111   volatile unsigned short *m_config;
00112   volatile unsigned short *m_period;
00113   volatile unsigned short *m_volume;
00114 };
00115 
00116 #endif
00117 

Generated on Mon Oct 3 2011 15:36:31 for libqwerk by  doxygen 1.7.1