Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
.gitignore
.github
*.sublime-project
*.sublime-workspace
._*
.gitignore
.vscode/
.vs/
.DS_Store
__*__
ignore/
*.egg-info/
python/test/xstudio.log
python/src/xstudio/version.py
*.egg-info/
docs/Doxyfile
docs/conf.py
python/src/xstudio/version.py
.vs/
.DS_Store
/build/
xstudio_install/
**/qml/*_qml_export.h
CMakeUserPresets.json
__build
__build_debug
build/
__build/
__build_debug/
build_rel/
build_dbg/
xstudio_install
CMakeUserPresets.json
aqtinstall.log
build_logs/
CMakeUserPresets.json.bak
15 changes: 15 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fpic")
set(TEST_RESOURCE "${CMAKE_CURRENT_SOURCE_DIR}/test_resource")
set(ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR})

# Generated headers (e.g. QML export headers) live in the build tree, not the source tree.
include_directories(${CMAKE_BINARY_DIR}/gen-include)

if(WIN32)
set(CMAKE_CXX_STANDARD 20)
add_compile_definitions($<$<CONFIG:Debug>:_ITERATOR_DEBUG_LEVEL=0>)
Expand Down Expand Up @@ -266,6 +269,10 @@ if(INSTALL_XSTUDIO)
install(DIRECTORY include/xstudio
DESTINATION include)

# QML export headers are generated into the build tree (see cmake/macros.cmake)
install(DIRECTORY ${CMAKE_BINARY_DIR}/gen-include/xstudio
DESTINATION include)

INSTALL(DIRECTORY extern/ DESTINATION extern)

add_subdirectory(share/preference)
Expand Down Expand Up @@ -308,6 +315,14 @@ if(INSTALL_XSTUDIO)
EXPORT_LINK_INTERFACE_LIBRARIES
)

# Also export the targets into the build tree, next to the generated
# xStudioConfig.cmake, so out-of-tree plugins can consume the build
# directory directly (xStudio_DIR=<build dir>) without installing.
export(EXPORT xstudio
FILE ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Targets.cmake
NAMESPACE xstudio::
)

endif()

endif ()
Expand Down
12 changes: 7 additions & 5 deletions cmake/macros.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ macro(default_options_local name)
target_include_directories(${name}
PUBLIC
$<BUILD_INTERFACE:${ROOT_DIR}/include>
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/gen-include>
# $<INSTALL_INTERFACE:include>
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/src
Expand Down Expand Up @@ -136,6 +137,7 @@ macro(default_options name)

target_include_directories(${name} INTERFACE
$<BUILD_INTERFACE:${ROOT_DIR}/include>
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/gen-include>
$<BUILD_INTERFACE:${ROOT_DIR}/extern/include>
$<INSTALL_INTERFACE:include>
$<INSTALL_INTERFACE:extern/include>
Expand All @@ -153,6 +155,7 @@ macro(default_options_static name)
target_include_directories(${name}
PUBLIC
$<BUILD_INTERFACE:${ROOT_DIR}/include>
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/gen-include>
# $<INSTALL_INTERFACE:include>
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/src
Expand All @@ -175,6 +178,7 @@ macro(default_plugin_options name)
target_include_directories(${name}
PUBLIC
$<BUILD_INTERFACE:${ROOT_DIR}/include>
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/gen-include>
# $<INSTALL_INTERFACE:include>
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/src
Expand Down Expand Up @@ -275,6 +279,7 @@ if (BUILD_TESTING)
target_include_directories(${name}
PUBLIC
$<BUILD_INTERFACE:${ROOT_DIR}/include>
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/gen-include>
# $<INSTALL_INTERFACE:include>
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/src
Expand All @@ -294,6 +299,7 @@ macro(default_options_qt name)
target_include_directories(${name}
PUBLIC
$<BUILD_INTERFACE:${ROOT_DIR}/include>
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/gen-include>
# $<INSTALL_INTERFACE:include>
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/src
Expand Down Expand Up @@ -661,18 +667,14 @@ macro(create_qml_component_with_alias NAME ALIASNAME VERSION DEPS EXTRAMOC)

# Generate export header
include(GenerateExportHeader)
generate_export_header(${PROJECT_NAME} EXPORT_FILE_NAME "${ROOT_DIR}/include/xstudio/ui/qml/${PROJECT_NAME}_export.h")
generate_export_header(${PROJECT_NAME} EXPORT_FILE_NAME "${CMAKE_BINARY_DIR}/gen-include/xstudio/ui/qml/${PROJECT_NAME}_export.h")
target_link_libraries(${PROJECT_NAME}
PUBLIC ${DEPS}
)

set_target_properties(${PROJECT_NAME} PROPERTIES LINK_DEPENDS_NO_SHARED true)
set_property(TARGET ${PROJECT_NAME} PROPERTY AUTOMOC ON)

## Add the directory containing the generated export header to the include directories
#target_include_directories(${PROJECT_NAME}
# PUBLIC ${CMAKE_BINARY_DIR} # Include the build directory
#)

endmacro()

Expand Down
12 changes: 11 additions & 1 deletion include/xstudio/atoms.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,7 @@ CAF_BEGIN_TYPE_ID_BLOCK(xstudio_simple_types, FIRST_CUSTOM_ID)
CAF_ADD_TYPE_ID(xstudio_simple_types, (xstudio::utility::Notification))
CAF_ADD_TYPE_ID(xstudio_simple_types, (xstudio::playhead::SelectionMode))
CAF_ADD_TYPE_ID(xstudio_simple_types, (xstudio::timeline::ItemType))
CAF_ADD_TYPE_ID(xstudio_simple_types, (xstudio::timeline::AudioMode))
CAF_ADD_TYPE_ID(xstudio_simple_types, (xstudio::utility::ColourTriplet))
CAF_ADD_TYPE_ID(xstudio_simple_types, (spdlog::level::level_enum))

Expand Down Expand Up @@ -711,6 +712,7 @@ CAF_BEGIN_TYPE_ID_BLOCK(xstudio_session_atoms, FIRST_CUSTOM_ID + (200 * 4))
CAF_ADD_ATOM(xstudio_session_atoms, xstudio::timeline, split_item_atom)
CAF_ADD_ATOM(xstudio_session_atoms, xstudio::timeline, split_item_at_frame_atom)
CAF_ADD_ATOM(xstudio_session_atoms, xstudio::timeline, trimmed_range_atom)
CAF_ADD_ATOM(xstudio_session_atoms, xstudio::timeline, audio_mode_atom)

CAF_ADD_ATOM(xstudio_session_atoms, xstudio::timeline, item_flag_atom)
CAF_ADD_ATOM(xstudio_session_atoms, xstudio::media, metadata_selection_atom)
Expand All @@ -727,7 +729,8 @@ CAF_BEGIN_TYPE_ID_BLOCK(xstudio_session_atoms, FIRST_CUSTOM_ID + (200 * 4))

CAF_ADD_ATOM(xstudio_session_atoms, xstudio::timeline, item_selection_atom)
CAF_ADD_ATOM(xstudio_session_atoms, xstudio::timeline, item_type_atom)

CAF_ADD_ATOM(xstudio_session_atoms, xstudio::timeline, clip_edited_status_atom)

CAF_ADD_ATOM(xstudio_session_atoms, xstudio::bookmark, remove_annotation_atom)


Expand Down Expand Up @@ -836,6 +839,7 @@ CAF_BEGIN_TYPE_ID_BLOCK(xstudio_playback_atoms, FIRST_CUSTOM_ID + (200 * 5))
CAF_ADD_ATOM(xstudio_playback_atoms, xstudio::colour_pipeline, global_ocio_controls_atom)
CAF_ADD_ATOM(xstudio_playback_atoms, xstudio::colour_pipeline, colour_pipe_linearise_data_atom)
CAF_ADD_ATOM(xstudio_playback_atoms, xstudio::colour_pipeline, colour_pipe_display_data_atom)
CAF_ADD_ATOM(xstudio_playback_atoms, xstudio::colour_pipeline, get_colourspace_info_atom)
CAF_ADD_ATOM(xstudio_playback_atoms, xstudio::playhead, skip_to_bookmark_atom)
CAF_ADD_ATOM(xstudio_playback_atoms, xstudio::playhead, skip_to_media_atom)

Expand Down Expand Up @@ -962,6 +966,12 @@ template <class Inspector> bool inspect(Inspector &f, ItemType &x) {
auto setter = [&x](int_t val) { x = static_cast<ItemType>(val); };
return f.apply(getter, setter);
}
template <class Inspector> bool inspect(Inspector &f, AudioMode &x) {
using int_t = std::underlying_type_t<AudioMode>;
auto getter = [&x] { return static_cast<int_t>(x); };
auto setter = [&x](int_t val) { x = static_cast<AudioMode>(val); };
return f.apply(getter, setter);
}
} // namespace xstudio::timeline

namespace xstudio::playhead {
Expand Down
8 changes: 7 additions & 1 deletion include/xstudio/media/media_actor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include "xstudio/json_store/json_store_handler.hpp"
#include "xstudio/utility/tree.hpp"
#include "xstudio/utility/uuid.hpp"
#include "xstudio/utility/notification_handler.hpp"

namespace xstudio::media {
class MediaActor : public caf::event_based_actor {
Expand All @@ -33,7 +34,9 @@ class MediaActor : public caf::event_based_actor {
caf::message_handler message_handler();

caf::behavior make_behavior() override {
return message_handler().or_else(base_.container_message_handler(this));
return message_handler().or_else(base_.container_message_handler(this))
.or_else(notification_.message_handler(this, base_.event_group()))
.or_else(utility::NotificationHandler::default_event_handler());
}
[[nodiscard]] const char *name() const override { return NAME.c_str(); }
static caf::message_handler default_event_handler();
Expand Down Expand Up @@ -79,6 +82,8 @@ class MediaActor : public caf::event_based_actor {
caf::actor dst_bookmarks);

Media base_;
utility::NotificationHandler notification_;

caf::actor json_store_;
std::map<utility::Uuid, caf::actor> media_sources_;
utility::UuidList bookmark_uuids_;
Expand All @@ -87,6 +92,7 @@ class MediaActor : public caf::event_based_actor {
utility::JsonStore human_readable_info_;
utility::JsonStore media_list_columns_info_;
utility::time_point creation_time_ = {utility::clock::now()};
bool pending_media_display_info_{false};
};

class MediaSourceActor : public caf::event_based_actor {
Expand Down
1 change: 1 addition & 0 deletions include/xstudio/playhead/playhead.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ class PlayheadBase : public module::Module {
module::JsonAttribute *cached_frames_;
module::IntegerVecAttribute *bookmarked_frames_;
module::IntegerVecAttribute *media_transition_frames_;
module::JsonAttribute *compared_timeline_ids_;

module::IntegerAttribute *max_compare_sources_;
module::BooleanAttribute *restore_play_state_after_scrub_;
Expand Down
2 changes: 2 additions & 0 deletions include/xstudio/playhead/playhead_actor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ class PlayheadActor : public caf::event_based_actor, public PlayheadBase {

[[nodiscard]] const char *name() const override { return NAME.c_str(); }

static inline const utility::Uuid TIMELINE_COMPARE_PLAYHEAD_UUID = utility::Uuid("442f6169-a3b0-465d-850d-03280b224d70");

private:
inline static const std::string NAME = "PlayheadActor";

Expand Down
1 change: 1 addition & 0 deletions include/xstudio/playhead/playhead_global_events_actor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ class PlayheadGlobalEventsActor : public caf::event_based_actor {
caf::actor event_group_;
// caf::actor fine_grain_events_group_;
caf::actor global_active_playhead_;
caf::actor dummy_playhead_;
struct ViewportAndPlayhead {
caf::actor viewport;
caf::actor playhead;
Expand Down
3 changes: 3 additions & 0 deletions include/xstudio/session/session_actor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ class SessionActor : public caf::event_based_actor {
}

void check_media_hook_plugin_version(const utility::JsonStore &jsn, const caf::uri &path);
void check_multi_timeline_mode();
void setOnScreenPlayhead(const bool check_if_current_session);

utility::NotificationHandler notification_;

Expand All @@ -126,6 +128,7 @@ class SessionActor : public caf::event_based_actor {
// store gui conext information
utility::UuidActor viewedContainer_;
utility::UuidActor inspectedContainer_;
utility::UuidActor timeline_compare_playhead_;

utility::UuidActorVector selection_;

Expand Down
8 changes: 6 additions & 2 deletions include/xstudio/shotgun_client/shotgun_client_actor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,18 @@
namespace xstudio::shotgun_client {
class ShotgunClientActor : public caf::event_based_actor {
public:
ShotgunClientActor(caf::actor_config &cfg);
ShotgunClientActor(
caf::actor_config &cfg,
const time_t &connection_timeout = CPPHTTPLIB_CONNECTION_TIMEOUT_SECOND,
const time_t &read_timeout = 10,
const time_t &write_timeout = 10
);
~ShotgunClientActor() override = default;

[[nodiscard]] const char *name() const override { return NAME.c_str(); }

private:
inline static const std::string NAME = "ShotgunClientActor";
void init();
caf::behavior make_behavior() override { return behavior_; }

template <typename T> void authenticate(T rp, std::function<void()> lambda) {
Expand Down
2 changes: 2 additions & 0 deletions include/xstudio/timeline/clip.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ class Clip : public utility::Container {

[[nodiscard]] bool valid_child(const Item &child) const { return item_.valid_child(child); }

[[nodiscard]] int clip_has_been_edited() const;

[[nodiscard]] const utility::Uuid &media_uuid() const { return media_uuid_; }
utility::JsonStore set_media_uuid(const utility::Uuid &media_uuid) {
auto jsn = item_.prop();
Expand Down
1 change: 1 addition & 0 deletions include/xstudio/timeline/clip_actor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,6 @@ class ClipActor : public caf::event_based_actor {

std::map<int, std::shared_ptr<const media::AVFrameID>> audio_ptr_cache_;
std::map<int, std::shared_ptr<const media::AVFrameID>> image_ptr_cache_;

};
} // namespace xstudio::timeline
7 changes: 7 additions & 0 deletions include/xstudio/timeline/enums.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#pragma once

namespace xstudio::timeline {

typedef enum {
IT_NONE = 0x0L,
IT_GAP = 0x1L,
Expand All @@ -11,4 +12,10 @@ typedef enum {
IT_STACK = 0x5L,
IT_TIMELINE = 0x6L
} ItemType;

typedef enum {
AM_USE_AUDIO_STACK = 0x0L,
AM_USE_VIDEO_STACK = 0x1L
} AudioMode;

}
4 changes: 3 additions & 1 deletion include/xstudio/timeline/item.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,8 @@ class Item : private Items {
const utility::FrameRate timeline_frame_rate,
const media::MediaType mt,
const utility::UuidSet &focus,
bool only_if_focussed) const;
bool only_if_focussed,
const AudioMode audio_mode) const;

[[nodiscard]] std::optional<ResolvedItem> resolve_time(
const utility::FrameRate &time,
Expand Down Expand Up @@ -336,6 +337,7 @@ class Item : private Items {
const media::MediaType media_type,
const utility::TimeSourceMode tsm,
const utility::FrameRate &override_rate,
const timeline::AudioMode audio_mode = AM_USE_AUDIO_STACK,
const utility::UuidSet &focus_list = utility::UuidSet());

private:
Expand Down
5 changes: 5 additions & 0 deletions include/xstudio/timeline/timeline.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ class Timeline : public utility::Container {
[[nodiscard]] bool empty() const { return media_list_.empty(); }
void clear() { media_list_.clear(); }

[[nodiscard]] AudioMode audio_mode() const { return audio_mode_; }
void set_audio_mode(const AudioMode am) { audio_mode_ = am; }

[[nodiscard]] utility::UuidList media() const { return media_list_.uuids(); }
[[nodiscard]] utility::UuidVector media_vector() const { return media_list_.uuid_vector(); }
void insert_media(
Expand Down Expand Up @@ -107,9 +110,11 @@ class Timeline : public utility::Container {
// }

private:

Item item_;
utility::UuidListContainer media_list_;
utility::UuidSet focus_list_;
AudioMode audio_mode_;

// utility::UuidListContainer tracks_;
// utility::FrameRateDuration start_time_;
Expand Down
6 changes: 6 additions & 0 deletions include/xstudio/timeline/timeline_actor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,12 @@ class TimelineActor : public caf::event_based_actor {

void duplicate_playhead(caf::actor duplicated_timeline);

void serialise_selection_for_clipboard(
caf::typed_response_promise<utility::JsonStore> rp, const utility::UuidVector &selected_items);

void paste_tracks_from_serialisation(
caf::typed_response_promise<utility::JsonStore> rp, const std::string &track_serialisation);

Timeline base_;
caf::actor change_event_group_;

Expand Down
5 changes: 5 additions & 0 deletions include/xstudio/timeline/track_actor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,11 @@ class TrackActor : public caf::event_based_actor {
const bool add_gap,
const bool replace_with_gap = false);

void do_partial_duplication(
caf::typed_response_promise<utility::UuidActor> rp,
const utility::UuidVector &selection_for_duplication
);

void merge_gaps(caf::typed_response_promise<utility::JsonStore> rp);
utility::JsonStore merge_gaps();

Expand Down
Loading
Loading