00001 00002 00003 00004 00005 00006 00007 #ifndef CSL_SoundFileJ_H 00008 #define CSL_SoundFileJ_H 00009 00010 #include "SoundFile.h" 00011 00012 #include <juce.h> 00013 00014 namespace csl { 00015 00019 00020 class JSoundFile : public Abst_SoundFile { 00021 public: 00022 JSoundFile(string path, int start = -1, int stop = -1); 00023 JSoundFile(string folder, string path, int start = -1, int stop = -1); 00024 JSoundFile(JSoundFile & otherSndFile); 00025 ~JSoundFile(); 00026 00027 unsigned duration() const; 00028 SoundFileFormat format(); 00029 00030 void openForRead() throw (CException); 00031 00032 void openForWrite(SoundFileFormat format = kSoundFileFormatAIFF, 00033 unsigned channels = 1, 00034 unsigned rate = 44100, 00035 unsigned bitDepth = 16) throw (CException); 00036 void openForReadWrite() throw (CException); 00037 void close(); 00038 00039 unsigned seekTo(int position, SeekPosition whence) throw(CException); 00040 void readBufferFromFile(unsigned numFrames); 00041 00042 void writeBuffer(Buffer &inputBuffer) throw (CException); 00043 00044 AudioFormatReader * mAFReader; 00045 AudioFormatWriter * mAFWriter; 00046 File * mIOFile; 00047 FileOutputStream * mOutStream; 00048 00049 protected: 00050 void initFromSndfile(); 00051 // void convertFormat(unsigned num, unsigned start); 00052 00053 }; 00054 00055 } 00056 00057 #endif
1.5.8