aboutsummaryrefslogtreecommitdiff
path: root/mainwindow.cc
diff options
context:
space:
mode:
authorJavier <dev.git@javispedro.com>2021-09-12 19:41:12 +0200
committerJavier <dev.git@javispedro.com>2021-09-12 19:41:12 +0200
commitac7b085449fb49f54225d22c7c229da6ad120e2b (patch)
tree7910cc8c9a3268dbacbbe434c7f3cea4eedafd3d /mainwindow.cc
parent66dd35254724ec5d4471a8be71f92e06cf0fa8e8 (diff)
downloadscribiu-ac7b085449fb49f54225d22c7c229da6ad120e2b.tar.gz
scribiu-ac7b085449fb49f54225d22c7c229da6ad120e2b.zip
remove PEN_EPOCH mistake and get usertime from the pen
Diffstat (limited to 'mainwindow.cc')
-rw-r--r--mainwindow.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/mainwindow.cc b/mainwindow.cc
index 8a32f2c..dae4ae6 100644
--- a/mainwindow.cc
+++ b/mainwindow.cc
@@ -96,10 +96,12 @@ void MainWindow::openNotebook(const QString &pen, const QString &notebook)
_curPenName = pen;
_curNotebookName = notebook;
+ Smartpen::PenTime userTime = _notebooks->penUserTime(pen);
+
if (_curNotebookName == PAPER_REPLAY) {
QString replayDir = _notebooks->paperReplayDirectory(_curPenName);
- _replay->open(replayDir, 0);
+ _replay->open(replayDir, PAPER_REPLAY_GUID, userTime);
_replayModel->refresh();
ui->pane2Stack->setCurrentWidget(ui->paperReplayView);
@@ -108,6 +110,7 @@ void MainWindow::openNotebook(const QString &pen, const QString &notebook)
qDebug() << "Opening notebook" << _curPenName << _curNotebookName << nbDir;
+ ui->notebookView->setPenUserTime(userTime);
ui->notebookView->setPaperReplay(_notebooks->paperReplayDirectory(_curPenName));
ui->notebookView->setNotebook(nbDir);
ui->pane2Stack->setCurrentWidget(ui->notebookView);
@@ -215,9 +218,12 @@ void MainWindow::handlePaperReplayRequested(const QString &file, qint64 time)
QString filePath = finfo.canonicalFilePath();
if (_media->currentSource().fileName() != filePath) {
+ qDebug() << "requesting media " << filePath;
_media->setCurrentSource(QUrl::fromLocalFile(filePath));
}
+ qDebug() << "requesting media seek to" << time << "/" << _media->totalTime();
+
switch (_media->state()) {
case Phonon::PlayingState:
case Phonon::BufferingState:
@@ -250,6 +256,7 @@ void MainWindow::handleMediaStateChange(Phonon::State state)
ui->playButton->setVisible(false);
ui->pauseButton->setVisible(true);
if (_pendingSeek) {
+ qDebug() << "requesting (pending) media seek to" << _pendingSeek << "/" << _media->totalTime();
_media->seek(_pendingSeek);
_pendingSeek = 0;
}