From 6cb50e66f3c196a2a4bcc95a419260d6b8c2461f Mon Sep 17 00:00:00 2001 From: Javier Date: Thu, 11 Jun 2015 01:16:26 +0200 Subject: experiment with audio/paperreplay data --- replaydata.h | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 replaydata.h (limited to 'replaydata.h') diff --git a/replaydata.h b/replaydata.h new file mode 100644 index 0000000..39b1e0e --- /dev/null +++ b/replaydata.h @@ -0,0 +1,53 @@ +#ifndef REPLAYDATA_H +#define REPLAYDATA_H + +#include +#include +#include +#include +#include + +class ReplayData : public QObject +{ + Q_OBJECT + +public: + explicit ReplayData(QObject *parent = 0); + + bool open(const QString &path); + void close(); + + struct Session { + QDateTime start, end; + QString name; + QVector pages; + QString file; + }; + + QList sessions(quint64 penId, quint64 notebookId); + QList sessions(quint64 penId, quint64 notebookId, quint64 pageAddress); + +private: + struct NotebookData { + QHash sessions; + QMultiMap byPage; + }; + +private: + bool findSessions(); + + static bool parseSessionInfo(Session &session, const QString &path); + static bool parseSessionInfo(Session &session, QIODevice *dev); + static bool parseSessionInfoV3(Session &session, QIODevice *dev); + + static bool parseSessionPages(Session &session, const QString &path); + static bool parseSessionPages(Session &session, QIODevice *dev); + static bool parseSessionPagesV1(Session &session, QIODevice *dev); + +private: + QDir _dir; + QHash > _notebooks; // TODO Cache on demand + // /userdata/XXX-XXX-XXX-XX/Paper Replay/99/0bf11a726d11f3f3/sessions/PRS-21977890a4 +}; + +#endif // REPLAYDATA_H -- cgit v1.2.3