diff 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
line wrap: on
line diff
--- a/edwaveform.h	Thu Oct 18 20:08:59 2012 +0300
+++ b/edwaveform.h	Thu Oct 18 20:10:13 2012 +0300
@@ -2,19 +2,32 @@
 #define EDWAVEFORM_H
 
 #include <QWidget>
+#include <QLabel>
 #include "dmengine.h"
 
-class WaveformView : public QWidget
+class WaveDisplay : public QWidget
 {
     Q_OBJECT
 
 public:
-    WaveformView(QWidget *parent = 0);
-    void setWaveform(qint16 *mdata, int mlen);
+    WaveDisplay(QWidget *parent = 0);
 
+    void setWaveform(void *mdata, int mlen, int mformat, int mchannels, int mfreq);
     void setTime(const int mtime);
     void setOffset(const int moffs);
     void setScale(const float mscale);
+    int getTime();
+    int getOffset();
+
+    QSize minimumSizeHint() const
+    {
+        return QSize(100, 60);
+    }
+
+    QSize sizeHint() const
+    {
+        return QSize(600, 60);
+    }
 
 protected:
     void mousePressEvent(QMouseEvent *event);
@@ -25,8 +38,28 @@
 
 private:
     float scale;
-    int time, offs, len;
-    qint16 *data;
+    int time, offs, len, channels, format, freq;
+    void *data;
+};
+
+
+class WaveformView : public QWidget
+{
+    Q_OBJECT
+
+private:
+    WaveDisplay *wave;
+    QLabel *infoName, *infoData;
+
+public:
+    WaveformView(QWidget *parent = 0);
+    void setWaveform(void *mdata, int mlen, int mformat, int mchannels, int mfreq);
+    void setName(QString name);
+    void setTime(const int mtime);
+    void setOffset(const int moffs);
+    void setScale(const float mscale);
+    int getTime();
+    int getOffset();
 };
 
 #endif