File indexing completed on 2024-05-12 16:01:54

0001 /*
0002  *  SPDX-License-Identifier: GPL-3.0-or-later
0003  */
0004 
0005 #ifndef KISSYNCEDAUDIOPLAYBACK_H
0006 #define KISSYNCEDAUDIOPLAYBACK_H
0007 
0008 #include <QScopedPointer>
0009 #include <QObject>
0010 
0011 class KisSyncedAudioPlayback : public QObject
0012 {
0013     Q_OBJECT
0014 public:
0015     KisSyncedAudioPlayback(const QString &fileName);
0016     ~KisSyncedAudioPlayback() override;
0017 
0018     void setSoundOffsetTolerance(qint64 value);
0019     void syncWithVideo(qint64 position);
0020 
0021     bool isPlaying() const;
0022     qint64 position() const;
0023 
0024     void setVolume(qreal value);
0025 
0026 public Q_SLOTS:
0027     void setSpeed(qreal value);
0028     void play(qint64 startPosition);
0029     void stop();
0030 
0031 Q_SIGNALS:
0032     void error(const QString &filename, const QString &message);
0033 
0034 private Q_SLOTS:
0035     void slotOnError();
0036 
0037 private:
0038     struct Private;
0039     const QScopedPointer<Private> m_d;
0040 };
0041 
0042 #endif // KISSYNCEDAUDIOPLAYBACK_H