Skip to content

Commit

Permalink
Merge branch 'beta' of github.com:ggarra13/mrv2 into beta
Browse files Browse the repository at this point in the history
  • Loading branch information
ggarra13 committed May 6, 2024
2 parents 01be70d + 2a066e3 commit c874981
Show file tree
Hide file tree
Showing 6 changed files with 146 additions and 52 deletions.
83 changes: 83 additions & 0 deletions bin/runme_ffmpeg_exr.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: BSD-3-Clause
# mrv2
# Copyright Contributors to the mrv2 Project. All rights reserved.


#
#
# Small build script for mrv2. Run it from the root of the mrv2 dir, like:
#
# ./bin/runme_small.sh
#
# It builds all dependencies and will install
# the main executable on BUILD_DIR (by default
# BUILD-OS-ARCH/BUILD_TYPE/install/bin).
#
# The small build does not have Python, USD, PDF, NDI or NETWORK support.
# It is intended for solo artists.
#
#
# On Linux and macOS, it will also create a mrv2 or mrv2-dbg symbolic link
# in $HOME/bin if the directory exists.
#
# It will also log the compilation on $BUILD_DIR/compile.log
#


#
# Store the parameters for passing them later
#
params=$*

#
# Find out our build dir
#
. etc/build_dir.sh


#
# Clear the flags, as they will be set by runme_nolog.sh.
#
export FLAGS=""
export CMAKE_FLAGS=""

#
# Common flags
#
export BUILD_PYTHON=OFF

#
# These are some of the expensive mrv2 options
#
export BUILD_PYTHON=OFF
export MRV2_PYFLTK=OFF
export MRV2_PYBIND11=OFF
export MRV2_NETWORK=OFF
export MRV2_PDF=OFF

#
# These are some of the expensive TLRENDER options
#
export TLRENDER_AV1=OFF
export TLRENDER_FFMPEG=ON
export TLRENDER_FFMPEG_MINIMAL=ON
export TLRENDER_EXR=ON
export TLRENDER_JPEG=OFF
export TLRENDER_NDI=OFF
export TLRENDER_NET=OFF
export TLRENDER_RAW=OFF
export TLRENDER_SGI=OFF
export TLRENDER_STB=OFF
export TLRENDER_TIFF=OFF
export TLRENDER_USD=OFF
export TLRENDER_VPX=OFF
export TLRENDER_WAYLAND=ON
export TLRENDER_X11=ON
export TLRENDER_YASM=ON

echo
echo "Saving compile log to $BUILD_DIR/compile.log ..."
echo
cmd="./runme_nolog.sh --ask $params 2>&1 | tee $BUILD_DIR/compile.log"
run_cmd $cmd
6 changes: 5 additions & 1 deletion mrv2/docs/HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,15 @@ v1.1.6
default.
- Cleaned up source code of passing ui pointer to several classes, using
App::ui instead.
- Removed .po python plug-in files from distribution.
- Removed .po python plug-in files from package distribution.
- Improved missing_translate.py script and added searching for plug-in
translations too.
- Removed unused FLU XPM icons from the code, as most have been replaced by
.svg icons.
- Fixed Edit Viewport Clip Info and Device Info not respecting the device
pixel ratio when the Edit button was pressed.
- Fixed macOS crashes with preview thumbnail.
- Respect last configuration of Timeline/ClipInfo and Timeline/TrackInfo.


