Mercurial > hg > dmlib
comparison edwaveform.h @ 384:e5220ff48bc8
Slowly working on the editor.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Thu, 18 Oct 2012 20:10:13 +0300 |
parents | 40e33ad0d153 |
children | 28a74940f2b6 |
comparison
equal
deleted
inserted
replaced
383:96ba58afdc6d | 384:e5220ff48bc8 |
---|---|
1 #ifndef EDWAVEFORM_H | 1 #ifndef EDWAVEFORM_H |
2 #define EDWAVEFORM_H | 2 #define EDWAVEFORM_H |
3 | 3 |
4 #include <QWidget> | 4 #include <QWidget> |
5 #include <QLabel> | |
5 #include "dmengine.h" | 6 #include "dmengine.h" |
6 | 7 |
7 class WaveformView : public QWidget | 8 class WaveDisplay : public QWidget |
8 { | 9 { |
9 Q_OBJECT | 10 Q_OBJECT |
10 | 11 |
11 public: | 12 public: |
12 WaveformView(QWidget *parent = 0); | 13 WaveDisplay(QWidget *parent = 0); |
13 void setWaveform(qint16 *mdata, int mlen); | |
14 | 14 |
15 void setWaveform(void *mdata, int mlen, int mformat, int mchannels, int mfreq); | |
15 void setTime(const int mtime); | 16 void setTime(const int mtime); |
16 void setOffset(const int moffs); | 17 void setOffset(const int moffs); |
17 void setScale(const float mscale); | 18 void setScale(const float mscale); |
19 int getTime(); | |
20 int getOffset(); | |
21 | |
22 QSize minimumSizeHint() const | |
23 { | |
24 return QSize(100, 60); | |
25 } | |
26 | |
27 QSize sizeHint() const | |
28 { | |
29 return QSize(600, 60); | |
30 } | |
18 | 31 |
19 protected: | 32 protected: |
20 void mousePressEvent(QMouseEvent *event); | 33 void mousePressEvent(QMouseEvent *event); |
21 void mouseMoveEvent(QMouseEvent *event); | 34 void mouseMoveEvent(QMouseEvent *event); |
22 void mouseReleaseEvent(QMouseEvent *event); | 35 void mouseReleaseEvent(QMouseEvent *event); |
23 | 36 |
24 void paintEvent(QPaintEvent *event); | 37 void paintEvent(QPaintEvent *event); |
25 | 38 |
26 private: | 39 private: |
27 float scale; | 40 float scale; |
28 int time, offs, len; | 41 int time, offs, len, channels, format, freq; |
29 qint16 *data; | 42 void *data; |
43 }; | |
44 | |
45 | |
46 class WaveformView : public QWidget | |
47 { | |
48 Q_OBJECT | |
49 | |
50 private: | |
51 WaveDisplay *wave; | |
52 QLabel *infoName, *infoData; | |
53 | |
54 public: | |
55 WaveformView(QWidget *parent = 0); | |
56 void setWaveform(void *mdata, int mlen, int mformat, int mchannels, int mfreq); | |
57 void setName(QString name); | |
58 void setTime(const int mtime); | |
59 void setOffset(const int moffs); | |
60 void setScale(const float mscale); | |
61 int getTime(); | |
62 int getOffset(); | |
30 }; | 63 }; |
31 | 64 |
32 #endif | 65 #endif |