00001 /* 00002 * Copyright (C) 2007 Anand K. Mistry 00003 * Copyright (C) 2008 Alan Calvert 00004 * 00005 * This program is free software; you can redistribute it and/or 00006 * modify it under the terms of the GNU General Public License 00007 * as published by the Free Software Foundation; either version 2 00008 * of the License, or (at your option) any later version. 00009 * 00010 * This program is distributed in the hope that it will be useful, 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 * GNU General Public License for more details. 00014 * 00015 * You should have received a copy of the GNU General Public License 00016 * along with this program; if not, write to the Free Software 00017 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 00018 * 02110-1301, USA. 00019 */ 00020 /* vim: set expandtab tabstop=4 shiftwidth=4: */ 00021 00022 #ifndef _AUDIOINPUTOSS_H_ 00023 #define _AUDIOINPUTOSS_H_ 00024 00025 #include "audioinput.h" 00026 00027 class AudioInputOSS : public AudioInput 00028 { 00029 public: 00030 AudioInputOSS(const QString &device); 00031 ~AudioInputOSS() { Close(); }; 00032 00033 bool Open(uint sample_bits, uint sample_rate, uint channels); 00034 inline bool IsOpen(void) { return (dsp_fd > -1); } 00035 void Close(void); 00036 00037 bool Start(void); 00038 bool Stop(void); 00039 00040 int GetBlockSize(void); 00041 int GetSamples(void *buffer, uint num_samples); 00042 int GetNumReadyBytes(void); 00043 00044 private: 00045 QByteArray m_device_name; 00046 int dsp_fd; 00047 }; 00048 #endif /* _AUDIOINPUTOSS_H_ */ 00049
1.6.3