Skip to content

Commit

Permalink
Fixed file::isSequence detecting movies incorrectly.
Browse files Browse the repository at this point in the history
Fixed TimelineWidget on Wayland.
  • Loading branch information
ggarra13 committed May 11, 2024
1 parent 21ebf83 commit 6d872c5
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 14 deletions.
5 changes: 3 additions & 2 deletions mrv2/lib/mrvApp/mrvApp.cpp
Expand Up @@ -991,8 +991,7 @@ namespace mrv
{
p.player->setPlayback(timeline::Playback::Reverse);
}
},
observer::CallbackAction::Suppress);
});
}
}

Expand Down Expand Up @@ -1599,6 +1598,8 @@ namespace mrv
const bool isSequence = file::isSequence(path.get());
if (isSequence)
{
std::cerr << "using sequence cache" << std::endl;

double seconds = 1.F;
if (!ioInfo.video.empty())
{
Expand Down
23 changes: 18 additions & 5 deletions mrv2/lib/mrvCore/mrvFile.cpp
Expand Up @@ -105,15 +105,28 @@ namespace mrv

bool isSequence(const std::string& filename)
{
auto context = App::app->getContext();
auto ioSystem = context->getSystem<tl::io::System>();

const file::Path path(filename);
// @todo: add view to tlRender's path.
const std::string& extension = path.getExtension();
switch (ioSystem->getFileType(extension))
{
case tl::io::FileType::Movie:
case tl::io::FileType::Audio:
return false;
break;
};
if (extension == ".mrv2s" || extension == ".otio" ||
extension == ".prefs" || extension == ".json")
return false;

const std::string baseName = path.getBaseName();
// \@todo: add view to tlRender's file::Path class.
// const std::string view = path.getView();
const std::string number = path.getNumber();
const std::string ext = path.getExtension();
if (ext == ".mrv2s" || ext == ".otio" || ext == ".prefs")
return false;
bool ok = (!baseName.empty() && !number.empty() && !ext.empty());
bool ok = (!baseName.empty() && !number.empty() &&
!extension.empty());
return ok;
}

Expand Down
5 changes: 1 addition & 4 deletions mrv2/lib/mrvGL/mrvTimelineWidget.cpp
Expand Up @@ -344,8 +344,6 @@ namespace mrv
void TimelineWidget::continuePlaying()
{
TLRENDER_P();

std::cerr << "continue playing callback" << std::endl;

p.continueReversePlaying = true;

Expand Down Expand Up @@ -385,8 +383,7 @@ namespace mrv
p.ui->uiView->setPlayback(timeline::Playback::Reverse);
p.continueReversePlaying = false;
}
},
observer::CallbackAction::Suppress);
});
}

int TimelineWidget::_seek()
Expand Down
4 changes: 2 additions & 2 deletions mrv2/po/messages.pot
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: mrv2 v1.1.6\n"
"Report-Msgid-Bugs-To: ggarra13@gmail.com\n"
"POT-Creation-Date: 2024-05-11 10:46-0300\n"
"POT-Creation-Date: 2024-05-11 11:44-0300\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
Expand Down Expand Up @@ -212,7 +212,7 @@ msgstr ""
msgid "Could not initialize NDI"
msgstr ""

#: mrvApp/mrvApp.cpp:1047
#: mrvApp/mrvApp.cpp:1046
msgid "Filename '{0}' does not exist or does not have read permissions."
msgstr ""

Expand Down
2 changes: 1 addition & 1 deletion tlRender

0 comments on commit 6d872c5

Please sign in to comment.