00001 #ifndef OfflineNetworkPlayer_hxx 00002 #define OfflineNetworkPlayer_hxx 00003 00004 #include "NetworkPlayer.hxx" 00005 #include "AudioSource.hxx" 00006 #include "AudioSink.hxx" 00007 #include <fstream> 00008 #include <sndfile.hh> 00009 00010 namespace CLAM 00011 { 00012 00013 class OfflineNetworkPlayer : public NetworkPlayer 00014 { 00015 typedef std::vector<std::string> FileNames; 00016 FileNames _inFileNames; 00017 FileNames _outFileNames; 00018 00019 typedef std::vector<int> ChannelsFiles; 00020 ChannelsFiles _outChannelsFiles; 00021 00022 int _format; 00023 bool _enableLoopInputWavs; 00024 float _resultWavsTime; 00025 00026 public: 00027 OfflineNetworkPlayer() 00028 : _enableLoopInputWavs(false) 00029 , _resultWavsTime(0.0) 00030 { 00031 } 00032 00033 void AddInputFile( const std::string& ); 00034 void AddOutputFile( const std::string& ); 00035 void AddNumChannels(int channel); 00036 void SetFormat(int format); 00037 // base class (virtual) interface: 00038 bool IsWorking(); 00039 std::string NonWorkingReason(); 00040 virtual bool IsRealTime() const { return false; } 00041 00042 typedef std::vector<SndfileHandle*> SndFileHandles; 00043 std::string listOfSourcesSinksAndFiles(const SndFileHandles & infiles, 00044 const SndFileHandles & outfiles); 00045 00046 virtual void Start(); 00047 virtual void Stop(); 00048 00049 void ProcessInputFile(); 00050 00051 // specific interface - not inherited 00052 void EnableLoopInputWavs() 00053 { 00054 _enableLoopInputWavs=true; 00055 } 00056 void SetResultWavsTime( double time) 00057 { 00058 _resultWavsTime=time; 00059 } 00060 }; 00061 00062 } 00063 #endif 00064