Skip to content

Commit 98a8aef

Browse files
committed
Sync with latest DNEG internal repo
1 parent c566cab commit 98a8aef

File tree

303 files changed

+14897
-6067
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

303 files changed

+14897
-6067
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@
33
._*
44
.gitignore
55
.vscode/
6+
build_*
67
__*__
78
ignore/
8-
python/src/xstudio.egg-info/
9+
*.egg-info/
910
python/test/xstudio.log
1011
docs/conf.py
1112
python/src/xstudio/version.py

CMakeLists.txt

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,18 @@ option(USE_VCPKG "Use Vcpkg for package management" OFF)
2222
option(BUILD_PYSIDE_WIDGETS "Build xstudio player as PySide widget" OFF)
2323

2424
if(WIN32)
25-
set(USE_VCPKG ON)
26-
#include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/vcpkg.cmake)
27-
set(CMAKE_CXX_FLAGS_DEBUG "/Zi /Ob0 /Od /Oy-")
28-
add_compile_options($<$<CXX_COMPILER_ID:MSVC>:/MP>)
29-
# enable UUID System Generator
30-
add_definitions(-DUUID_SYSTEM_GENERATOR=ON)
25+
set(USE_VCPKG ON)
26+
#include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/vcpkg.cmake)
27+
set(CMAKE_CXX_FLAGS_DEBUG "/Zi /Ob0 /Od /Oy-")
28+
add_compile_options($<$<CXX_COMPILER_ID:MSVC>:/MP>)
29+
# enable UUID System Generator
30+
add_definitions(-DUUID_SYSTEM_GENERATOR=ON)
3131
endif()
3232

3333
set(STUDIO_PLUGINS "" CACHE STRING "Enable compilation of SITE plugins")
3434

3535
if (("${CMAKE_GENERATOR}" MATCHES "Makefiles" OR ("${CMAKE_GENERATOR}" MATCHES "Ninja" AND NOT WIN32)) AND NOT __CHECKED_CXX_FLAGS)
36-
set(__CHECKED_CXX_FLAGS TRUE CACHE INTERNAL "Whether we checked the CXX flags already")
36+
set(__CHECKED_CXX_FLAGS TRUE CACHE INTERNAL "Whether we checked the CXX flags already")
3737
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${COMMON_GCC}" CACHE STRING "" FORCE)
3838
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} ${COMMON_GCC}" CACHE STRING "" FORCE)
3939
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} ${COMMON_GCC}" CACHE STRING "" FORCE)
@@ -295,7 +295,7 @@ if(INSTALL_XSTUDIO)
295295

296296
endif ()
297297

298-
if(USE_VCPKG)
298+
if (USE_VCPKG)
299299
# To provide reliable ordering, we need to make this install script happen in a subdirectory.
300300
# Otherwise, Qt deploy will happen before we have the rest of the application deployed.
301301
add_subdirectory("scripts/qt_install")
@@ -343,11 +343,11 @@ if (WIN32)
343343
WriteRegStr HKCR 'XStudioSession\\\\DefaultIcon' \\\\
344344
'' '$INSTDIR\\\\bin\\\\xstudio.exe,0'
345345
WriteRegStr HKCR 'XStudioSession\\\\shell\\\\open\\\\command' \\\\
346-
'' '$INSTDIR\\\\bin\\\\xstudio.exe \\"%1\\"'
346+
'' '$INSTDIR\\\\bin\\\\xstudio.exe \\\"%1\\\"'
347347
WriteRegStr HKCR 'XStudioSession\\\\shell\\\\edit' \\\\
348348
'' 'Edit xSTUDIO Session File'
349349
WriteRegStr HKCR 'XStudioSession\\\\shell\\\\edit\\\\command' \\\\
350-
'' '$INSTDIR\\\\bin\\\\xstudio.exe \\"%1\\"'
350+
'' '$INSTDIR\\\\bin\\\\xstudio.exe \\\"%1\\\"'
351351
System::Call \\\\
352352
'Shell32::SHChangeNotify(i 0x8000000, i 0, i 0, i 0)'
353353
")

docs/Doxyfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ PROJECT_NAME = "xStudio"
3838
# could be handy for archiving the generated documentation or if some version
3939
# control system is used.
4040

41-
PROJECT_NUMBER = "1.1.0"
41+
PROJECT_NUMBER = "0.0.0"
4242

4343
# Using the PROJECT_BRIEF tag one can provide an optional one line description
4444
# for a project that appears at the top of each page and should give viewer a

docs/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,9 @@
7676
# built documents.
7777
#
7878
# The short X.Y version.
79-
version = '1.1.0'
79+
version = '0.0.0'
8080
# The full version, including alpha/beta/rc tags.
81-
release = '1.1.0'
81+
release = '0.0.0'
8282

