summaryrefslogtreecommitdiffstats
path: root/helper.h
blob: c8982b42e8b6f1ab2ca12abd7c5628b96cf5c942 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#ifndef HELPER_H
#define HELPER_H

#include <QString>
#include <QJsonDocument>
#include <QPixmap>
#include <QIcon>

namespace Helper {
    const QString md5Sum(const QString &path);
    const QJsonDocument ffpmegData(const QString &path);
    const QPixmap preview(const QString &file);
    const QImage snapshot(const QString &file, int offset);
    const QString appDataDir();
    const QIcon icon(const QColor &bg, const QChar c, bool bold = true);
    class Duration {
        public:
            Duration();
            Duration(qint64 seconds);
            Duration(const QString &dur);
            Duration operator+(const Duration &dur) const;
            const QString toString() const;
            bool isNull() const;
            qint64 toSeconds() const;

        private:
            int mHours;
            int mMinutes;
            int mSeconds;
    };
}

#endif // HELPER_H