Main Page | Modules | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

pitchmarks.h

Go to the documentation of this file.
00001 /* pitchmarks.h    $Revision: 1.2 $ $Date: 2005/12/10 20:33:54 $
00002    Copyright (C) 2003 University of Bonn.
00003    http://www.ikp.uni-bonn.de/boss
00004 
00005    This program is free software; you can redistribute it and/or
00006    modify it under the terms of the GNU General Public License
00007    as published by the Free Software Foundation; either version 2
00008    of the License, or (at your option) any later version.
00009 
00010    This program is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY; without even the implied warranty of
00012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013    GNU General Public License for more details.
00014 
00015    You should have received a copy of the GNU General Public License
00016    along with this program; if not, write to the Free Software
00017    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA. */
00018 
00029 #ifndef PITCHMARKS_H
00030 #define PITCHMARKS_H
00031 
00032 #include <vector>
00033 #include <map>
00034 #include <iostream>
00035 #include <fstream>
00036 #include "pitchmark_parser.h"
00037 
00038 using namespace std;
00039 
00043 typedef vector< pair<double, double> > PitchContour;
00044 
00045 
00049 class Pitchmark {
00050 public:
00051         double time;
00052         bool voiced;
00053         double intensity;
00054         Pitchmark(double _time=0.0, bool _voiced=true): time(_time), voiced(_voiced){}
00055 };
00056 
00057 
00061 class Pitchmarks: public vector<Pitchmark> {
00062         
00063         int getPitchmarkFormat(const string & filename);
00064         void loadPraatPitchmarks(const string & filename, const double start, const double end);
00065         void loadRawPitchmarks(const string & filename, const double start, const double end);
00066         double interpolate(double x, const pair<double,double> & p1, const pair<double,double> & p2);
00067 
00068 public:
00069         Pitchmarks(): vector<Pitchmark>(0) {}
00070         // chaos; doxygen complains about this declaration, dunno why; mho
00071         //Pitchmarks::Pitchmarks(PitchContour pitchContour, double startTime = 0.0, double endTime = 1.0);
00072         Pitchmarks(vector< pair< double, double > >, double duration, double startTime);
00073         void loadPitchmarks(const string & filename, const double start, const double end);
00074         bool selfCheck();
00075         
00076 };
00077  // end of group boss_ola
00079 
00080 #endif
00081 

Generated on Tue Dec 20 23:14:38 2005 for BOSS by doxygen 1.3.6