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

FilterAUDIOFILE.h

Go to the documentation of this file.
00001 //LabPlot : FilterAUDIOFILE.h
00002 
00003 #ifndef FILTERAUDIOFILE_H
00004 #define FILTERAUDIOFILE_H
00005 
00006 #include <qstring.h>
00007 #include <qstringlist.h>
00008 
00009 #ifdef HAVE_AUDIOFILE
00010 #include <audiofile.h>
00011 #endif
00012 
00013 class FilterAUDIOFILE
00014 {
00015 public:
00016         FilterAUDIOFILE(QString filename=0);
00017         bool fileOK() { return fileok; }
00018         QString description() { return QString("TODO"); }       // TODO
00019         int frameCount() { 
00020 #ifdef HAVE_AUDIOFILE
00021                 return (int) afGetFrameCount(file, AF_DEFAULT_TRACK); 
00022 #else
00023                 return 0;
00024 #endif
00025         }
00026         int channelCount() { 
00027 #ifdef HAVE_AUDIOFILE
00028                 return afGetVirtualChannels(file, AF_DEFAULT_TRACK); 
00029 #else
00030                 return 0;
00031 #endif
00032         }
00033         QString Name() { 
00034 #ifdef HAVE_AUDIOFILE
00035                 return QString((char *)afQueryPointer(AF_QUERYTYPE_FILEFMT,AF_QUERY_NAME,format,0,0)); 
00036 #else
00037                 return QString::null;
00038 #endif
00039         }
00040         QString Desc() { 
00041 #ifdef HAVE_AUDIOFILE
00042                 return QString((char *)afQueryPointer(AF_QUERYTYPE_FILEFMT,AF_QUERY_DESC,format,0,0)); 
00043 #else
00044                 return QString::null;
00045 #endif
00046         }
00047         QString sampleFormat();
00048         QString Format(int f);
00049         int sampleWidth();
00050         double sampleRate() { 
00051 #ifdef HAVE_AUDIOFILE
00052                 return afGetRate(file, AF_DEFAULT_TRACK); 
00053 #else
00054                 return 0;
00055 #endif
00056         }
00057         double frameSize() { 
00058 #ifdef HAVE_AUDIOFILE
00059                 return (double) afGetVirtualFrameSize(file, AF_DEFAULT_TRACK, 1); 
00060 #else
00061                 return 0;
00062 #endif
00063         }
00064         unsigned int virtualFrameSize() { 
00065 #ifdef HAVE_AUDIOFILE
00066                 return (unsigned int)afGetVirtualFrameSize(file,AF_DEFAULT_TRACK, 1);
00067 #else
00068                 return 0;
00069 #endif
00070         }
00071         double *Data();
00072 
00073 private:
00074         QString filename;                       // file
00075         bool fileok;                            // is an audio file and readable
00076 #ifdef HAVE_AUDIOFILE
00077         AFfilehandle file;
00078 #endif
00079         int format;                             // numeric format id
00080 };
00081 
00082 #endif //FILTERAUDIOFILE_H

Generated on Sat Oct 13 21:55:01 2007 for LabPlot by  doxygen 1.4.4