kwave  18.07.70
TrackView.h
Go to the documentation of this file.
1 /***************************************************************************
2  TrackView.h - signal views that shows the track in time space
3  -------------------
4  begin : Sat Jan 30 2010
5  copyright : (C) 2010 by Thomas Eschenbacher
6  email : Thomas.Eschenbacher@gmx.de
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 
18 #ifndef TRACK_VIEW_H
19 #define TRACK_VIEW_H
20 
21 #include "config.h"
22 
23 #include <QtGlobal>
24 #include <QImage>
25 #include <QObject>
26 #include <QPoint>
27 #include <QPointer>
28 #include <QWidget>
29 
30 #include "libkwave/Sample.h"
31 
32 #include "libgui/SignalView.h"
33 #include "libgui/TrackPixmap.h"
34 
35 class QPaintEvent;
36 class QResizeEvent;
37 
38 namespace Kwave
39 {
40 
41  class SignalManager; // forward declaration
42  class Track;
43 
44  class Q_DECL_EXPORT TrackView: public SignalView
45  {
46  Q_OBJECT
47  public:
55  TrackView(QWidget *parent, QWidget *controls,
56  Kwave::SignalManager *signal_manager,
57  Kwave::Track *track);
58 
60  virtual ~TrackView() Q_DECL_OVERRIDE;
61 
63  virtual void refresh() Q_DECL_OVERRIDE;
64 
70  virtual void setZoomAndOffset(double zoom, sample_index_t offset)
71  Q_DECL_OVERRIDE;
72 
77  virtual void setVerticalZoom(double zoom) Q_DECL_OVERRIDE;
78 
80  virtual void resizeEvent(QResizeEvent *event) Q_DECL_OVERRIDE;
81 
83  virtual void paintEvent(QPaintEvent *) Q_DECL_OVERRIDE;
84 
90  virtual bool canHandleSelection() const Q_DECL_OVERRIDE { return true; }
91 
100  virtual QSharedPointer<Kwave::ViewItem> findItem(const QPoint &pos)
101  Q_DECL_OVERRIDE;
102 
108  virtual void handleContextMenu(const QPoint &pos, QMenu *menu)
109  Q_DECL_OVERRIDE;
110 
111  public slots:
112 
117  virtual void showCursor(sample_index_t pos = SAMPLE_INDEX_MAX)
118  Q_DECL_OVERRIDE;
119 
120  private slots:
121 
123  void refreshSignalLayer();
124 
126  void refreshSelectionLayer();
127 
129  void refreshMarkersLayer();
130 
132  void refreshAllLayers();
133 
135  void contextMenuLabelNew();
136 
137  private:
138 
141 
144 
147 
149  QImage m_image;
150 
152  QImage m_img_signal;
153 
156 
159 
162 
165 
168 
171 
174  };
175 }
176 
177 #endif /* TRACK_VIEW_H */
178 
179 //***************************************************************************
180 //***************************************************************************
QImage m_img_selection
Definition: TrackView.h:155
bool m_img_signal_needs_refresh
Definition: TrackView.h:161
bool m_img_markers_needs_refresh
Definition: TrackView.h:167
Definition: App.h:33
sample_index_t m_mouse_click_position
Definition: TrackView.h:170
QImage m_img_signal
Definition: TrackView.h:152
quint64 sample_index_t
Definition: Sample.h:28
Kwave::TrackPixmap m_pixmap
Definition: TrackView.h:140
virtual bool canHandleSelection() const Q_DECL_OVERRIDE
Definition: TrackView.h:90
QImage m_img_markers
Definition: TrackView.h:158
bool m_img_selection_needs_refresh
Definition: TrackView.h:164
sample_index_t m_cursor_pos
Definition: TrackView.h:173
#define SAMPLE_INDEX_MAX
Definition: Sample.h:31