c3ec7e7085
context menu, it will also show the app when double clicked. AudFile::getDuration() and AudFile::duration() can now calculate the length of the audio based on the rate at which QMediaPlayer calls AudFile::seek() and the amount of data it pulls at a time. it converts that time internally to a string, where it is then used to display on Ui::timeDisp. i've also modified the minimize to tray function as a feasure that can be turned on/off within Conf and added the needed check box to the config menu.
46 lines
663 B
C++
46 lines
663 B
C++
#ifndef AUD_FILE_H
|
|
#define AUD_FILE_H
|
|
|
|
#include <QBuffer>
|
|
#include <QFile>
|
|
#include <QObject>
|
|
#include <QString>
|
|
#include <QTimer>
|
|
#include <QTime>
|
|
#include <QDebug>
|
|
#include <QStringList>
|
|
|
|
class AudFile : public QFile
|
|
{
|
|
Q_OBJECT
|
|
|
|
private:
|
|
|
|
qint64 buffRate;
|
|
qint64 offset;
|
|
bool init;
|
|
|
|
private slots:
|
|
|
|
void delayFinished();
|
|
|
|
public:
|
|
|
|
AudFile(QObject *parent = 0);
|
|
|
|
bool openFile(const QString &path);
|
|
bool seek(qint64 off);
|
|
qint64 getOffset();
|
|
QString getDuration();
|
|
|
|
~AudFile();
|
|
|
|
signals:
|
|
|
|
void posChanged(qint64 off);
|
|
void endOfPlayback();
|
|
void duration(QString timeStr);
|
|
};
|
|
|
|
#endif // AUD_FILE_H
|