annotate src/Analyser.h @ 133:c3b53a10c920
Make sure flexinote layer is always the current one for editing
author |
Chris Cannam |
date |
Thu, 09 Jan 2014 20:58:05 +0000 |
parents |
2abff42be385 |
children |
995478fbbe17 |
rev |
line source |
Chris@6
|
1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
|
Chris@6
|
2
|
Chris@6
|
3 /*
|
Chris@6
|
4 Tony
|
Chris@6
|
5 An intonation analysis and annotation tool
|
Chris@6
|
6 Centre for Digital Music, Queen Mary, University of London.
|
Chris@6
|
7 This file copyright 2006-2012 Chris Cannam and QMUL.
|
Chris@6
|
8
|
Chris@6
|
9 This program is free software; you can redistribute it and/or
|
Chris@6
|
10 modify it under the terms of the GNU General Public License as
|
Chris@6
|
11 published by the Free Software Foundation; either version 2 of the
|
Chris@6
|
12 License, or (at your option) any later version. See the file
|
Chris@6
|
13 COPYING included with this distribution for more information.
|
Chris@6
|
14 */
|
Chris@6
|
15
|
Chris@6
|
16 #ifndef ANALYSER_H
|
Chris@6
|
17 #define ANALYSER_H
|
Chris@6
|
18
|
Chris@6
|
19 #include <QObject>
|
Chris@6
|
20
|
Chris@128
|
21 #include <map>
|
Chris@6
|
22
|
Chris@6
|
23 class WaveFileModel;
|
Chris@6
|
24 class Pane;
|
Chris@6
|
25 class PaneStack;
|
Chris@6
|
26 class Document;
|
Chris@6
|
27 class Layer;
|
Chris@128
|
28 class TimeValueLayer;
|
Chris@128
|
29 class Layer;
|
Chris@6
|
30
|
Chris@6
|
31 class Analyser : public QObject
|
Chris@6
|
32 {
|
Chris@6
|
33 Q_OBJECT
|
Chris@6
|
34
|
Chris@6
|
35 public:
|
Chris@6
|
36 Analyser();
|
Chris@6
|
37 virtual ~Analyser();
|
Chris@6
|
38
|
Chris@6
|
39 void newFileLoaded(Document *newDocument, WaveFileModel *model,
|
Chris@6
|
40 PaneStack *paneStack, Pane *pane);
|
gyorgyf@45
|
41
|
gyorgyf@45
|
42 void setIntelligentActions(bool);
|
Chris@6
|
43
|
Chris@128
|
44 enum Component {
|
Chris@128
|
45 Audio,
|
Chris@128
|
46 PitchTrack,
|
Chris@128
|
47 Notes,
|
Chris@128
|
48 };
|
Chris@128
|
49
|
Chris@128
|
50 bool isVisible(Component c) const;
|
Chris@128
|
51 void setVisible(Component c, bool v);
|
Chris@128
|
52
|
Chris@128
|
53 bool isAudible(Component c) const;
|
Chris@128
|
54 void setAudible(Component c, bool v);
|
Chris@128
|
55
|
Chris@128
|
56 void cycleStatus(Component c) {
|
Chris@128
|
57 if (isVisible(c)) {
|
Chris@128
|
58 if (isAudible(c)) {
|
Chris@128
|
59 setVisible(c, false);
|
Chris@128
|
60 setAudible(c, false);
|
Chris@128
|
61 } else {
|
Chris@128
|
62 setAudible(c, true);
|
Chris@128
|
63 }
|
Chris@128
|
64 } else {
|
Chris@128
|
65 setVisible(c, true);
|
Chris@128
|
66 setAudible(c, false);
|
Chris@128
|
67 }
|
Chris@128
|
68 }
|
Chris@128
|
69
|
Chris@128
|
70 signals:
|
Chris@128
|
71 void layersChanged();
|
Chris@128
|
72
|
Chris@6
|
73 protected:
|
Chris@6
|
74 Document *m_document;
|
Chris@6
|
75 WaveFileModel *m_fileModel;
|
Chris@133
|
76 PaneStack *m_paneStack;
|
Chris@6
|
77 Pane *m_pane;
|
Chris@128
|
78 mutable std::map<Component, Layer *> m_layers;
|
Chris@132
|
79
|
Chris@132
|
80 void saveState(Component c) const;
|
Chris@132
|
81 void loadState(Component c);
|
Chris@6
|
82 };
|
Chris@6
|
83
|
Chris@6
|
84 #endif
|