Skip to content

Commit

Permalink
Updated timelineitemoptions.
Browse files Browse the repository at this point in the history
  • Loading branch information
ggarra13 committed Oct 16, 2023
1 parent 8e6e337 commit 061770c
Show file tree
Hide file tree
Showing 9 changed files with 365 additions and 206 deletions.
8 changes: 7 additions & 1 deletion mrv2/docs/HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,13 @@ v0.8.0
- Fixed Creation of EDL Playlist with image sequences.
- Fixed annotations copying from source clip to EDL Playlist when adding the
clip to the playlist.
- Some UI fixes:
- Adding a clip to an EDL playlist will now positiong the current time at the
frame of the new clip, instead of resetting it to 0.
- Session files also save and load the timeline viewport options (ie. Edit mode,
size of thumbnails, transitions and markers).
- Thumbnail above the timeline no longer appears when there's no clip loaded
after it was shown once.
- Some UI fixes and improvements:
* The Zoom factor in the Pixel Toolbar keeps its value when selecting
it from the pulldown.
* All buttons and displays have the same size on both the timeline and
Expand Down
45 changes: 43 additions & 2 deletions mrv2/lib/mrvFl/mrvCallbacks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
#include "mrvNetwork/mrvTCP.h"
#include "mrvNetwork/mrvCypher.h"
#include "mrvNetwork/mrvFilesModelItem.h"
#include "mrvNetwork/mrvTimelineItemOptions.h"

#include "mrvApp/mrvSettingsObject.h"
#include "mrvApp/App.h"
Expand Down Expand Up @@ -1298,7 +1299,7 @@ namespace mrv

void annotation_clear_cb(Fl_Menu_*, ViewerUI* ui)
{
const auto& player = ui->uiView->getTimelinePlayer();
const auto player = ui->uiView->getTimelinePlayer();
if (!player)
return;
if (ui->uiPrefs->SendAnnotations->value())
Expand All @@ -1310,7 +1311,7 @@ namespace mrv

void annotation_clear_all_cb(Fl_Menu_*, ViewerUI* ui)
{
const auto& player = ui->uiView->getTimelinePlayer();
const auto player = ui->uiView->getTimelinePlayer();
if (!player)
return;
if (ui->uiPrefs->SendAnnotations->value())
Expand All @@ -1325,6 +1326,11 @@ namespace mrv
{
auto options = ui->uiTimeline->getItemOptions();
options.thumbnails = false;
Message msg;
msg["command"] = "setTimelineItemOptions";
msg["value"] = options;
if (ui->uiPrefs->SendUI->value())
tcp->pushMessage(msg);
ui->uiTimeline->setItemOptions(options);
if (editMode != EditMode::kTimeline)
set_edit_mode_cb(EditMode::kFull, ui);
Expand All @@ -1336,6 +1342,11 @@ namespace mrv
Fl_Menu_Item* item = const_cast< Fl_Menu_Item* >(m->mvalue());
bool editable = (bool)item->checked();
ui->uiTimeline->setEditable(editable);
Message msg;
msg["command"] = "setTimelineEditable";
msg["value"] = editable;
if (ui->uiPrefs->SendUI->value())
tcp->pushMessage(msg);
ui->uiMain->fill_menu(ui->uiMenuBar);
}

Expand All @@ -1344,6 +1355,11 @@ namespace mrv
Fl_Menu_Item* item = const_cast< Fl_Menu_Item* >(m->mvalue());
auto options = ui->uiTimeline->getItemOptions();
options.editAssociatedClips = item->checked();
Message msg;
msg["command"] = "setTimelineItemOptions";
msg["value"] = options;
if (ui->uiPrefs->SendUI->value())
tcp->pushMessage(msg);
ui->uiTimeline->setItemOptions(options);
ui->uiMain->fill_menu(ui->uiMenuBar);
}
Expand All @@ -1353,6 +1369,11 @@ namespace mrv
Fl_Menu_Item* item = const_cast< Fl_Menu_Item* >(m->mvalue());
auto options = ui->uiTimeline->getItemOptions();
options.showMarkers = item->checked();
Message msg;
msg["command"] = "setTimelineItemOptions";
msg["value"] = options;
if (ui->uiPrefs->SendUI->value())
tcp->pushMessage(msg);
ui->uiTimeline->setItemOptions(options);
if (editMode != EditMode::kTimeline)
set_edit_mode_cb(EditMode::kFull, ui);
Expand All @@ -1364,6 +1385,11 @@ namespace mrv
Fl_Menu_Item* item = const_cast< Fl_Menu_Item* >(m->mvalue());
auto options = ui->uiTimeline->getItemOptions();
options.showTransitions = item->checked();
Message msg;
msg["command"] = "setTimelineItemOptions";
msg["value"] = options;
if (ui->uiPrefs->SendUI->value())
tcp->pushMessage(msg);
ui->uiTimeline->setItemOptions(options);
if (editMode != EditMode::kTimeline)
set_edit_mode_cb(EditMode::kFull, ui);
Expand All @@ -1376,6 +1402,11 @@ namespace mrv
options.thumbnails = true;
options.thumbnailHeight = 100;
options.waveformHeight = options.thumbnailHeight / 2;
Message msg;
msg["command"] = "setTimelineItemOptions";
msg["value"] = options;
if (ui->uiPrefs->SendUI->value())
tcp->pushMessage(msg);
ui->uiTimeline->setItemOptions(options);
if (editMode != EditMode::kTimeline)
set_edit_mode_cb(EditMode::kFull, ui);
Expand All @@ -1388,6 +1419,11 @@ namespace mrv
options.thumbnails = true;
options.thumbnailHeight = 200;
options.waveformHeight = options.thumbnailHeight / 2;
Message msg;
msg["command"] = "setTimelineItemOptions";
msg["value"] = options;
if (ui->uiPrefs->SendUI->value())
tcp->pushMessage(msg);
ui->uiTimeline->setItemOptions(options);
if (editMode != EditMode::kTimeline)
set_edit_mode_cb(EditMode::kFull, ui);
Expand All @@ -1400,6 +1436,11 @@ namespace mrv
options.thumbnails = true;
options.thumbnailHeight = 300;
options.waveformHeight = options.thumbnailHeight / 2;
Message msg;
msg["command"] = "setTimelineItemOptions";
msg["value"] = options;
if (ui->uiPrefs->SendUI->value())
tcp->pushMessage(msg);
ui->uiTimeline->setItemOptions(options);
if (editMode != EditMode::kTimeline)
set_edit_mode_cb(EditMode::kFull, ui);
Expand Down
Loading

0 comments on commit 061770c

Please sign in to comment.