00001
00002 #ifndef DEVICE_H
00003 #define DEVICE_H
00004 #include <qobject.h>
00005 #include <sys/soundcard.h>
00006
00007 class Device : public QObject {
00008 Q_OBJECT
00009 public:
00010 Device( QObject * parent=0, bool record=0 );
00011 ~Device() {};
00012 bool closeDevice( bool);
00013 int getChannels();
00014 int getFormat();
00015 int getInVolume();
00016 int getOutVolume();
00017 int getRate();
00018 int getRes();
00019 int sd;
00020 void changedInVolume(int);
00021 void changedOutVolume(int);
00022 bool openDsp();
00023 int getDeviceFormat();
00024 int getDeviceRate();
00025 int getDeviceBits();
00026 int getDeviceChannels();
00027 int getDeviceFragSize();
00028 bool setFragSize(int);
00029 bool setDeviceChannels(int);
00030 bool setDeviceRate(int);
00031 bool setDeviceFormat(int);
00032 bool reset();
00033
00034 int devRead(int, short *, int);
00035 int devWrite(int, short *, int);
00036
00037 private:
00038 int devRes, devCh, devRate, devForm, flags;
00039 QString dspstr, mixstr;
00040 bool selectMicInput();
00041 int openDevice( int );
00042 private slots:
00043
00044 protected:
00045
00046 };
00047
00048 #endif