8383
# The language for content autogenerated by Sphinx. Refer to documentation
8484
# for a list of supported languages.

extern/otio/OpenTimelineIO

Submodule OpenTimelineIO deleted from 4440afa

include/xstudio/atoms.hpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ namespace bookmark {
5959
class AnnotationBase;
6060
struct BookmarkDetail;
6161
struct BookmarkAndAnnotation;
62+
typedef std::shared_ptr<const AnnotationBase> AnnotationBasePtr;
6263
typedef std::shared_ptr<const BookmarkAndAnnotation> BookmarkAndAnnotationPtr;
6364
} // namespace bookmark
6465

@@ -183,7 +184,7 @@ CAF_ALLOW_UNSAFE_MESSAGE_TYPE(httplib::Response)
183184
CAF_ALLOW_UNSAFE_MESSAGE_TYPE(std::shared_ptr<const xstudio::module::Attribute>)
184185
CAF_ALLOW_UNSAFE_MESSAGE_TYPE(xstudio::utility::BlindDataObjectPtr)
185186
CAF_ALLOW_UNSAFE_MESSAGE_TYPE(xstudio::utility::BlindDataObjectPtrVec)
186-
CAF_ALLOW_UNSAFE_MESSAGE_TYPE(std::shared_ptr<xstudio::bookmark::AnnotationBase>)
187+
CAF_ALLOW_UNSAFE_MESSAGE_TYPE(xstudio::bookmark::AnnotationBasePtr)
187188
CAF_ALLOW_UNSAFE_MESSAGE_TYPE(std::shared_ptr<xstudio::colour_pipeline::ColourPipeline>)
188189
CAF_ALLOW_UNSAFE_MESSAGE_TYPE(std::shared_ptr<xstudio::media::AVFrameID>)
189190
CAF_ALLOW_UNSAFE_MESSAGE_TYPE(std::shared_ptr<xstudio::media_reader::AudioBuffer>)
@@ -331,7 +332,8 @@ CAF_BEGIN_TYPE_ID_BLOCK(xstudio_complex_types, FIRST_CUSTOM_ID + 200)
331332
CAF_ADD_TYPE_ID(xstudio_complex_types, (std::shared_ptr<const xstudio::module::Attribute>))
332333
CAF_ADD_TYPE_ID(xstudio_complex_types, (xstudio::utility::BlindDataObjectPtr))
333334
CAF_ADD_TYPE_ID(xstudio_complex_types, (xstudio::utility::BlindDataObjectPtrVec))
334-
CAF_ADD_TYPE_ID(xstudio_complex_types, (std::shared_ptr<xstudio::bookmark::AnnotationBase>))
335+
CAF_ADD_TYPE_ID(xstudio_complex_types, (xstudio::bookmark::AnnotationBasePtr))
336+
CAF_ADD_TYPE_ID(xstudio_complex_types, (std::vector<xstudio::bookmark::AnnotationBasePtr>))
335337
CAF_ADD_TYPE_ID(xstudio_complex_types, (std::shared_ptr<xstudio::colour_pipeline::ColourPipeline>))
336338
CAF_ADD_TYPE_ID(xstudio_complex_types, (std::shared_ptr<xstudio::media::AVFrameID>))
337339
CAF_ADD_TYPE_ID(xstudio_complex_types, (std::shared_ptr<xstudio::media_reader::AudioBuffer>))
@@ -592,6 +594,7 @@ CAF_BEGIN_TYPE_ID_BLOCK(xstudio_session_atoms, FIRST_CUSTOM_ID + (200 * 4))
592594
CAF_ADD_ATOM(xstudio_session_atoms, xstudio::bookmark, build_annotation_atom)
593595
CAF_ADD_ATOM(xstudio_session_atoms, xstudio::bookmark, default_category_atom)
594596
CAF_ADD_ATOM(xstudio_session_atoms, xstudio::bookmark, get_annotation_atom)
597+
CAF_ADD_ATOM(xstudio_session_atoms, xstudio::bookmark, annotation_data_atom)
595598
CAF_ADD_ATOM(xstudio_session_atoms, xstudio::bookmark, get_bookmark_atom)
596599
CAF_ADD_ATOM(xstudio_session_atoms, xstudio::bookmark, get_bookmarks_atom)
597600
CAF_ADD_ATOM(xstudio_session_atoms, xstudio::bookmark, remove_bookmark_atom)
@@ -619,7 +622,9 @@ CAF_BEGIN_TYPE_ID_BLOCK(xstudio_session_atoms, FIRST_CUSTOM_ID + (200 * 4))
619622
CAF_ADD_ATOM(xstudio_session_atoms, xstudio::media, relink_atom)
620623
CAF_ADD_ATOM(xstudio_session_atoms, xstudio::media, rescan_atom)
621624
CAF_ADD_ATOM(xstudio_session_atoms, xstudio::media, source_offset_frames_atom)
625+
CAF_ADD_ATOM(xstudio_session_atoms, xstudio::media, rotation_atom)
622626
CAF_ADD_ATOM(xstudio_session_atoms, xstudio::media, pixel_aspect_atom)
627+
CAF_ADD_ATOM(xstudio_session_atoms, xstudio::media, transform_matrix_atom)
623628
CAF_ADD_ATOM(xstudio_session_atoms, xstudio::media_metadata, get_metadata_atom)
624629
CAF_ADD_ATOM(xstudio_session_atoms, xstudio::playlist, add_media_atom)
625630
CAF_ADD_ATOM(xstudio_session_atoms, xstudio::playlist, add_media_with_subsets_atom)

