00001
00002 #ifndef AUDIO_INFO_H
00003 #define AUDIO_INFO_H
00004
00005 #include <string>
00006 #include <iostream>
00007 #include "Object.h"
00008 #include "Vector.h"
00009
00010 namespace FD {
00011
00012 class Tag {
00013 protected:
00014 int begin;
00015 int end;
00016 int phoneID;
00017 int stateID;
00018 int gaussianID;
00019
00020 bool using_IDs;
00021
00022
00023
00024 public:
00025 Tag()
00026 : begin(0)
00027 , end(0)
00028 , using_IDs(true)
00029 {}
00030 };
00031
00033 class AudioInfo : public Object {
00034 protected:
00035 std::string ortho;
00036 int length;
00037 bool coarse_endpointed;
00038 int coarse_start;
00039 int coarse_end;
00040 bool fine_endpointed;
00041 int fine_start;
00042 int fine_end;
00043
00044
00045 public:
00047 AudioInfo(std::string _ortho, int _length)
00048 : ortho(_ortho)
00049 , length(_length)
00050 , coarse_endpointed(false)
00051 , fine_endpointed(false)
00052 {
00053
00054 }
00055
00057 AudioInfo()
00058 : coarse_endpointed(false)
00059 , fine_endpointed(false)
00060 {}
00061
00063 bool isCoarseEndpointed() const {return coarse_endpointed;}
00064
00066 bool isFineEndpointed() const {return fine_endpointed;}
00067
00069 bool isWithinCoarse(int sample) {return sample > coarse_start && sample < coarse_end;}
00070
00072 bool isWithinFine(int sample) {return sample > fine_start && sample < fine_end;}
00073
00075 virtual void printOn(std::ostream &out=std::cout) const;
00076
00078 void readFrom (std::istream &in=std::cin);
00079
00080
00081 friend std::istream &operator >> (std::istream &in, AudioInfo &info);
00082
00083 };
00084
00085 }
00086
00087 #endif