00001
00002
00003
00004
00005
00006
00007 using namespace std;
00008
00009 #include <iostream>
00010 #include <cstring>
00011 #include <string>
00012
00013 #ifndef CODEFILEINCLUDED
00014 #include "codefile.cpp"
00015 #endif
00016
00017 #ifndef REPOSITORYMANAGERINCLUDED
00018 #include "repositorymanager.cpp"
00019 #endif
00020
00021 #ifndef WAVEFILEINCLUDED
00022 #include "wavefile.cpp"
00023 #endif
00024
00025 #ifndef FRAMEINCLUDED
00026 #include "frame.cpp"
00027 #endif
00028
00029 #ifndef PARAMETERSINCLUDED
00030 #include "parameters.cpp"
00031 #endif
00032
00033 #define DECODERINCLUDED
00034
00035 class decoder {
00036
00037 private:
00038
00039 public:
00040
00041 int decode(string filename, string sfname)
00042 {
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052 codefile cf(filename);
00053 repositorymanager repmgr(cf.reademailid());
00054
00055 wavefile* wf=new wavefile();
00056 unsigned int code;
00057 string framename;
00058
00059 while((code=cf.getcode())!=END_OF_CODESTREAM)
00060 {
00061
00062
00063 framename= repmgr.getFrameName(code);
00064 wf->appendFrame(framename);
00065 }
00066 wf->makePerm(sfname);
00067 delete wf;
00068
00069
00070 return 0;
00071 }
00072
00073 };