include/xstudio/audio/audio_output.hpp

Lines changed: 59 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
#include <chrono>
55

6+
#include "xstudio/audio/enums.hpp"
67
#include "xstudio/media_reader/media_reader.hpp"
78
#include "xstudio/module/module.hpp"
89
#include "xstudio/utility/chrono.hpp"
@@ -13,6 +14,43 @@ namespace xstudio::audio {
1314

1415
enum AudioBehaviourOnSilence { StopPushingSamplesOnSilence, ContinuePushingSamplesOnSilence };
1516

17+
18+
static inline std::map<std::string, ScrubBehaviour> scrubBehaviourMap = {
19+
{"1 Frame", OneFrame},
20+
{"1.25 Frames", OnePt25Frames},
21+
{"1.5 Frames", OnePt5Frames},
22+
{"2 Frames", TwoFrames},
23+
{"3 Frames", ThreeFrames},
24+
{"1/24th Sec", OneFrameAt24Fps},
25+
{"1/30th Sec", OneFrameAt30Fps},
26+
{"1/60th Sec", OneFrameAt60Fps},
27+
{"Custom Duration", Custom},
28+
};
29+
30+
struct ScrubHelper {
31+
32+
ScrubHelper() = default;
33+
34+
void set_custom_duration_ms(const int ms) {
35+
scrub_window_millisecs_ = ms;
36+
}
37+
void set_behaviour(const std::string &behaviour) {
38+
const auto p = scrubBehaviourMap.find(behaviour);
39+
if (p != scrubBehaviourMap.end()) scrub_behaviour_= p->second;
40+
else scrub_behaviour_ = ScrubBehaviour::OneFrame;
41+
}
42+
43+
timebase::flicks scrub_duration(const utility::FrameRate & media_rate) const;
44+
double scrub_duration_secs(const utility::FrameRate & media_rate) const {
45+
return timebase::to_seconds(scrub_duration(media_rate));
46+
}
47+
48+
private:
49+
int scrub_window_millisecs_ = {50};
50+
ScrubBehaviour scrub_behaviour_ = {OneFrame};
51+
52+
};
53+
1654
/**
1755
* @brief Class for delivering audio to soundcard by maintaining a smoothed
1856
* measurment of the playhead position and re-sampling audio sources as
@@ -22,6 +60,8 @@ enum AudioBehaviourOnSilence { StopPushingSamplesOnSilence, ContinuePushingSampl
2260
class AudioOutputControl {
2361

2462
public:
63+
64+
2565
/**
2666
* @brief Constructor
2767
*
@@ -55,13 +95,14 @@ class AudioOutputControl {
5595
* @brief The audio volume (range is 0-100)
5696
*/
5797
[[nodiscard]] float volume() const {
58-
return override_volume_ == -1.0f ? volume_ : override_volume_;
98+
return (override_volume_ == -1.0f ? volume_ : override_volume_) * playhead_volume_ /
99+
100.0f;
59100
}
60101

61102
/**
62103
* @brief The audio volume muted
63104
*/
64-
[[nodiscard]] bool muted() const { return muted_; }
105+
[[nodiscard]] bool muted() const { return override_volume_ == -1.0f ? muted_ : false; }
65106

66107
/**
67108
* @brief Queue audio buffer for streaming to the soundcard
@@ -81,6 +122,8 @@ class AudioOutputControl {
81122
*/
82123
void playhead_position_changed(
83124
const timebase::flicks playhead_position,
125+
const timebase::flicks playhead_loop_in,
126+
const timebase::flicks playhead_loop_out,
84127
const bool forward,
85128
const float velocity,
86129
const bool playing,
@@ -101,11 +144,15 @@ class AudioOutputControl {
101144
const float volume,
102145
const bool muted,
103146
const bool audio_repitch,
104-
const bool audio_scrubbing) {
105-
volume_ = volume;
106-
muted_ = muted;
107-
audio_repitch_ = audio_repitch;
108-
audio_scrubbing_ = audio_scrubbing;
147+
const bool audio_scrubbing,
148+
const std::string & scrub_behaviour,
149+
const int scrub_window_millisecs) {
150+
volume_ = volume;
151+
muted_ = muted;
152+
audio_repitch_ = audio_repitch;
153+
audio_scrubbing_ = audio_scrubbing;
154+
scrub_helper_.set_behaviour(scrub_behaviour);
155+
scrub_helper_.set_custom_duration_ms(scrub_window_millisecs);
109156
}
110157

111158
void set_override_volume(const float override_volume) {
@@ -138,6 +185,8 @@ class AudioOutputControl {
138185
int fade_in_out_ = {NoFade};
139186

140187
timebase::flicks playhead_position_;
188+
timebase::flicks playhead_loop_in_ = {timebase::flicks(std::numeric_limits<timebase::flicks::rep>::lowest())};
189+
timebase::flicks playhead_loop_out_ = {timebase::flicks(std::numeric_limits<timebase::flicks::rep>::max())};
141190
bool playing_forward_ = {true};
142191
utility::time_point playhead_position_update_tp_;
143192
timebase::flicks last_buffer_pts_;
@@ -148,8 +197,11 @@ class AudioOutputControl {
148197
bool muted_ = {false};
149198
bool playing_ = {false};
150199
float override_volume_ = {-1.0f};
200+
float playhead_volume_ = {100.0f};
151201
float last_volume_ = {100.0f};
152202
float scrub_chunk_duration_frames_ = {1.0f};
153203
bool apply_global_volume_ = {true};
204+
205+
ScrubHelper scrub_helper_;
154206
};
155207
} // namespace xstudio::audio

include/xstudio/audio/audio_output_actor.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,10 @@ class GlobalAudioOutputActor : public caf::event_based_actor, module::Module {
250250
module::BooleanAttribute *audio_scrubbing_;
251251
module::FloatAttribute *volume_;
252252
module::BooleanAttribute *muted_;
253+
module::StringAttribute *scrub_behaviour_;
254+
module::IntegerAttribute *scrub_window_millisecs_;
253255
utility::Uuid mute_hotkey_;
256+
utility::Uuid audio_scrubbing_hotkey_;
254257
std::map<utility::Uuid, caf::actor> independent_outputs_;
255258
};
256259

include/xstudio/audio/enums.hpp

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// SPDX-License-Identifier: Apache-2.0
2+
#pragma once
3+
4+
namespace xstudio {
5+
namespace audio {
6+
// maps to options in preference /core/audio/audio_scrub_duration
7+
enum ScrubBehaviour {
8+
OneFrame,
9+
OnePt25Frames,
10+
OnePt5Frames,
11+
TwoFrames,
12+
ThreeFrames,
13+
OneFrameAt24Fps,
14+
OneFrameAt30Fps,
15+
OneFrameAt60Fps,
16+
Custom
17+
};
18+
} // namespace audio
19+
} // namespace xstudio

include/xstudio/bookmark/bookmark.hpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,15 @@ namespace bookmark {
3131
}
3232
utility::Uuid bookmark_uuid_;
3333

34+
virtual const void * user_data() const { return nullptr; }
35+
3436
virtual size_t hash() const { return 0; }
3537

3638
private:
3739
utility::JsonStore store_;
3840
};
3941

40-
typedef std::shared_ptr<AnnotationBase> AnnotationBasePtr;
42+
typedef std::shared_ptr<const AnnotationBase> AnnotationBasePtr;
4143

4244
class Note {
4345
public:
@@ -335,15 +337,15 @@ namespace bookmark {
335337
utility::sys_time_point created_{utility::sysclock::now()};
336338

337339
std::shared_ptr<Note> note_{nullptr};
338-
std::shared_ptr<AnnotationBase> annotation_{nullptr};
340+
AnnotationBasePtr annotation_;
339341
};
340342

341343
/* This struct is used by Playhead classes as a convenient way to maintain
342344
a record of bookmarks, attached annotation data and a logical frame range*/
343345
struct BookmarkAndAnnotation {
344346

345347
BookmarkDetail detail_;
346-
std::shared_ptr<AnnotationBase> annotation_;
348+
AnnotationBasePtr annotation_;
347349
int start_frame_ = 0;
348350
int end_frame_ = 240;
349351
};

0 commit comments

Comments
 (0)