v1.1.5
Expand Down
12 changes: 6 additions & 6 deletions mrv2/lib/mrvEdit/mrvEditCallbacks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2276,8 +2276,9 @@ namespace mrv
int calculate_edit_viewport_size(ViewerUI* ui)
{
// Some constants, as Darby does not expose this in tlRender.
const int kTrackInfoHeight = 21;
const int kClipInfoHeight = 21;
const float pixels_unit = ui->uiTimeline->pixels_per_unit();
const int kTrackInfoHeight = 21 * pixels_unit;
const int kClipInfoHeight = 21 * pixels_unit;
const int kTransitionsHeight = 30;
const int kAudioGapOnlyHeight = 20;
const int kMarkerHeight = 24;
Expand Down Expand Up @@ -2425,7 +2426,7 @@ namespace mrv
{
if (ui->uiView->getPresentationMode())
return;

Fl_Button* b = ui->uiEdit;

bool active = (mode == EditMode::kFull || mode == EditMode::kSaved);
Expand All @@ -2452,8 +2453,7 @@ namespace mrv
int tileH = tile->h();
int H = kMinEditModeH; // timeline height
int viewH = H;
bool showTimeline = ui->uiMain->visible() &&
mode != EditMode::kNone;
bool showTimeline = ui->uiMain->visible() && mode != EditMode::kNone;
auto player = ui->uiView->getTimelinePlayer();
if (mode == EditMode::kFull && player)
{
Expand Down Expand Up @@ -2487,7 +2487,7 @@ namespace mrv

if (showTimeline)
ui->uiTimeline->show();

int newY = tileY + tileH - H;

view->resize(view->x(), view->y(), view->w(), tileH - viewH);
Expand Down
2 changes: 2 additions & 0 deletions mrv2/lib/mrvFl/mrvPreferences.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1571,6 +1571,8 @@ namespace mrv
break;
}
options.waveformHeight = options.thumbnailHeight / 2;
options.trackInfo = settings->getValue<int>("Timeline/TrackInfo");
options.clipInfo = settings->getValue<int>("Timeline/ClipInfo");
ui->uiTimeline->setItemOptions(options);

if (uiPrefs->uiPrefsTimeline->value())
Expand Down
85 changes: 43 additions & 42 deletions mrv2/lib/mrvGL/mrvTimelineWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ namespace mrv
!p.timelineWidget->isEditable())
{
p.timeRange = p.player->player()->getTimeRange();
auto time = _posToTime(X);
const auto& time = _posToTime(X);
p.player->seek(time);
return 1;
}
Expand Down Expand Up @@ -544,10 +544,12 @@ namespace mrv
_p->timelineWidget->setItemOptions(value);
}

void TimelineWidget::_initializeGLResources()
void TimelineWidget::_initializeGL()
{
TLRENDER_P();

gl::initGLAD();

if (auto context = p.context.lock())
{
try
Expand Down Expand Up @@ -592,39 +594,23 @@ namespace mrv
"mrv::mrvTimelineWidget", e.what(), log::Type::Error);
}

_sizeHintEvent();
p.vao.reset();
p.vbo.reset();
p.buffer.reset();
}
}

void TimelineWidget::_initializeGL()
{
gl::initGLAD();

CHECK_GL;
refresh();
CHECK_GL;

_initializeGLResources();
CHECK_GL;
}

void TimelineWidget::resize(int X, int Y, int W, int H)
{
TLRENDER_P();

Fl_Gl_Window::resize(X, Y, W, H);

const float devicePixelRatio = this->pixels_per_unit();
ui::SizeHintEvent sizeHintEvent(
p.style, p.iconLibrary, p.fontSystem, devicePixelRatio);
_sizeHintEvent(p.timelineWindow, sizeHintEvent);

const math::Box2i geometry(0, 0, _toUI(W), _toUI(H));
p.timelineWindow->setGeometry(geometry);
_setGeometry();

_clipEvent(p.timelineWindow, geometry, false);
_sizeHintEvent();
_clipEvent();

p.vbo.reset();
p.vao.reset();
Expand Down Expand Up @@ -1361,34 +1347,19 @@ namespace mrv
//! destruction?
if (_p)
{
ui::TickEvent tickEvent(p.style, p.iconLibrary, p.fontSystem);
_tickEvent(p.timelineWindow, true, true, tickEvent);
_tickEvent();

if (_getSizeUpdate(p.timelineWindow))
{
const float devicePixelRatio = this->pixels_per_unit();
ui::SizeHintEvent sizeHintEvent(
p.style, p.iconLibrary, p.fontSystem, devicePixelRatio);
_sizeHintEvent(p.timelineWindow, sizeHintEvent);

const math::Box2i geometry(0, 0, _toUI(w()), _toUI(h()));
p.timelineWindow->setGeometry(geometry);

_clipEvent(p.timelineWindow, geometry, false);
_sizeHintEvent();
_setGeometry();
_clipEvent();
// updateGeometry(); // Qt function?
}

if (_getDrawUpdate(p.timelineWindow))
{
#ifdef DEBUG_TIMELINE_CALLBACK
std::cerr << "R" << std::endl;
redraw();
#endif
}
else
{
#ifdef DEBUG_TIMELINE_CALLBACK
std::cerr << "." << std::endl;
#endif
}
}
Fl::repeat_timeout(kTimeout, (Fl_Timeout_Handler)timerEvent_cb, this);
Expand Down Expand Up @@ -1570,6 +1541,13 @@ namespace mrv
edit_move_clip_annotations(moves, p.ui);
}

