summaryrefslogtreecommitdiff
path: root/examples/spectrum/app/engine.h
diff options
context:
space:
mode:
authorhjk <qthjk@ovi.com>2012-11-20 18:27:28 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-11-21 14:01:44 +0100
commit21c39152055131d87614f051ca08566bd51f268f (patch)
tree95854dfdd5fee984742c18507eb6efca3d2761dc /examples/spectrum/app/engine.h
parent9f4d6e824c1b75642150f448f8a359dbc95fb955 (diff)
downloadqtmultimedia-21c39152055131d87614f051ca08566bd51f268f.tar.gz
Multimedia: examples coding style unification
Change-Id: Iffae3a276bb2b01f871aee76dc069ce006d69fce Reviewed-by: David Schulz <david.schulz@digia.com>
Diffstat (limited to 'examples/spectrum/app/engine.h')
-rw-r--r--examples/spectrum/app/engine.h46
1 files changed, 23 insertions, 23 deletions
diff --git a/examples/spectrum/app/engine.h b/examples/spectrum/app/engine.h
index f281adcf3..f3ca5c97a 100644
--- a/examples/spectrum/app/engine.h
+++ b/examples/spectrum/app/engine.h
@@ -45,12 +45,13 @@
#include "spectrumanalyser.h"
#include "wavfile.h"
-#include <QObject>
-#include <QByteArray>
+#include <QAudioDeviceInfo>
+#include <QAudioFormat>
#include <QBuffer>
+#include <QByteArray>
+#include <QDir>
+#include <QObject>
#include <QVector>
-#include <QtMultimedia/QAudioDeviceInfo>
-#include <QtMultimedia/QAudioFormat>
#ifdef DUMP_CAPTURED_AUDIO
#define DUMP_DATA
@@ -60,14 +61,11 @@
#define DUMP_DATA
#endif
-#ifdef DUMP_DATA
-#include <QDir>
-#endif
-
class FrequencySpectrum;
-QT_FORWARD_DECLARE_CLASS(QAudioInput)
-QT_FORWARD_DECLARE_CLASS(QAudioOutput)
-QT_FORWARD_DECLARE_CLASS(QFile)
+QT_BEGIN_NAMESPACE
+class QAudioInput;
+class QAudioOutput;
+QT_END_NAMESPACE
/**
* This class interfaces with the QtMultimedia audio classes, and also with
@@ -75,26 +73,28 @@ QT_FORWARD_DECLARE_CLASS(QFile)
* of audio data, meanwhile performing real-time analysis of the audio level
* and frequency spectrum.
*/
-class Engine : public QObject {
+class Engine : public QObject
+{
Q_OBJECT
+
public:
- Engine(QObject *parent = 0);
+ explicit Engine(QObject *parent = 0);
~Engine();
- const QList<QAudioDeviceInfo>& availableAudioInputDevices() const
+ const QList<QAudioDeviceInfo> &availableAudioInputDevices() const
{ return m_availableAudioInputDevices; }
- const QList<QAudioDeviceInfo>& availableAudioOutputDevices() const
+ const QList<QAudioDeviceInfo> &availableAudioOutputDevices() const
{ return m_availableAudioOutputDevices; }
- QAudio::Mode mode() const { return m_mode; }
- QAudio::State state() const { return m_state; }
+ QAudio::Mode mode() const { return m_mode; }
+ QAudio::State state() const { return m_state; }
/**
* \return Current audio format
* \note May be QAudioFormat() if engine is not initialized
*/
- const QAudioFormat& format() const { return m_format; }
+ const QAudioFormat& format() const { return m_format; }
/**
* Stop any ongoing recording or playback, and reset to ground state.
@@ -125,25 +125,25 @@ public:
* Position of the audio input device.
* \return Position in bytes.
*/
- qint64 recordPosition() const { return m_recordPosition; }
+ qint64 recordPosition() const { return m_recordPosition; }
/**
* RMS level of the most recently processed set of audio samples.
* \return Level in range (0.0, 1.0)
*/
- qreal rmsLevel() const { return m_rmsLevel; }
+ qreal rmsLevel() const { return m_rmsLevel; }
/**
* Peak level of the most recently processed set of audio samples.
* \return Level in range (0.0, 1.0)
*/
- qreal peakLevel() const { return m_peakLevel; }
+ qreal peakLevel() const { return m_peakLevel; }
/**
* Position of the audio output device.
* \return Position in bytes.
*/
- qint64 playPosition() const { return m_playPosition; }
+ qint64 playPosition() const { return m_playPosition; }
/**
* Length of the internal engine buffer.
@@ -155,7 +155,7 @@ public:
* Amount of data held in the buffer.
* \return Data length in bytes.
*/
- qint64 dataLength() const { return m_dataLength; }
+ qint64 dataLength() const { return m_dataLength; }
/**
* Set window function applied to audio data before spectral analysis.