2016-10-10 13:29:41 -04:00
|
|
|
#ifndef AUD_FILE_H
|
|
|
|
#define AUD_FILE_H
|
|
|
|
|
2016-10-16 17:04:21 -04:00
|
|
|
#include <QBuffer>
|
2016-10-10 13:29:41 -04:00
|
|
|
#include <QFile>
|
|
|
|
#include <QObject>
|
|
|
|
#include <QString>
|
2016-10-23 21:26:58 -04:00
|
|
|
#include <QTimer>
|
|
|
|
#include <QDebug>
|
2016-10-10 13:29:41 -04:00
|
|
|
|
|
|
|
class AudFile : public QFile
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
2016-10-23 21:26:58 -04:00
|
|
|
qint64 buffRate;
|
2016-10-10 13:29:41 -04:00
|
|
|
qint64 offset;
|
2016-10-23 21:26:58 -04:00
|
|
|
bool init;
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
|
|
|
|
void delayFinished();
|
2016-10-10 13:29:41 -04:00
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
AudFile(QObject *parent = 0);
|
|
|
|
|
2016-10-16 17:04:21 -04:00
|
|
|
bool openFile(const QString &path);
|
|
|
|
bool seek(qint64 off);
|
2016-10-23 21:26:58 -04:00
|
|
|
qint64 getOffset();
|
|
|
|
qint64 getDuration();
|
2016-10-10 13:29:41 -04:00
|
|
|
|
|
|
|
~AudFile();
|
2016-10-23 21:26:58 -04:00
|
|
|
|
|
|
|
signals:
|
|
|
|
|
|
|
|
void posChanged(qint64 off);
|
|
|
|
void endOfPlayback();
|
|
|
|
void duration(qint64 msec);
|
2016-10-10 13:29:41 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // AUD_FILE_H
|