1 /***************************************************************************
2 * Copyright (C) 2010 by Simon Andreas Eugster (simon.eu@gmail.com) *
3 * This file is part of kdenlive. See www.kdenlive.org. *
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 ***************************************************************************/
11 #ifndef ABSTRACTAUDIOSCOPEWIDGET_H
12 #define ABSTRACTAUDIOSCOPEWIDGET_H
20 #include "../abstractscopewidget.h"
26 \brief Abstract class for scopes analyzing audio samples.
28 class AbstractAudioScopeWidget : public AbstractScopeWidget
32 explicit AbstractAudioScopeWidget(bool trackMouse = false, QWidget *parent = 0);
33 virtual ~AbstractAudioScopeWidget();
36 void slotReceiveAudio(const QVector<int16_t> &sampleData, int freq, int num_channels, int num_samples);
39 /** @brief This is just a wrapper function, subclasses can use renderAudioScope. */
40 virtual QImage renderScope(uint accelerationFactor);
42 ///// Unimplemented Methods /////
43 /** @brief Scope renderer. Must emit signalScopeRenderingFinished()
44 when calculation has finished, to allow multi-threading.
45 accelerationFactor hints how much faster than usual the calculation should be accomplished, if possible. */
46 virtual QImage renderAudioScope(uint accelerationFactor,
47 const QVector<int16_t> &audioFrame, const int freq, const int num_channels, const int num_samples,
48 const int newData) = 0;
55 QVector<int16_t> m_audioFrame;
60 #endif // ABSTRACTAUDIOSCOPEWIDGET_H