svcore  1.9
MatchFileReader.h
Go to the documentation of this file.
1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
2 
3 /*
4  Sonic Visualiser
5  An audio file viewer and annotation editor.
6  Centre for Digital Music, Queen Mary, University of London.
7  This file copyright 2007 QMUL.
8 
9  This program is free software; you can redistribute it and/or
10  modify it under the terms of the GNU General Public License as
11  published by the Free Software Foundation; either version 2 of the
12  License, or (at your option) any later version. See the file
13  COPYING included with this distribution for more information.
14 */
15 
16 #ifndef _MATCH_FILE_READER_H_
17 #define _MATCH_FILE_READER_H_
18 
19 #include <vector>
20 #include <QString>
21 #include "base/Debug.h"
22 
23 class QFile;
24 class Model;
25 
26 class Alignment
27 {
28 public:
29  Alignment();
30 
31  typedef std::vector<int> FrameArray;
32 
33  double thisHopTime;
34  double refHopTime;
35 
38 
39  double fromReference(double) const;
40  double toReference(double) const;
41 
43  void setMainModel(Model *m) { m_mainModel = m; }
44  bool isMainModel(Model *m) const { return m == m_mainModel; }
45 
46  int search(const FrameArray &arr, int val) const;
47 
48 protected:
50 };
51 
53 {
54 public:
55  MatchFileReader(QString path);
56  virtual ~MatchFileReader();
57 
58  virtual bool isOK() const;
59  virtual QString getError() const;
60  virtual Alignment load() const;
61 
62 protected:
63  QFile *m_file;
64  QString m_error;
65 };
66 
67 #endif
68 
double fromReference(double) const
FrameArray thisIndex
double refHopTime
double toReference(double) const
int search(const FrameArray &arr, int val) const
Model * m_mainModel
virtual QString getError() const
virtual bool isOK() const
bool isMainModel(Model *m) const
std::vector< int > FrameArray
double thisHopTime
void setMainModel(Model *m)
!! blah
virtual ~MatchFileReader()
Model is the base class for all data models that represent any sort of data on a time scale based on ...
Definition: Model.h:35
virtual Alignment load() const
MatchFileReader(QString path)
FrameArray refIndex