Chris@867: /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*-  vi:set ts=8 sts=4 sw=4: */
Chris@867: 
Chris@867: /*
Chris@867:     Sonic Visualiser
Chris@867:     An audio file viewer and annotation editor.
Chris@867:     Centre for Digital Music, Queen Mary, University of London.
Chris@867:     This file copyright 2006-2014 Chris Cannam and QMUL.
Chris@867:     
Chris@867:     This program is free software; you can redistribute it and/or
Chris@867:     modify it under the terms of the GNU General Public License as
Chris@867:     published by the Free Software Foundation; either version 2 of the
Chris@867:     License, or (at your option) any later version.  See the file
Chris@867:     COPYING included with this distribution for more information.
Chris@867: */
Chris@867: 
Chris@867: #ifndef ALIGNMENT_VIEW_H
Chris@867: #define ALIGNMENT_VIEW_H
Chris@867: 
Chris@867: #include "View.h"
Chris@867: 
Chris@867: class AlignmentView : public View
Chris@867: {
Chris@867:     Q_OBJECT
Chris@867: 
Chris@867: public:
Chris@867:     AlignmentView(QWidget *parent = 0);
Chris@1406:     QString getPropertyContainerIconName() const override { return "alignment"; }
Chris@867:     
Chris@867:     void setViewAbove(View *view);
Chris@867:     void setViewBelow(View *view);
Chris@867: 
Chris@867: public slots:
Chris@1406:     void globalCentreFrameChanged(sv_frame_t) override;
Chris@1406:     void viewCentreFrameChanged(View *, sv_frame_t) override;
Chris@1493:     
Chris@1183:     virtual void viewAboveZoomLevelChanged(ZoomLevel, bool);
Chris@1183:     virtual void viewBelowZoomLevelChanged(ZoomLevel, bool);
Chris@1493:     
Chris@1406:     void viewManagerPlaybackFrameChanged(sv_frame_t) override;
Chris@867: 
Chris@1493:     void keyFramesChanged();
Chris@1493: 
Chris@867: protected:
Chris@1406:     void paintEvent(QPaintEvent *e) override;
Chris@1406:     bool shouldLabelSelections() const override { return false; }
Chris@867: 
Chris@1493:     void buildKeyFrameMap();
Chris@1493: 
Chris@1493:     std::vector<sv_frame_t> getKeyFrames(View *, sv_frame_t &resolution);
Chris@976:     std::vector<sv_frame_t> getDefaultKeyFrames();
Chris@868: 
Chris@1493:     ModelId getSalientModel(View *);
Chris@1493: 
Chris@1493:     void reconnectModels();
Chris@1493: 
Chris@867:     View *m_above;
Chris@867:     View *m_below;
Chris@1493: 
Chris@1493:     QMutex m_keyFrameMutex;
Chris@1493:     std::multimap<sv_frame_t, sv_frame_t> m_keyFrameMap;
Chris@867: };
Chris@867: 
Chris@867: #endif