Skip to content

Commit 47f6713

Browse files
authored
Merge pull request #180 from kenmcgaugh/misc_fixes_additions
Miscellaneous fixes and additions
2 parents 180de28 + c2556ca commit 47f6713

File tree

8 files changed

+20
-6
lines changed

8 files changed

+20
-6
lines changed

include/xstudio/ui/keyboard.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ namespace ui {
2222
inline static const std::map<int, int> key_to_modifier = {
2323
{16777248, (int)ShiftModifier},
2424
{16777249, (int)ControlModifier},
25-
{16777251, (int)AltModifier},
26-
{16777249, (int)MetaModifier}};
25+
{16777250, (int)MetaModifier},
26+
{16777251, (int)AltModifier}};
2727

2828
// This is very rough and ready, needs a lot more work!
2929
class Hotkey {

src/plugin/colour_op/grading/src/grading_data_serialiser.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ void GradingDataSerialiser::register_serialiser(
4444
const unsigned char maj_ver,
4545
const unsigned char minor_ver,
4646
std::shared_ptr<GradingDataSerialiser> sptr) {
47-
int fver = maj_ver << 8 + minor_ver;
47+
int fver = (maj_ver << 8) + minor_ver;
4848
assert(sptr);
4949
if (serialisers.find(fver) != serialisers.end()) {
5050
throw std::runtime_error("Attempt to register Annotation Serialiser with a used "

src/plugin/media_metadata/ffprobe/src/ffprobe_lib.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -553,6 +553,9 @@ std::shared_ptr<MediaFile> FFProbe::open_file(const std::string &path) {
553553
av_dict_set(&format_opts, "scan_all_pmts", "1", AV_DICT_DONT_OVERWRITE);
554554
auto scan_all_pmts_set = 1;
555555

556+
// Tell ffmpeg to export custom "udta" metadata tags.
557+
av_dict_set_int(&format_opts, "export_all", 1, 0);
558+
556559
iformat = av_find_input_format("format");
557560
if (not iformat) {
558561
// throw std::runtime_error("Unknown input format");

src/python_module/src/py_register.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,7 @@ void register_timecode_class(py::module &m, const std::string &name) {
257257
auto str_impl = [](const utility::Timecode &x) { return to_string(x); };
258258
py::class_<utility::Timecode>(m, name.c_str())
259259
.def(py::init<>())
260+
.def(py::init<const int, const double>())
260261
.def("__str__", str_impl)
261262
.def("hours", [](const utility::Timecode &x) { return x.hours(); })
262263
.def("minutes", [](const utility::Timecode &x) { return x.minutes(); })
@@ -289,9 +290,10 @@ void register_mediareference_class(py::module &m, const std::string &name) {
289290
&utility::MediaReference::uri, py::const_),
290291
"URI of mediareference",
291292
py::arg("fpf") = utility::MediaReference::FramePadFormat::FPF_XSTUDIO)
292-
293+
.def("set_frame_list", &utility::MediaReference::set_frame_list)
293294
.def("uri_from_frame", &utility::MediaReference::uri_from_frame)
294295
.def("timecode", &utility::MediaReference::timecode)
296+
.def("set_timecode", &utility::MediaReference::set_timecode)
295297
.def("offset", &utility::MediaReference::offset)
296298
.def("set_offset", &utility::MediaReference::set_offset)
297299
.def("start_frame_offset", &utility::MediaReference::start_frame_offset)
@@ -569,6 +571,7 @@ void register_frame_list_class(py::module &m, const std::string &name) {
569571
auto str_impl = [](const utility::FrameList &x) { return to_string(x); };
570572
py::class_<utility::FrameList>(m, name.c_str())
571573
.def(py::init<>())
574+
.def(py::init<int, int, int>())
572575
.def(py::init<std::string>())
573576
.def("__str__", str_impl);
574577
}

src/python_module/src/py_ui.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ void py_ui(py::module_ &m) {
2525
.value("NoModifier", ui::KeyboardModifier::NoModifier)
2626
.value("ShiftModifier", ui::KeyboardModifier::ShiftModifier)
2727
.value("ControlModifier", ui::KeyboardModifier::ControlModifier)
28+
.value("AltModifier", ui::KeyboardModifier::AltModifier)
2829
.value("MetaModifier", ui::KeyboardModifier::MetaModifier)
2930
.value("KeypadModifier", ui::KeyboardModifier::KeypadModifier)
3031
.value("GroupSwitchModifier", ui::KeyboardModifier::GroupSwitchModifier)

src/scanner/src/scanner_actor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ media::MediaStatus check_media_status(const MediaReference &mr) {
3535
try {
3636

3737
if (mr.container()) {
38-
if (not fs::exists(uri_to_posix_path(mr.uri())))
38+
if (mr.uri().scheme() == "file" and not fs::exists(uri_to_posix_path(mr.uri())))
3939
ms = media::MediaStatus::MS_MISSING;
4040
} else {
4141
// check first and last frame.

src/thumbnail/src/thumbnail.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,13 @@ void DiskCacheStat::populate(const std::string &path) {
1717
for (const auto &entry : fs::recursive_directory_iterator(path)) {
1818
if (fs::is_regular_file(entry.status())) {
1919
auto mtime = fs::last_write_time(entry.path());
20+
const auto stem = entry.path().stem().string();
21+
#if __apple__
22+
if (stem == ".DS_Store")
23+
continue;
24+
#endif
2025
add_thumbnail(
21-
std::stoull(entry.path().stem().string(), nullptr, 16),
26+
std::stoull(stem, nullptr, 16),
2227
fs::file_size(entry.path()),
2328
mtime);
2429
}

src/timeline/src/clip_actor.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,8 @@ caf::message_handler ClipActor::message_handler() {
247247
return jsn;
248248
},
249249

250+
[=](utility::event_atom, utility::name_atom, const std::string & /*name*/) {},
251+
250252
[=](item_name_atom, const std::string &value) -> JsonStore {
251253
auto jsn = base_.item().set_name(value);
252254
if (not jsn.is_null())

0 commit comments

Comments
 (0)