AlignmentView.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 2006-2014 Chris Cannam and 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 ALIGNMENT_VIEW_H
17 #define ALIGNMENT_VIEW_H
18 
19 #include "View.h"
20 
21 class AlignmentView : public View
22 {
23  Q_OBJECT
24 
25 public:
26  AlignmentView(QWidget *parent = 0);
27  QString getPropertyContainerIconName() const override { return "alignment"; }
28 
29  void setAboveView(View *view);
30  void setBelowView(View *view);
31  void setReferenceView(View *view);
32 
33 public slots:
34  void globalCentreFrameChanged(sv_frame_t) override;
35  void viewCentreFrameChanged(View *, sv_frame_t) override;
36 
37  virtual void viewAboveZoomLevelChanged(ZoomLevel, bool);
38  virtual void viewBelowZoomLevelChanged(ZoomLevel, bool);
39 
40  void viewManagerPlaybackFrameChanged(sv_frame_t) override;
41 
42  void keyFramesChanged();
43 
44 protected:
45  void paintEvent(QPaintEvent *e) override;
46  bool shouldLabelSelections() const override { return false; }
47 
48  void buildMaps();
49 
50  std::vector<sv_frame_t> getKeyFrames(View *, sv_frame_t &resolution);
51  std::vector<sv_frame_t> getDefaultKeyFrames();
52 
53  ModelId getSalientModel(View *);
54 
55  void reconnectModels();
56 
60 
61  QMutex m_mapsMutex;
62  std::multimap<sv_frame_t, sv_frame_t> m_fromAboveMap;
63  std::multimap<sv_frame_t, sv_frame_t> m_fromReferenceMap;
64  sv_frame_t m_leftmostAbove;
65  sv_frame_t m_rightmostAbove;
66 };
67 
68 #endif
sv_frame_t m_leftmostAbove
Definition: AlignmentView.h:64
void viewManagerPlaybackFrameChanged(sv_frame_t) override
virtual void viewAboveZoomLevelChanged(ZoomLevel, bool)
View * m_reference
Definition: AlignmentView.h:59
QString getPropertyContainerIconName() const override
Definition: AlignmentView.h:27
QMutex m_mapsMutex
Definition: AlignmentView.h:61
void viewCentreFrameChanged(View *, sv_frame_t) override
void keyFramesChanged()
void setBelowView(View *view)
std::multimap< sv_frame_t, sv_frame_t > m_fromReferenceMap
Definition: AlignmentView.h:63
ModelId getSalientModel(View *)
void globalCentreFrameChanged(sv_frame_t) override
AlignmentView(QWidget *parent=0)
View is the base class of widgets that display one or more overlaid views of data against a horizonta...
Definition: View.h:55
void setReferenceView(View *view)
sv_frame_t m_rightmostAbove
Definition: AlignmentView.h:65
void paintEvent(QPaintEvent *e) override
std::vector< sv_frame_t > getKeyFrames(View *, sv_frame_t &resolution)
std::multimap< sv_frame_t, sv_frame_t > m_fromAboveMap
Definition: AlignmentView.h:62
void setAboveView(View *view)
std::vector< sv_frame_t > getDefaultKeyFrames()
bool shouldLabelSelections() const override
Definition: AlignmentView.h:46
void reconnectModels()
virtual void viewBelowZoomLevelChanged(ZoomLevel, bool)