annotate widgets/Panner.h @ 83:01f27a282c90

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