diff --git a/mrv2/docs/HISTORY.md b/mrv2/docs/HISTORY.md index cff6017ec..e467a9db8 100644 --- a/mrv2/docs/HISTORY.md +++ b/mrv2/docs/HISTORY.md @@ -26,6 +26,7 @@ v0.5.4 - Fixed channel (layer) shown in the color channel pulldown when switching files. - Fixed macOS start-up script not passing the command-line arguments. +- Made session file store and restore the current time. v0.5.3 diff --git a/mrv2/lib/mrvFl/mrvSession.cpp b/mrv2/lib/mrvFl/mrvSession.cpp index 1bc977db8..1f27bf188 100644 --- a/mrv2/lib/mrvFl/mrvSession.cpp +++ b/mrv2/lib/mrvFl/mrvSession.cpp @@ -59,6 +59,7 @@ namespace mrv Message timeline; Message annotation; + Message time; if (player) { @@ -69,9 +70,11 @@ namespace mrv jAnnotations.push_back(*(ann.get())); } annotation = jAnnotations; + time = player->currentTime(); } timeline["annotations"] = annotation; + timeline["time"] = time; Message bars = { {"menu_bar", (bool)ui->uiMenuGroup->visible()}, @@ -322,8 +325,18 @@ namespace mrv auto player = view->getTimelinePlayer(); if (player) + { player->setAllAnnotations(annotations); + tmp = j["time"]; + if (!tmp.is_null()) + { + otime::RationalTime time; + tmp.get_to(time); + player->seek(time); + } + } + TimelineClass* c = ui->uiTimeWindow; c->uiTimeline->redraw(); ui->uiMain->fill_menu(ui->uiMenuBar);