Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Compound Members | File Members

AudioA.hh

Go to the documentation of this file.
00001 /*
00002 
00003     ALSA audio I/O
00004     Copyright (C) 2000-2001 Jussi Laako
00005 
00006     This program is free software; you can redistribute it and/or modify
00007     it under the terms of the GNU General Public License as published by
00008     the Free Software Foundation; either version 2 of the License, or
00009     (at your option) any later version.
00010 
00011     This program is distributed in the hope that it will be useful,
00012     but WITHOUT ANY WARRANTY; without even the implied warranty of
00013     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014     GNU General Public License for more details.
00015 
00016     You should have received a copy of the GNU General Public License
00017     along with this program; if not, write to the Free Software
00018     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00019 
00020 */
00021 
00022 
00023 #ifdef USE_ALSA05
00024 
00025 
00026 #include <sys/asoundlib.h>
00027 
00028 
00029 #ifndef AUDIOA_HH
00030     #define AUDIOA_HH
00031 
00032     #define AA_MODE_PLAY            SND_PCM_OPEN_PLAYBACK
00033     #define AA_MODE_RECORD          SND_PCM_OPEN_CAPTURE
00034     #define AA_MODE_DUPLEX          SND_PCM_OPEN_DUPLEX
00035 
00036     #define AA_FRAG_RECORD_LW       1
00037     #define AA_FRAG_PLAY_LW         3
00038     #define AA_FRAG_PLAY_HW         1
00039 
00040 
00044     class clAudioA
00045     {
00046             bool bStream;
00047             int iCard;
00048             int iDevice;
00049             int iSubDevice;
00050             int iMode;
00051             snd_ctl_t *spSndCtlH;
00052             snd_pcm_t *spPcmH;
00053             snd_ctl_hw_info_t sHWInfo;
00054             snd_pcm_info_t sPCMInfo;
00055             snd_pcm_channel_info_t sPCMChInfo;
00056             snd_pcm_channel_setup_t sPCMSetup;
00057         public:
00058             clAudioA ();
00059             ~clAudioA ();
00060             /* - Card specifics - */
00067             bool CardOpen (int);
00071             void CardClose ();
00079             int CardGetCount ();
00085             const char *CardGetName ();
00091             const char *CardGetLongName ();
00097             int CardGetChannelCount ();
00098             /* - Device specifics - */
00107             bool PcmOpen (int, int, int);
00111             void PcmClose ();
00122             bool PcmSetSetup (int, int, int, int, bool);
00128             int PcmGetChannels ();
00134             int PcmGetSampleRate ();
00140             int PcmGetBits ();
00146             int PcmGetFragmentSize ();
00152             const char *PcmGetFormatName ();
00158             int PcmGetStatus ();
00164             const char *PcmGetStatusStr (int);
00170             const char *PcmGetName ();
00176             const snd_pcm_channel_info_t *PcmGetChannelInfo ();
00183             bool PcmGetChannelStatus (snd_pcm_channel_status_t *);
00189             int PcmGetBufUsed ();
00195             int PcmGetBufFree ();
00201             bool PcmPrepare ();
00207             bool PcmGo ();
00213             bool PcmDrain ();
00219             bool PcmFlush ();
00225             ssize_t PcmGetTransferSize ();
00233             ssize_t PcmRead (void *, size_t);
00241             ssize_t PcmWrite (const void *, size_t);
00242     };
00243 
00244 #endif
00245 
00246 #endif  // USE_ALSA05

Generated on Sun Oct 26 19:11:18 2003 for HASAS by doxygen 1.3.3