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, bool load = false); 00023 JSoundFile(string folder, string path, bool load = false); 00024 // JSoundFile(string path, int start = -1, int stop = -1); 00025 // JSoundFile(string folder, string path, int start = -1, int stop = -1); 00026 JSoundFile(JSoundFile & otherSndFile); 00027 ~JSoundFile(); 00028 00029 unsigned duration() const; 00030 SoundFileFormat format(); 00031 00032 void openForRead() throw (CException); 00033 00034 void openForWrite(SoundFileFormat format = kSoundFileFormatAIFF, 00035 unsigned channels = 1, 00036 unsigned rate = 44100, 00037 unsigned bitDepth = 16) throw (CException); 00038 void openForReadWrite() throw (CException); 00039 void close(); 00040 00041 unsigned seekTo(int position, SeekPosition whence) throw(CException); 00042 void readBufferFromFile(unsigned numFrames); 00043 00044 void writeBuffer(Buffer &inputBuffer) throw (CException); 00045 00046 AudioFormatReader * mAFReader; 00047 AudioFormatWriter * mAFWriter; 00048 File * mIOFile; 00049 FileOutputStream * mOutStream; 00050 00051 protected: 00052 void initFromSndfile(); 00053 // void convertFormat(unsigned num, unsigned start); 00054 00055 }; 00056 00057 } 00058 00059 #endif
1.4.5-20051010