]> git.sesse.net Git - kdenlive/blob - src/audioscopes/abstractaudioscopewidget.h
Made AbstractAudioScope and AbstractGfxScope inherit from AbstractScope; Done for...
[kdenlive] / src / audioscopes / abstractaudioscopewidget.h
1 /***************************************************************************
2  *   Copyright (C) 2010 by Simon Andreas Eugster (simon.eu@gmail.com)      *
3  *   This file is part of kdenlive. See www.kdenlive.org.                  *
4  *                                                                         *
5  *   This program is free software; you can redistribute it and/or modify  *
6  *   it under the terms of the GNU General Public License as published by  *
7  *   the Free Software Foundation; either version 2 of the License, or     *
8  *   (at your option) any later version.                                   *
9  ***************************************************************************/
10
11 #ifndef ABSTRACTAUDIOSCOPEWIDGET_H
12 #define ABSTRACTAUDIOSCOPEWIDGET_H
13
14
15 #include <QtCore>
16 #include <QWidget>
17
18 #include "abstractscopewidget.h"
19
20 class QMenu;
21
22 class Monitor;
23 class Render;
24
25 class AbstractAudioScopeWidget : public AbstractScopeWidget
26 {
27     Q_OBJECT
28 public:
29     AbstractAudioScopeWidget(Monitor *projMonitor, Monitor *clipMonitor, bool trackMouse = false, QWidget *parent = 0);
30     virtual ~AbstractAudioScopeWidget();
31
32 protected:
33     virtual QImage renderScope(uint accelerationFactor);
34
35     ///// Unimplemented Methods /////
36     /** @brief Scope renderer. Must emit signalScopeRenderingFinished()
37         when calculation has finished, to allow multi-threading.
38         accelerationFactor hints how much faster than usual the calculation should be accomplished, if possible. */
39     virtual QImage renderAudioScope(uint accelerationFactor,
40                                const QVector<int16_t> audioFrame, const int freq, const int num_channels, const int num_samples) = 0;
41
42 private:
43     QVector<int16_t> m_audioFrame;
44     int m_freq;
45     int m_nChannels;
46     int m_nSamples;
47
48 private slots:
49     void slotReceiveAudio(const QVector<int16_t>& sampleData, int freq, int num_channels, int num_samples); // NEW, TODO comment
50
51 };
52
53 #endif // ABSTRACTAUDIOSCOPEWIDGET_H