diff options
Diffstat (limited to 'examples/multimedia/spectrum/progressbar.h')
-rw-r--r-- | examples/multimedia/spectrum/progressbar.h | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/examples/multimedia/spectrum/progressbar.h b/examples/multimedia/spectrum/progressbar.h new file mode 100644 index 000000000..8b117c7e6 --- /dev/null +++ b/examples/multimedia/spectrum/progressbar.h @@ -0,0 +1,38 @@ +// Copyright (C) 2017 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause + +#ifndef PROGRESSBAR_H +#define PROGRESSBAR_H + +#include <QWidget> + +/** + * Widget which displays a the current fill state of the Engine's internal + * buffer, and the current play/record position within that buffer. + */ +class ProgressBar : public QWidget +{ + Q_OBJECT + +public: + explicit ProgressBar(QWidget *parent = nullptr); + ~ProgressBar(); + + void reset(); + void paintEvent(QPaintEvent *event) override; + +public slots: + void bufferLengthChanged(qint64 length); + void recordPositionChanged(qint64 recordPosition); + void playPositionChanged(qint64 playPosition); + void windowChanged(qint64 position, qint64 length); + +private: + qint64 m_bufferLength; + qint64 m_recordPosition; + qint64 m_playPosition; + qint64 m_windowPosition; + qint64 m_windowLength; +}; + +#endif // PROGRESSBAR_H |