From 007708bc7ad52ec28581a4dba861743737fbe449 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gonzalo=20Garramu=C3=B1o?= Date: Wed, 29 Mar 2023 15:16:41 -0300 Subject: [PATCH 01/26] Beautified code. --- mrv2/lib/mrvApp/App.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mrv2/lib/mrvApp/App.cpp b/mrv2/lib/mrvApp/App.cpp index 12fa7b18d..aeac484c8 100644 --- a/mrv2/lib/mrvApp/App.cpp +++ b/mrv2/lib/mrvApp/App.cpp @@ -1042,15 +1042,15 @@ namespace mrv const auto& video = ioInfo.video[0]; auto pixelType = video.pixelType; std::size_t size = imaging::getDataByteCount(video); - double frames = bytes / (double)size; + double frames = bytes / static_cast(size); seconds = frames / player->defaultSpeed(); } if (ioInfo.audio.isValid()) { const auto& audio = ioInfo.audio; - size_t channelCount = audio.channelCount; - size_t byteCount = audio::getByteCount(audio.dataType); - size_t sampleRate = audio.sampleRate; + std::size_t channelCount = audio.channelCount; + std::size_t byteCount = audio::getByteCount(audio.dataType); + std::size_t sampleRate = audio.sampleRate; uint64_t size = sampleRate * byteCount * channelCount; seconds -= size / 1024.0 / 1024.0; } From ad9c2727f1e9242dd49e565c62e211c26ee976b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gonzalo=20Garramu=C3=B1o?= Date: Wed, 29 Mar 2023 21:17:26 -0300 Subject: [PATCH 02/26] Added HUD of Cache Read Ahead/Read Behind. --- mrv2/docs/HISTORY.md | 18 ++++--- mrv2/lib/mrvApp/App.cpp | 2 +- mrv2/lib/mrvApp/mrvMainControl.cpp | 39 ++++++++------ mrv2/lib/mrvFl/mrvPreferences.cpp | 8 ++- mrv2/lib/mrvGL/mrvGLViewport.cpp | 46 ++++++++++++++++- mrv2/lib/mrvGL/mrvTimelineViewport.cpp | 53 +++++++++++++------- mrv2/lib/mrvGL/mrvTimelineViewport.h | 5 +- mrv2/lib/mrvGL/mrvTimelineViewportEvents.cpp | 2 +- mrv2/lib/mrvWidgets/mrViewer.fl | 3 +- mrv2/lib/mrvWidgets/mrvPreferencesUI.fl | 8 ++- 10 files changed, 135 insertions(+), 49 deletions(-) diff --git a/mrv2/docs/HISTORY.md b/mrv2/docs/HISTORY.md index c2a02d295..232e92722 100644 --- a/mrv2/docs/HISTORY.md +++ b/mrv2/docs/HISTORY.md @@ -1,22 +1,28 @@ v0.3.8 ------ -- Added Python Doxygen documentation. -- Documented C++ code a lot. - Changed language handling in preferences. Now the locale code is stored. - Removed all languages except for English and Spanish. Note that on Windows, if you had Spanish selected, it will revert to English. You will need to change it once again. - Added reporting of memory use to HUD. -- Added Chache in Gigabytes to Settings menu. When this is non-zero the +- Added Cache in Gigabytes to Settings menu. When this is non-zero the Read Ahead and the Read Behind are calculated automatically based on - the Gigabytes number set here. It divides it by image size, pixel type and - number of active movies. + the Gigabytes number set here. It divides it by image size, pixel type, + fps and number of active movies. It also takes into account audio, but + poorly. - Fixed a resizing issue on Python Panel, not resizing the tile group. -- Documented Python API in both English and Spanish. +- Documented Python API in both English and Spanish, with Search browser. - Fixed sorting of recent files so that they don't change order. - Fixed reccent files to not list files that cannot be found on disk. - Made recent files list the files in order of how they were loaded, with last loaded first. +- Fixed original pixel lookups on clips that have a pixel aspect ratio != 1.0. +- Fixed original pixel lookups on YUV420P_U16, YUV444P_U16 format. + Missing testing YUV422P_U16, but it should work. +- Made audio volume and audio mute / track selection not active if the clip + has no audio. +- Added number of Cache Ahead and Behind Video and Audio frames to HUD. + If Ahead Video cache becomes 0 when playing forwards, playback will stop. v0.3.7 ------ diff --git a/mrv2/lib/mrvApp/App.cpp b/mrv2/lib/mrvApp/App.cpp index aeac484c8..4065a01a5 100644 --- a/mrv2/lib/mrvApp/App.cpp +++ b/mrv2/lib/mrvApp/App.cpp @@ -1068,7 +1068,7 @@ namespace mrv options.readBehind = otime::RationalTime( seconds * readBehind / static_cast(activeCount), 1.0); } - + for (const auto& i : p.timelinePlayers) { if (i) diff --git a/mrv2/lib/mrvApp/mrvMainControl.cpp b/mrv2/lib/mrvApp/mrvMainControl.cpp index 2a12c37cf..90d94ef03 100644 --- a/mrv2/lib/mrvApp/mrvMainControl.cpp +++ b/mrv2/lib/mrvApp/mrvMainControl.cpp @@ -160,8 +160,6 @@ namespace mrv c->uiFrame->activate(); c->uiStartFrame->activate(); c->uiEndFrame->activate(); - c->uiVolume->activate(); - c->uiAudioTracks->activate(); c->uiFPS->activate(); c->uiStartButton->activate(); c->uiEndButton->activate(); @@ -198,22 +196,33 @@ namespace mrv const auto timeline = player->timeline(); const auto ioinfo = timeline->getIOInfo(); const auto audio = ioinfo.audio; - const auto name = audio.name; - int mode = FL_MENU_RADIO; - c->uiAudioTracks->add(_("Mute"), 0, 0, 0, mode); - int idx = c->uiAudioTracks->add( - name.c_str(), 0, 0, 0, mode | FL_MENU_VALUE); + if ( audio.isValid() ) + { + const auto name = audio.name; + int mode = FL_MENU_RADIO; + c->uiAudioTracks->add(_("Mute"), 0, 0, 0, mode); + int idx = c->uiAudioTracks->add( + name.c_str(), 0, 0, 0, mode | FL_MENU_VALUE); + + c->uiVolume->activate(); + c->uiAudioTracks->activate(); + + if (player->isMuted()) + { + c->uiAudioTracks->value(0); + } + c->uiAudioTracks->do_callback(); + c->uiAudioTracks->redraw(); - if (player->isMuted()) + // Set the audio volume + c->uiVolume->value(player->volume()); + c->uiVolume->redraw(); + } + else { - c->uiAudioTracks->value(0); + delete c->uiAudioTracks->image(); + c->uiAudioTracks->image( mrv::load_svg("Mute.svg") ); } - c->uiAudioTracks->do_callback(); - c->uiAudioTracks->redraw(); - - // Set the audio volume - c->uiVolume->value(player->volume()); - c->uiVolume->redraw(); } else { diff --git a/mrv2/lib/mrvFl/mrvPreferences.cpp b/mrv2/lib/mrvFl/mrvPreferences.cpp index 2622ce31b..2ef4905cc 100644 --- a/mrv2/lib/mrvFl/mrvPreferences.cpp +++ b/mrv2/lib/mrvFl/mrvPreferences.cpp @@ -637,6 +637,8 @@ namespace mrv uiPrefs->uiPrefsHudFrameRange->value((bool)tmp); hud.get("frame_count", tmp, 0); uiPrefs->uiPrefsHudFrameCount->value((bool)tmp); + hud.get("cache", tmp, 0); + uiPrefs->uiPrefsHudCache->value((bool)tmp); hud.get("memory", tmp, 0); uiPrefs->uiPrefsHudMemory->value((bool)tmp); hud.get("attributes", tmp, 0); @@ -1033,8 +1035,9 @@ namespace mrv hud.set("resolution", uiPrefs->uiPrefsHudResolution->value()); hud.set("frame_range", uiPrefs->uiPrefsHudFrameRange->value()); hud.set("frame_count", uiPrefs->uiPrefsHudFrameCount->value()); - hud.set("attributes", uiPrefs->uiPrefsHudAttributes->value()); + hud.set("cache", uiPrefs->uiPrefsHudCache->value()); hud.set("memory", uiPrefs->uiPrefsHudMemory->value()); + hud.set("attributes", uiPrefs->uiPrefsHudAttributes->value()); { Fl_Preferences win(view, "window"); @@ -1551,6 +1554,9 @@ namespace mrv if (uiPrefs->uiPrefsHudAttributes->value()) hud |= HudDisplay::kAttributes; + if (uiPrefs->uiPrefsHudCache->value()) + hud |= HudDisplay::kCache; + if (uiPrefs->uiPrefsHudMemory->value()) hud |= HudDisplay::kMemory; diff --git a/mrv2/lib/mrvGL/mrvGLViewport.cpp b/mrv2/lib/mrvGL/mrvGLViewport.cpp index d02fdcc03..5ce715b1b 100644 --- a/mrv2/lib/mrvGL/mrvGLViewport.cpp +++ b/mrv2/lib/mrvGL/mrvGLViewport.cpp @@ -1390,7 +1390,6 @@ namespace mrv if (p.hud & HudDisplay::kFPS) { - auto time_diff = (time - p.lastTime); int64_t frame_diff = time_diff.to_frames(); int64_t absdiff = std::abs(frame_diff); @@ -1454,6 +1453,51 @@ namespace mrv p.fontSystem->getGlyphs(tmp, fontInfo), pos, lineHeight, labelColor); + if (p.hud & HudDisplay::kCache) + { + const auto& cacheInfo = player->cacheInfo(); + + uint64_t aheadVideoFrames = 0, behindVideoFrames = 0; + uint64_t aheadAudioFrames = 0, behindAudioFrames = 0; + + otime::TimeRange currentRange( + otime::RationalTime( + static_cast(frame), player->defaultSpeed()), + otime::RationalTime(1.0, player->defaultSpeed())); + + for (const auto& i : cacheInfo.videoFrames) + { + if (i.intersects(currentRange)) + { + aheadVideoFrames += i.end_time_inclusive().to_frames() - + frame; + behindVideoFrames += frame - i.start_time().to_frames(); + } + } + + for (const auto& i : cacheInfo.audioFrames) + { + if (i.intersects(currentRange)) + { + aheadAudioFrames += i.end_time_inclusive().to_frames() - + frame; + behindAudioFrames += frame - i.start_time().to_frames(); + } + } + snprintf( + buf, 512, _("Ahead V: % 4" PRIu64 " A: % 4" PRIu64), + aheadVideoFrames, aheadAudioFrames); + _drawText( + p.fontSystem->getGlyphs(buf, fontInfo), pos, lineHeight, + labelColor); + snprintf( + buf, 512, _("Behind V: % 4" PRIu64 " A: % 4" PRIu64), + behindVideoFrames, behindAudioFrames); + _drawText( + p.fontSystem->getGlyphs(buf, fontInfo), pos, lineHeight, + labelColor); + } + if (p.hud & HudDisplay::kAttributes) { const auto& info = player->timelinePlayer()->getIOInfo(); diff --git a/mrv2/lib/mrvGL/mrvTimelineViewport.cpp b/mrv2/lib/mrvGL/mrvTimelineViewport.cpp index df850c315..8a20eb628 100644 --- a/mrv2/lib/mrvGL/mrvTimelineViewport.cpp +++ b/mrv2/lib/mrvGL/mrvTimelineViewport.cpp @@ -706,6 +706,11 @@ namespace mrv { TimelineClass* c = _p->ui->uiTimeWindow; c->uiTimeline->redraw(); + + if (getHudActive() && (getHudDisplay() & HudDisplay::kCache)) + { + redrawWindows(); + } } } @@ -1697,7 +1702,7 @@ namespace mrv if (X < 0 || Y < 0 || X >= size.w || Y >= size.h) return; - size_t offset = (Y * size.w + X) * depth; + size_t offset = (Y * size.w + X); switch (type) { @@ -1710,7 +1715,7 @@ namespace mrv case imaging::PixelType::YUV_444P_U16: break; default: - offset *= channels; + offset *= channels * depth; break; } @@ -1913,36 +1918,46 @@ namespace mrv rgba = color::YPbPr::to_rgb(rgba, yuvCoefficients); break; } - case imaging::PixelType::YUV_420P_U16: + case imaging::PixelType::YUV_420P_U16: // Works { - size_t pos = Y * size.w / 4 + X / 2; + uint16_t* f = (uint16_t*)data; + size_t Ysize = size.w * size.h; - size_t Usize = Ysize / 4; - rgba.r = data[offset] / 65535.0f; - rgba.g = data[Ysize + pos] / 65535.0f; - rgba.b = data[Ysize + Usize + pos] / 65535.0f; + size_t w2 = (size.w + 1) / 2; + size_t h2 = (size.h + 1) / 2; + size_t Usize = w2 * h2; + size_t offset2 = (Y / 2) * w2 + X / 2; + + rgba.r = f[offset] / 65535.0f; + rgba.g = f[Ysize + offset2] / 65535.0f; + rgba.b = f[Ysize + Usize + offset2] / 65535.0f; color::checkLevels(rgba, videoLevels); rgba = color::YPbPr::to_rgb(rgba, yuvCoefficients); break; } case imaging::PixelType::YUV_422P_U16: { - size_t Ysize = size.w * size.h * depth; - size_t pos = Y * size.w + X; - size_t Usize = size.w / 2 * size.h * depth; - rgba.r = data[offset] / 65535.0f; - rgba.g = data[Ysize + pos] / 65535.0f; - rgba.b = data[Ysize + Usize + pos] / 65535.0f; + uint16_t* f = (uint16_t*)data; + + size_t Ysize = size.w * size.h; + size_t w2 = (size.w + 1) / 2; + size_t Usize = w2 * size.h; + size_t offset2 = Y * w2 + X / 2; + + rgba.r = f[offset] / 65535.0f; + rgba.g = f[Ysize + offset2] / 65535.0f; + rgba.b = f[Ysize + Usize + offset2] / 65535.0f; color::checkLevels(rgba, videoLevels); rgba = color::YPbPr::to_rgb(rgba, yuvCoefficients); break; } - case imaging::PixelType::YUV_444P_U16: + case imaging::PixelType::YUV_444P_U16: // Works { - size_t Ysize = size.w * size.h * depth; - rgba.r = data[offset] / 65535.0f; - rgba.g = data[Ysize + offset] / 65535.0f; - rgba.b = data[Ysize * 2 + offset] / 65535.0f; + uint16_t* f = (uint16_t*)data; + size_t Ysize = size.w * size.h; + rgba.r = f[offset] / 65535.0f; + rgba.g = f[Ysize + offset] / 65535.0f; + rgba.b = f[Ysize * 2 + offset] / 65535.0f; color::checkLevels(rgba, videoLevels); rgba = color::YPbPr::to_rgb(rgba, yuvCoefficients); break; diff --git a/mrv2/lib/mrvGL/mrvTimelineViewport.h b/mrv2/lib/mrvGL/mrvTimelineViewport.h index 83387b74b..af958dcc9 100644 --- a/mrv2/lib/mrvGL/mrvTimelineViewport.h +++ b/mrv2/lib/mrvGL/mrvTimelineViewport.h @@ -43,7 +43,8 @@ namespace mrv kTimecode = 1 << 6, kFPS = 1 << 7, kMemory = 1 << 8, - kAttributes = 1 << 9, + kCache = 1 << 9, + kAttributes = 1 << 10, }; enum ActionMode { @@ -287,7 +288,7 @@ namespace mrv imaging::Size getRenderSize() const noexcept; //! Redraw both the primary and secondary windows. - void redrawWindows(); + void redrawWindows() const; //! Refresh both the primary and secondary windows by clearing the //! associated resources. diff --git a/mrv2/lib/mrvGL/mrvTimelineViewportEvents.cpp b/mrv2/lib/mrvGL/mrvTimelineViewportEvents.cpp index 641b894c2..c2d44ba7c 100644 --- a/mrv2/lib/mrvGL/mrvTimelineViewportEvents.cpp +++ b/mrv2/lib/mrvGL/mrvTimelineViewportEvents.cpp @@ -47,7 +47,7 @@ namespace namespace mrv { - void TimelineViewport::redrawWindows() + void TimelineViewport::redrawWindows() const { _p->ui->uiView->redraw(); if (_p->ui->uiSecondary && _p->ui->uiSecondary->window()->visible()) diff --git a/mrv2/lib/mrvWidgets/mrViewer.fl b/mrv2/lib/mrvWidgets/mrViewer.fl index 3baf44cfb..7aff61912 100644 --- a/mrv2/lib/mrvWidgets/mrViewer.fl +++ b/mrv2/lib/mrvWidgets/mrViewer.fl @@ -898,8 +898,7 @@ uiView->updateDisplayOptions();} Fl_Menu_Button uiICS { label {Input Color Space} user_data this user_data_type {ViewerUI*} - callback {uiView->updateColorConfigOptions(); -uiView->flush();} open + callback {uiView->updateColorConfigOptions();} open tooltip {OCIO input color space for the image} xywh {277 27 143 22} box ROUNDED_BOX labelsize 12 align 96 code0 {o->disable_submenus();} class {mrv::PopupMenu} diff --git a/mrv2/lib/mrvWidgets/mrvPreferencesUI.fl b/mrv2/lib/mrvWidgets/mrvPreferencesUI.fl index 7279d6928..ffeeb52b6 100644 --- a/mrv2/lib/mrvWidgets/mrvPreferencesUI.fl +++ b/mrv2/lib/mrvWidgets/mrvPreferencesUI.fl @@ -304,7 +304,7 @@ If you try to open several mrv2s with different images, all these images will be } Fl_Check_Button uiPrefsHudTimecode { label Timecode - user_data this user_data_type {PreferencesUI*} selected + user_data this user_data_type {PreferencesUI*} xywh {650 323 20 18} box UP_BOX down_box DOWN_BOX align 8 class {mrv::CheckButton} } @@ -320,6 +320,12 @@ If you try to open several mrv2s with different images, all these images will be xywh {334 349 20 20} box UP_BOX down_box DOWN_BOX align 8 class {mrv::CheckButton} } + Fl_Check_Button uiPrefsHudCache { + label Cache + user_data this user_data_type {PreferencesUI*} selected + xywh {480 350 20 20} box UP_BOX down_box DOWN_BOX align 8 + class {mrv::CheckButton} + } Fl_Check_Button uiPrefsHudAttributes { label Attributes user_data this user_data_type {PreferencesUI*} From 5cb6798d248667f7489bb2c8aa257068b25831c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gonzalo=20Garramu=C3=B1o?= Date: Wed, 29 Mar 2023 21:33:38 -0300 Subject: [PATCH 03/26] Changed readBehind to 1.0. --- mrv2/lib/mrvApp/App.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mrv2/lib/mrvApp/App.cpp b/mrv2/lib/mrvApp/App.cpp index 4065a01a5..d386b9ad9 100644 --- a/mrv2/lib/mrvApp/App.cpp +++ b/mrv2/lib/mrvApp/App.cpp @@ -1057,8 +1057,9 @@ namespace mrv constexpr double defaultReadAhead = timeline::PlayerCacheOptions().readAhead.value(); - constexpr double defaultReadBehind = - timeline::PlayerCacheOptions().readBehind.value(); + // 0.5 creates stutters on macOS audio: + // timeline::PlayerCacheOptions().readBehind.value(); + constexpr double defaultReadBehind = 1.0; constexpr double totalTime = defaultReadAhead + defaultReadBehind; constexpr double readAhead = defaultReadAhead / totalTime; constexpr double readBehind = defaultReadBehind / totalTime; From ba3714a55274b090b3019b4c4ae55d95c9ba0426 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gonzalo=20Garramu=C3=B1o?= Date: Wed, 29 Mar 2023 21:51:11 -0300 Subject: [PATCH 04/26] Reformatting. --- mrv2/lib/mrvApp/App.cpp | 2 +- mrv2/lib/mrvApp/mrvMainControl.cpp | 6 +++--- mrv2/lib/mrvFl/mrvPreferences.cpp | 2 +- mrv2/lib/mrvGL/mrvGLViewport.cpp | 10 +++++----- mrv2/lib/mrvGL/mrvTimelineViewport.cpp | 6 +++--- mrv2/lib/mrvGL/mrvTimelineViewport.h | 2 +- mrv2/lib/mrvGL/mrvTimelineViewportEvents.cpp | 9 +++++---- 7 files changed, 19 insertions(+), 18 deletions(-) diff --git a/mrv2/lib/mrvApp/App.cpp b/mrv2/lib/mrvApp/App.cpp index 4065a01a5..aeac484c8 100644 --- a/mrv2/lib/mrvApp/App.cpp +++ b/mrv2/lib/mrvApp/App.cpp @@ -1068,7 +1068,7 @@ namespace mrv options.readBehind = otime::RationalTime( seconds * readBehind / static_cast(activeCount), 1.0); } - + for (const auto& i : p.timelinePlayers) { if (i) diff --git a/mrv2/lib/mrvApp/mrvMainControl.cpp b/mrv2/lib/mrvApp/mrvMainControl.cpp index 90d94ef03..b73cca854 100644 --- a/mrv2/lib/mrvApp/mrvMainControl.cpp +++ b/mrv2/lib/mrvApp/mrvMainControl.cpp @@ -196,7 +196,7 @@ namespace mrv const auto timeline = player->timeline(); const auto ioinfo = timeline->getIOInfo(); const auto audio = ioinfo.audio; - if ( audio.isValid() ) + if (audio.isValid()) { const auto name = audio.name; int mode = FL_MENU_RADIO; @@ -206,7 +206,7 @@ namespace mrv c->uiVolume->activate(); c->uiAudioTracks->activate(); - + if (player->isMuted()) { c->uiAudioTracks->value(0); @@ -221,7 +221,7 @@ namespace mrv else { delete c->uiAudioTracks->image(); - c->uiAudioTracks->image( mrv::load_svg("Mute.svg") ); + c->uiAudioTracks->image(mrv::load_svg("Mute.svg")); } } else diff --git a/mrv2/lib/mrvFl/mrvPreferences.cpp b/mrv2/lib/mrvFl/mrvPreferences.cpp index 2ef4905cc..cae01436e 100644 --- a/mrv2/lib/mrvFl/mrvPreferences.cpp +++ b/mrv2/lib/mrvFl/mrvPreferences.cpp @@ -1556,7 +1556,7 @@ namespace mrv if (uiPrefs->uiPrefsHudCache->value()) hud |= HudDisplay::kCache; - + if (uiPrefs->uiPrefsHudMemory->value()) hud |= HudDisplay::kMemory; diff --git a/mrv2/lib/mrvGL/mrvGLViewport.cpp b/mrv2/lib/mrvGL/mrvGLViewport.cpp index 5ce715b1b..13877ee39 100644 --- a/mrv2/lib/mrvGL/mrvGLViewport.cpp +++ b/mrv2/lib/mrvGL/mrvGLViewport.cpp @@ -1469,8 +1469,8 @@ namespace mrv { if (i.intersects(currentRange)) { - aheadVideoFrames += i.end_time_inclusive().to_frames() - - frame; + aheadVideoFrames += + i.end_time_inclusive().to_frames() - frame; behindVideoFrames += frame - i.start_time().to_frames(); } } @@ -1479,8 +1479,8 @@ namespace mrv { if (i.intersects(currentRange)) { - aheadAudioFrames += i.end_time_inclusive().to_frames() - - frame; + aheadAudioFrames += + i.end_time_inclusive().to_frames() - frame; behindAudioFrames += frame - i.start_time().to_frames(); } } @@ -1497,7 +1497,7 @@ namespace mrv p.fontSystem->getGlyphs(buf, fontInfo), pos, lineHeight, labelColor); } - + if (p.hud & HudDisplay::kAttributes) { const auto& info = player->timelinePlayer()->getIOInfo(); diff --git a/mrv2/lib/mrvGL/mrvTimelineViewport.cpp b/mrv2/lib/mrvGL/mrvTimelineViewport.cpp index 8a20eb628..13b370458 100644 --- a/mrv2/lib/mrvGL/mrvTimelineViewport.cpp +++ b/mrv2/lib/mrvGL/mrvTimelineViewport.cpp @@ -1918,7 +1918,7 @@ namespace mrv rgba = color::YPbPr::to_rgb(rgba, yuvCoefficients); break; } - case imaging::PixelType::YUV_420P_U16: // Works + case imaging::PixelType::YUV_420P_U16: // Works { uint16_t* f = (uint16_t*)data; @@ -1927,7 +1927,7 @@ namespace mrv size_t h2 = (size.h + 1) / 2; size_t Usize = w2 * h2; size_t offset2 = (Y / 2) * w2 + X / 2; - + rgba.r = f[offset] / 65535.0f; rgba.g = f[Ysize + offset2] / 65535.0f; rgba.b = f[Ysize + Usize + offset2] / 65535.0f; @@ -1943,7 +1943,7 @@ namespace mrv size_t w2 = (size.w + 1) / 2; size_t Usize = w2 * size.h; size_t offset2 = Y * w2 + X / 2; - + rgba.r = f[offset] / 65535.0f; rgba.g = f[Ysize + offset2] / 65535.0f; rgba.b = f[Ysize + Usize + offset2] / 65535.0f; diff --git a/mrv2/lib/mrvGL/mrvTimelineViewport.h b/mrv2/lib/mrvGL/mrvTimelineViewport.h index af958dcc9..c96b75987 100644 --- a/mrv2/lib/mrvGL/mrvTimelineViewport.h +++ b/mrv2/lib/mrvGL/mrvTimelineViewport.h @@ -43,7 +43,7 @@ namespace mrv kTimecode = 1 << 6, kFPS = 1 << 7, kMemory = 1 << 8, - kCache = 1 << 9, + kCache = 1 << 9, kAttributes = 1 << 10, }; diff --git a/mrv2/lib/mrvGL/mrvTimelineViewportEvents.cpp b/mrv2/lib/mrvGL/mrvTimelineViewportEvents.cpp index c2d44ba7c..4496c3127 100644 --- a/mrv2/lib/mrvGL/mrvTimelineViewportEvents.cpp +++ b/mrv2/lib/mrvGL/mrvTimelineViewportEvents.cpp @@ -881,15 +881,16 @@ namespace mrv if (p.lastEvent == FL_PUSH && Fl::event_button() == FL_LEFT_MOUSE) { - if ( p.timelinePlayers.empty() ) return 0; + if (p.timelinePlayers.empty()) + return 0; - if ( _isPlaybackStopped() ) + if (_isPlaybackStopped()) { - setHelpText( _("Play") ); + setHelpText(_("Play")); } else { - setHelpText( _("Stop") ); + setHelpText(_("Stop")); } togglePlayback(); } From 203d9bdb35ed1d481ff529d556db6c1c7d2494b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gonzalo=20Garramu=C3=B1o?= Date: Thu, 30 Mar 2023 13:37:53 -0300 Subject: [PATCH 05/26] Turned off compiling with Wayland, which makes it, when run under Wayland more reliable, except for typing text. --- cmake/Modules/BuildFLTK.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/Modules/BuildFLTK.cmake b/cmake/Modules/BuildFLTK.cmake index 274545dc4..38cb47889 100644 --- a/cmake/Modules/BuildFLTK.cmake +++ b/cmake/Modules/BuildFLTK.cmake @@ -15,8 +15,8 @@ if (APPLE OR WIN32) set( wayland OFF ) set( pango OFF ) else() - set( wayland ON ) # we'll leave it on, but it is way too - # buggy with Nvidia cards. + set( wayland OFF ) # we'll leave it off, but it is way too + # buggy with, at least, Nvidia cards. set( pango ON ) endif() From 7df1bac2446e4e8ebf072edac4df5808df63c5b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gonzalo=20Garramu=C3=B1o?= Date: Thu, 30 Mar 2023 17:00:10 -0300 Subject: [PATCH 06/26] Fixed MultilineInput on Wayland. --- mrv2/lib/mrvWidgets/mrvMultilineInput.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/mrv2/lib/mrvWidgets/mrvMultilineInput.cpp b/mrv2/lib/mrvWidgets/mrvMultilineInput.cpp index 205e3b907..ef48792ad 100644 --- a/mrv2/lib/mrvWidgets/mrvMultilineInput.cpp +++ b/mrv2/lib/mrvWidgets/mrvMultilineInput.cpp @@ -171,6 +171,7 @@ namespace mrv W += kCrossSize * 2 + 10; // use 10 for padding and cursor. H += kCrossSize * 2; size(W, H); + redraw(); } int MultilineInput::textsize() const From f6cdd7c7015db6bb78a6897073444e48077e2ab1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gonzalo=20Garramu=C3=B1o?= Date: Thu, 30 Mar 2023 17:00:46 -0300 Subject: [PATCH 07/26] Went back to compile FLTK's master HEAD. --- cmake/Modules/BuildFLTK.cmake | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cmake/Modules/BuildFLTK.cmake b/cmake/Modules/BuildFLTK.cmake index 38cb47889..58dbd005a 100644 --- a/cmake/Modules/BuildFLTK.cmake +++ b/cmake/Modules/BuildFLTK.cmake @@ -5,8 +5,8 @@ include( ExternalProject ) # Stable TAG -set( FLTK_TAG 73a2ca5261ee7b0d0e33fc1e49611520d7b0e0cb ) -#set( FLTK_TAG master ) +#set( FLTK_TAG 73a2ca5261ee7b0d0e33fc1e49611520d7b0e0cb ) +set( FLTK_TAG master ) set( patch_cmd ) @@ -15,7 +15,7 @@ if (APPLE OR WIN32) set( wayland OFF ) set( pango OFF ) else() - set( wayland OFF ) # we'll leave it off, but it is way too + set( wayland ON ) # we'll leave it off, but it is way too # buggy with, at least, Nvidia cards. set( pango ON ) endif() From 9665e50b9d152580c0beb028a44bf5e2d9ca3b01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gonzalo=20Garramu=C3=B1o?= Date: Thu, 30 Mar 2023 17:02:12 -0300 Subject: [PATCH 08/26] Updated HISTORY.md file. --- mrv2/docs/HISTORY.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mrv2/docs/HISTORY.md b/mrv2/docs/HISTORY.md index 232e92722..89257aaea 100644 --- a/mrv2/docs/HISTORY.md +++ b/mrv2/docs/HISTORY.md @@ -5,7 +5,7 @@ v0.3.8 if you had Spanish selected, it will revert to English. You will need to change it once again. - Added reporting of memory use to HUD. -- Added Cache in Gigabytes to Settings menu. When this is non-zero the +- Added Cache in Gigabytes to Settings Panel. When this is non-zero the Read Ahead and the Read Behind are calculated automatically based on the Gigabytes number set here. It divides it by image size, pixel type, fps and number of active movies. It also takes into account audio, but @@ -23,6 +23,7 @@ v0.3.8 has no audio. - Added number of Cache Ahead and Behind Video and Audio frames to HUD. If Ahead Video cache becomes 0 when playing forwards, playback will stop. +- Fixed Text tool input on Wayland. v0.3.7 ------ From 0db7bfa3e6d8b581e2706d2f93d2bc09d13bb507 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gonzalo=20Garramu=C3=B1o?= Date: Thu, 30 Mar 2023 17:02:32 -0300 Subject: [PATCH 09/26] Added new translations for cache. --- mrv2/po/es.po | 10 +++++++++- mrv2/po/messages.pot | 10 +++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/mrv2/po/es.po b/mrv2/po/es.po index 0a0dd32a4..1e71dc01a 100644 --- a/mrv2/po/es.po +++ b/mrv2/po/es.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: mrv2 v0.3.3\n" "Report-Msgid-Bugs-To: ggarra13@gmail.com\n" -"POT-Creation-Date: 2023-03-28 21:47-0300\n" +"POT-Creation-Date: 2023-03-30 14:05-0300\n" "PO-Revision-Date: 2023-02-11 13:42-0300\n" "Last-Translator: Gonzalo Garramuño \n" "Language-Team: Spanish \n" @@ -800,6 +800,10 @@ msgstr "Avanzar un cuadro." msgid "Advanced Systems Format Media" msgstr "Advanced Systems Format Media" +#, c-format +msgid "Ahead V: % 4 A: % 4" +msgstr "Adelante V: % 4 A: % 4" + msgid "All" msgstr "Todos" @@ -962,6 +966,10 @@ msgstr "Fondo" msgid "Beginning frame of clip" msgstr "Cuadro de comienzo del clip" +#, c-format +msgid "Behind V: % 4 A: % 4" +msgstr "Atrás V: % 4 A: % 4 " + msgid "Bit depth of clip" msgstr "Profundidad en bits" diff --git a/mrv2/po/messages.pot b/mrv2/po/messages.pot index 9b20b17e8..c844b1dd6 100644 --- a/mrv2/po/messages.pot +++ b/mrv2/po/messages.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: mrv2 v0.3.8\n" "Report-Msgid-Bugs-To: ggarra13@gmail.com\n" -"POT-Creation-Date: 2023-03-28 21:47-0300\n" +"POT-Creation-Date: 2023-03-30 14:05-0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -598,6 +598,10 @@ msgstr "" msgid "Advanced Systems Format Media" msgstr "" +#, c-format +msgid "Ahead V: % 4 A: % 4" +msgstr "" + msgid "All" msgstr "" @@ -757,6 +761,10 @@ msgstr "" msgid "Beginning frame of clip" msgstr "" +#, c-format +msgid "Behind V: % 4 A: % 4" +msgstr "" + msgid "Bit depth of clip" msgstr "" From 18f6e09a3f5e4d7fe2d912665ca777cfb5e7ba4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gonzalo=20Garramu=C3=B1o?= Date: Thu, 30 Mar 2023 17:05:43 -0300 Subject: [PATCH 10/26] Updated environment.sh.in with Wayland comment. --- mrv2/bin/environment.sh.in | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/mrv2/bin/environment.sh.in b/mrv2/bin/environment.sh.in index 86d648c35..9c6abf4a6 100644 --- a/mrv2/bin/environment.sh.in +++ b/mrv2/bin/environment.sh.in @@ -41,21 +41,15 @@ export PYTHONPATH="${dir}/lib/@MRV2_PYTHON_VERSION@:/usr/local/lib64/@MRV2_PYTHO # as Wayland is still too buggy. # if [[ "$XDG_SESSION_TYPE" == "wayland" && "$FLTK_BACKEND" == "" ]]; then - gfx_card=`lspci -k | grep -EA3 'VGA|3D|Display' | grep nvidia_drm` - if [[ $gfx_card != "" ]]; then - echo " Wayland support with NVidia drivers is currently buggy." - echo " If you still want to run FLTK applications with Wayland," - echo " set the environment variable FLTK_BACKEND to wayland, like:" + echo " Wayland support with is currently beta." + echo " If you still want to run FLTK applications with Wayland," + echo " set the environment variable FLTK_BACKEND to wayland, like:" + echo "" + echo " export FLTK_BACKEND=wayland" + echo "" + if [[ "$FLTK_BACKEND" == "" ]]; then + echo " Setting the environment variable FLTK_BACKEND=x11." echo "" - echo " export FLTK_BACKEND=wayland" - echo "" - if [[ "$FLTK_BACKEND" == "" ]]; then - echo " Setting the environment variable FLTK_BACKEND=x11." - echo "" - echo " However, we recommend you log in into an X11 server or" - echo " use the Xorg.org noveau drivers instead." - echo "" - export FLTK_BACKEND=x11 - fi + export FLTK_BACKEND=x11 fi fi From ebcf5540488111dece77438ba1b49c1ab7d27968 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gonzalo=20Garramu=C3=B1o?= Date: Thu, 30 Mar 2023 17:22:40 -0300 Subject: [PATCH 11/26] Fixed typo. --- mrv2/bin/environment.sh.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mrv2/bin/environment.sh.in b/mrv2/bin/environment.sh.in index 9c6abf4a6..2d98982cf 100644 --- a/mrv2/bin/environment.sh.in +++ b/mrv2/bin/environment.sh.in @@ -41,7 +41,7 @@ export PYTHONPATH="${dir}/lib/@MRV2_PYTHON_VERSION@:/usr/local/lib64/@MRV2_PYTHO # as Wayland is still too buggy. # if [[ "$XDG_SESSION_TYPE" == "wayland" && "$FLTK_BACKEND" == "" ]]; then - echo " Wayland support with is currently beta." + echo " Wayland support is currently beta." echo " If you still want to run FLTK applications with Wayland," echo " set the environment variable FLTK_BACKEND to wayland, like:" echo "" From 3dabd5e4f7ac28ed169539787bacb4cfa64420e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gonzalo=20Garramu=C3=B1o?= Date: Thu, 30 Mar 2023 21:22:35 -0300 Subject: [PATCH 12/26] Added more system libs not to distribute. --- cmake/functions.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/functions.cmake b/cmake/functions.cmake index bd81adb36..aa9190a19 100644 --- a/cmake/functions.cmake +++ b/cmake/functions.cmake @@ -68,7 +68,7 @@ function( is_system_lib TARGET ISSYSLIB ) # # List of system libraries that should not be distributed # - set( _syslibs libOpenGL libGL libEGL libGLdispatch libGLX libX nvidia libdrm2 libpthread libresolv libm librt libdl libxcb libasound libgpg-error libfontconfig libfreetype libxshmfence libc libstdc libgcc_s libselinux ld-linux ) + set( _syslibs ld-linux libasound libc libcrypto libdl libharfbuzz libfontconfig libfreetype libgcc_s libgpg-error libEGL libGL libGLdispatch libGLX libgtk-3 libgdk-3 libX nvidia libdrm2 libpthread libresolv libm libOpenGL libpulse libpulse-simple librt libselinux libxcb libxshmfence libstdc libz ) set( ${ISSYSLIB} 0 PARENT_SCOPE) From 6814003f914157d2644908e48513d1c3b3689bae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gonzalo=20Garramu=C3=B1o?= Date: Thu, 30 Mar 2023 22:07:10 -0300 Subject: [PATCH 13/26] Removed libgtk-3 and libgdk-3 from system libs. --- cmake/functions.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/functions.cmake b/cmake/functions.cmake index aa9190a19..348b555db 100644 --- a/cmake/functions.cmake +++ b/cmake/functions.cmake @@ -63,12 +63,12 @@ function( is_system_lib TARGET ISSYSLIB ) # # List of libraries that are accepted to distribute # - set( _acceptedlibs libmd libcairo libcap libcrypto ) + set( _acceptedlibs libmd libcairo libcap ) # # List of system libraries that should not be distributed # - set( _syslibs ld-linux libasound libc libcrypto libdl libharfbuzz libfontconfig libfreetype libgcc_s libgpg-error libEGL libGL libGLdispatch libGLX libgtk-3 libgdk-3 libX nvidia libdrm2 libpthread libresolv libm libOpenGL libpulse libpulse-simple librt libselinux libxcb libxshmfence libstdc libz ) + set( _syslibs ld-linux libasound libc libcrypto libdl libharfbuzz libfontconfig libfreetype libgcc_s libgpg-error libEGL libGL libGLdispatch libGLX libX nvidia libdrm2 libpthread libresolv libm libOpenGL libpulse libpulse-simple librt libselinux libxcb libxshmfence libstdc libz ) set( ${ISSYSLIB} 0 PARENT_SCOPE) From a08220d494af224e34cab0a2ccff1a9956d6ba49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gonzalo=20Garramu=C3=B1o?= Date: Thu, 30 Mar 2023 22:20:40 -0300 Subject: [PATCH 14/26] Made Gbytes setting start at half the memory by default. --- mrv2/lib/mrvApp/mrvSettingsObject.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/mrv2/lib/mrvApp/mrvSettingsObject.cpp b/mrv2/lib/mrvApp/mrvSettingsObject.cpp index 86629f05e..8754b6fc3 100644 --- a/mrv2/lib/mrvApp/mrvSettingsObject.cpp +++ b/mrv2/lib/mrvApp/mrvSettingsObject.cpp @@ -10,6 +10,8 @@ #include #include +#include "mrvCore/mrvMemory.h" + #include "mrvFl/mrvIO.h" #include "mrvApp/mrvSettingsObject.h" @@ -35,9 +37,20 @@ namespace mrv { TLRENDER_P(); + uint64_t totalVirtualMem = 0; + uint64_t virtualMemUsed = 0; + uint64_t virtualMemUsedByMe = 0; + uint64_t totalPhysMem = 0; + uint64_t physMemUsed = 0; + uint64_t physMemUsedByMe = 0; + memory_information( + totalVirtualMem, virtualMemUsed, virtualMemUsedByMe, + totalPhysMem, physMemUsed, physMemUsedByMe); + + p.defaultValues["Timeline/Thumbnails"] = 1; p.defaultValues["Timeline/StopOnScrub"] = 0; - p.defaultValues["Cache/GBytes"] = 0; + p.defaultValues["Cache/GBytes"] = totalPhysMem / 2; p.defaultValues["Cache/ReadAhead"] = timeline::PlayerCacheOptions().readAhead.value(); p.defaultValues["Cache/ReadBehind"] = From 03545aaae8cead0349395204bf550427227bece9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gonzalo=20Garramu=C3=B1o?= Date: Thu, 30 Mar 2023 21:22:35 -0300 Subject: [PATCH 15/26] Added more system libs not to distribute. --- cmake/functions.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/functions.cmake b/cmake/functions.cmake index bd81adb36..348b555db 100644 --- a/cmake/functions.cmake +++ b/cmake/functions.cmake @@ -63,12 +63,12 @@ function( is_system_lib TARGET ISSYSLIB ) # # List of libraries that are accepted to distribute # - set( _acceptedlibs libmd libcairo libcap libcrypto ) + set( _acceptedlibs libmd libcairo libcap ) # # List of system libraries that should not be distributed # - set( _syslibs libOpenGL libGL libEGL libGLdispatch libGLX libX nvidia libdrm2 libpthread libresolv libm librt libdl libxcb libasound libgpg-error libfontconfig libfreetype libxshmfence libc libstdc libgcc_s libselinux ld-linux ) + set( _syslibs ld-linux libasound libc libcrypto libdl libharfbuzz libfontconfig libfreetype libgcc_s libgpg-error libEGL libGL libGLdispatch libGLX libX nvidia libdrm2 libpthread libresolv libm libOpenGL libpulse libpulse-simple librt libselinux libxcb libxshmfence libstdc libz ) set( ${ISSYSLIB} 0 PARENT_SCOPE) From 7d6b9e6a252465d145296153d6d3fada06060130 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gonzalo=20Garramu=C3=B1o?= Date: Thu, 30 Mar 2023 22:20:40 -0300 Subject: [PATCH 16/26] Made Gbytes setting start at half the memory by default. --- mrv2/lib/mrvApp/mrvSettingsObject.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/mrv2/lib/mrvApp/mrvSettingsObject.cpp b/mrv2/lib/mrvApp/mrvSettingsObject.cpp index 86629f05e..2a69d13b8 100644 --- a/mrv2/lib/mrvApp/mrvSettingsObject.cpp +++ b/mrv2/lib/mrvApp/mrvSettingsObject.cpp @@ -10,6 +10,8 @@ #include #include +#include "mrvCore/mrvMemory.h" + #include "mrvFl/mrvIO.h" #include "mrvApp/mrvSettingsObject.h" @@ -35,9 +37,19 @@ namespace mrv { TLRENDER_P(); + uint64_t totalVirtualMem = 0; + uint64_t virtualMemUsed = 0; + uint64_t virtualMemUsedByMe = 0; + uint64_t totalPhysMem = 0; + uint64_t physMemUsed = 0; + uint64_t physMemUsedByMe = 0; + memory_information( + totalVirtualMem, virtualMemUsed, virtualMemUsedByMe, totalPhysMem, + physMemUsed, physMemUsedByMe); + p.defaultValues["Timeline/Thumbnails"] = 1; p.defaultValues["Timeline/StopOnScrub"] = 0; - p.defaultValues["Cache/GBytes"] = 0; + p.defaultValues["Cache/GBytes"] = totalPhysMem / 2; p.defaultValues["Cache/ReadAhead"] = timeline::PlayerCacheOptions().readAhead.value(); p.defaultValues["Cache/ReadBehind"] = From 60d35b24dd85c9d4b6402940814349bb578c8ca8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gonzalo=20Garramu=C3=B1o?= Date: Thu, 30 Mar 2023 22:27:02 -0300 Subject: [PATCH 17/26] Fixed function call parameter's tabulation. --- mrv2/lib/mrvApp/mrvSettingsObject.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mrv2/lib/mrvApp/mrvSettingsObject.cpp b/mrv2/lib/mrvApp/mrvSettingsObject.cpp index d9ab719cf..2a69d13b8 100644 --- a/mrv2/lib/mrvApp/mrvSettingsObject.cpp +++ b/mrv2/lib/mrvApp/mrvSettingsObject.cpp @@ -44,9 +44,9 @@ namespace mrv uint64_t physMemUsed = 0; uint64_t physMemUsedByMe = 0; memory_information( - totalVirtualMem, virtualMemUsed, virtualMemUsedByMe, - totalPhysMem, physMemUsed, physMemUsedByMe); - + totalVirtualMem, virtualMemUsed, virtualMemUsedByMe, totalPhysMem, + physMemUsed, physMemUsedByMe); + p.defaultValues["Timeline/Thumbnails"] = 1; p.defaultValues["Timeline/StopOnScrub"] = 0; p.defaultValues["Cache/GBytes"] = totalPhysMem / 2; From 2ea8c78b27dbbf050da76dca5be5b61670d188f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gonzalo=20Garramu=C3=B1o?= Date: Thu, 30 Mar 2023 22:52:43 -0300 Subject: [PATCH 18/26] Fixes to distrubuted libraries. --- cmake/functions.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/functions.cmake b/cmake/functions.cmake index 348b555db..c283131f3 100644 --- a/cmake/functions.cmake +++ b/cmake/functions.cmake @@ -63,12 +63,12 @@ function( is_system_lib TARGET ISSYSLIB ) # # List of libraries that are accepted to distribute # - set( _acceptedlibs libmd libcairo libcap ) + set( _acceptedlibs libmd libcairo libcap libcrypto ) # # List of system libraries that should not be distributed # - set( _syslibs ld-linux libasound libc libcrypto libdl libharfbuzz libfontconfig libfreetype libgcc_s libgpg-error libEGL libGL libGLdispatch libGLX libX nvidia libdrm2 libpthread libresolv libm libOpenGL libpulse libpulse-simple librt libselinux libxcb libxshmfence libstdc libz ) + set( _syslibs ld-linux libasound libc libdl libharfbuzz libfontconfig libfreetype libgcc_s libgpg-error libEGL libGL libGLdispatch libGLX libX nvidia libdrm2 libpthread libresolv libm libOpenGL libpulse libpulse-simple librt libselinux libxcb libxshmfence libstdc libz ) set( ${ISSYSLIB} 0 PARENT_SCOPE) From 264f1c017b7f49452e8e5f7c71b00cd9ea99dcc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gonzalo=20Garramu=C3=B1o?= Date: Thu, 30 Mar 2023 23:14:25 -0300 Subject: [PATCH 19/26] Fixed memory use on first use. --- mrv2/lib/mrvApp/mrvSettingsObject.cpp | 3 ++- mrv2/lib/mrvPanels/mrvSettingsPanel.cpp | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mrv2/lib/mrvApp/mrvSettingsObject.cpp b/mrv2/lib/mrvApp/mrvSettingsObject.cpp index 2a69d13b8..2caaa7c62 100644 --- a/mrv2/lib/mrvApp/mrvSettingsObject.cpp +++ b/mrv2/lib/mrvApp/mrvSettingsObject.cpp @@ -46,10 +46,11 @@ namespace mrv memory_information( totalVirtualMem, virtualMemUsed, virtualMemUsedByMe, totalPhysMem, physMemUsed, physMemUsedByMe); + totalPhysMem /= 1024; p.defaultValues["Timeline/Thumbnails"] = 1; p.defaultValues["Timeline/StopOnScrub"] = 0; - p.defaultValues["Cache/GBytes"] = totalPhysMem / 2; + p.defaultValues["Cache/GBytes"] = static_cast(totalPhysMem / 2); p.defaultValues["Cache/ReadAhead"] = timeline::PlayerCacheOptions().readAhead.value(); p.defaultValues["Cache/ReadBehind"] = diff --git a/mrv2/lib/mrvPanels/mrvSettingsPanel.cpp b/mrv2/lib/mrvPanels/mrvSettingsPanel.cpp index eef6fb33d..fe06ecd11 100644 --- a/mrv2/lib/mrvPanels/mrvSettingsPanel.cpp +++ b/mrv2/lib/mrvPanels/mrvSettingsPanel.cpp @@ -74,7 +74,6 @@ namespace mrv physMemUsed, physMemUsedByMe); totalPhysMem /= 1024; - totalPhysMem *= 2; auto sV = new Widget< HorSlider >( g->x(), 90, g->w(), 20, _(" Gigabytes")); From 16541afc69c0f834a85b8546d7b9401ba5c3c6e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gonzalo=20Garramu=C3=B1o?= Date: Thu, 30 Mar 2023 23:30:51 -0300 Subject: [PATCH 20/26] Added clean to runme.sh script on Windows. --- .github/workflows/ci-workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-workflow.yml b/.github/workflows/ci-workflow.yml index f7b5e7743..8eb86f1d1 100644 --- a/.github/workflows/ci-workflow.yml +++ b/.github/workflows/ci-workflow.yml @@ -121,7 +121,7 @@ jobs: - name: Build mrv2 run: > - ./runme.sh -v + ./runme.sh -v clean From e45b4f85bbeb757639d78b72c2d7694dde41e1b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gonzalo=20Garramu=C3=B1o?= Date: Fri, 31 Mar 2023 07:42:31 -0300 Subject: [PATCH 21/26] Fixed channel switching. --- cmake/version.cmake | 2 +- mrv2/docs/HISTORY.md | 8 ++ mrv2/lib/mrvCore/mrvHotkey.cpp | 7 +- mrv2/lib/mrvCore/mrvHotkey.h | 5 +- mrv2/lib/mrvFl/mrvCallbacks.cpp | 100 ++++++++++++-------- mrv2/lib/mrvFl/mrvCallbacks.h | 2 + mrv2/lib/mrvFl/mrvMenus.cpp | 16 +++- mrv2/lib/mrvGL/mrvGLViewport.cpp | 2 +- mrv2/lib/mrvGL/mrvTimelineViewport.cpp | 35 ++----- mrv2/lib/mrvGL/mrvTimelineViewport.h | 14 ++- mrv2/lib/mrvGL/mrvTimelineViewportPrivate.h | 3 + 11 files changed, 116 insertions(+), 78 deletions(-) diff --git a/cmake/version.cmake b/cmake/version.cmake index 3018c6a48..605a7066c 100644 --- a/cmake/version.cmake +++ b/cmake/version.cmake @@ -5,7 +5,7 @@ set( mrv2_VERSION_MAJOR 0 ) set( mrv2_VERSION_MINOR 3 ) -set( mrv2_VERSION_PATCH 8 ) +set( mrv2_VERSION_PATCH 9 ) set( mrv2_VERSION "${mrv2_VERSION_MAJOR}.${mrv2_VERSION_MINOR}.${mrv2_VERSION_PATCH}" ) diff --git a/mrv2/docs/HISTORY.md b/mrv2/docs/HISTORY.md index 89257aaea..bd2b6fc46 100644 --- a/mrv2/docs/HISTORY.md +++ b/mrv2/docs/HISTORY.md @@ -1,3 +1,9 @@ +v0.3.9 +------ +- Added a Render->Black Background option to quickly switch from a gray + background to a black background on imaeges or movies that have an alpha + channel. + v0.3.8 ------ - Changed language handling in preferences. Now the locale code is stored. @@ -24,6 +30,8 @@ v0.3.8 - Added number of Cache Ahead and Behind Video and Audio frames to HUD. If Ahead Video cache becomes 0 when playing forwards, playback will stop. - Fixed Text tool input on Wayland. +- Removed libharfbuzz from the Linux distribution as it was causing trouble + with some newer Linux distros. v0.3.7 ------ diff --git a/mrv2/lib/mrvCore/mrvHotkey.cpp b/mrv2/lib/mrvCore/mrvHotkey.cpp index 1e82ca338..31a302f74 100644 --- a/mrv2/lib/mrvCore/mrvHotkey.cpp +++ b/mrv2/lib/mrvCore/mrvHotkey.cpp @@ -48,6 +48,8 @@ namespace mrv Hotkey kToggleOnePanelOnly(false, false, false, false, 'p'); + Hotkey kToggleBlackBackground(false, false, false, false, 0); + Hotkey kFitScreen(false, false, false, false, 'f'); Hotkey kResizeMainWindow(false, false, false, true, 'w'); Hotkey kFitAll(false, false, false, false, 0); @@ -127,8 +129,8 @@ namespace mrv Hotkey kCircleMode(false, false, false, true, 'c'); Hotkey kTextMode(false, false, false, true, 't'); - Hotkey kPenSizeMore(false, false, false, false, 0, "]"); - Hotkey kPenSizeLess(false, false, false, false, 0, "["); + Hotkey kPenSizeMore(false, false, false, false, 0, "+"); + Hotkey kPenSizeLess(false, false, false, false, 0, "-"); Hotkey kUndoDraw(false, true, false, false, 'z'); Hotkey kRedoDraw(false, true, false, true, 'z'); @@ -385,6 +387,7 @@ namespace mrv HotkeyEntry(_("Gamma Less"), kGammaLess), HotkeyEntry(_("Set In Point"), kSetInPoint), HotkeyEntry(_("Set Out Point"), kSetOutPoint), + HotkeyEntry(_("Toggle Black Background"), kToggleBlackBackground, true), HotkeyEntry(_("Toggle One Panel Only"), kToggleOnePanelOnly), HotkeyEntry(_("Toggle Files Panel"), kToggleReel), HotkeyEntry(_("Toggle Media Info Panel"), kToggleMediaInfo), diff --git a/mrv2/lib/mrvCore/mrvHotkey.h b/mrv2/lib/mrvCore/mrvHotkey.h index 21960e371..305042f87 100644 --- a/mrv2/lib/mrvCore/mrvHotkey.h +++ b/mrv2/lib/mrvCore/mrvHotkey.h @@ -114,11 +114,14 @@ namespace mrv extern Hotkey kFitAll; extern Hotkey kTextureFiltering; - // @todo: extern Hotkey kSafeAreas; + + // @todo: extern Hotkey kDisplayWindow; extern Hotkey kDataWindow; + extern Hotkey kToggleBlackBackground; + extern Hotkey kCompareWipe; extern Hotkey kCompareOverlay; extern Hotkey kCompareDifference; diff --git a/mrv2/lib/mrvFl/mrvCallbacks.cpp b/mrv2/lib/mrvFl/mrvCallbacks.cpp index a77a8ea3b..a9ecc701b 100644 --- a/mrv2/lib/mrvFl/mrvCallbacks.cpp +++ b/mrv2/lib/mrvFl/mrvCallbacks.cpp @@ -324,53 +324,50 @@ namespace mrv ui->uiView->redraw(); } - static void toggle_channel( - Fl_Menu_Item* item, ViewerUI* ui, const timeline::Channels channel) + static void toggle_channel(ViewerUI* ui, const timeline::Channels channel) { - timeline::DisplayOptions o = ui->app->displayOptions(); + App* app = ui->app; + timeline::DisplayOptions o = app->displayOptions(); if (o.channels == channel) - item->uncheck(); - - ui->uiView->toggleDisplayChannel(channel); + { + o.channels = timeline::Channels::Color; + } + else + { + o.channels = channel; + } + app->setDisplayOptions(o); + ui->uiMain->fill_menu(ui->uiMenuBar); } void toggle_red_channel_cb(Fl_Menu_* w, ViewerUI* ui) { - Fl_Menu_Item* item = const_cast< Fl_Menu_Item* >(w->mvalue()); const timeline::Channels channel = timeline::Channels::Red; - toggle_channel(item, ui, channel); - ui->uiMain->fill_menu(ui->uiMenuBar); + toggle_channel(ui, channel); } void toggle_green_channel_cb(Fl_Menu_* w, ViewerUI* ui) { - Fl_Menu_Item* item = const_cast< Fl_Menu_Item* >(w->mvalue()); const timeline::Channels channel = timeline::Channels::Green; - toggle_channel(item, ui, channel); - ui->uiMain->fill_menu(ui->uiMenuBar); + toggle_channel(ui, channel); } void toggle_blue_channel_cb(Fl_Menu_* w, ViewerUI* ui) { - Fl_Menu_Item* item = const_cast< Fl_Menu_Item* >(w->mvalue()); const timeline::Channels channel = timeline::Channels::Blue; - toggle_channel(item, ui, channel); - ui->uiMain->fill_menu(ui->uiMenuBar); + toggle_channel(ui, channel); } void toggle_alpha_channel_cb(Fl_Menu_* w, ViewerUI* ui) { - Fl_Menu_Item* item = const_cast< Fl_Menu_Item* >(w->mvalue()); const timeline::Channels channel = timeline::Channels::Alpha; - toggle_channel(item, ui, channel); - ui->uiMain->fill_menu(ui->uiMenuBar); + toggle_channel(ui, channel); } void toggle_color_channel_cb(Fl_Menu_* w, ViewerUI* ui) { const timeline::Channels channel = timeline::Channels::Color; - ui->uiView->toggleDisplayChannel(channel); - ui->uiMain->fill_menu(ui->uiMenuBar); + toggle_channel(ui, channel); } void toggle_fullscreen_cb(Fl_Menu_* m, ViewerUI* ui) @@ -425,13 +422,23 @@ namespace mrv } else { - view->setContext(ui->app->getContext()); + App* app = ui->app; + view->setContext(app->getContext()); view->setColorConfigOptions(ui->uiView->getColorConfigOptions()); - view->setLUTOptions(ui->uiView->lutOptions()); - view->setImageOptions(ui->uiView->getImageOptions()); - view->setDisplayOptions(ui->uiView->getDisplayOptions()); - view->setCompareOptions(ui->uiView->getCompareOptions()); - view->setTimelinePlayers(ui->uiView->getTimelinePlayers(), false); + view->setLUTOptions(app->lutOptions()); + std::vector< timeline::ImageOptions > imageOptions; + std::vector< timeline::DisplayOptions > displayOptions; + const auto& players = ui->uiView->getTimelinePlayers(); + for ( const auto &p : players ) + { + imageOptions.push_back( app->imageOptions() ); + displayOptions.push_back( app->displayOptions() ); + } + view->setImageOptions(imageOptions); + view->setDisplayOptions(displayOptions); + auto model = app->filesModel(); + view->setCompareOptions(model->observeCompareOptions()->get()); + view->setTimelinePlayers( players, false); window->show(); view->frameView(); } @@ -894,44 +901,50 @@ namespace mrv void video_levels_from_file_cb(Fl_Menu_*, ViewerUI* ui) { - timeline::ImageOptions& o = ui->uiView->getImageOptions(-1); + App* app = ui->app; + timeline::ImageOptions o = app->imageOptions(); o.videoLevels = timeline::InputVideoLevels::FromFile; - ui->uiView->redraw(); + app->setImageOptions( o ); } void video_levels_legal_range_cb(Fl_Menu_*, ViewerUI* ui) { - timeline::ImageOptions& o = ui->uiView->getImageOptions(-1); + App* app = ui->app; + timeline::ImageOptions o = app->imageOptions(); o.videoLevels = timeline::InputVideoLevels::LegalRange; - ui->uiView->redraw(); + app->setImageOptions( o ); } void video_levels_full_range_cb(Fl_Menu_*, ViewerUI* ui) { - timeline::ImageOptions& o = ui->uiView->getImageOptions(-1); + App* app = ui->app; + timeline::ImageOptions o = app->imageOptions(); o.videoLevels = timeline::InputVideoLevels::FullRange; - ui->uiView->redraw(); + app->setImageOptions( o ); } void alpha_blend_none_cb(Fl_Menu_*, ViewerUI* ui) { - timeline::ImageOptions& o = ui->uiView->getImageOptions(-1); + App* app = ui->app; + timeline::ImageOptions o = app->imageOptions(); o.alphaBlend = timeline::AlphaBlend::None; - ui->uiView->redraw(); + app->setImageOptions( o ); } void alpha_blend_straight_cb(Fl_Menu_*, ViewerUI* ui) { - timeline::ImageOptions& o = ui->uiView->getImageOptions(-1); + App* app = ui->app; + timeline::ImageOptions o = app->imageOptions(); o.alphaBlend = timeline::AlphaBlend::Straight; - ui->uiView->redraw(); + app->setImageOptions( o ); } void alpha_blend_premultiplied_cb(Fl_Menu_*, ViewerUI* ui) { - timeline::ImageOptions& o = ui->uiView->getImageOptions(-1); + App* app = ui->app; + timeline::ImageOptions o = app->imageOptions(); o.alphaBlend = timeline::AlphaBlend::Premultiplied; - ui->uiView->redraw(); + app->setImageOptions( o ); } void start_frame_cb(Fl_Menu_*, ViewerUI* ui) @@ -1190,5 +1203,14 @@ namespace mrv "file://" + mrv::rootpath() + "/docs/" + code + "/index.html"; fl_open_uri(docs.c_str()); } - + + void toggle_black_background_cb(Fl_Menu_* m, ViewerUI* ui) + { + bool value = true; + const Fl_Menu_Item* item = m->mvalue(); + if (!item->checked()) + value = false; + ui->uiView->setBlackBackground(value); + } + } // namespace mrv diff --git a/mrv2/lib/mrvFl/mrvCallbacks.h b/mrv2/lib/mrvFl/mrvCallbacks.h index 2daffee70..60b8a9278 100644 --- a/mrv2/lib/mrvFl/mrvCallbacks.h +++ b/mrv2/lib/mrvFl/mrvCallbacks.h @@ -165,4 +165,6 @@ namespace mrv void help_documentation_cb(Fl_Menu_*, ViewerUI* ui); + void toggle_black_background_cb(Fl_Menu_* m, ViewerUI* ui); + } // namespace mrv diff --git a/mrv2/lib/mrvFl/mrvMenus.cpp b/mrv2/lib/mrvFl/mrvMenus.cpp index 139450612..ba36c64db 100644 --- a/mrv2/lib/mrvFl/mrvMenus.cpp +++ b/mrv2/lib/mrvFl/mrvMenus.cpp @@ -441,7 +441,8 @@ namespace mrv const timeline::DisplayOptions& d = ui->app->displayOptions(); const timeline::ImageOptions& o = ui->uiView->getImageOptions(-1); - + const bool blackBackground = ui->uiView->getBlackBackground(); + mode = FL_MENU_RADIO; if (numFiles == 0) mode |= FL_MENU_INACTIVE; @@ -511,6 +512,18 @@ namespace mrv if (numFiles == 0) mode |= FL_MENU_INACTIVE; + mode = FL_MENU_TOGGLE; + if (numFiles == 0) + mode |= FL_MENU_INACTIVE; + + idx = menu->add( + _("Render/Black Background "), kToggleBlackBackground.hotkey(), + (Fl_Callback*)toggle_black_background_cb, ui, + FL_MENU_DIVIDER | mode); + item = (Fl_Menu_Item*)&(menu->menu()[idx]); + if (blackBackground) + item->set(); + idx = menu->add( _("Render/Video Levels/From File"), 0, (Fl_Callback*)video_levels_from_file_cb, ui, mode); @@ -537,6 +550,7 @@ namespace mrv if (numFiles == 0) mode |= FL_MENU_INACTIVE; + idx = menu->add( _("Render/Alpha Blend/None"), 0, (Fl_Callback*)alpha_blend_none_cb, ui, mode); diff --git a/mrv2/lib/mrvGL/mrvGLViewport.cpp b/mrv2/lib/mrvGL/mrvGLViewport.cpp index 13877ee39..ffbe735d1 100644 --- a/mrv2/lib/mrvGL/mrvGLViewport.cpp +++ b/mrv2/lib/mrvGL/mrvGLViewport.cpp @@ -349,7 +349,7 @@ namespace mrv glViewport(0, 0, GLsizei(viewportSize.w), GLsizei(viewportSize.h)); float r, g, b, a = 1.0f; - if (!p.presentation) + if (!p.presentation && !p.blackBackground) { uint8_t ur, ug, ub; Fl::get_color(p.ui->uiPrefs->uiPrefsViewBG->color(), ur, ug, ub); diff --git a/mrv2/lib/mrvGL/mrvTimelineViewport.cpp b/mrv2/lib/mrvGL/mrvTimelineViewport.cpp index 13b370458..4cd79019f 100644 --- a/mrv2/lib/mrvGL/mrvTimelineViewport.cpp +++ b/mrv2/lib/mrvGL/mrvTimelineViewport.cpp @@ -50,6 +50,7 @@ namespace mrv otio::RationalTime TimelineViewport::Private::lastTime; uint64_t TimelineViewport::Private::skippedFrames = 0; bool TimelineViewport::Private::safeAreas = false; + bool TimelineViewport::Private::blackBackground = false; std::string TimelineViewport::Private::helpText; float TimelineViewport::Private::helpTextFade; bool TimelineViewport::Private::hudActive = true; @@ -416,12 +417,6 @@ namespace mrv redraw(); } - const timeline::CompareOptions& - TimelineViewport::getCompareOptions() noexcept - { - return _p->compareOptions; - } - void TimelineViewport::setCompareOptions( const timeline::CompareOptions& value) noexcept { @@ -1446,28 +1441,18 @@ namespace mrv redraw(); Fl::flush(); // force the redraw } - - void TimelineViewport::toggleDisplayChannel( - const timeline::Channels& channel, int idx) noexcept + + bool TimelineViewport::getBlackBackground() const noexcept { - TLRENDER_P(); - timeline::DisplayOptions d; - if (idx < 0) - d = p.displayOptions[0]; - else - d = p.displayOptions[idx]; - if (d.channels == channel) - { - d.channels = timeline::Channels::Color; - } - else - { - d.channels = channel; - } - _updateDisplayOptions(idx, d); - redraw(); + return _p->blackBackground; } + void TimelineViewport::setBlackBackground(bool active) noexcept + { + _p->blackBackground = active; + redrawWindows(); + } + bool TimelineViewport::getPresentationMode() const noexcept { return _p->presentation; diff --git a/mrv2/lib/mrvGL/mrvTimelineViewport.h b/mrv2/lib/mrvGL/mrvTimelineViewport.h index c96b75987..3871646f7 100644 --- a/mrv2/lib/mrvGL/mrvTimelineViewport.h +++ b/mrv2/lib/mrvGL/mrvTimelineViewport.h @@ -126,9 +126,6 @@ namespace mrv //! Get the display options. std::vector< timeline::DisplayOptions >& getDisplayOptions() noexcept; - //! Get the comparison options. - const timeline::CompareOptions& getCompareOptions() noexcept; - //! Set the comparison options. void setCompareOptions(const timeline::CompareOptions&) noexcept; @@ -258,17 +255,18 @@ namespace mrv //! This signal is emitted when the view is framed. void frameViewActivated() noexcept; - //! Toggle a display channel between it and the color channel - //! in a timeline or in all timelines if idx = -1. - void - toggleDisplayChannel(const timeline::Channels&, int idx = -1) noexcept; - //! Set or unset the window to full screen and hide/show all bars. void setPresentationMode(bool active = true) noexcept; //! Get the window to full screen and hide/show all bars. bool getPresentationMode() const noexcept; + //! Get the compositing status. + bool getBlackBackground() const noexcept; + + //! Set the compositing status. + void setBlackBackground( bool active ) noexcept; + //! Set or unset the window to full screen but don't hide any bars. void setFullScreenMode(bool active = true) noexcept; diff --git a/mrv2/lib/mrvGL/mrvTimelineViewportPrivate.h b/mrv2/lib/mrvGL/mrvTimelineViewportPrivate.h index b532c4d7e..dd642830f 100644 --- a/mrv2/lib/mrvGL/mrvTimelineViewportPrivate.h +++ b/mrv2/lib/mrvGL/mrvTimelineViewportPrivate.h @@ -55,6 +55,9 @@ namespace mrv std::shared_ptr fontSystem; Fl_Menu_Button* popupMenu = nullptr; + //! Compositing switch (render on black or on background color) + static bool blackBackground; + //! Temporary help text displayed in HUD static std::string helpText; static float helpTextFade; From 7376d0aa0442114a1440dda1e856ea964b135f3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gonzalo=20Garramu=C3=B1o?= Date: Fri, 31 Mar 2023 07:43:18 -0300 Subject: [PATCH 22/26] Went back to version v0.3.8 in cmake/version.cmake. --- cmake/version.cmake | 2 +- mrv2/lib/mrvCore/mrvHotkey.cpp | 2 +- mrv2/lib/mrvCore/mrvHotkey.h | 2 +- mrv2/lib/mrvFl/mrvCallbacks.cpp | 26 ++++++++++----------- mrv2/lib/mrvFl/mrvCallbacks.h | 2 +- mrv2/lib/mrvFl/mrvMenus.cpp | 7 +++--- mrv2/lib/mrvGL/mrvTimelineViewport.cpp | 4 ++-- mrv2/lib/mrvGL/mrvTimelineViewport.h | 6 ++--- mrv2/lib/mrvGL/mrvTimelineViewportPrivate.h | 6 ++--- 9 files changed, 28 insertions(+), 29 deletions(-) diff --git a/cmake/version.cmake b/cmake/version.cmake index 605a7066c..3018c6a48 100644 --- a/cmake/version.cmake +++ b/cmake/version.cmake @@ -5,7 +5,7 @@ set( mrv2_VERSION_MAJOR 0 ) set( mrv2_VERSION_MINOR 3 ) -set( mrv2_VERSION_PATCH 9 ) +set( mrv2_VERSION_PATCH 8 ) set( mrv2_VERSION "${mrv2_VERSION_MAJOR}.${mrv2_VERSION_MINOR}.${mrv2_VERSION_PATCH}" ) diff --git a/mrv2/lib/mrvCore/mrvHotkey.cpp b/mrv2/lib/mrvCore/mrvHotkey.cpp index 31a302f74..ac891df68 100644 --- a/mrv2/lib/mrvCore/mrvHotkey.cpp +++ b/mrv2/lib/mrvCore/mrvHotkey.cpp @@ -49,7 +49,7 @@ namespace mrv Hotkey kToggleOnePanelOnly(false, false, false, false, 'p'); Hotkey kToggleBlackBackground(false, false, false, false, 0); - + Hotkey kFitScreen(false, false, false, false, 'f'); Hotkey kResizeMainWindow(false, false, false, true, 'w'); Hotkey kFitAll(false, false, false, false, 0); diff --git a/mrv2/lib/mrvCore/mrvHotkey.h b/mrv2/lib/mrvCore/mrvHotkey.h index 305042f87..1174b5f33 100644 --- a/mrv2/lib/mrvCore/mrvHotkey.h +++ b/mrv2/lib/mrvCore/mrvHotkey.h @@ -121,7 +121,7 @@ namespace mrv extern Hotkey kDataWindow; extern Hotkey kToggleBlackBackground; - + extern Hotkey kCompareWipe; extern Hotkey kCompareOverlay; extern Hotkey kCompareDifference; diff --git a/mrv2/lib/mrvFl/mrvCallbacks.cpp b/mrv2/lib/mrvFl/mrvCallbacks.cpp index a9ecc701b..0c2279043 100644 --- a/mrv2/lib/mrvFl/mrvCallbacks.cpp +++ b/mrv2/lib/mrvFl/mrvCallbacks.cpp @@ -334,7 +334,7 @@ namespace mrv } else { - o.channels = channel; + o.channels = channel; } app->setDisplayOptions(o); ui->uiMain->fill_menu(ui->uiMenuBar); @@ -429,16 +429,16 @@ namespace mrv std::vector< timeline::ImageOptions > imageOptions; std::vector< timeline::DisplayOptions > displayOptions; const auto& players = ui->uiView->getTimelinePlayers(); - for ( const auto &p : players ) + for (const auto& p : players) { - imageOptions.push_back( app->imageOptions() ); - displayOptions.push_back( app->displayOptions() ); + imageOptions.push_back(app->imageOptions()); + displayOptions.push_back(app->displayOptions()); } view->setImageOptions(imageOptions); view->setDisplayOptions(displayOptions); auto model = app->filesModel(); view->setCompareOptions(model->observeCompareOptions()->get()); - view->setTimelinePlayers( players, false); + view->setTimelinePlayers(players, false); window->show(); view->frameView(); } @@ -904,7 +904,7 @@ namespace mrv App* app = ui->app; timeline::ImageOptions o = app->imageOptions(); o.videoLevels = timeline::InputVideoLevels::FromFile; - app->setImageOptions( o ); + app->setImageOptions(o); } void video_levels_legal_range_cb(Fl_Menu_*, ViewerUI* ui) @@ -912,7 +912,7 @@ namespace mrv App* app = ui->app; timeline::ImageOptions o = app->imageOptions(); o.videoLevels = timeline::InputVideoLevels::LegalRange; - app->setImageOptions( o ); + app->setImageOptions(o); } void video_levels_full_range_cb(Fl_Menu_*, ViewerUI* ui) @@ -920,7 +920,7 @@ namespace mrv App* app = ui->app; timeline::ImageOptions o = app->imageOptions(); o.videoLevels = timeline::InputVideoLevels::FullRange; - app->setImageOptions( o ); + app->setImageOptions(o); } void alpha_blend_none_cb(Fl_Menu_*, ViewerUI* ui) @@ -928,7 +928,7 @@ namespace mrv App* app = ui->app; timeline::ImageOptions o = app->imageOptions(); o.alphaBlend = timeline::AlphaBlend::None; - app->setImageOptions( o ); + app->setImageOptions(o); } void alpha_blend_straight_cb(Fl_Menu_*, ViewerUI* ui) @@ -936,7 +936,7 @@ namespace mrv App* app = ui->app; timeline::ImageOptions o = app->imageOptions(); o.alphaBlend = timeline::AlphaBlend::Straight; - app->setImageOptions( o ); + app->setImageOptions(o); } void alpha_blend_premultiplied_cb(Fl_Menu_*, ViewerUI* ui) @@ -944,7 +944,7 @@ namespace mrv App* app = ui->app; timeline::ImageOptions o = app->imageOptions(); o.alphaBlend = timeline::AlphaBlend::Premultiplied; - app->setImageOptions( o ); + app->setImageOptions(o); } void start_frame_cb(Fl_Menu_*, ViewerUI* ui) @@ -1203,7 +1203,7 @@ namespace mrv "file://" + mrv::rootpath() + "/docs/" + code + "/index.html"; fl_open_uri(docs.c_str()); } - + void toggle_black_background_cb(Fl_Menu_* m, ViewerUI* ui) { bool value = true; @@ -1212,5 +1212,5 @@ namespace mrv value = false; ui->uiView->setBlackBackground(value); } - + } // namespace mrv diff --git a/mrv2/lib/mrvFl/mrvCallbacks.h b/mrv2/lib/mrvFl/mrvCallbacks.h index 60b8a9278..30ec1e42b 100644 --- a/mrv2/lib/mrvFl/mrvCallbacks.h +++ b/mrv2/lib/mrvFl/mrvCallbacks.h @@ -166,5 +166,5 @@ namespace mrv void help_documentation_cb(Fl_Menu_*, ViewerUI* ui); void toggle_black_background_cb(Fl_Menu_* m, ViewerUI* ui); - + } // namespace mrv diff --git a/mrv2/lib/mrvFl/mrvMenus.cpp b/mrv2/lib/mrvFl/mrvMenus.cpp index ba36c64db..aef5c3102 100644 --- a/mrv2/lib/mrvFl/mrvMenus.cpp +++ b/mrv2/lib/mrvFl/mrvMenus.cpp @@ -442,7 +442,7 @@ namespace mrv const timeline::DisplayOptions& d = ui->app->displayOptions(); const timeline::ImageOptions& o = ui->uiView->getImageOptions(-1); const bool blackBackground = ui->uiView->getBlackBackground(); - + mode = FL_MENU_RADIO; if (numFiles == 0) mode |= FL_MENU_INACTIVE; @@ -515,7 +515,7 @@ namespace mrv mode = FL_MENU_TOGGLE; if (numFiles == 0) mode |= FL_MENU_INACTIVE; - + idx = menu->add( _("Render/Black Background "), kToggleBlackBackground.hotkey(), (Fl_Callback*)toggle_black_background_cb, ui, @@ -523,7 +523,7 @@ namespace mrv item = (Fl_Menu_Item*)&(menu->menu()[idx]); if (blackBackground) item->set(); - + idx = menu->add( _("Render/Video Levels/From File"), 0, (Fl_Callback*)video_levels_from_file_cb, ui, mode); @@ -550,7 +550,6 @@ namespace mrv if (numFiles == 0) mode |= FL_MENU_INACTIVE; - idx = menu->add( _("Render/Alpha Blend/None"), 0, (Fl_Callback*)alpha_blend_none_cb, ui, mode); diff --git a/mrv2/lib/mrvGL/mrvTimelineViewport.cpp b/mrv2/lib/mrvGL/mrvTimelineViewport.cpp index 4cd79019f..8bac5cca3 100644 --- a/mrv2/lib/mrvGL/mrvTimelineViewport.cpp +++ b/mrv2/lib/mrvGL/mrvTimelineViewport.cpp @@ -1441,7 +1441,7 @@ namespace mrv redraw(); Fl::flush(); // force the redraw } - + bool TimelineViewport::getBlackBackground() const noexcept { return _p->blackBackground; @@ -1452,7 +1452,7 @@ namespace mrv _p->blackBackground = active; redrawWindows(); } - + bool TimelineViewport::getPresentationMode() const noexcept { return _p->presentation; diff --git a/mrv2/lib/mrvGL/mrvTimelineViewport.h b/mrv2/lib/mrvGL/mrvTimelineViewport.h index 3871646f7..569056a07 100644 --- a/mrv2/lib/mrvGL/mrvTimelineViewport.h +++ b/mrv2/lib/mrvGL/mrvTimelineViewport.h @@ -263,10 +263,10 @@ namespace mrv //! Get the compositing status. bool getBlackBackground() const noexcept; - + //! Set the compositing status. - void setBlackBackground( bool active ) noexcept; - + void setBlackBackground(bool active) noexcept; + //! Set or unset the window to full screen but don't hide any bars. void setFullScreenMode(bool active = true) noexcept; diff --git a/mrv2/lib/mrvGL/mrvTimelineViewportPrivate.h b/mrv2/lib/mrvGL/mrvTimelineViewportPrivate.h index dd642830f..3f84e30ed 100644 --- a/mrv2/lib/mrvGL/mrvTimelineViewportPrivate.h +++ b/mrv2/lib/mrvGL/mrvTimelineViewportPrivate.h @@ -56,11 +56,11 @@ namespace mrv Fl_Menu_Button* popupMenu = nullptr; //! Compositing switch (render on black or on background color) - static bool blackBackground; - + static bool blackBackground; + //! Temporary help text displayed in HUD static std::string helpText; - static float helpTextFade; + static float helpTextFade; //! HUD display flags (ORed together) static bool hudActive; From 39bab3c37fd04f9784358c43fd504b136e95a4c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gonzalo=20Garramu=C3=B1o?= Date: Fri, 31 Mar 2023 08:04:15 -0300 Subject: [PATCH 23/26] Set stable branch for FLTK previous release. --- cmake/Modules/BuildFLTK.cmake | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cmake/Modules/BuildFLTK.cmake b/cmake/Modules/BuildFLTK.cmake index 58dbd005a..e33bb9c68 100644 --- a/cmake/Modules/BuildFLTK.cmake +++ b/cmake/Modules/BuildFLTK.cmake @@ -5,8 +5,8 @@ include( ExternalProject ) # Stable TAG -#set( FLTK_TAG 73a2ca5261ee7b0d0e33fc1e49611520d7b0e0cb ) -set( FLTK_TAG master ) +set( FLTK_TAG 64ac7b47b81549bce8911422209c81b77a9232ba ) +#set( FLTK_TAG master ) set( patch_cmd ) @@ -15,7 +15,7 @@ if (APPLE OR WIN32) set( wayland OFF ) set( pango OFF ) else() - set( wayland ON ) # we'll leave it off, but it is way too + set( wayland ON ) # we'll leave it on, but it is way too # buggy with, at least, Nvidia cards. set( pango ON ) endif() From 43c89e5f9db00e63fbbd2ed00c0d099768ffd04a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gonzalo=20Garramu=C3=B1o?= Date: Fri, 31 Mar 2023 08:20:29 -0300 Subject: [PATCH 24/26] Added running runme.sh -t package to simplify distribution. --- runme.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/runme.sh b/runme.sh index 87309a09a..cb8fed260 100755 --- a/runme.sh +++ b/runme.sh @@ -33,5 +33,9 @@ run_cmd $cmd cmd="./runmeq.sh ${CMAKE_BUILD_TYPE} -t install" run_cmd $cmd +if [[ $CMAKE_TARGET == "package" ]]; then + cmd="./runmeq.sh ${CMAKE_BUILD_TYPE} -t package" + run_cmd $cmd +fi . $PWD/etc/build_end.sh From 42d378166d2d8506717a6f125285fc0740f3e847 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gonzalo=20Garramu=C3=B1o?= Date: Fri, 31 Mar 2023 08:44:43 -0300 Subject: [PATCH 25/26] Updated trasnlations. --- mrv2/docs/HISTORY.md | 9 +++------ mrv2/po/es.po | 8 +++++++- mrv2/po/messages.pot | 10 ++++++++-- 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/mrv2/docs/HISTORY.md b/mrv2/docs/HISTORY.md index bd2b6fc46..32753a0d1 100644 --- a/mrv2/docs/HISTORY.md +++ b/mrv2/docs/HISTORY.md @@ -1,9 +1,3 @@ -v0.3.9 ------- -- Added a Render->Black Background option to quickly switch from a gray - background to a black background on imaeges or movies that have an alpha - channel. - v0.3.8 ------ - Changed language handling in preferences. Now the locale code is stored. @@ -32,6 +26,9 @@ v0.3.8 - Fixed Text tool input on Wayland. - Removed libharfbuzz from the Linux distribution as it was causing trouble with some newer Linux distros. +- Added a Render->Black Background option to quickly switch from a gray + background to a black background on images or movies that have an alpha + channel. v0.3.7 ------ diff --git a/mrv2/po/es.po b/mrv2/po/es.po index 1e71dc01a..4692d61e3 100644 --- a/mrv2/po/es.po +++ b/mrv2/po/es.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: mrv2 v0.3.3\n" "Report-Msgid-Bugs-To: ggarra13@gmail.com\n" -"POT-Creation-Date: 2023-03-30 14:05-0300\n" +"POT-Creation-Date: 2023-03-31 08:43-0300\n" "PO-Revision-Date: 2023-02-11 13:42-0300\n" "Last-Translator: Gonzalo Garramuño \n" "Language-Team: Spanish \n" @@ -2773,6 +2773,9 @@ msgstr "Render/Mezcla Alfa/Derecha" msgid "Render/Alpha Channel" msgstr "Render/Canal Alfa" +msgid "Render/Black Background " +msgstr "Render/Fondo Negro" + msgid "Render/Blue Channel" msgstr "Render/Canal Azul" @@ -3531,6 +3534,9 @@ msgstr "Alternar Ventana de Acerca de mrv2" msgid "Toggle Annotation Panel" msgstr "Alternar Panel de Anotación" +msgid "Toggle Black Background" +msgstr "Alternar Fondo Negro" + msgid "Toggle Color Area Info Panel" msgstr "Alternar Panel de Área de Color" diff --git a/mrv2/po/messages.pot b/mrv2/po/messages.pot index c844b1dd6..d1f5eac93 100644 --- a/mrv2/po/messages.pot +++ b/mrv2/po/messages.pot @@ -1,5 +1,5 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR Contributors\ to\ the\ mrv2\ Project +# Copyright (C) YEAR Contributors to the mrv2 Project # This file is distributed under the same license as the mrv2 package. # FIRST AUTHOR , YEAR. # @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: mrv2 v0.3.8\n" "Report-Msgid-Bugs-To: ggarra13@gmail.com\n" -"POT-Creation-Date: 2023-03-30 14:05-0300\n" +"POT-Creation-Date: 2023-03-31 08:43-0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -2523,6 +2523,9 @@ msgstr "" msgid "Render/Alpha Channel" msgstr "" +msgid "Render/Black Background " +msgstr "" + msgid "Render/Blue Channel" msgstr "" @@ -3216,6 +3219,9 @@ msgstr "" msgid "Toggle Annotation Panel" msgstr "" +msgid "Toggle Black Background" +msgstr "" + msgid "Toggle Color Area Info Panel" msgstr "" From 6e3aebcda1ab4984c06eadb617607a9f469c28a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gonzalo=20Garramu=C3=B1o?= Date: Fri, 31 Mar 2023 08:49:58 -0300 Subject: [PATCH 26/26] Fixed runmeq.sh script to run install after generation of .mo files when packaging. --- runmeq.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/runmeq.sh b/runmeq.sh index a9dfcfcd4..8d0278cf5 100755 --- a/runmeq.sh +++ b/runmeq.sh @@ -33,6 +33,10 @@ cd $dir if [[ $CMAKE_TARGET == "install" || $CMAKE_TARGET == "package" ]]; then cmake --build . $FLAGS --config $CMAKE_BUILD_TYPE -t mo + + if [[ $CMAKE_TARGET == "package" ]]; then + cmake --build . $FLAGS --config $CMAKE_BUILD_TYPE -t install + fi fi cmake --build . $FLAGS --config $CMAKE_BUILD_TYPE -t ${CMAKE_TARGET}