]> git.sesse.net Git - kdenlive/blobdiff - src/scopes/audioscopes/audiosignal.h
Continue merging of scopemanager from Granjow
[kdenlive] / src / scopes / audioscopes / audiosignal.h
diff --git a/src/scopes/audioscopes/audiosignal.h b/src/scopes/audioscopes/audiosignal.h
new file mode 100644 (file)
index 0000000..6cb9b07
--- /dev/null
@@ -0,0 +1,65 @@
+/***************************************************************************
+ *   Copyright (C) 2010 by Marco Gittler (g.marco@freenet.de)              *
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program; if not, write to the                         *
+ *   Free Software Foundation, Inc.,                                       *
+ *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA          *
+ ***************************************************************************/
+
+#ifndef AUDIOSIGNAL_H
+#define AUDIOSIGNAL_H
+
+#include <QByteArray>
+#include <QList>
+#include <QColor>
+#include <QTimer>
+class QLabel;
+
+#include  <QWidget>
+
+#include <stdint.h>
+
+class AudioSignal : public QWidget
+{
+    Q_OBJECT
+public:
+    AudioSignal(QWidget *parent = 0);
+    ~AudioSignal();
+    /** @brief Used for checking whether audio data needs to be delivered */
+    bool monitoringEnabled() const;
+
+private:
+    double valueToPixel(double in);
+       QTimer m_timer;
+    QLabel* label;
+    QByteArray channels,peeks,peekage;
+       QList<int> dbscale;
+    QAction *m_aMonitoringEnabled;
+
+protected:
+    void paintEvent(QPaintEvent*);
+
+public slots:
+    void showAudio(const QByteArray);
+    void slotReceiveAudio(const QVector<int16_t>&,int,int,int);
+private slots:
+     void slotSwitchAudioMonitoring(bool isOn);
+       void slotNoAudioTimeout();
+
+signals:
+    void updateAudioMonitoring();
+
+};
+
+#endif