Skip to content

Commit

Permalink
Made session file store and restore timeline's current time.
Browse files Browse the repository at this point in the history
  • Loading branch information
ggarra13 committed Jun 3, 2023
1 parent 3ad898e commit bfb99e1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions mrv2/docs/HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 13 additions & 0 deletions mrv2/lib/mrvFl/mrvSession.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ namespace mrv

Message timeline;
Message annotation;
Message time;

if (player)
{
Expand All @@ -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()},
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit bfb99e1

Please sign in to comment.