void TimelineWidget::_tickEvent()
{
TLRENDER_P();
ui::TickEvent tickEvent(p.style, p.iconLibrary, p.fontSystem);
_tickEvent(_p->timelineWindow, true, true, tickEvent);
}

void TimelineWidget::_tickEvent(
const std::shared_ptr<ui::IWidget>& widget, bool visible, bool enabled,
const ui::TickEvent& event)
Expand Down Expand Up @@ -1603,6 +1581,15 @@ namespace mrv
return out;
}

void TimelineWidget::_sizeHintEvent()
{
TLRENDER_P();
const float devicePixelRatio = this->pixels_per_unit();
ui::SizeHintEvent sizeHintEvent(
p.style, p.iconLibrary, p.fontSystem, devicePixelRatio);
_sizeHintEvent(p.timelineWindow, sizeHintEvent);
}

void TimelineWidget::_sizeHintEvent(
const std::shared_ptr<ui::IWidget>& widget,
const ui::SizeHintEvent& event)
Expand All @@ -1614,6 +1601,20 @@ namespace mrv
widget->sizeHintEvent(event);
}

void TimelineWidget::_setGeometry()
{
TLRENDER_P();
const math::Box2i geometry(0, 0, _toUI(w()), _toUI(h()));
p.timelineWindow->setGeometry(geometry);
}

void TimelineWidget::_clipEvent()
{
TLRENDER_P();
const math::Box2i geometry(0, 0, _toUI(w()), _toUI(h()));
_clipEvent(p.timelineWindow, geometry, false);
}

void TimelineWidget::_clipEvent(
const std::shared_ptr<ui::IWidget>& widget, const math::Box2i& clipRect,
bool clipped)
Expand Down
10 changes: 7 additions & 3 deletions mrv2/lib/mrvGL/mrvTimelineWidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,6 @@ namespace mrv
void moveCallback(const std::vector<tl::timeline::MoveData>&);

protected:
void _initializeGL();
void _initializeGLResources();

int enterEvent();
int leaveEvent();
int mousePressEvent();
Expand All @@ -161,19 +158,26 @@ namespace mrv
void timerEvent();

private:
void _initializeGL();

void _createThumbnailWindow();
void _getThumbnailPosition(int& X, int& Y);

void _setTimeUnits(tl::timeline::TimeUnits);

void _tickEvent();
void _tickEvent(
const std::shared_ptr<ui::IWidget>&, bool visible, bool enabled,
const ui::TickEvent&);

bool _getSizeUpdate(const std::shared_ptr<ui::IWidget>&) const;
void _sizeHintEvent();
void _sizeHintEvent(
const std::shared_ptr<ui::IWidget>&, const ui::SizeHintEvent&);

void _setGeometry();

void _clipEvent();
void _clipEvent(
const std::shared_ptr<ui::IWidget>&, const math::Box2i&,
bool clipped);
Expand Down

0 comments on commit c874981

Please sign in to comment.