annotate view/Overview.h @ 173:9c40dc10c88c

* Rename the existing Panner to Overview (big duh!) * Fixes to the new Panner.
author Chris Cannam
date Thu, 19 Oct 2006 09:57:27 +0000
parents
children 42118892f428
rev   line source
Chris@173 1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
Chris@173 2
Chris@173 3 /*
Chris@173 4 Sonic Visualiser
Chris@173 5 An audio file viewer and annotation editor.
Chris@173 6 Centre for Digital Music, Queen Mary, University of London.
Chris@173 7 This file copyright 2006 Chris Cannam.
Chris@173 8
Chris@173 9 This program is free software; you can redistribute it and/or
Chris@173 10 modify it under the terms of the GNU General Public License as
Chris@173 11 published by the Free Software Foundation; either version 2 of the
Chris@173 12 License, or (at your option) any later version. See the file
Chris@173 13 COPYING included with this distribution for more information.
Chris@173 14 */
Chris@173 15
Chris@173 16 #ifndef _OVERVIEW_H_
Chris@173 17 #define _OVERVIEW_H_
Chris@173 18
Chris@173 19 #include "View.h"
Chris@173 20
Chris@173 21 #include <QPoint>
Chris@173 22
Chris@173 23 class QWidget;
Chris@173 24 class QPaintEvent;
Chris@173 25 class Layer;
Chris@173 26 class View;
Chris@173 27
Chris@173 28 #include <map>
Chris@173 29
Chris@173 30 class Overview : public View
Chris@173 31 {
Chris@173 32 Q_OBJECT
Chris@173 33
Chris@173 34 public:
Chris@173 35 Overview(QWidget *parent = 0);
Chris@173 36
Chris@173 37 void registerView(View *widget);
Chris@173 38 void unregisterView(View *widget);
Chris@173 39
Chris@173 40 virtual QString getPropertyContainerIconName() const { return "panner"; }
Chris@173 41
Chris@173 42 public slots:
Chris@173 43 virtual void modelChanged(size_t startFrame, size_t endFrame);
Chris@173 44 virtual void modelReplaced();
Chris@173 45
Chris@173 46 virtual void viewManagerCentreFrameChanged(void *, unsigned long, bool);
Chris@173 47 virtual void viewManagerZoomLevelChanged(void *, unsigned long, bool);
Chris@173 48 virtual void viewManagerPlaybackFrameChanged(unsigned long);
Chris@173 49
Chris@173 50 protected:
Chris@173 51 virtual void paintEvent(QPaintEvent *e);
Chris@173 52 virtual void mousePressEvent(QMouseEvent *e);
Chris@173 53 virtual void mouseReleaseEvent(QMouseEvent *e);
Chris@173 54 virtual void mouseMoveEvent(QMouseEvent *e);
Chris@173 55 virtual bool shouldLabelSelections() const { return false; }
Chris@173 56
Chris@173 57 QPoint m_clickPos;
Chris@173 58 QPoint m_mousePos;
Chris@173 59 bool m_clickedInRange;
Chris@173 60 size_t m_dragCentreFrame;
Chris@173 61
Chris@173 62 typedef std::set<void *> WidgetSet;
Chris@173 63 WidgetSet m_widgets;
Chris@173 64 };
Chris@173 65
Chris@173 66 #endif
Chris@173 67