format: reformatting files

This commit is contained in:
2026-07-13 15:30:43 +08:00
parent 7522543c48
commit e5eeaddf2f
511 changed files with 274803 additions and 207140 deletions
+214 -214
View File
@@ -17,8 +17,8 @@
# Set Olive sources and resources # Set Olive sources and resources
set(OLIVE_SOURCES set(OLIVE_SOURCES
core.h core.h
core.cpp core.cpp
) )
#set(OLIVE_RESOURCES) #set(OLIVE_RESOURCES)
@@ -47,15 +47,15 @@ add_subdirectory(window)
qt_add_translation(OLIVE_QM_FILES ${OLIVE_TS_FILES}) qt_add_translation(OLIVE_QM_FILES ${OLIVE_TS_FILES})
set(QRC_BODY "") set(QRC_BODY "")
foreach(QM_FILE ${OLIVE_QM_FILES}) foreach (QM_FILE ${OLIVE_QM_FILES})
get_filename_component(QM_FILENAME_COMPONENT ${QM_FILE} NAME_WE) get_filename_component(QM_FILENAME_COMPONENT ${QM_FILE} NAME_WE)
string(APPEND QRC_BODY "<file alias=\"${QM_FILENAME_COMPONENT}\">${QM_FILE}</file>\n") string(APPEND QRC_BODY "<file alias=\"${QM_FILENAME_COMPONENT}\">${QM_FILE}</file>\n")
endforeach() endforeach ()
configure_file(ts/translations.qrc.in ts/translations.qrc @ONLY) configure_file(ts/translations.qrc.in ts/translations.qrc @ONLY)
set(OLIVE_RESOURCES set(OLIVE_RESOURCES
${OLIVE_RESOURCES} ${OLIVE_RESOURCES}
${CMAKE_CURRENT_BINARY_DIR}/ts/translations.qrc ${CMAKE_CURRENT_BINARY_DIR}/ts/translations.qrc
render/job/pluginjob.cpp render/job/pluginjob.cpp
render/job/pluginjob.h render/job/pluginjob.h
widget/nodeparamview/nodeparambutton.cpp widget/nodeparamview/nodeparambutton.cpp
@@ -64,18 +64,18 @@ set(OLIVE_RESOURCES
# Add version object # Add version object
add_library(olive-version-obj add_library(olive-version-obj
OBJECT OBJECT
version.cpp version.cpp
version.h version.h
) )
target_link_libraries(olive-version-obj PRIVATE Qt${QT_VERSION_MAJOR}::Core) target_link_libraries(olive-version-obj PRIVATE Qt${QT_VERSION_MAJOR}::Core)
target_compile_options(olive-version-obj PRIVATE -DAPPVERSION="${PROJECT_VERSION}" -DAPPVERSIONLONG="${PROJECT_LONG_VERSION}" ) target_compile_options(olive-version-obj PRIVATE -DAPPVERSION="${PROJECT_VERSION}" -DAPPVERSIONLONG="${PROJECT_LONG_VERSION}")
# Add main library # Add main library
add_library(libolive-editor add_library(libolive-editor
OBJECT OBJECT
${OLIVE_SOURCES} ${OLIVE_SOURCES}
${OLIVE_RESOURCES} ${OLIVE_RESOURCES}
) )
add_subdirectory(common) add_subdirectory(common)
add_subdirectory(pluginSupport) add_subdirectory(pluginSupport)
@@ -89,164 +89,164 @@ set_target_properties(libolive-editor PROPERTIES PREFIX "")
option(OAK_ENABLE_DYNAMIC_RENDER_BACKEND "Build and use the dynamic render backend adapter" ON) option(OAK_ENABLE_DYNAMIC_RENDER_BACKEND "Build and use the dynamic render backend adapter" ON)
if (OAK_ENABLE_DYNAMIC_RENDER_BACKEND) if (OAK_ENABLE_DYNAMIC_RENDER_BACKEND)
set_target_properties(libolive-editor PROPERTIES POSITION_INDEPENDENT_CODE ON) set_target_properties(libolive-editor PROPERTIES POSITION_INDEPENDENT_CODE ON)
target_compile_definitions(libolive-editor PRIVATE OAK_ENABLE_DYNAMIC_RENDER_BACKEND) target_compile_definitions(libolive-editor PRIVATE OAK_ENABLE_DYNAMIC_RENDER_BACKEND)
foreach(target olivecore kddockwidgets) foreach (target olivecore kddockwidgets)
if (TARGET ${target}) if (TARGET ${target})
set_target_properties(${target} PROPERTIES POSITION_INDEPENDENT_CODE ON) set_target_properties(${target} PROPERTIES POSITION_INDEPENDENT_CODE ON)
endif() endif ()
endforeach() endforeach ()
# Render core library: the minimal set of code required by the OpenGL/Vulkan backend # Render core library: the minimal set of code required by the OpenGL/Vulkan backend
# libraries. Keeping this separate from libolive-editor prevents the backends from # libraries. Keeping this separate from libolive-editor prevents the backends from
# dragging in editor-wide state (project, task, cache, UI, etc.). # dragging in editor-wide state (project, task, cache, UI, etc.).
add_library(libolive-rendercore STATIC add_library(libolive-rendercore STATIC
common/avframeptr.h common/avframeptr.h
common/define.h common/define.h
common/filefunctions.cpp common/filefunctions.cpp
common/filefunctions.h common/filefunctions.h
common/qtutils.cpp common/qtutils.cpp
common/qtutils.h common/qtutils.h
common/xmlutils.cpp common/xmlutils.cpp
common/xmlutils.h common/xmlutils.h
node/param.cpp node/param.cpp
node/param.h node/param.h
node/splitvalue.h node/splitvalue.h
node/value.cpp node/value.cpp
node/value.h node/value.h
node/valuedatabase.cpp node/valuedatabase.cpp
node/valuedatabase.h node/valuedatabase.h
render/backend/dynamicrenderer.cpp render/backend/dynamicrenderer.cpp
render/backend/dynamicrenderer.h render/backend/dynamicrenderer.h
render/backend/renderbackend_c.h render/backend/renderbackend_c.h
render/job/acceleratedjob.cpp render/job/acceleratedjob.cpp
render/job/acceleratedjob.h render/job/acceleratedjob.h
render/job/shaderjob.h render/job/shaderjob.h
render/renderer.cpp render/renderer.cpp
render/renderer.h render/renderer.h
render/shadercode.h render/shadercode.h
render/texture.cpp render/texture.cpp
render/texture.h render/texture.h
render/videoparams.cpp render/videoparams.cpp
render/videoparams.h render/videoparams.h
)
set_target_properties(libolive-rendercore PROPERTIES POSITION_INDEPENDENT_CODE ON)
target_include_directories(libolive-rendercore PUBLIC
${CMAKE_SOURCE_DIR}/app
${CMAKE_SOURCE_DIR}/third_party/openfx/include
${CMAKE_SOURCE_DIR}/third_party/openfx/HostSupport/include
${OLIVE_INCLUDE_DIRS}
)
target_link_libraries(libolive-rendercore PUBLIC ${OLIVE_LIBRARIES} OfxHost)
target_compile_definitions(libolive-rendercore PUBLIC ${OLIVE_DEFINITIONS})
target_compile_options(libolive-rendercore PUBLIC ${OLIVE_COMPILE_OPTIONS})
add_library(oakgl SHARED
render/opengl/openglbackend_c.cpp
render/opengl/openglrenderer.cpp
render/opengl/openglrenderer.h
)
target_link_libraries(oakgl PRIVATE libolive-rendercore)
target_compile_definitions(oakgl PRIVATE OAK_RENDER_BACKEND_PLUGIN)
set_target_properties(oakgl PROPERTIES
OUTPUT_NAME oakgl
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
)
if(WIN32)
set_target_properties(oakgl PROPERTIES PREFIX "")
endif()
install(TARGETS oakgl
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
)
if(Vulkan_FOUND)
add_library(oakvulkan SHARED
render/vulkan/vulkanbackend_c.cpp
render/vulkan/vulkanrenderer.cpp
render/vulkan/vulkanrenderer.h
) )
target_link_libraries(oakvulkan PRIVATE libolive-rendercore) set_target_properties(libolive-rendercore PROPERTIES POSITION_INDEPENDENT_CODE ON)
target_link_libraries(oakvulkan PRIVATE Vulkan::Vulkan) target_include_directories(libolive-rendercore PUBLIC
target_compile_definitions(oakvulkan PRIVATE OAK_HAS_VULKAN) ${CMAKE_SOURCE_DIR}/app
if(SHADERC_FOUND) ${CMAKE_SOURCE_DIR}/third_party/openfx/include
target_link_libraries(oakvulkan PRIVATE ${SHADERC_LIBRARIES}) ${CMAKE_SOURCE_DIR}/third_party/openfx/HostSupport/include
target_include_directories(oakvulkan PRIVATE ${SHADERC_INCLUDE_DIRS}) ${OLIVE_INCLUDE_DIRS}
target_compile_definitions(oakvulkan PRIVATE OAK_HAS_SHADERC)
endif()
set_target_properties(oakvulkan PROPERTIES
OUTPUT_NAME oakvulkan
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
) )
if(WIN32) target_link_libraries(libolive-rendercore PUBLIC ${OLIVE_LIBRARIES} OfxHost)
set_target_properties(oakvulkan PROPERTIES PREFIX "") target_compile_definitions(libolive-rendercore PUBLIC ${OLIVE_DEFINITIONS})
endif() target_compile_options(libolive-rendercore PUBLIC ${OLIVE_COMPILE_OPTIONS})
install(TARGETS oakvulkan
RUNTIME DESTINATION bin add_library(oakgl SHARED
LIBRARY DESTINATION lib render/opengl/openglbackend_c.cpp
ARCHIVE DESTINATION lib render/opengl/openglrenderer.cpp
render/opengl/openglrenderer.h
) )
endif() target_link_libraries(oakgl PRIVATE libolive-rendercore)
endif() target_compile_definitions(oakgl PRIVATE OAK_RENDER_BACKEND_PLUGIN)
set_target_properties(oakgl PROPERTIES
OUTPUT_NAME oakgl
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
)
if (WIN32)
set_target_properties(oakgl PROPERTIES PREFIX "")
endif ()
install(TARGETS oakgl
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
)
if (Vulkan_FOUND)
add_library(oakvulkan SHARED
render/vulkan/vulkanbackend_c.cpp
render/vulkan/vulkanrenderer.cpp
render/vulkan/vulkanrenderer.h
)
target_link_libraries(oakvulkan PRIVATE libolive-rendercore)
target_link_libraries(oakvulkan PRIVATE Vulkan::Vulkan)
target_compile_definitions(oakvulkan PRIVATE OAK_HAS_VULKAN)
if (SHADERC_FOUND)
target_link_libraries(oakvulkan PRIVATE ${SHADERC_LIBRARIES})
target_include_directories(oakvulkan PRIVATE ${SHADERC_INCLUDE_DIRS})
target_compile_definitions(oakvulkan PRIVATE OAK_HAS_SHADERC)
endif ()
set_target_properties(oakvulkan PROPERTIES
OUTPUT_NAME oakvulkan
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
)
if (WIN32)
set_target_properties(oakvulkan PROPERTIES PREFIX "")
endif ()
install(TARGETS oakvulkan
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
)
endif ()
endif ()
add_library(oakgl-cabi-check OBJECT add_library(oakgl-cabi-check OBJECT
render/opengl/openglbackend_c.cpp render/opengl/openglbackend_c.cpp
) )
target_include_directories(oakgl-cabi-check PRIVATE target_include_directories(oakgl-cabi-check PRIVATE
${CMAKE_SOURCE_DIR}/app ${CMAKE_SOURCE_DIR}/app
${CMAKE_SOURCE_DIR}/third_party/openfx/include ${CMAKE_SOURCE_DIR}/third_party/openfx/include
${CMAKE_SOURCE_DIR}/third_party/openfx/HostSupport/include ${CMAKE_SOURCE_DIR}/third_party/openfx/HostSupport/include
${OLIVE_INCLUDE_DIRS} ${OLIVE_INCLUDE_DIRS}
) )
target_link_libraries(oakgl-cabi-check PRIVATE ${OLIVE_LIBRARIES} OfxHost) target_link_libraries(oakgl-cabi-check PRIVATE ${OLIVE_LIBRARIES} OfxHost)
target_compile_definitions(oakgl-cabi-check PRIVATE ${OLIVE_DEFINITIONS}) target_compile_definitions(oakgl-cabi-check PRIVATE ${OLIVE_DEFINITIONS})
target_compile_options(oakgl-cabi-check PRIVATE ${OLIVE_COMPILE_OPTIONS}) target_compile_options(oakgl-cabi-check PRIVATE ${OLIVE_COMPILE_OPTIONS})
if(Vulkan_FOUND) if (Vulkan_FOUND)
add_library(oakvulkan-cabi-check OBJECT add_library(oakvulkan-cabi-check OBJECT
render/vulkan/vulkanbackend_c.cpp render/vulkan/vulkanbackend_c.cpp
render/vulkan/vulkanrenderer.cpp render/vulkan/vulkanrenderer.cpp
render/vulkan/vulkanrenderer.h render/vulkan/vulkanrenderer.h
) )
target_include_directories(oakvulkan-cabi-check PRIVATE target_include_directories(oakvulkan-cabi-check PRIVATE
${CMAKE_SOURCE_DIR}/app ${CMAKE_SOURCE_DIR}/app
${CMAKE_SOURCE_DIR}/third_party/openfx/include ${CMAKE_SOURCE_DIR}/third_party/openfx/include
${CMAKE_SOURCE_DIR}/third_party/openfx/HostSupport/include ${CMAKE_SOURCE_DIR}/third_party/openfx/HostSupport/include
${OLIVE_INCLUDE_DIRS} ${OLIVE_INCLUDE_DIRS}
) )
target_link_libraries(oakvulkan-cabi-check PRIVATE Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Gui Qt${QT_VERSION_MAJOR}::Widgets) target_link_libraries(oakvulkan-cabi-check PRIVATE Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Gui Qt${QT_VERSION_MAJOR}::Widgets)
target_link_libraries(oakvulkan-cabi-check PRIVATE Vulkan::Vulkan) target_link_libraries(oakvulkan-cabi-check PRIVATE Vulkan::Vulkan)
target_compile_definitions(oakvulkan-cabi-check PRIVATE OAK_HAS_VULKAN) target_compile_definitions(oakvulkan-cabi-check PRIVATE OAK_HAS_VULKAN)
if(SHADERC_FOUND) if (SHADERC_FOUND)
target_link_libraries(oakvulkan-cabi-check PRIVATE ${SHADERC_LIBRARIES}) target_link_libraries(oakvulkan-cabi-check PRIVATE ${SHADERC_LIBRARIES})
target_include_directories(oakvulkan-cabi-check PRIVATE ${SHADERC_INCLUDE_DIRS}) target_include_directories(oakvulkan-cabi-check PRIVATE ${SHADERC_INCLUDE_DIRS})
target_compile_definitions(oakvulkan-cabi-check PRIVATE OAK_HAS_SHADERC) target_compile_definitions(oakvulkan-cabi-check PRIVATE OAK_HAS_SHADERC)
endif() endif ()
target_compile_definitions(oakvulkan-cabi-check PRIVATE ${OLIVE_DEFINITIONS}) target_compile_definitions(oakvulkan-cabi-check PRIVATE ${OLIVE_DEFINITIONS})
target_compile_options(oakvulkan-cabi-check PRIVATE ${OLIVE_COMPILE_OPTIONS}) target_compile_options(oakvulkan-cabi-check PRIVATE ${OLIVE_COMPILE_OPTIONS})
endif() endif ()
# Add application # Add application
add_executable(olive-editor add_executable(olive-editor
main.cpp main.cpp
$<TARGET_OBJECTS:libolive-editor> $<TARGET_OBJECTS:libolive-editor>
$<TARGET_OBJECTS:olive-version-obj> $<TARGET_OBJECTS:olive-version-obj>
) )
target_include_directories(olive-editor PUBLIC pluginSupport) target_include_directories(olive-editor PUBLIC pluginSupport)
target_link_libraries(olive-editor PUBLIC OfxHost) target_link_libraries(olive-editor PUBLIC OfxHost)
add_dependencies(olive-editor oakgl-cabi-check) add_dependencies(olive-editor oakgl-cabi-check)
if (OAK_ENABLE_DYNAMIC_RENDER_BACKEND) if (OAK_ENABLE_DYNAMIC_RENDER_BACKEND)
add_dependencies(olive-editor oakgl) add_dependencies(olive-editor oakgl)
if (TARGET oakvulkan) if (TARGET oakvulkan)
add_dependencies(olive-editor oakvulkan) add_dependencies(olive-editor oakvulkan)
endif() endif ()
endif() endif ()
# Ensure the render worker is always built together with the editor on every platform. # Ensure the render worker is always built together with the editor on every platform.
add_dependencies(olive-editor olive-render-worker) add_dependencies(olive-editor olive-render-worker)
@@ -258,79 +258,79 @@ set_target_properties(olive-editor PROPERTIES OUTPUT_NAME "oak-editor")
# currently the full OLIVE_LIBRARIES for simplicity; trimming UI-only dependencies is a later-phase # currently the full OLIVE_LIBRARIES for simplicity; trimming UI-only dependencies is a later-phase
# cleanup (see render-process-isolation plan). # cleanup (see render-process-isolation plan).
add_executable(olive-render-worker add_executable(olive-render-worker
render/worker/workermain.cpp render/worker/workermain.cpp
$<TARGET_OBJECTS:libolive-editor> $<TARGET_OBJECTS:libolive-editor>
$<TARGET_OBJECTS:olive-version-obj> $<TARGET_OBJECTS:olive-version-obj>
) )
set_target_properties(olive-render-worker PROPERTIES OUTPUT_NAME "oak-render-worker") set_target_properties(olive-render-worker PROPERTIES OUTPUT_NAME "oak-render-worker")
if (APPLE) if (APPLE)
target_sources(olive-render-worker PRIVATE render/worker/workermain_mac.mm) target_sources(olive-render-worker PRIVATE render/worker/workermain_mac.mm)
target_link_libraries(olive-render-worker PRIVATE "-framework Cocoa") target_link_libraries(olive-render-worker PRIVATE "-framework Cocoa")
endif() endif ()
target_include_directories(olive-render-worker PUBLIC pluginSupport) target_include_directories(olive-render-worker PUBLIC pluginSupport)
target_link_libraries(olive-render-worker PUBLIC OfxHost) target_link_libraries(olive-render-worker PUBLIC OfxHost)
if (OAK_ENABLE_DYNAMIC_RENDER_BACKEND) if (OAK_ENABLE_DYNAMIC_RENDER_BACKEND)
target_compile_definitions(olive-render-worker PRIVATE OAK_ENABLE_DYNAMIC_RENDER_BACKEND) target_compile_definitions(olive-render-worker PRIVATE OAK_ENABLE_DYNAMIC_RENDER_BACKEND)
add_dependencies(olive-render-worker oakgl) add_dependencies(olive-render-worker oakgl)
if (TARGET oakvulkan) if (TARGET oakvulkan)
add_dependencies(olive-render-worker oakvulkan) add_dependencies(olive-render-worker oakvulkan)
endif() endif ()
endif() endif ()
# Create docs if doxygen was found # Create docs if doxygen was found
if(DOXYGEN_FOUND) if (DOXYGEN_FOUND)
set(DOXYGEN_PROJECT_NAME "Oak Video Editor") set(DOXYGEN_PROJECT_NAME "Oak Video Editor")
set(DOXYGEN_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/docs") set(DOXYGEN_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/docs")
set(DOXYGEN_EXTRACT_ALL "YES") set(DOXYGEN_EXTRACT_ALL "YES")
set(DOXYGEN_EXTRACT_PRIVATE "YES") set(DOXYGEN_EXTRACT_PRIVATE "YES")
doxygen_add_docs(docs ALL ${OLIVE_SOURCES}) doxygen_add_docs(docs ALL ${OLIVE_SOURCES})
endif() endif ()
# Platform-specific deployment preferences # Platform-specific deployment preferences
if (WIN32) if (WIN32)
# Set Windows application icon # Set Windows application icon
target_sources(olive-editor PRIVATE packaging/windows/resources.rc) target_sources(olive-editor PRIVATE packaging/windows/resources.rc)
# Preserve folder structure in visual studio # Preserve folder structure in visual studio
source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} FILES ${OLIVE_SOURCES}) source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} FILES ${OLIVE_SOURCES})
elseif(APPLE) elseif (APPLE)
# Set Mac application icon # Set Mac application icon
set(OLIVE_ICON packaging/macos/oak.icns) set(OLIVE_ICON packaging/macos/oak.icns)
target_sources(olive-editor PRIVATE ${OLIVE_ICON}) target_sources(olive-editor PRIVATE ${OLIVE_ICON})
# Set Mac bundle properties # Set Mac bundle properties
set_target_properties(olive-editor PROPERTIES set_target_properties(olive-editor PROPERTIES
MACOSX_BUNDLE TRUE MACOSX_BUNDLE TRUE
MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/packaging/macos/MacOSXBundleInfo.plist.in MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/packaging/macos/MacOSXBundleInfo.plist.in
MACOSX_BUNDLE_GUI_IDENTIFIER org.oakvideoeditor.Oak MACOSX_BUNDLE_GUI_IDENTIFIER org.oakvideoeditor.Oak
MACOSX_BUNDLE_ICON_FILE oak.icns MACOSX_BUNDLE_ICON_FILE oak.icns
MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION} MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION}
MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION} MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION}
MACOSX_BUNDLE_BUNDLE_NAME "Oak Video Editor" MACOSX_BUNDLE_BUNDLE_NAME "Oak Video Editor"
MACOSX_BUNDLE_INFO_STRING "Oak Video Editor ${PROJECT_LONG_VERSION}" MACOSX_BUNDLE_INFO_STRING "Oak Video Editor ${PROJECT_LONG_VERSION}"
MACOSX_BUNDLE_COPYRIGHT "©2018-2021 Olive Studios LLC and others. Fork maintained by Oak Video Editor Team." MACOSX_BUNDLE_COPYRIGHT "©2018-2021 Olive Studios LLC and others. Fork maintained by Oak Video Editor Team."
RESOURCE "${OLIVE_ICON}" RESOURCE "${OLIVE_ICON}"
OUTPUT_NAME "Oak" OUTPUT_NAME "Oak"
)
# Copy the render worker and dynamic render backends into the app bundle.
# They are looked up in QCoreApplication::applicationDirPath(), which on
# macOS points to Oak.app/Contents/MacOS.
add_custom_command(TARGET olive-editor POST_BUILD
COMMAND ${CMAKE_COMMAND} -E make_directory $<TARGET_BUNDLE_DIR:olive-editor>/Contents/MacOS
COMMAND ${CMAKE_COMMAND} -E copy_if_different $<TARGET_FILE:olive-render-worker> $<TARGET_BUNDLE_DIR:olive-editor>/Contents/MacOS/
COMMAND ${CMAKE_COMMAND} -E copy_if_different $<TARGET_FILE:oakgl> $<TARGET_BUNDLE_DIR:olive-editor>/Contents/MacOS/
COMMENT "Copying oak-render-worker and render backends into Oak.app"
)
if (TARGET oakvulkan)
add_custom_command(TARGET olive-editor POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different $<TARGET_FILE:oakvulkan> $<TARGET_BUNDLE_DIR:olive-editor>/Contents/MacOS/
) )
endif()
elseif(UNIX) # Copy the render worker and dynamic render backends into the app bundle.
# Set Linux-specific properties for application # They are looked up in QCoreApplication::applicationDirPath(), which on
install(TARGETS olive-editor RUNTIME DESTINATION bin) # macOS points to Oak.app/Contents/MacOS.
endif() add_custom_command(TARGET olive-editor POST_BUILD
COMMAND ${CMAKE_COMMAND} -E make_directory $<TARGET_BUNDLE_DIR:olive-editor>/Contents/MacOS
COMMAND ${CMAKE_COMMAND} -E copy_if_different $<TARGET_FILE:olive-render-worker> $<TARGET_BUNDLE_DIR:olive-editor>/Contents/MacOS/
COMMAND ${CMAKE_COMMAND} -E copy_if_different $<TARGET_FILE:oakgl> $<TARGET_BUNDLE_DIR:olive-editor>/Contents/MacOS/
COMMENT "Copying oak-render-worker and render backends into Oak.app"
)
if (TARGET oakvulkan)
add_custom_command(TARGET olive-editor POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different $<TARGET_FILE:oakvulkan> $<TARGET_BUNDLE_DIR:olive-editor>/Contents/MacOS/
)
endif ()
elseif (UNIX)
# Set Linux-specific properties for application
install(TARGETS olive-editor RUNTIME DESTINATION bin)
endif ()
# Set link libraries # Set link libraries
target_link_libraries(olive-editor PRIVATE ${OLIVE_LIBRARIES}) target_link_libraries(olive-editor PRIVATE ${OLIVE_LIBRARIES})
@@ -354,10 +354,10 @@ target_include_directories(olive-render-worker PRIVATE ${OLIVE_INCLUDE_DIRS})
# Install the render worker alongside the editor on Linux. # Install the render worker alongside the editor on Linux.
if (UNIX AND NOT APPLE) if (UNIX AND NOT APPLE)
install(TARGETS olive-render-worker RUNTIME DESTINATION bin) install(TARGETS olive-render-worker RUNTIME DESTINATION bin)
endif() endif ()
# Add crash handler # Add crash handler
if (GoogleCrashpad_FOUND AND Qt${QT_VERSION_MAJOR}Network_FOUND) if (GoogleCrashpad_FOUND AND Qt${QT_VERSION_MAJOR}Network_FOUND)
add_subdirectory(crashhandler) add_subdirectory(crashhandler)
endif() endif ()
+14 -14
View File
@@ -15,18 +15,18 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
set(OLIVE_SOURCES set(OLIVE_SOURCES
${OLIVE_SOURCES} ${OLIVE_SOURCES}
audio/audiolevelmeter.cpp audio/audiolevelmeter.cpp
audio/audiolevelmeter.h audio/audiolevelmeter.h
audio/audiosynchronizer.cpp audio/audiosynchronizer.cpp
audio/audiosynchronizer.h audio/audiosynchronizer.h
audio/audiowaveformsync.cpp audio/audiowaveformsync.cpp
audio/audiowaveformsync.h audio/audiowaveformsync.h
audio/audiomanager.cpp audio/audiomanager.cpp
audio/audiomanager.h audio/audiomanager.h
audio/audioprocessor.cpp audio/audioprocessor.cpp
audio/audioprocessor.h audio/audioprocessor.h
audio/audiovisualwaveform.cpp audio/audiovisualwaveform.cpp
audio/audiovisualwaveform.h audio/audiovisualwaveform.h
PARENT_SCOPE PARENT_SCOPE
) )
+4 -3
View File
@@ -57,7 +57,8 @@ AudioLevelMeter::AnalyzeSampleBuffer(const core::SampleBuffer &samples)
square_sum += value * value; square_sum += value * value;
} }
const double mean_square = square_sum / static_cast<double>(sample_count); const double mean_square =
square_sum / static_cast<double>(sample_count);
const double rms = std::sqrt(mean_square); const double rms = std::sqrt(mean_square);
ChannelStats channel_stats; ChannelStats channel_stats;
@@ -74,8 +75,8 @@ AudioLevelMeter::AnalyzeSampleBuffer(const core::SampleBuffer &samples)
} }
stats.silence = qFuzzyIsNull(stats.max_peak_linear); stats.silence = qFuzzyIsNull(stats.max_peak_linear);
stats.integrated_lufs = PowerToLufs( stats.integrated_lufs =
total_square / static_cast<double>(total_samples)); PowerToLufs(total_square / static_cast<double>(total_samples));
return stats; return stats;
} }
+5 -6
View File
@@ -28,8 +28,7 @@ AudioSynchronizer::Placement AudioSynchronizer::PlaceBySourceTime(
const core::rational &reference_timeline_in) const core::rational &reference_timeline_in)
{ {
Placement placement; Placement placement;
if (!reference.has_source_start_time || if (!reference.has_source_start_time || !candidate.has_source_start_time ||
!candidate.has_source_start_time ||
reference.source_start_time.isNaN() || reference.source_start_time.isNaN() ||
candidate.source_start_time.isNaN()) { candidate.source_start_time.isNaN()) {
return placement; return placement;
@@ -55,10 +54,10 @@ AudioSynchronizer::Placement AudioSynchronizer::PlaceByWaveformOffset(
return placement; return placement;
} }
placement.timeline_in = placement.timeline_in = reference_timeline_in +
reference_timeline_in + core::rational::fromDouble(
core::rational::fromDouble(static_cast<double>(candidate_offset_samples) / static_cast<double>(candidate_offset_samples) /
static_cast<double>(sample_rate)); static_cast<double>(sample_rate));
placement.valid = !placement.timeline_in.isNaN(); placement.valid = !placement.timeline_in.isNaN();
return placement; return placement;
} }
+6 -6
View File
@@ -41,13 +41,13 @@ public:
bool valid = false; bool valid = false;
}; };
static Placement PlaceBySourceTime(const SourceClip &reference, static Placement
const SourceClip &candidate, PlaceBySourceTime(const SourceClip &reference, const SourceClip &candidate,
const core::rational &reference_timeline_in); const core::rational &reference_timeline_in);
static Placement PlaceByWaveformOffset( static Placement
const core::rational &reference_timeline_in, PlaceByWaveformOffset(const core::rational &reference_timeline_in,
int64_t candidate_offset_samples, int sample_rate); int64_t candidate_offset_samples, int sample_rate);
}; };
} }
+3 -3
View File
@@ -96,7 +96,8 @@ AudioWaveformSync::OffsetResult AudioWaveformSync::EstimateEnvelopeOffset(
int64_t best_lag = 0; int64_t best_lag = 0;
for (int64_t lag = -max_offset_windows; lag <= max_offset_windows; lag++) { for (int64_t lag = -max_offset_windows; lag <= max_offset_windows; lag++) {
const int reference_start = static_cast<int>(std::max<int64_t>(0, -lag)); const int reference_start =
static_cast<int>(std::max<int64_t>(0, -lag));
const int candidate_start = static_cast<int>(std::max<int64_t>(0, lag)); const int candidate_start = static_cast<int>(std::max<int64_t>(0, lag));
const int overlap = std::min(reference.size() - reference_start, const int overlap = std::min(reference.size() - reference_start,
candidate.size() - candidate_start); candidate.size() - candidate_start);
@@ -142,8 +143,7 @@ AudioWaveformSync::OffsetResult AudioWaveformSync::EstimateEnvelopeOffset(
if (best_score > -2.0) { if (best_score > -2.0) {
result.valid = true; result.valid = true;
result.confidence = std::max(0.0, best_score); result.confidence = std::max(0.0, best_score);
result.offset_samples = result.offset_samples = best_lag * static_cast<int64_t>(window_samples);
best_lag * static_cast<int64_t>(window_samples);
} }
return result; return result;
+2 -2
View File
@@ -38,8 +38,8 @@ public:
bool valid = false; bool valid = false;
}; };
static QVector<double> static QVector<double> ExtractRmsEnvelope(const core::SampleBuffer &samples,
ExtractRmsEnvelope(const core::SampleBuffer &samples, size_t window_samples); size_t window_samples);
static OffsetResult EstimateOffset(const core::SampleBuffer &reference, static OffsetResult EstimateOffset(const core::SampleBuffer &reference,
const core::SampleBuffer &candidate, const core::SampleBuffer &candidate,
+2 -2
View File
@@ -18,6 +18,6 @@ add_subdirectory(cliprogress)
add_subdirectory(clitask) add_subdirectory(clitask)
set(OLIVE_SOURCES set(OLIVE_SOURCES
${OLIVE_SOURCES} ${OLIVE_SOURCES}
PARENT_SCOPE PARENT_SCOPE
) )
+4 -4
View File
@@ -15,8 +15,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
set(OLIVE_SOURCES set(OLIVE_SOURCES
${OLIVE_SOURCES} ${OLIVE_SOURCES}
cli/cliprogress/cliprogressdialog.h cli/cliprogress/cliprogressdialog.h
cli/cliprogress/cliprogressdialog.cpp cli/cliprogress/cliprogressdialog.cpp
PARENT_SCOPE PARENT_SCOPE
) )
+4 -4
View File
@@ -15,8 +15,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
set(OLIVE_SOURCES set(OLIVE_SOURCES
${OLIVE_SOURCES} ${OLIVE_SOURCES}
cli/clitask/clitaskdialog.h cli/clitask/clitaskdialog.h
cli/clitask/clitaskdialog.cpp cli/clitask/clitaskdialog.cpp
PARENT_SCOPE PARENT_SCOPE
) )
+20 -20
View File
@@ -18,24 +18,24 @@ add_subdirectory(ffmpeg)
add_subdirectory(oiio) add_subdirectory(oiio)
set(OLIVE_SOURCES set(OLIVE_SOURCES
${OLIVE_SOURCES} ${OLIVE_SOURCES}
codec/conformmanager.cpp codec/conformmanager.cpp
codec/conformmanager.h codec/conformmanager.h
codec/decoder.cpp codec/decoder.cpp
codec/decoder.h codec/decoder.h
codec/encoder.cpp codec/encoder.cpp
codec/encoder.h codec/encoder.h
codec/exportcodec.cpp codec/exportcodec.cpp
codec/exportcodec.h codec/exportcodec.h
codec/exportformat.cpp codec/exportformat.cpp
codec/exportformat.h codec/exportformat.h
codec/frame.cpp codec/frame.cpp
codec/frame.h codec/frame.h
codec/planarfiledevice.cpp codec/planarfiledevice.cpp
codec/planarfiledevice.h codec/planarfiledevice.h
codec/proxymanager.cpp codec/proxymanager.cpp
codec/proxymanager.h codec/proxymanager.h
codec/timecodemetadata.cpp codec/timecodemetadata.cpp
codec/timecodemetadata.h codec/timecodemetadata.h
PARENT_SCOPE PARENT_SCOPE
) )
+1 -1
View File
@@ -32,7 +32,7 @@ extern "C" {
#include <QWaitCondition> #include <QWaitCondition>
#include <stdint.h> #include <stdint.h>
#include "codec/frame.h" #include "codec/frame.h"
#include "node/block/block.h" #include "node/block/block.h"
#include "node/project/footage/footagedescription.h" #include "node/project/footage/footagedescription.h"
#include "render/cancelatom.h" #include "render/cancelatom.h"
+6 -6
View File
@@ -15,10 +15,10 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
set(OLIVE_SOURCES set(OLIVE_SOURCES
${OLIVE_SOURCES} ${OLIVE_SOURCES}
codec/ffmpeg/ffmpegdecoder.cpp codec/ffmpeg/ffmpegdecoder.cpp
codec/ffmpeg/ffmpegdecoder.h codec/ffmpeg/ffmpegdecoder.h
codec/ffmpeg/ffmpegencoder.cpp codec/ffmpeg/ffmpegencoder.cpp
codec/ffmpeg/ffmpegencoder.h codec/ffmpeg/ffmpegencoder.h
PARENT_SCOPE PARENT_SCOPE
) )
+127 -110
View File
@@ -25,11 +25,11 @@ extern "C" {
#include <libavutil/pixdesc.h> #include <libavutil/pixdesc.h>
} }
namespace olive { namespace olive
{
static FramePtr CopyPackedAVFrameToFrame(const AVFramePtr &src, static FramePtr CopyPackedAVFrameToFrame(const AVFramePtr &src,
PixelFormat format, PixelFormat format, int channel_count,
int channel_count,
const rational &timestamp) const rational &timestamp)
{ {
if (!src || !src->data[0]) { if (!src || !src->data[0]) {
@@ -48,8 +48,7 @@ static FramePtr CopyPackedAVFrameToFrame(const AVFramePtr &src,
VideoParams::GetBytesPerPixel(format, channel_count); VideoParams::GetBytesPerPixel(format, channel_count);
for (int y = 0; y < frame->height(); y++) { for (int y = 0; y < frame->height(); y++) {
memcpy(frame->data() + y * frame->linesize_bytes(), memcpy(frame->data() + y * frame->linesize_bytes(),
src->data[0] + y * src->linesize[0], src->data[0] + y * src->linesize[0], size_t(row_bytes));
size_t(row_bytes));
} }
return frame; return frame;
@@ -97,7 +96,8 @@ namespace olive
QVariant Yuv2RgbShader; QVariant Yuv2RgbShader;
QVariant DeinterlaceShader; QVariant DeinterlaceShader;
namespace { namespace
{
constexpr int64_t kAnalyzeDurationUs = 5000000; constexpr int64_t kAnalyzeDurationUs = 5000000;
constexpr int64_t kProbeSizeBytes = 20000000; constexpr int64_t kProbeSizeBytes = 20000000;
@@ -133,8 +133,9 @@ void DiscardSubtitleStreams(AVFormatContext *ctx)
} }
} }
TimecodeMetadata::SourceTime ExtractSourceStartTime( TimecodeMetadata::SourceTime ExtractSourceStartTime(AVDictionary *metadata,
AVDictionary *metadata, const rational &timebase, int sample_rate) const rational &timebase,
int sample_rate)
{ {
if (!metadata) { if (!metadata) {
return TimecodeMetadata::SourceTime(); return TimecodeMetadata::SourceTime();
@@ -423,7 +424,7 @@ TexturePtr FFmpegDecoder::RetrieveVideoInternal(const RetrieveVideoParams &p)
// Perform any CPU processing required // Perform any CPU processing required
AVFramePtr ptr = PreProcessFrame(f, p); AVFramePtr ptr = PreProcessFrame(f, p);
f=std::move(ptr); f = std::move(ptr);
if (!f) { if (!f) {
qWarning() << "PreProcessFrame failed"; qWarning() << "PreProcessFrame failed";
return nullptr; return nullptr;
@@ -458,14 +459,15 @@ FramePtr FFmpegDecoder::RetrieveVideoFrameInternal(const RetrieveVideoParams &p)
AVFramePtr dest = CreateAVFramePtr(); AVFramePtr dest = CreateAVFramePtr();
dest->width = f->width; dest->width = f->width;
dest->height = f->height; dest->height = f->height;
dest->format = p.maximum_format == PixelFormat::U8 dest->format = p.maximum_format == PixelFormat::U8 ? AV_PIX_FMT_RGBA :
? AV_PIX_FMT_RGBA AV_PIX_FMT_RGBA64;
: AV_PIX_FMT_RGBA64;
dest->color_range = f->color_range; dest->color_range = f->color_range;
dest->colorspace = f->colorspace; dest->colorspace = f->colorspace;
if (p.divider > 1) { if (p.divider > 1) {
dest->width = VideoParams::GetScaledDimension(dest->width, p.divider); dest->width =
dest->height = VideoParams::GetScaledDimension(dest->height, p.divider); VideoParams::GetScaledDimension(dest->width, p.divider);
dest->height =
VideoParams::GetScaledDimension(dest->height, p.divider);
} }
int r = av_frame_get_buffer(dest.get(), 0); int r = av_frame_get_buffer(dest.get(), 0);
@@ -504,8 +506,8 @@ FramePtr FFmpegDecoder::RetrieveVideoFrameInternal(const RetrieveVideoParams &p)
// zero-initializes the destination, leaving alpha at 0. The color // zero-initializes the destination, leaving alpha at 0. The color
// management shader later multiplies RGB by alpha, producing black. // management shader later multiplies RGB by alpha, producing black.
// Ensure alpha is opaque for source formats that have no alpha. // Ensure alpha is opaque for source formats that have no alpha.
const AVPixFmtDescriptor *src_desc = av_pix_fmt_desc_get( const AVPixFmtDescriptor *src_desc =
static_cast<AVPixelFormat>(f->format)); av_pix_fmt_desc_get(static_cast<AVPixelFormat>(f->format));
if (src_desc && !(src_desc->flags & AV_PIX_FMT_FLAG_ALPHA)) { if (src_desc && !(src_desc->flags & AV_PIX_FMT_FLAG_ALPHA)) {
const int bpc = (dest->format == AV_PIX_FMT_RGBA) ? 1 : 2; const int bpc = (dest->format == AV_PIX_FMT_RGBA) ? 1 : 2;
const int stride = dest->linesize[0]; const int stride = dest->linesize[0];
@@ -522,11 +524,10 @@ FramePtr FFmpegDecoder::RetrieveVideoFrameInternal(const RetrieveVideoParams &p)
} }
return CopyPackedAVFrameToFrame(dest, return CopyPackedAVFrameToFrame(dest,
dest->format == AV_PIX_FMT_RGBA dest->format == AV_PIX_FMT_RGBA ?
? PixelFormat::U8 PixelFormat::U8 :
: PixelFormat::U16, PixelFormat::U16,
VideoParams::kRGBAChannelCount, VideoParams::kRGBAChannelCount, p.time);
p.time);
} }
return nullptr; return nullptr;
@@ -580,7 +581,8 @@ FootageDescription FFmpegDecoder::Probe(const QString &filename,
AVFormatContext *fmt_ctx = nullptr; AVFormatContext *fmt_ctx = nullptr;
AVDictionary *format_opts = nullptr; AVDictionary *format_opts = nullptr;
ApplyFormatOpenOptions(&format_opts); ApplyFormatOpenOptions(&format_opts);
error_code = avformat_open_input(&fmt_ctx, filename_c, nullptr, &format_opts); error_code =
avformat_open_input(&fmt_ctx, filename_c, nullptr, &format_opts);
av_dict_free(&format_opts); av_dict_free(&format_opts);
TuneFormatContext(fmt_ctx); TuneFormatContext(fmt_ctx);
DiscardSubtitleStreams(fmt_ctx); DiscardSubtitleStreams(fmt_ctx);
@@ -591,9 +593,8 @@ FootageDescription FFmpegDecoder::Probe(const QString &filename,
avformat_find_stream_info(fmt_ctx, nullptr); avformat_find_stream_info(fmt_ctx, nullptr);
int64_t footage_duration = fmt_ctx->duration; int64_t footage_duration = fmt_ctx->duration;
TimecodeMetadata::SourceTime source_start_time = TimecodeMetadata::SourceTime source_start_time = ExtractSourceStartTime(
ExtractSourceStartTime(fmt_ctx->metadata, rational(1, AV_TIME_BASE), fmt_ctx->metadata, rational(1, AV_TIME_BASE), 0);
0);
bool duration_guessed_from_bitrate = bool duration_guessed_from_bitrate =
(fmt_ctx->duration_estimation_method == (fmt_ctx->duration_estimation_method ==
@@ -625,78 +626,87 @@ FootageDescription FFmpegDecoder::Probe(const QString &filename,
avstream->codecpar->codec_type == AVMEDIA_TYPE_SUBTITLE)) { avstream->codecpar->codec_type == AVMEDIA_TYPE_SUBTITLE)) {
if (avstream->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) { if (avstream->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) {
{ {
// Read at least two frames to get more information about this video stream // Read at least two frames to get more information about this video stream
AVPacket *pkt = av_packet_alloc(); AVPacket *pkt = av_packet_alloc();
AVFrame *frame = av_frame_alloc(); AVFrame *frame = av_frame_alloc();
VideoParams::Interlacing interlacing = VideoParams::kInterlaceNone; VideoParams::Interlacing interlacing =
AVRational pixel_aspect_ratio = {1, 1}; VideoParams::kInterlaceNone;
AVRational frame_rate = avstream->avg_frame_rate; AVRational pixel_aspect_ratio = { 1, 1 };
AVPixelFormat compatible_pix_fmt = AVRational frame_rate = avstream->avg_frame_rate;
FFmpegUtils::GetCompatiblePixelFormat( AVPixelFormat compatible_pix_fmt =
static_cast<AVPixelFormat>(avstream->codecpar->format)); FFmpegUtils::GetCompatiblePixelFormat(
bool image_is_still = false; static_cast<AVPixelFormat>(
avstream->codecpar->format));
bool image_is_still = false;
{ {
Instance instance; Instance instance;
if (instance.Open(filename_c, avstream->index) != 0) if (instance.Open(filename_c, avstream->index) != 0)
goto cleanup; goto cleanup;
AVCodecContext *avctx = instance.codec_ctx(); AVCodecContext *avctx = instance.codec_ctx();
interlacing = FFmpegFieldOrderToOlive(avctx->field_order); interlacing =
FFmpegFieldOrderToOlive(avctx->field_order);
if (instance.GetFrame(pkt, frame) >= 0) { if (instance.GetFrame(pkt, frame) >= 0) {
pixel_aspect_ratio = pixel_aspect_ratio =
av_guess_sample_aspect_ratio(instance.fmt_ctx(), av_guess_sample_aspect_ratio(
instance.avstream(), frame); instance.fmt_ctx(), instance.avstream(),
frame_rate = frame);
av_guess_frame_rate(instance.fmt_ctx(), frame_rate = av_guess_frame_rate(
instance.avstream(), frame); instance.fmt_ctx(), instance.avstream(),
} frame);
}
int ret = instance.GetFrame(pkt, frame); int ret = instance.GetFrame(pkt, frame);
if (ret == AVERROR_EOF) { if (ret == AVERROR_EOF) {
image_is_still = true; image_is_still = true;
} else if (avstream->duration == AV_NOPTS_VALUE || } else if (avstream->duration == AV_NOPTS_VALUE ||
duration_guessed_from_bitrate) { duration_guessed_from_bitrate) {
int64_t last_ts = frame->best_effort_timestamp; int64_t last_ts = frame->best_effort_timestamp;
while (instance.GetFrame(pkt, frame) >= 0 && while (
(!cancelled || !cancelled->IsCancelled())) instance.GetFrame(pkt, frame) >= 0 &&
last_ts = frame->best_effort_timestamp; (!cancelled || !cancelled->IsCancelled()))
avstream->duration = last_ts; last_ts = frame->best_effort_timestamp;
} avstream->duration = last_ts;
}
instance.Close(); instance.Close();
} }
cleanup: cleanup:
av_frame_free(&frame); av_frame_free(&frame);
av_packet_free(&pkt); av_packet_free(&pkt);
VideoParams stream; VideoParams stream;
stream.set_stream_index(i); stream.set_stream_index(i);
stream.set_width(avstream->codecpar->width); stream.set_width(avstream->codecpar->width);
stream.set_height(avstream->codecpar->height); stream.set_height(avstream->codecpar->height);
stream.set_video_type(image_is_still ? VideoParams::kVideoTypeStill stream.set_video_type(image_is_still ?
: VideoParams::kVideoTypeVideo); VideoParams::kVideoTypeStill :
stream.set_format(GetNativePixelFormat(compatible_pix_fmt)); VideoParams::kVideoTypeVideo);
stream.set_channel_count(GetNativeChannelCount(compatible_pix_fmt)); stream.set_format(
stream.set_interlacing(interlacing); // <-- 已正确填充 GetNativePixelFormat(compatible_pix_fmt));
stream.set_pixel_aspect_ratio(pixel_aspect_ratio); stream.set_channel_count(
stream.set_frame_rate(frame_rate); GetNativeChannelCount(compatible_pix_fmt));
stream.set_start_time(avstream->start_time); stream.set_interlacing(interlacing); // <-- 已正确填充
stream.set_time_base(avstream->time_base); stream.set_pixel_aspect_ratio(pixel_aspect_ratio);
stream.set_duration(avstream->duration); stream.set_frame_rate(frame_rate);
stream.set_color_range(avstream->codecpar->color_range == AVCOL_RANGE_JPEG stream.set_start_time(avstream->start_time);
? VideoParams::kColorRangeFull stream.set_time_base(avstream->time_base);
: VideoParams::kColorRangeLimited); stream.set_duration(avstream->duration);
stream.set_premultiplied_alpha(false); stream.set_color_range(
avstream->codecpar->color_range ==
AVCOL_RANGE_JPEG ?
VideoParams::kColorRangeFull :
VideoParams::kColorRangeLimited);
stream.set_premultiplied_alpha(false);
desc.AddVideoStream(stream); desc.AddVideoStream(stream);
image_is_still ? still_streams++ : video_streams++; image_is_still ? still_streams++ : video_streams++;
} }
} else if (avstream->codecpar->codec_type == } else if (avstream->codecpar->codec_type ==
AVMEDIA_TYPE_AUDIO) { AVMEDIA_TYPE_AUDIO) {
// Create an audio stream object // Create an audio stream object
@@ -837,7 +847,7 @@ bool FFmpegDecoder::ConformAudioInternal(const QVector<QString> &filenames,
} }
// Create resampling context // Create resampling context
AVChannelLayout layout = params.channel_layout(); AVChannelLayout layout = params.channel_layout();
SwrContext *resampler=NULL; SwrContext *resampler = NULL;
swr_alloc_set_opts2( swr_alloc_set_opts2(
&resampler, &layout, &resampler, &layout,
FFmpegUtils::GetFFmpegSampleFormat(params.format()), FFmpegUtils::GetFFmpegSampleFormat(params.format()),
@@ -1270,14 +1280,14 @@ AVFramePtr FFmpegDecoder::RetrieveFrame(const rational &time,
AVFramePtr FFmpegDecoder::TransferHardwareFrame(AVFramePtr f) AVFramePtr FFmpegDecoder::TransferHardwareFrame(AVFramePtr f)
{ {
if (!instance_.hwaccel_enabled() || if (!instance_.hwaccel_enabled() || f->format != instance_.hw_pix_fmt()) {
f->format != instance_.hw_pix_fmt()) {
return f; return f;
} }
AVFrame *sw_frame = av_frame_alloc(); AVFrame *sw_frame = av_frame_alloc();
if (!sw_frame) { if (!sw_frame) {
qCritical() << "Failed to allocate software frame for hardware transfer"; qCritical()
<< "Failed to allocate software frame for hardware transfer";
return nullptr; return nullptr;
} }
@@ -1291,8 +1301,9 @@ AVFramePtr FFmpegDecoder::TransferHardwareFrame(AVFramePtr f)
ret = av_frame_copy_props(sw_frame, f.get()); ret = av_frame_copy_props(sw_frame, f.get());
if (ret < 0) { if (ret < 0) {
qWarning() << "Failed to copy frame properties during hardware transfer:" qWarning()
<< FFmpegError(ret); << "Failed to copy frame properties during hardware transfer:"
<< FFmpegError(ret);
} }
return CreateAVFramePtr(sw_frame); return CreateAVFramePtr(sw_frame);
@@ -1372,7 +1383,8 @@ bool FFmpegDecoder::Instance::Open(const char *filename, int stream_index)
// Open file in a format context // Open file in a format context
AVDictionary *format_opts = nullptr; AVDictionary *format_opts = nullptr;
ApplyFormatOpenOptions(&format_opts); ApplyFormatOpenOptions(&format_opts);
int error_code = avformat_open_input(&fmt_ctx_, filename, nullptr, &format_opts); int error_code =
avformat_open_input(&fmt_ctx_, filename, nullptr, &format_opts);
av_dict_free(&format_opts); av_dict_free(&format_opts);
TuneFormatContext(fmt_ctx_); TuneFormatContext(fmt_ctx_);
DiscardSubtitleStreams(fmt_ctx_); DiscardSubtitleStreams(fmt_ctx_);
@@ -1420,7 +1432,7 @@ bool FFmpegDecoder::Instance::Open(const char *filename, int stream_index)
// Handle failure to copy parameters // Handle failure to copy parameters
if (error_code < 0) { if (error_code < 0) {
qCritical() qCritical()
<< "Failed to copy parameters from AVStream to AVCodecContext"; << "Failed to copy parameters from AVStream to AVCodecContext";
return false; return false;
} }
@@ -1437,13 +1449,14 @@ bool FFmpegDecoder::Instance::Open(const char *filename, int stream_index)
error_code = avcodec_open2(codec_ctx_, codec, &opts_); error_code = avcodec_open2(codec_ctx_, codec, &opts_);
if (error_code == 0) { if (error_code == 0) {
hwaccel_enabled_ = true; hwaccel_enabled_ = true;
qDebug() << "Hardware decoding enabled for" << filename qDebug() << "Hardware decoding enabled for" << filename << "using"
<< "using" << av_hwdevice_get_type_name(hw_device_type_) << av_hwdevice_get_type_name(hw_device_type_)
<< "pixel format" << av_get_pix_fmt_name(hw_pix_fmt_); << "pixel format" << av_get_pix_fmt_name(hw_pix_fmt_);
return true; return true;
} }
qWarning() << "Failed to open hardware codec, falling back to software decoding:"; qWarning()
<< "Failed to open hardware codec, falling back to software decoding:";
char buf[512]; char buf[512];
av_strerror(error_code, buf, 512); av_strerror(error_code, buf, 512);
qWarning() << FFmpegError(error_code) << buf; qWarning() << FFmpegError(error_code) << buf;
@@ -1454,11 +1467,13 @@ bool FFmpegDecoder::Instance::Open(const char *filename, int stream_index)
codec_ctx_ = avcodec_alloc_context3(codec); codec_ctx_ = avcodec_alloc_context3(codec);
if (codec_ctx_ == nullptr) { if (codec_ctx_ == nullptr) {
qCritical() << "Failed to allocate codec context for software fallback"; qCritical()
<< "Failed to allocate codec context for software fallback";
return false; return false;
} }
error_code = avcodec_parameters_to_context(codec_ctx_, avstream_->codecpar); error_code =
avcodec_parameters_to_context(codec_ctx_, avstream_->codecpar);
if (error_code < 0) { if (error_code < 0) {
qCritical() qCritical()
<< "Failed to copy parameters from AVStream to AVCodecContext"; << "Failed to copy parameters from AVStream to AVCodecContext";
@@ -1494,25 +1509,26 @@ AVHWDeviceType FFmpegDecoder::Instance::ChooseHardwareDevice()
} }
} }
#elif defined(Q_OS_WIN) #elif defined(Q_OS_WIN)
for (AVHWDeviceType type : { AV_HWDEVICE_TYPE_D3D11VA, AV_HWDEVICE_TYPE_DXVA2, for (AVHWDeviceType type :
AV_HWDEVICE_TYPE_CUDA }) { { AV_HWDEVICE_TYPE_D3D11VA, AV_HWDEVICE_TYPE_DXVA2,
AV_HWDEVICE_TYPE_CUDA }) {
if (av_hwdevice_find_type_by_name(av_hwdevice_get_type_name(type)) != if (av_hwdevice_find_type_by_name(av_hwdevice_get_type_name(type)) !=
AV_HWDEVICE_TYPE_NONE) { AV_HWDEVICE_TYPE_NONE) {
return type; return type;
} }
} }
#elif defined(Q_OS_MACOS) #elif defined(Q_OS_MACOS)
if (av_hwdevice_find_type_by_name( if (av_hwdevice_find_type_by_name(av_hwdevice_get_type_name(
av_hwdevice_get_type_name(AV_HWDEVICE_TYPE_VIDEOTOOLBOX)) != AV_HWDEVICE_TYPE_VIDEOTOOLBOX)) != AV_HWDEVICE_TYPE_NONE) {
AV_HWDEVICE_TYPE_NONE) {
return AV_HWDEVICE_TYPE_VIDEOTOOLBOX; return AV_HWDEVICE_TYPE_VIDEOTOOLBOX;
} }
#endif #endif
return AV_HWDEVICE_TYPE_NONE; return AV_HWDEVICE_TYPE_NONE;
} }
AVPixelFormat FFmpegDecoder::Instance::GetHardwareFormat( AVPixelFormat
AVCodecContext *ctx, const AVPixelFormat *pix_fmts) FFmpegDecoder::Instance::GetHardwareFormat(AVCodecContext *ctx,
const AVPixelFormat *pix_fmts)
{ {
const Instance *inst = static_cast<const Instance *>(ctx->opaque); const Instance *inst = static_cast<const Instance *>(ctx->opaque);
for (const AVPixelFormat *p = pix_fmts; *p != AV_PIX_FMT_NONE; p++) { for (const AVPixelFormat *p = pix_fmts; *p != AV_PIX_FMT_NONE; p++) {
@@ -1521,7 +1537,8 @@ AVPixelFormat FFmpegDecoder::Instance::GetHardwareFormat(
} }
} }
qWarning() << "Hardware pixel format not supported by decoder, using first software format"; qWarning()
<< "Hardware pixel format not supported by decoder, using first software format";
return pix_fmts[0]; return pix_fmts[0];
} }
@@ -1547,9 +1564,9 @@ bool FFmpegDecoder::Instance::InitHardwareAcceleration(const AVCodec *codec)
} }
if (hw_pix_fmt_ == AV_PIX_FMT_NONE) { if (hw_pix_fmt_ == AV_PIX_FMT_NONE) {
qDebug() << "Codec" << codec->id qDebug()
<< "does not support hardware device type" << "Codec" << codec->id << "does not support hardware device type"
<< av_hwdevice_get_type_name(device_type); << av_hwdevice_get_type_name(device_type);
return false; return false;
} }
+3 -2
View File
@@ -74,7 +74,8 @@ protected:
virtual bool OpenInternal() override; virtual bool OpenInternal() override;
virtual TexturePtr virtual TexturePtr
RetrieveVideoInternal(const RetrieveVideoParams &p) override; RetrieveVideoInternal(const RetrieveVideoParams &p) override;
virtual FramePtr RetrieveVideoFrameInternal(const RetrieveVideoParams &p) override; virtual FramePtr
RetrieveVideoFrameInternal(const RetrieveVideoParams &p) override;
virtual bool ConformAudioInternal(const QVector<QString> &filenames, virtual bool ConformAudioInternal(const QVector<QString> &filenames,
const AudioParams &params, const AudioParams &params,
CancelAtom *cancelled) override; CancelAtom *cancelled) override;
@@ -145,7 +146,7 @@ private:
private: private:
static AVHWDeviceType ChooseHardwareDevice(); static AVHWDeviceType ChooseHardwareDevice();
static AVPixelFormat GetHardwareFormat(AVCodecContext *ctx, static AVPixelFormat GetHardwareFormat(AVCodecContext *ctx,
const AVPixelFormat *pix_fmts); const AVPixelFormat *pix_fmts);
bool InitHardwareAcceleration(const AVCodec *codec); bool InitHardwareAcceleration(const AVCodec *codec);
void CleanupHardwareAcceleration(); void CleanupHardwareAcceleration();
+6 -6
View File
@@ -15,10 +15,10 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
set(OLIVE_SOURCES set(OLIVE_SOURCES
${OLIVE_SOURCES} ${OLIVE_SOURCES}
codec/oiio/oiiodecoder.cpp codec/oiio/oiiodecoder.cpp
codec/oiio/oiiodecoder.h codec/oiio/oiiodecoder.h
codec/oiio/oiioencoder.cpp codec/oiio/oiioencoder.cpp
codec/oiio/oiioencoder.h codec/oiio/oiioencoder.h
PARENT_SCOPE PARENT_SCOPE
) )
+2 -1
View File
@@ -185,7 +185,8 @@ FramePtr OIIODecoder::RetrieveVideoFrameInternal(const RetrieveVideoParams &p)
if (!frame->allocate()) { if (!frame->allocate()) {
return nullptr; return nullptr;
} }
memcpy(frame->data(), buffer_.const_data(), size_t(buffer_.allocated_size())); memcpy(frame->data(), buffer_.const_data(),
size_t(buffer_.allocated_size()));
return frame; return frame;
} }
+2 -1
View File
@@ -51,7 +51,8 @@ protected:
virtual bool OpenInternal() override; virtual bool OpenInternal() override;
virtual TexturePtr virtual TexturePtr
RetrieveVideoInternal(const RetrieveVideoParams &p) override; RetrieveVideoInternal(const RetrieveVideoParams &p) override;
virtual FramePtr RetrieveVideoFrameInternal(const RetrieveVideoParams &p) override; virtual FramePtr
RetrieveVideoFrameInternal(const RetrieveVideoParams &p) override;
virtual void CloseInternal() override; virtual void CloseInternal() override;
private: private:
+13 -15
View File
@@ -52,14 +52,12 @@ QString ProxyManager::GetProxyFilename(const QString &cache_path,
const QString proxy_dir = GetProxyDirectory(cache_path); const QString proxy_dir = GetProxyDirectory(cache_path);
const QString extension = const QString extension =
params.extension.isEmpty() ? QStringLiteral("mp4") : params.extension; params.extension.isEmpty() ? QStringLiteral("mp4") : params.extension;
const QString filename = QStringLiteral("%1-%2.%3x%4.v%5.%6") const QString filename =
.arg(FileFunctions::GetUniqueFileIdentifier( QStringLiteral("%1-%2.%3x%4.v%5.%6")
source_filename), .arg(FileFunctions::GetUniqueFileIdentifier(source_filename),
QString::number(stream_index), QString::number(stream_index), QString::number(params.width),
QString::number(params.width), QString::number(params.height),
QString::number(params.height), QString::number(params.version), extension);
QString::number(params.version),
extension);
return QDir(proxy_dir).filePath(filename); return QDir(proxy_dir).filePath(filename);
} }
@@ -119,9 +117,10 @@ ProxyManager::ProxyStateFromString(const QString &state)
return kProxyMissing; return kProxyMissing;
} }
ProxyManager::Proxy ProxyManager::GetOrStartProxy( ProxyManager::Proxy
const QString &cache_path, const QString &source_filename, ProxyManager::GetOrStartProxy(const QString &cache_path,
int stream_index, const ProxyParams &params) const QString &source_filename, int stream_index,
const ProxyParams &params)
{ {
QMutexLocker locker(&mutex_); QMutexLocker locker(&mutex_);
@@ -145,10 +144,9 @@ ProxyManager::Proxy ProxyManager::GetOrStartProxy(
} }
const QString working_filename = GetWorkingProxyFilename(filename); const QString working_filename = GetWorkingProxyFilename(filename);
ProxyTask *task = new ProxyTask(source_filename, stream_index, params, ProxyTask *task =
working_filename); new ProxyTask(source_filename, stream_index, params, working_filename);
connect(task, &Task::Finished, this, connect(task, &Task::Finished, this, &ProxyManager::ProxyTaskFinished);
&ProxyManager::ProxyTaskFinished);
task->moveToThread(TaskManager::instance()->thread()); task->moveToThread(TaskManager::instance()->thread());
QMetaObject::invokeMethod(TaskManager::instance(), "AddTask", QMetaObject::invokeMethod(TaskManager::instance(), "AddTask",
Qt::QueuedConnection, Q_ARG(Task *, task)); Qt::QueuedConnection, Q_ARG(Task *, task));
+1 -2
View File
@@ -90,8 +90,7 @@ public:
static ProxyState ProxyStateFromString(const QString &state); static ProxyState ProxyStateFromString(const QString &state);
Proxy GetOrStartProxy(const QString &cache_path, Proxy GetOrStartProxy(const QString &cache_path,
const QString &source_filename, const QString &source_filename, int stream_index,
int stream_index,
const ProxyParams &params); const ProxyParams &params);
signals: signals:
+10 -9
View File
@@ -28,8 +28,9 @@
namespace olive namespace olive
{ {
TimecodeMetadata::SourceTime TimecodeMetadata::FromTimecodeString( TimecodeMetadata::SourceTime
const QString &timecode, const core::rational &timebase) TimecodeMetadata::FromTimecodeString(const QString &timecode,
const core::rational &timebase)
{ {
SourceTime result; SourceTime result;
const QString trimmed = timecode.trimmed(); const QString trimmed = timecode.trimmed();
@@ -39,8 +40,8 @@ TimecodeMetadata::SourceTime TimecodeMetadata::FromTimecodeString(
bool ok = false; bool ok = false;
const core::Timecode::Display display = const core::Timecode::Display display =
trimmed.contains(';') ? core::Timecode::kTimecodeDropFrame trimmed.contains(';') ? core::Timecode::kTimecodeDropFrame :
: core::Timecode::kTimecodeNonDropFrame; core::Timecode::kTimecodeNonDropFrame;
result.time = core::Timecode::timecode_to_time(trimmed.toStdString(), result.time = core::Timecode::timecode_to_time(trimmed.toStdString(),
timebase, display, &ok); timebase, display, &ok);
result.valid = ok; result.valid = ok;
@@ -50,8 +51,9 @@ TimecodeMetadata::SourceTime TimecodeMetadata::FromTimecodeString(
return result; return result;
} }
TimecodeMetadata::SourceTime TimecodeMetadata::FromBwfTimeReference( TimecodeMetadata::SourceTime
const QString &time_reference, int sample_rate) TimecodeMetadata::FromBwfTimeReference(const QString &time_reference,
int sample_rate)
{ {
SourceTime result; SourceTime result;
if (sample_rate <= 0) { if (sample_rate <= 0) {
@@ -73,9 +75,8 @@ TimecodeMetadata::SourceTime TimecodeMetadata::FromBwfTimeReference(
const qulonglong rational_limit = const qulonglong rational_limit =
static_cast<qulonglong>(std::numeric_limits<int>::max()); static_cast<qulonglong>(std::numeric_limits<int>::max());
if (numerator <= rational_limit && denominator <= rational_limit) { if (numerator <= rational_limit && denominator <= rational_limit) {
result.time = result.time = core::rational(static_cast<int>(numerator),
core::rational(static_cast<int>(numerator), static_cast<int>(denominator));
static_cast<int>(denominator));
} else { } else {
result.time = core::rational::fromDouble( result.time = core::rational::fromDouble(
static_cast<double>(samples) / static_cast<double>(sample_rate)); static_cast<double>(samples) / static_cast<double>(sample_rate));
+38 -38
View File
@@ -16,42 +16,42 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
target_sources(libolive-editor PRIVATE target_sources(libolive-editor PRIVATE
cancelableobject.h cancelableobject.h
channellayout.h channellayout.h
commandlineparser.cpp commandlineparser.cpp
commandlineparser.h commandlineparser.h
crashpadinterface.cpp crashpadinterface.cpp
crashpadinterface.h crashpadinterface.h
crashpadutils.h crashpadutils.h
Current.cpp Current.cpp
Current.h Current.h
debug.cpp debug.cpp
debug.h debug.h
decibel.h decibel.h
define.h define.h
ffmpegutils.cpp ffmpegutils.cpp
ffmpegutils.h ffmpegutils.h
filefunctions.cpp filefunctions.cpp
filefunctions.h filefunctions.h
html.cpp html.cpp
html.h html.h
jobtime.cpp jobtime.cpp
jobtime.h jobtime.h
lerp.h lerp.h
memorypool.h memorypool.h
ocioutils.cpp ocioutils.cpp
ocioutils.h ocioutils.h
oiioutils.cpp oiioutils.cpp
oiioutils.h oiioutils.h
otioutils.h otioutils.h
qtutils.cpp qtutils.cpp
qtutils.h qtutils.h
range.h range.h
ratiodialog.cpp ratiodialog.cpp
ratiodialog.h ratiodialog.h
threadsafemap.h threadsafemap.h
tohex.h tohex.h
util.h util.h
xmlutils.cpp xmlutils.cpp
xmlutils.h xmlutils.h
) )
+10 -10
View File
@@ -25,31 +25,31 @@
class Current { class Current {
public: public:
static Current& getInstance() static Current &getInstance()
{ {
return current; return current;
} }
olive::VideoParams& currentVideoParams() olive::VideoParams &currentVideoParams()
{ {
return currentVideoParams_; return currentVideoParams_;
} }
olive::AudioParams& currentAudioParams() olive::AudioParams &currentAudioParams()
{ {
return currentAudioParams_; return currentAudioParams_;
} }
void setCurrentVideoParams(olive::VideoParams& params) void setCurrentVideoParams(olive::VideoParams &params)
{ {
currentVideoParams_ = params; currentVideoParams_ = params;
} }
void setCurrentAudioParams(olive::AudioParams& params) void setCurrentAudioParams(olive::AudioParams &params)
{ {
currentAudioParams_ = params; currentAudioParams_ = params;
} }
void setCurrentVideoParams(olive::VideoParams&& params) void setCurrentVideoParams(olive::VideoParams &&params)
{ {
currentVideoParams_ = params; currentVideoParams_ = params;
} }
void setCurrentAudioParams(olive::AudioParams&& params) void setCurrentAudioParams(olive::AudioParams &&params)
{ {
currentAudioParams_ = params; currentAudioParams_ = params;
} }
@@ -73,10 +73,12 @@ public:
return plugin_cache_; return plugin_cache_;
} }
void setPluginCache(std::shared_ptr<OFX::Host::ImageEffect::PluginCache> cache) void
setPluginCache(std::shared_ptr<OFX::Host::ImageEffect::PluginCache> cache)
{ {
plugin_cache_ = cache; plugin_cache_ = cache;
} }
private: private:
static Current current; static Current current;
olive::VideoParams currentVideoParams_; olive::VideoParams currentVideoParams_;
@@ -85,6 +87,4 @@ private:
std::shared_ptr<OFX::Host::ImageEffect::PluginCache> plugin_cache_; std::shared_ptr<OFX::Host::ImageEffect::PluginCache> plugin_cache_;
}; };
#endif //CURRENT_H #endif //CURRENT_H
+4 -4
View File
@@ -15,8 +15,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
set(OLIVE_SOURCES set(OLIVE_SOURCES
${OLIVE_SOURCES} ${OLIVE_SOURCES}
config/config.h config/config.h
config/config.cpp config/config.cpp
PARENT_SCOPE PARENT_SCOPE
) )
+2 -2
View File
@@ -341,8 +341,8 @@ void Config::Load()
// Config::Load() is called before Core (and therefore the main window) // Config::Load() is called before Core (and therefore the main window)
// is constructed, so we cannot use Core::instance()->main_window() as // is constructed, so we cannot use Core::instance()->main_window() as
// the message box parent. Passing nullptr creates a top-level dialog. // the message box parent. Passing nullptr creates a top-level dialog.
QWidget *parent = Core::instance() ? Core::instance()->main_window() QWidget *parent = Core::instance() ? Core::instance()->main_window() :
: nullptr; nullptr;
QMessageBox::critical( QMessageBox::critical(
parent, parent,
QCoreApplication::translate("Config", "Error loading settings"), QCoreApplication::translate("Config", "Error loading settings"),
+23 -23
View File
@@ -80,37 +80,37 @@
#include "widget/menu/menushared.h" #include "widget/menu/menushared.h"
#include "window/mainwindow/mainwindow.h" #include "window/mainwindow/mainwindow.h"
namespace { namespace
{
QStringList FootageVideoExtensions() QStringList FootageVideoExtensions()
{ {
return QStringList{ return QStringList{
QStringLiteral("mp4"), QStringLiteral("mov"), QStringLiteral("m4v"), QStringLiteral("mp4"), QStringLiteral("mov"), QStringLiteral("m4v"),
QStringLiteral("avi"), QStringLiteral("mpg"), QStringLiteral("mpeg"), QStringLiteral("avi"), QStringLiteral("mpg"), QStringLiteral("mpeg"),
QStringLiteral("m2ts"), QStringLiteral("mts"), QStringLiteral("ts"), QStringLiteral("m2ts"), QStringLiteral("mts"), QStringLiteral("ts"),
QStringLiteral("webm"), QStringLiteral("wmv"), QStringLiteral("flv"), QStringLiteral("webm"), QStringLiteral("wmv"), QStringLiteral("flv"),
QStringLiteral("3gp"), QStringLiteral("3g2"), QStringLiteral("mxf") QStringLiteral("3gp"), QStringLiteral("3g2"), QStringLiteral("mxf")
}; };
} }
QStringList FootageAudioExtensions() QStringList FootageAudioExtensions()
{ {
return QStringList{ return QStringList{ QStringLiteral("wav"), QStringLiteral("mp3"),
QStringLiteral("wav"), QStringLiteral("mp3"), QStringLiteral("flac"), QStringLiteral("flac"), QStringLiteral("aac"),
QStringLiteral("aac"), QStringLiteral("ogg"), QStringLiteral("opus"), QStringLiteral("ogg"), QStringLiteral("opus"),
QStringLiteral("m4a"), QStringLiteral("alac"), QStringLiteral("aif"), QStringLiteral("m4a"), QStringLiteral("alac"),
QStringLiteral("aiff"), QStringLiteral("aifc"), QStringLiteral("wma") QStringLiteral("aif"), QStringLiteral("aiff"),
}; QStringLiteral("aifc"), QStringLiteral("wma") };
} }
QStringList FootageImageExtensions() QStringList FootageImageExtensions()
{ {
return QStringList{ return QStringList{ QStringLiteral("png"), QStringLiteral("jpg"),
QStringLiteral("png"), QStringLiteral("jpg"), QStringLiteral("jpeg"), QStringLiteral("jpeg"), QStringLiteral("tif"),
QStringLiteral("tif"), QStringLiteral("tiff"), QStringLiteral("bmp"), QStringLiteral("tiff"), QStringLiteral("bmp"),
QStringLiteral("gif"), QStringLiteral("exr"), QStringLiteral("dpx"), QStringLiteral("gif"), QStringLiteral("exr"),
QStringLiteral("webp") QStringLiteral("dpx"), QStringLiteral("webp") };
};
} }
QString BuildFootageFilterGroup(const QString &label, QString BuildFootageFilterGroup(const QString &label,
@@ -122,8 +122,8 @@ QString BuildFootageFilterGroup(const QString &label,
patterns.append(QStringLiteral("*.%1").arg(ext)); patterns.append(QStringLiteral("*.%1").arg(ext));
} }
return QStringLiteral("%1 (%2)") return QStringLiteral("%1 (%2)").arg(label,
.arg(label, patterns.join(QLatin1Char(' '))); patterns.join(QLatin1Char(' ')));
} }
QString BuildFootageFileDialogFilter() QString BuildFootageFileDialogFilter()
@@ -457,9 +457,9 @@ void Core::DialogAboutShow()
void Core::DialogImportShow() void Core::DialogImportShow()
{ {
// Open dialog for user to select files // Open dialog for user to select files
QStringList files = QFileDialog::getOpenFileNames( QStringList files =
main_window_, tr("Import footage..."), QString(), QFileDialog::getOpenFileNames(main_window_, tr("Import footage..."),
FootageFileDialogFilter()); QString(), FootageFileDialogFilter());
// Check if the user actually selected files to import // Check if the user actually selected files to import
if (!files.isEmpty()) { if (!files.isEmpty()) {
+28 -28
View File
@@ -16,10 +16,10 @@
# Create crash handler executable # Create crash handler executable
add_executable( add_executable(
olive-crashhandler olive-crashhandler
crashhandler.cpp crashhandler.cpp
crashhandler.h crashhandler.h
$<TARGET_OBJECTS:olive-version-obj> $<TARGET_OBJECTS:olive-version-obj>
) )
# Rename the generated binary to oak-crashhandler so it matches the Oak branding. # Rename the generated binary to oak-crashhandler so it matches the Oak branding.
@@ -27,42 +27,42 @@ set_target_properties(olive-crashhandler PROPERTIES OUTPUT_NAME "oak-crashhandle
# Disable console appearing on crash handler dialog # Disable console appearing on crash handler dialog
set_target_properties(olive-crashhandler PROPERTIES set_target_properties(olive-crashhandler PROPERTIES
WIN32_EXECUTABLE TRUE WIN32_EXECUTABLE TRUE
) )
# Set crash handler includes # Set crash handler includes
target_include_directories( target_include_directories(
olive-crashhandler olive-crashhandler
PRIVATE PRIVATE
${CMAKE_SOURCE_DIR}/app ${CMAKE_SOURCE_DIR}/app
${CRASHPAD_INCLUDE_DIRS} ${CRASHPAD_INCLUDE_DIRS}
) )
# Set crash handler libs # Set crash handler libs
target_link_libraries( target_link_libraries(
olive-crashhandler olive-crashhandler
PRIVATE PRIVATE
Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Core
Qt${QT_VERSION_MAJOR}::Gui Qt${QT_VERSION_MAJOR}::Gui
Qt${QT_VERSION_MAJOR}::Widgets Qt${QT_VERSION_MAJOR}::Widgets
Qt${QT_VERSION_MAJOR}::Network Qt${QT_VERSION_MAJOR}::Network
${CRASHPAD_LIBRARIES} ${CRASHPAD_LIBRARIES}
) )
set(CRASHPAD_HANDLER "crashpad_handler${CMAKE_EXECUTABLE_SUFFIX}") set(CRASHPAD_HANDLER "crashpad_handler${CMAKE_EXECUTABLE_SUFFIX}")
set(MINIDUMP_STACKWALK "minidump_stackwalk${CMAKE_EXECUTABLE_SUFFIX}") set(MINIDUMP_STACKWALK "minidump_stackwalk${CMAKE_EXECUTABLE_SUFFIX}")
if(APPLE) if (APPLE)
# Move crash handler executables inside Mac app bundle # Move crash handler executables inside Mac app bundle
add_custom_command(TARGET olive-crashhandler POST_BUILD add_custom_command(TARGET olive-crashhandler POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different $<TARGET_FILE:olive-crashhandler> $<TARGET_FILE_DIR:olive-editor> COMMAND ${CMAKE_COMMAND} -E copy_if_different $<TARGET_FILE:olive-crashhandler> $<TARGET_FILE_DIR:olive-editor>
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CRASHPAD_LIBRARY_DIRS}/${CRASHPAD_HANDLER} $<TARGET_FILE_DIR:olive-editor> COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CRASHPAD_LIBRARY_DIRS}/${CRASHPAD_HANDLER} $<TARGET_FILE_DIR:olive-editor>
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${BREAKPAD_BIN_DIR}/${MINIDUMP_STACKWALK} $<TARGET_FILE_DIR:olive-editor> COMMAND ${CMAKE_COMMAND} -E copy_if_different ${BREAKPAD_BIN_DIR}/${MINIDUMP_STACKWALK} $<TARGET_FILE_DIR:olive-editor>
) )
elseif(UNIX) elseif (UNIX)
install(TARGETS olive-crashhandler RUNTIME DESTINATION bin) install(TARGETS olive-crashhandler RUNTIME DESTINATION bin)
install(PROGRAMS ${CRASHPAD_LIBRARY_DIRS}/${CRASHPAD_HANDLER} DESTINATION bin) install(PROGRAMS ${CRASHPAD_LIBRARY_DIRS}/${CRASHPAD_HANDLER} DESTINATION bin)
install(PROGRAMS ${BREAKPAD_BIN_DIR}/${MINIDUMP_STACKWALK} DESTINATION bin) install(PROGRAMS ${BREAKPAD_BIN_DIR}/${MINIDUMP_STACKWALK} DESTINATION bin)
endif() endif ()
target_compile_definitions(olive-crashhandler PRIVATE ${OLIVE_DEFINITIONS}) target_compile_definitions(olive-crashhandler PRIVATE ${OLIVE_DEFINITIONS})
+3 -3
View File
@@ -54,9 +54,9 @@ CrashHandlerDialog::CrashHandlerDialog(const QString &report_path)
QVBoxLayout *layout = new QVBoxLayout(this); QVBoxLayout *layout = new QVBoxLayout(this);
layout->addWidget(new QLabel( layout->addWidget(new QLabel(tr(
tr("We're sorry, Oak Video Editor has crashed. Please help us fix it by " "We're sorry, Oak Video Editor has crashed. Please help us fix it by "
"sending an error report."))); "sending an error report.")));
QSplitter *splitter = new QSplitter(Qt::Vertical); QSplitter *splitter = new QSplitter(Qt::Vertical);
splitter->setChildrenCollapsible(false); splitter->setChildrenCollapsible(false);
+5 -5
View File
@@ -25,9 +25,9 @@ add_subdirectory(footageproperties)
add_subdirectory(footagerelink) add_subdirectory(footagerelink)
add_subdirectory(keyframeproperties) add_subdirectory(keyframeproperties)
add_subdirectory(markerproperties) add_subdirectory(markerproperties)
if(OpenTimelineIO_FOUND) if (OpenTimelineIO_FOUND)
add_subdirectory(otioproperties) add_subdirectory(otioproperties)
endif() endif ()
add_subdirectory(preferences) add_subdirectory(preferences)
add_subdirectory(progress) add_subdirectory(progress)
add_subdirectory(projectproperties) add_subdirectory(projectproperties)
@@ -38,6 +38,6 @@ add_subdirectory(task)
add_subdirectory(text) add_subdirectory(text)
set(OLIVE_SOURCES set(OLIVE_SOURCES
${OLIVE_SOURCES} ${OLIVE_SOURCES}
PARENT_SCOPE PARENT_SCOPE
) )
+7 -7
View File
@@ -15,11 +15,11 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
set(OLIVE_SOURCES set(OLIVE_SOURCES
${OLIVE_SOURCES} ${OLIVE_SOURCES}
dialog/about/about.cpp dialog/about/about.cpp
dialog/about/about.h dialog/about/about.h
dialog/about/patreon.h dialog/about/patreon.h
dialog/about/scrollinglabel.cpp dialog/about/scrollinglabel.cpp
dialog/about/scrollinglabel.h dialog/about/scrollinglabel.h
PARENT_SCOPE PARENT_SCOPE
) )
+7 -6
View File
@@ -66,12 +66,13 @@ AboutDialog::AboutDialog(bool welcome_dialog, QWidget *parent)
"<p>%3</p>" // Description "<p>%3</p>" // Description
"<p>%4</p>" // Fork notice "<p>%4</p>" // Fork notice
"</body></html>") "</body></html>")
.arg(QApplication::applicationName(), .arg(
QApplication::applicationVersion(), QApplication::applicationName(),
tr("Oak Video Editor is a free open source non-linear video editor. " QApplication::applicationVersion(),
"This software is licensed under the GNU GPL Version 3."), tr("Oak Video Editor is a free open source non-linear video editor. "
tr("This project is a fork of " "This software is licensed under the GNU GPL Version 3."),
"<a href=\"https://github.com/olive-editor/olive\">Olive Video Editor</a>."))); tr("This project is a fork of "
"<a href=\"https://github.com/olive-editor/olive\">Olive Video Editor</a>.")));
// Set text formatting // Set text formatting
label->setAlignment(Qt::AlignLeft | Qt::AlignVCenter); label->setAlignment(Qt::AlignLeft | Qt::AlignVCenter);
+8 -7
View File
@@ -57,7 +57,7 @@ url = 'https://www.patreon.com/api/oauth2/v2/campaigns/1478705/members?include=c
name_list = '' name_list = ''
while True: while True:
member_data = requests.get(url, headers = {"authorization": "Bearer " + os.environ.get('PATREON_KEY')}) member_data = requests.get(url, headers={"authorization": "Bearer " + os.environ.get('PATREON_KEY')})
member_data_decoded = json.loads(member_data.text) member_data_decoded = json.loads(member_data.text)
for member in member_data_decoded["data"]: for member in member_data_decoded["data"]:
@@ -68,16 +68,17 @@ while True:
name = member["attributes"]["full_name"] name = member["attributes"]["full_name"]
name_list += " QStringLiteral(\"" name_list += " QStringLiteral(\""
name_list += name.translate(str.maketrans({ name_list += name.translate(str.maketrans({
"\"": "\\\"", "\"": "\\\"",
"\\": "\\\\" "\\": "\\\\"
})) }))
name_list += "\")" name_list += "\")"
if "links" in member_data_decoded: if "links" in member_data_decoded:
url = member_data_decoded["links"]["next"] url = member_data_decoded["links"]["next"]
else: else:
break break
text_file = open("patreon.h", "w", encoding="utf-8") text_file = open("patreon.h", "w", encoding="utf-8")
text_file.write("#ifndef PATREON_H\n#define PATREON_H\n\n#include <QStringList>\n\nQStringList patrons = {\n%s\n};\n\n#endif // PATREON_H\n" % name_list) text_file.write(
"#ifndef PATREON_H\n#define PATREON_H\n\n#include <QStringList>\n\nQStringList patrons = {\n%s\n};\n\n#endif // PATREON_H\n" % name_list)
text_file.close() text_file.close()
+4 -4
View File
@@ -15,8 +15,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
set(OLIVE_SOURCES set(OLIVE_SOURCES
${OLIVE_SOURCES} ${OLIVE_SOURCES}
dialog/actionsearch/actionsearch.h dialog/actionsearch/actionsearch.h
dialog/actionsearch/actionsearch.cpp dialog/actionsearch/actionsearch.cpp
PARENT_SCOPE PARENT_SCOPE
) )
+4 -4
View File
@@ -15,8 +15,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
set(OLIVE_SOURCES set(OLIVE_SOURCES
${OLIVE_SOURCES} ${OLIVE_SOURCES}
dialog/autorecovery/autorecoverydialog.h dialog/autorecovery/autorecoverydialog.h
dialog/autorecovery/autorecoverydialog.cpp dialog/autorecovery/autorecoverydialog.cpp
PARENT_SCOPE PARENT_SCOPE
) )
+4 -4
View File
@@ -15,8 +15,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
set(OLIVE_SOURCES set(OLIVE_SOURCES
${OLIVE_SOURCES} ${OLIVE_SOURCES}
dialog/color/colordialog.h dialog/color/colordialog.h
dialog/color/colordialog.cpp dialog/color/colordialog.cpp
PARENT_SCOPE PARENT_SCOPE
) )
+6 -6
View File
@@ -15,10 +15,10 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
set(OLIVE_SOURCES set(OLIVE_SOURCES
${OLIVE_SOURCES} ${OLIVE_SOURCES}
dialog/configbase/configdialogbase.cpp dialog/configbase/configdialogbase.cpp
dialog/configbase/configdialogbase.h dialog/configbase/configdialogbase.h
dialog/configbase/configdialogbasetab.cpp dialog/configbase/configdialogbasetab.cpp
dialog/configbase/configdialogbasetab.h dialog/configbase/configdialogbasetab.h
PARENT_SCOPE PARENT_SCOPE
) )
+4 -4
View File
@@ -15,8 +15,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
set(OLIVE_SOURCES set(OLIVE_SOURCES
${OLIVE_SOURCES} ${OLIVE_SOURCES}
dialog/diskcache/diskcachedialog.h dialog/diskcache/diskcachedialog.h
dialog/diskcache/diskcachedialog.cpp dialog/diskcache/diskcachedialog.cpp
PARENT_SCOPE PARENT_SCOPE
) )
-1
View File
@@ -26,7 +26,6 @@
#include <QLabel> #include <QLabel>
#include <QMessageBox> #include <QMessageBox>
namespace olive namespace olive
{ {
+16 -16
View File
@@ -17,20 +17,20 @@
add_subdirectory(codec) add_subdirectory(codec)
set(OLIVE_SOURCES set(OLIVE_SOURCES
${OLIVE_SOURCES} ${OLIVE_SOURCES}
dialog/export/export.cpp dialog/export/export.cpp
dialog/export/export.h dialog/export/export.h
dialog/export/exportadvancedvideodialog.cpp dialog/export/exportadvancedvideodialog.cpp
dialog/export/exportadvancedvideodialog.h dialog/export/exportadvancedvideodialog.h
dialog/export/exportaudiotab.cpp dialog/export/exportaudiotab.cpp
dialog/export/exportaudiotab.h dialog/export/exportaudiotab.h
dialog/export/exportformatcombobox.cpp dialog/export/exportformatcombobox.cpp
dialog/export/exportformatcombobox.h dialog/export/exportformatcombobox.h
dialog/export/exportsavepresetdialog.cpp dialog/export/exportsavepresetdialog.cpp
dialog/export/exportsavepresetdialog.h dialog/export/exportsavepresetdialog.h
dialog/export/exportsubtitlestab.cpp dialog/export/exportsubtitlestab.cpp
dialog/export/exportsubtitlestab.h dialog/export/exportsubtitlestab.h
dialog/export/exportvideotab.cpp dialog/export/exportvideotab.cpp
dialog/export/exportvideotab.h dialog/export/exportvideotab.h
PARENT_SCOPE PARENT_SCOPE
) )
+14 -14
View File
@@ -15,18 +15,18 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
set(OLIVE_SOURCES set(OLIVE_SOURCES
${OLIVE_SOURCES} ${OLIVE_SOURCES}
dialog/export/codec/av1section.cpp dialog/export/codec/av1section.cpp
dialog/export/codec/av1section.h dialog/export/codec/av1section.h
dialog/export/codec/cineformsection.cpp dialog/export/codec/cineformsection.cpp
dialog/export/codec/cineformsection.h dialog/export/codec/cineformsection.h
dialog/export/codec/codecsection.cpp dialog/export/codec/codecsection.cpp
dialog/export/codec/codecsection.h dialog/export/codec/codecsection.h
dialog/export/codec/codecstack.cpp dialog/export/codec/codecstack.cpp
dialog/export/codec/codecstack.h dialog/export/codec/codecstack.h
dialog/export/codec/h264section.cpp dialog/export/codec/h264section.cpp
dialog/export/codec/h264section.h dialog/export/codec/h264section.h
dialog/export/codec/imagesection.cpp dialog/export/codec/imagesection.cpp
dialog/export/codec/imagesection.h dialog/export/codec/imagesection.h
PARENT_SCOPE PARENT_SCOPE
) )
-1
View File
@@ -24,7 +24,6 @@
#include <QGridLayout> #include <QGridLayout>
#include <QLabel> #include <QLabel>
namespace olive namespace olive
{ {
+4 -4
View File
@@ -17,8 +17,8 @@
add_subdirectory(streamproperties) add_subdirectory(streamproperties)
set(OLIVE_SOURCES set(OLIVE_SOURCES
${OLIVE_SOURCES} ${OLIVE_SOURCES}
dialog/footageproperties/footageproperties.cpp dialog/footageproperties/footageproperties.cpp
dialog/footageproperties/footageproperties.h dialog/footageproperties/footageproperties.h
PARENT_SCOPE PARENT_SCOPE
) )
@@ -15,12 +15,12 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
set(OLIVE_SOURCES set(OLIVE_SOURCES
${OLIVE_SOURCES} ${OLIVE_SOURCES}
dialog/footageproperties/streamproperties/streamproperties.h dialog/footageproperties/streamproperties/streamproperties.h
dialog/footageproperties/streamproperties/streamproperties.cpp dialog/footageproperties/streamproperties/streamproperties.cpp
dialog/footageproperties/streamproperties/audiostreamproperties.h dialog/footageproperties/streamproperties/audiostreamproperties.h
dialog/footageproperties/streamproperties/audiostreamproperties.cpp dialog/footageproperties/streamproperties/audiostreamproperties.cpp
dialog/footageproperties/streamproperties/videostreamproperties.h dialog/footageproperties/streamproperties/videostreamproperties.h
dialog/footageproperties/streamproperties/videostreamproperties.cpp dialog/footageproperties/streamproperties/videostreamproperties.cpp
PARENT_SCOPE PARENT_SCOPE
) )
+4 -4
View File
@@ -15,8 +15,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
set(OLIVE_SOURCES set(OLIVE_SOURCES
${OLIVE_SOURCES} ${OLIVE_SOURCES}
dialog/footagerelink/footagerelinkdialog.h dialog/footagerelink/footagerelinkdialog.h
dialog/footagerelink/footagerelinkdialog.cpp dialog/footagerelink/footagerelinkdialog.cpp
PARENT_SCOPE PARENT_SCOPE
) )
+4 -4
View File
@@ -15,8 +15,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
set(OLIVE_SOURCES set(OLIVE_SOURCES
${OLIVE_SOURCES} ${OLIVE_SOURCES}
dialog/keyframeproperties/keyframeproperties.h dialog/keyframeproperties/keyframeproperties.h
dialog/keyframeproperties/keyframeproperties.cpp dialog/keyframeproperties/keyframeproperties.cpp
PARENT_SCOPE PARENT_SCOPE
) )
+4 -4
View File
@@ -15,8 +15,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
set(OLIVE_SOURCES set(OLIVE_SOURCES
${OLIVE_SOURCES} ${OLIVE_SOURCES}
dialog/markerproperties/markerpropertiesdialog.h dialog/markerproperties/markerpropertiesdialog.h
dialog/markerproperties/markerpropertiesdialog.cpp dialog/markerproperties/markerpropertiesdialog.cpp
PARENT_SCOPE PARENT_SCOPE
) )
+4 -4
View File
@@ -15,8 +15,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
set(OLIVE_SOURCES set(OLIVE_SOURCES
${OLIVE_SOURCES} ${OLIVE_SOURCES}
dialog/otioproperties/otiopropertiesdialog.h dialog/otioproperties/otiopropertiesdialog.h
dialog/otioproperties/otiopropertiesdialog.cpp dialog/otioproperties/otiopropertiesdialog.cpp
PARENT_SCOPE PARENT_SCOPE
) )
+6 -6
View File
@@ -17,10 +17,10 @@
add_subdirectory(tabs) add_subdirectory(tabs)
set(OLIVE_SOURCES set(OLIVE_SOURCES
${OLIVE_SOURCES} ${OLIVE_SOURCES}
dialog/preferences/keysequenceeditor.h dialog/preferences/keysequenceeditor.h
dialog/preferences/keysequenceeditor.cpp dialog/preferences/keysequenceeditor.cpp
dialog/preferences/preferences.h dialog/preferences/preferences.h
dialog/preferences/preferences.cpp dialog/preferences/preferences.cpp
PARENT_SCOPE PARENT_SCOPE
) )
+9 -6
View File
@@ -46,16 +46,19 @@ PreferencesDialog::PreferencesDialog(MainWindow *main_window, int start_tab)
AddTab(new PreferencesGeneralTab(), tr("General")); AddTab(new PreferencesGeneralTab(), tr("General"));
AddTab(new PreferencesAppearanceTab(), tr("Appearance")); AddTab(new PreferencesAppearanceTab(), tr("Appearance"));
AddTab(new PreferencesAudioTab(), tr("Audio")); AddTab(new PreferencesAudioTab(), tr("Audio"));
AddTab(new PreferencesBehaviorTab(PreferencesBehaviorTab::kCategoryTimeline), AddTab(
tr("Timeline")); new PreferencesBehaviorTab(PreferencesBehaviorTab::kCategoryTimeline),
AddTab(new PreferencesBehaviorTab(PreferencesBehaviorTab::kCategoryPlayback), tr("Timeline"));
tr("Playback")); AddTab(
new PreferencesBehaviorTab(PreferencesBehaviorTab::kCategoryPlayback),
tr("Playback"));
AddTab(new PreferencesBehaviorTab(PreferencesBehaviorTab::kCategoryProject), AddTab(new PreferencesBehaviorTab(PreferencesBehaviorTab::kCategoryProject),
tr("Project")); tr("Project"));
AddTab(new PreferencesBehaviorTab(PreferencesBehaviorTab::kCategoryNodes), AddTab(new PreferencesBehaviorTab(PreferencesBehaviorTab::kCategoryNodes),
tr("Nodes")); tr("Nodes"));
AddTab(new PreferencesBehaviorTab(PreferencesBehaviorTab::kCategoryRendering), AddTab(
tr("Rendering")); new PreferencesBehaviorTab(PreferencesBehaviorTab::kCategoryRendering),
tr("Rendering"));
AddTab(new PreferencesDiskTab(), tr("Disk")); AddTab(new PreferencesDiskTab(), tr("Disk"));
AddTab(new PreferencesKeyboardTab(main_window), tr("Keyboard")); AddTab(new PreferencesKeyboardTab(main_window), tr("Keyboard"));
+14 -14
View File
@@ -15,18 +15,18 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
set(OLIVE_SOURCES set(OLIVE_SOURCES
${OLIVE_SOURCES} ${OLIVE_SOURCES}
dialog/preferences/tabs/preferencesgeneraltab.h dialog/preferences/tabs/preferencesgeneraltab.h
dialog/preferences/tabs/preferencesgeneraltab.cpp dialog/preferences/tabs/preferencesgeneraltab.cpp
dialog/preferences/tabs/preferencesbehaviortab.h dialog/preferences/tabs/preferencesbehaviortab.h
dialog/preferences/tabs/preferencesbehaviortab.cpp dialog/preferences/tabs/preferencesbehaviortab.cpp
dialog/preferences/tabs/preferencesdisktab.h dialog/preferences/tabs/preferencesdisktab.h
dialog/preferences/tabs/preferencesdisktab.cpp dialog/preferences/tabs/preferencesdisktab.cpp
dialog/preferences/tabs/preferencesappearancetab.h dialog/preferences/tabs/preferencesappearancetab.h
dialog/preferences/tabs/preferencesappearancetab.cpp dialog/preferences/tabs/preferencesappearancetab.cpp
dialog/preferences/tabs/preferencesaudiotab.h dialog/preferences/tabs/preferencesaudiotab.h
dialog/preferences/tabs/preferencesaudiotab.cpp dialog/preferences/tabs/preferencesaudiotab.cpp
dialog/preferences/tabs/preferenceskeyboardtab.h dialog/preferences/tabs/preferenceskeyboardtab.h
dialog/preferences/tabs/preferenceskeyboardtab.cpp dialog/preferences/tabs/preferenceskeyboardtab.cpp
PARENT_SCOPE PARENT_SCOPE
) )
@@ -40,8 +40,7 @@ PreferencesBehaviorTab::PreferencesBehaviorTab(Category category)
AddItems({ AddItems({
{ tr("Auto-Seek to Imported Clips"), { tr("Auto-Seek to Imported Clips"),
QStringLiteral("EnableSeekToImport") }, QStringLiteral("EnableSeekToImport") },
{ tr("Edit Tool Also Seeks"), { tr("Edit Tool Also Seeks"), QStringLiteral("EditToolAlsoSeeks") },
QStringLiteral("EditToolAlsoSeeks") },
{ tr("Edit Tool Selects Links"), { tr("Edit Tool Selects Links"),
QStringLiteral("EditToolSelectsLinks") }, QStringLiteral("EditToolSelectsLinks") },
{ tr("Enable Drag Files to Timeline"), { tr("Enable Drag Files to Timeline"),
@@ -83,8 +82,7 @@ PreferencesBehaviorTab::PreferencesBehaviorTab(Category category)
}); });
break; break;
case kCategoryRendering: case kCategoryRendering: {
{
QLabel *backend_label = new QLabel(tr("Graphics Backend")); QLabel *backend_label = new QLabel(tr("Graphics Backend"));
backend_label->setToolTip( backend_label->setToolTip(
tr("Selects the graphics API Oak should request on next launch. " tr("Selects the graphics API Oak should request on next launch. "
@@ -94,17 +92,16 @@ PreferencesBehaviorTab::PreferencesBehaviorTab(Category category)
graphics_backend_combobox_ = new QComboBox(); graphics_backend_combobox_ = new QComboBox();
graphics_backend_combobox_->addItem(tr("OpenGL"), graphics_backend_combobox_->addItem(tr("OpenGL"),
QStringLiteral("opengl")); QStringLiteral("opengl"));
graphics_backend_combobox_->addItem(tr("Vulkan (experimental)"), graphics_backend_combobox_->addItem(tr("Vulkan (experimental)"),
QStringLiteral("vulkan")); QStringLiteral("vulkan"));
const QString current_backend = const QString current_backend =
OLIVE_CONFIG("GraphicsBackend").toString().toLower(); OLIVE_CONFIG("GraphicsBackend").toString().toLower();
const int backend_index = graphics_backend_combobox_->findData( const int backend_index = graphics_backend_combobox_->findData(
current_backend.isEmpty() ? QStringLiteral("opengl") current_backend.isEmpty() ? QStringLiteral("opengl") :
: current_backend); current_backend);
graphics_backend_combobox_->setCurrentIndex(backend_index >= 0 graphics_backend_combobox_->setCurrentIndex(
? backend_index backend_index >= 0 ? backend_index : 0);
: 0);
QHBoxLayout *backend_layout = new QHBoxLayout(); QHBoxLayout *backend_layout = new QHBoxLayout();
backend_layout->addWidget(backend_label); backend_layout->addWidget(backend_label);
@@ -49,7 +49,8 @@ public:
static QString BehaviorPrefTr(const char *text) static QString BehaviorPrefTr(const char *text)
{ {
return QCoreApplication::translate("olive::PreferencesBehaviorTab", text); return QCoreApplication::translate("olive::PreferencesBehaviorTab",
text);
} }
private: private:
@@ -105,16 +105,14 @@ PreferencesDiskTab::PreferencesDiskTab()
proxy_width_slider_ = new IntegerSlider(); proxy_width_slider_ = new IntegerSlider();
proxy_width_slider_->SetMinimum(160); proxy_width_slider_->SetMinimum(160);
proxy_width_slider_->SetMaximum(4096); proxy_width_slider_->SetMaximum(4096);
proxy_width_slider_->SetValue( proxy_width_slider_->SetValue(OLIVE_CONFIG("ProxyWidth").value<int>());
OLIVE_CONFIG("ProxyWidth").value<int>());
proxy_layout->addWidget(proxy_width_slider_, proxy_row, 1); proxy_layout->addWidget(proxy_width_slider_, proxy_row, 1);
proxy_layout->addWidget(new QLabel(tr("Proxy Height:")), proxy_row, 2); proxy_layout->addWidget(new QLabel(tr("Proxy Height:")), proxy_row, 2);
proxy_height_slider_ = new IntegerSlider(); proxy_height_slider_ = new IntegerSlider();
proxy_height_slider_->SetMinimum(120); proxy_height_slider_->SetMinimum(120);
proxy_height_slider_->SetMaximum(2160); proxy_height_slider_->SetMaximum(2160);
proxy_height_slider_->SetValue( proxy_height_slider_->SetValue(OLIVE_CONFIG("ProxyHeight").value<int>());
OLIVE_CONFIG("ProxyHeight").value<int>());
proxy_layout->addWidget(proxy_height_slider_, proxy_row, 3); proxy_layout->addWidget(proxy_height_slider_, proxy_row, 3);
proxy_row++; proxy_row++;
@@ -123,28 +121,22 @@ PreferencesDiskTab::PreferencesDiskTab()
proxy_crf_slider_ = new IntegerSlider(); proxy_crf_slider_ = new IntegerSlider();
proxy_crf_slider_->SetMinimum(0); proxy_crf_slider_->SetMinimum(0);
proxy_crf_slider_->SetMaximum(51); proxy_crf_slider_->SetMaximum(51);
proxy_crf_slider_->SetValue( proxy_crf_slider_->SetValue(OLIVE_CONFIG("ProxyCRF").value<int>());
OLIVE_CONFIG("ProxyCRF").value<int>());
proxy_layout->addWidget(proxy_crf_slider_, proxy_row, 1); proxy_layout->addWidget(proxy_crf_slider_, proxy_row, 1);
proxy_layout->addWidget(new QLabel(tr("Proxy Preset:")), proxy_row, 2); proxy_layout->addWidget(new QLabel(tr("Proxy Preset:")), proxy_row, 2);
proxy_preset_combo_ = new QComboBox(); proxy_preset_combo_ = new QComboBox();
const QStringList presets = { const QStringList presets = {
QStringLiteral("ultrafast"), QStringLiteral("ultrafast"), QStringLiteral("superfast"),
QStringLiteral("superfast"), QStringLiteral("veryfast"), QStringLiteral("faster"),
QStringLiteral("veryfast"), QStringLiteral("fast"), QStringLiteral("medium"),
QStringLiteral("faster"), QStringLiteral("slow"), QStringLiteral("slower"),
QStringLiteral("fast"),
QStringLiteral("medium"),
QStringLiteral("slow"),
QStringLiteral("slower"),
QStringLiteral("veryslow"), QStringLiteral("veryslow"),
}; };
for (const QString &preset : presets) { for (const QString &preset : presets) {
proxy_preset_combo_->addItem(preset); proxy_preset_combo_->addItem(preset);
} }
proxy_preset_combo_->setCurrentText( proxy_preset_combo_->setCurrentText(OLIVE_CONFIG("ProxyPreset").toString());
OLIVE_CONFIG("ProxyPreset").toString());
proxy_layout->addWidget(proxy_preset_combo_, proxy_row, 3); proxy_layout->addWidget(proxy_preset_combo_, proxy_row, 3);
outer_layout->addStretch(); outer_layout->addStretch();
@@ -185,8 +177,10 @@ void PreferencesDiskTab::Accept(MultiUndoCommand *command)
OLIVE_CONFIG("DiskCacheAhead") = QVariant::fromValue( OLIVE_CONFIG("DiskCacheAhead") = QVariant::fromValue(
rational::fromDouble(cache_ahead_slider_->GetValue())); rational::fromDouble(cache_ahead_slider_->GetValue()));
OLIVE_CONFIG("ProxyWidth") = static_cast<int>(proxy_width_slider_->GetValue()); OLIVE_CONFIG("ProxyWidth") =
OLIVE_CONFIG("ProxyHeight") = static_cast<int>(proxy_height_slider_->GetValue()); static_cast<int>(proxy_width_slider_->GetValue());
OLIVE_CONFIG("ProxyHeight") =
static_cast<int>(proxy_height_slider_->GetValue());
OLIVE_CONFIG("ProxyCRF") = static_cast<int>(proxy_crf_slider_->GetValue()); OLIVE_CONFIG("ProxyCRF") = static_cast<int>(proxy_crf_slider_->GetValue());
OLIVE_CONFIG("ProxyPreset") = proxy_preset_combo_->currentText(); OLIVE_CONFIG("ProxyPreset") = proxy_preset_combo_->currentText();
} }
@@ -169,21 +169,25 @@ PreferencesGeneralTab::PreferencesGeneralTab()
} }
{ {
QGroupBox *behavior_groupbox = new QGroupBox(PreferencesBehaviorTab::BehaviorPrefTr("Behavior")); QGroupBox *behavior_groupbox =
new QGroupBox(PreferencesBehaviorTab::BehaviorPrefTr("Behavior"));
QVBoxLayout *behavior_layout = new QVBoxLayout(behavior_groupbox); QVBoxLayout *behavior_layout = new QVBoxLayout(behavior_groupbox);
layout->addWidget(behavior_groupbox); layout->addWidget(behavior_groupbox);
hover_focus_ = new QCheckBox(PreferencesBehaviorTab::BehaviorPrefTr("Enable hover focus")); hover_focus_ = new QCheckBox(
PreferencesBehaviorTab::BehaviorPrefTr("Enable hover focus"));
hover_focus_->setToolTip(PreferencesBehaviorTab::BehaviorPrefTr( hover_focus_->setToolTip(PreferencesBehaviorTab::BehaviorPrefTr(
"Panels will be considered focused when the mouse cursor is over them without having to click them.")); "Panels will be considered focused when the mouse cursor is over them without having to click them."));
hover_focus_->setChecked(OLIVE_CONFIG("HoverFocus").toBool()); hover_focus_->setChecked(OLIVE_CONFIG("HoverFocus").toBool());
behavior_layout->addWidget(hover_focus_); behavior_layout->addWidget(hover_focus_);
slider_ladder_ = new QCheckBox(PreferencesBehaviorTab::BehaviorPrefTr("Enable slider ladder")); slider_ladder_ = new QCheckBox(
PreferencesBehaviorTab::BehaviorPrefTr("Enable slider ladder"));
slider_ladder_->setChecked(OLIVE_CONFIG("UseSliderLadders").toBool()); slider_ladder_->setChecked(OLIVE_CONFIG("UseSliderLadders").toBool());
behavior_layout->addWidget(slider_ladder_); behavior_layout->addWidget(slider_ladder_);
scroll_zooms_ = new QCheckBox(PreferencesBehaviorTab::BehaviorPrefTr("Scrolling zooms by default")); scroll_zooms_ = new QCheckBox(PreferencesBehaviorTab::BehaviorPrefTr(
"Scrolling zooms by default"));
scroll_zooms_->setToolTip(PreferencesBehaviorTab::BehaviorPrefTr( scroll_zooms_->setToolTip(PreferencesBehaviorTab::BehaviorPrefTr(
"By default, scrolling will move the view around, and holding Ctrl/Cmd will make it zoom instead. " "By default, scrolling will move the view around, and holding Ctrl/Cmd will make it zoom instead. "
"Enabling this will switch those, scrolling will zoom by default, and holding Ctrl/Cmd will move the view instead.")); "Enabling this will switch those, scrolling will zoom by default, and holding Ctrl/Cmd will move the view instead."));
+4 -4
View File
@@ -15,8 +15,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
set(OLIVE_SOURCES set(OLIVE_SOURCES
${OLIVE_SOURCES} ${OLIVE_SOURCES}
dialog/progress/progress.h dialog/progress/progress.h
dialog/progress/progress.cpp dialog/progress/progress.cpp
PARENT_SCOPE PARENT_SCOPE
) )
+4 -4
View File
@@ -15,8 +15,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
set(OLIVE_SOURCES set(OLIVE_SOURCES
${OLIVE_SOURCES} ${OLIVE_SOURCES}
dialog/projectproperties/projectproperties.h dialog/projectproperties/projectproperties.h
dialog/projectproperties/projectproperties.cpp dialog/projectproperties/projectproperties.cpp
PARENT_SCOPE PARENT_SCOPE
) )
+4 -4
View File
@@ -15,8 +15,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
set(OLIVE_SOURCES set(OLIVE_SOURCES
${OLIVE_SOURCES} ${OLIVE_SOURCES}
dialog/rendercancel/rendercancel.h dialog/rendercancel/rendercancel.h
dialog/rendercancel/rendercancel.cpp dialog/rendercancel/rendercancel.cpp
PARENT_SCOPE PARENT_SCOPE
) )
+10 -10
View File
@@ -15,14 +15,14 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
set(OLIVE_SOURCES set(OLIVE_SOURCES
${OLIVE_SOURCES} ${OLIVE_SOURCES}
dialog/sequence/presetmanager.h dialog/sequence/presetmanager.h
dialog/sequence/sequence.h dialog/sequence/sequence.h
dialog/sequence/sequence.cpp dialog/sequence/sequence.cpp
dialog/sequence/sequencedialogparametertab.h dialog/sequence/sequencedialogparametertab.h
dialog/sequence/sequencedialogparametertab.cpp dialog/sequence/sequencedialogparametertab.cpp
dialog/sequence/sequencedialogpresettab.h dialog/sequence/sequencedialogpresettab.h
dialog/sequence/sequencedialogpresettab.cpp dialog/sequence/sequencedialogpresettab.cpp
dialog/sequence/sequencepreset.h dialog/sequence/sequencepreset.h
PARENT_SCOPE PARENT_SCOPE
) )
@@ -23,7 +23,6 @@
#include <QPushButton> #include <QPushButton>
#include <QVBoxLayout> #include <QVBoxLayout>
namespace olive namespace olive
{ {
+4 -4
View File
@@ -15,8 +15,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
set(OLIVE_SOURCES set(OLIVE_SOURCES
${OLIVE_SOURCES} ${OLIVE_SOURCES}
dialog/speedduration/speeddurationdialog.cpp dialog/speedduration/speeddurationdialog.cpp
dialog/speedduration/speeddurationdialog.h dialog/speedduration/speeddurationdialog.h
PARENT_SCOPE PARENT_SCOPE
) )
+4 -4
View File
@@ -15,8 +15,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
set(OLIVE_SOURCES set(OLIVE_SOURCES
${OLIVE_SOURCES} ${OLIVE_SOURCES}
dialog/task/task.h dialog/task/task.h
dialog/task/task.cpp dialog/task/task.cpp
PARENT_SCOPE PARENT_SCOPE
) )
+4 -4
View File
@@ -15,8 +15,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
set(OLIVE_SOURCES set(OLIVE_SOURCES
${OLIVE_SOURCES} ${OLIVE_SOURCES}
dialog/text/text.h dialog/text/text.h
dialog/text/text.cpp dialog/text/text.cpp
PARENT_SCOPE PARENT_SCOPE
) )
-1
View File
@@ -27,7 +27,6 @@
#include <QPushButton> #include <QPushButton>
#include <QVBoxLayout> #include <QVBoxLayout>
namespace olive namespace olive
{ {
+6 -8
View File
@@ -148,7 +148,6 @@ int decompress_project(const QString &project)
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
// Set up debug handler // Set up debug handler
qInstallMessageHandler(olive::DebugHandler); qInstallMessageHandler(olive::DebugHandler);
@@ -229,8 +228,7 @@ int main(int argc, char *argv[])
auto no_plugin = parser.AddOption( auto no_plugin = parser.AddOption(
{ QStringLiteral("-no-plugin") }, { QStringLiteral("-no-plugin") },
QCoreApplication::translate("main", "Don't load plugins") QCoreApplication::translate("main", "Don't load plugins"));
);
// Qt options re-implemented (add to this as necessary) // Qt options re-implemented (add to this as necessary)
// //
@@ -352,13 +350,13 @@ int main(int argc, char *argv[])
olive::Config::Current()[QStringLiteral("GraphicsBackend")] olive::Config::Current()[QStringLiteral("GraphicsBackend")]
.toString() .toString()
.toLower(); .toLower();
qputenv("QSG_RHI_BACKEND", qputenv("QSG_RHI_BACKEND", graphics_backend == QStringLiteral("vulkan") ?
graphics_backend == QStringLiteral("vulkan") QByteArrayLiteral("vulkan") :
? QByteArrayLiteral("vulkan") QByteArrayLiteral("opengl"));
: QByteArrayLiteral("opengl"));
if (auto *gui_app = qobject_cast<QGuiApplication *>(a.get())) { if (auto *gui_app = qobject_cast<QGuiApplication *>(a.get())) {
gui_app->setWindowIcon(QIcon(QStringLiteral(":/graphics/oak-logo.png"))); gui_app->setWindowIcon(
QIcon(QStringLiteral(":/graphics/oak-logo.png")));
} }
if (load_plugins) { if (load_plugins) {
+27 -27
View File
@@ -33,31 +33,31 @@ add_subdirectory(project)
add_subdirectory(time) add_subdirectory(time)
set(OLIVE_SOURCES set(OLIVE_SOURCES
${OLIVE_SOURCES} ${OLIVE_SOURCES}
node/factory.cpp node/factory.cpp
node/factory.h node/factory.h
node/globals.cpp node/globals.cpp
node/globals.h node/globals.h
node/inputdragger.cpp node/inputdragger.cpp
node/inputdragger.h node/inputdragger.h
node/inputimmediate.cpp node/inputimmediate.cpp
node/inputimmediate.h node/inputimmediate.h
node/keyframe.cpp node/keyframe.cpp
node/keyframe.h node/keyframe.h
node/node.cpp node/node.cpp
node/node.h node/node.h
node/nodeundo.cpp node/nodeundo.cpp
node/nodeundo.h node/nodeundo.h
node/param.cpp node/param.cpp
node/param.h node/param.h
node/project.cpp node/project.cpp
node/project.h node/project.h
node/splitvalue.h node/splitvalue.h
node/traverser.cpp node/traverser.cpp
node/traverser.h node/traverser.h
node/value.cpp node/value.cpp
node/value.h node/value.h
node/valuedatabase.cpp node/valuedatabase.cpp
node/valuedatabase.h node/valuedatabase.h
PARENT_SCOPE PARENT_SCOPE
) )
+2 -2
View File
@@ -18,6 +18,6 @@ add_subdirectory(pan)
add_subdirectory(volume) add_subdirectory(volume)
set(OLIVE_SOURCES set(OLIVE_SOURCES
${OLIVE_SOURCES} ${OLIVE_SOURCES}
PARENT_SCOPE PARENT_SCOPE
) )
+4 -4
View File
@@ -15,8 +15,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
set(OLIVE_SOURCES set(OLIVE_SOURCES
${OLIVE_SOURCES} ${OLIVE_SOURCES}
node/audio/pan/pan.h node/audio/pan/pan.h
node/audio/pan/pan.cpp node/audio/pan/pan.cpp
PARENT_SCOPE PARENT_SCOPE
) )
+4 -4
View File
@@ -15,8 +15,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
set(OLIVE_SOURCES set(OLIVE_SOURCES
${OLIVE_SOURCES} ${OLIVE_SOURCES}
node/audio/volume/volume.h node/audio/volume/volume.h
node/audio/volume/volume.cpp node/audio/volume/volume.cpp
PARENT_SCOPE PARENT_SCOPE
) )
+4 -4
View File
@@ -20,8 +20,8 @@ add_subdirectory(subtitle)
add_subdirectory(transition) add_subdirectory(transition)
set(OLIVE_SOURCES set(OLIVE_SOURCES
${OLIVE_SOURCES} ${OLIVE_SOURCES}
node/block/block.h node/block/block.h
node/block/block.cpp node/block/block.cpp
PARENT_SCOPE PARENT_SCOPE
) )
+4 -4
View File
@@ -15,8 +15,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
set(OLIVE_SOURCES set(OLIVE_SOURCES
${OLIVE_SOURCES} ${OLIVE_SOURCES}
node/block/clip/clip.h node/block/clip/clip.h
node/block/clip/clip.cpp node/block/clip/clip.cpp
PARENT_SCOPE PARENT_SCOPE
) )
+4 -4
View File
@@ -15,8 +15,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
set(OLIVE_SOURCES set(OLIVE_SOURCES
${OLIVE_SOURCES} ${OLIVE_SOURCES}
node/block/gap/gap.h node/block/gap/gap.h
node/block/gap/gap.cpp node/block/gap/gap.cpp
PARENT_SCOPE PARENT_SCOPE
) )
+4 -4
View File
@@ -15,8 +15,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
set(OLIVE_SOURCES set(OLIVE_SOURCES
${OLIVE_SOURCES} ${OLIVE_SOURCES}
node/block/subtitle/subtitle.cpp node/block/subtitle/subtitle.cpp
node/block/subtitle/subtitle.h node/block/subtitle/subtitle.h
PARENT_SCOPE PARENT_SCOPE
) )
+4 -4
View File
@@ -18,8 +18,8 @@ add_subdirectory(crossdissolve)
add_subdirectory(diptocolor) add_subdirectory(diptocolor)
set(OLIVE_SOURCES set(OLIVE_SOURCES
${OLIVE_SOURCES} ${OLIVE_SOURCES}
node/block/transition/transition.h node/block/transition/transition.h
node/block/transition/transition.cpp node/block/transition/transition.cpp
PARENT_SCOPE PARENT_SCOPE
) )
@@ -15,8 +15,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
set(OLIVE_SOURCES set(OLIVE_SOURCES
${OLIVE_SOURCES} ${OLIVE_SOURCES}
node/block/transition/crossdissolve/crossdissolvetransition.h node/block/transition/crossdissolve/crossdissolvetransition.h
node/block/transition/crossdissolve/crossdissolvetransition.cpp node/block/transition/crossdissolve/crossdissolvetransition.cpp
PARENT_SCOPE PARENT_SCOPE
) )
@@ -15,8 +15,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
set(OLIVE_SOURCES set(OLIVE_SOURCES
${OLIVE_SOURCES} ${OLIVE_SOURCES}
node/block/transition/diptocolor/diptocolortransition.h node/block/transition/diptocolor/diptocolortransition.h
node/block/transition/diptocolor/diptocolortransition.cpp node/block/transition/diptocolor/diptocolortransition.cpp
PARENT_SCOPE PARENT_SCOPE
) )
+2 -2
View File
@@ -22,6 +22,6 @@ add_subdirectory(ociolut)
add_subdirectory(threewaycolor) add_subdirectory(threewaycolor)
set(OLIVE_SOURCES set(OLIVE_SOURCES
${OLIVE_SOURCES} ${OLIVE_SOURCES}
PARENT_SCOPE PARENT_SCOPE
) )
+4 -4
View File
@@ -15,8 +15,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
set(OLIVE_SOURCES set(OLIVE_SOURCES
${OLIVE_SOURCES} ${OLIVE_SOURCES}
node/color/colormanager/colormanager.cpp node/color/colormanager/colormanager.cpp
node/color/colormanager/colormanager.h node/color/colormanager/colormanager.h
PARENT_SCOPE PARENT_SCOPE
) )
@@ -15,8 +15,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
set(OLIVE_SOURCES set(OLIVE_SOURCES
${OLIVE_SOURCES} ${OLIVE_SOURCES}
node/color/displaytransform/displaytransform.cpp node/color/displaytransform/displaytransform.cpp
node/color/displaytransform/displaytransform.h node/color/displaytransform/displaytransform.h
PARENT_SCOPE PARENT_SCOPE
) )
+4 -4
View File
@@ -15,8 +15,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
set(OLIVE_SOURCES set(OLIVE_SOURCES
${OLIVE_SOURCES} ${OLIVE_SOURCES}
node/color/ociobase/ociobase.cpp node/color/ociobase/ociobase.cpp
node/color/ociobase/ociobase.h node/color/ociobase/ociobase.h
PARENT_SCOPE PARENT_SCOPE
) )
@@ -15,8 +15,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
set(OLIVE_SOURCES set(OLIVE_SOURCES
${OLIVE_SOURCES} ${OLIVE_SOURCES}
node/color/ociogradingtransformlinear/ociogradingtransformlinear.cpp node/color/ociogradingtransformlinear/ociogradingtransformlinear.cpp
node/color/ociogradingtransformlinear/ociogradingtransformlinear.h node/color/ociogradingtransformlinear/ociogradingtransformlinear.h
PARENT_SCOPE PARENT_SCOPE
) )
+4 -4
View File
@@ -7,8 +7,8 @@
# (at your option) any later version. # (at your option) any later version.
set(OLIVE_SOURCES set(OLIVE_SOURCES
${OLIVE_SOURCES} ${OLIVE_SOURCES}
node/color/ociolut/ociolut.cpp node/color/ociolut/ociolut.cpp
node/color/ociolut/ociolut.h node/color/ociolut/ociolut.h
PARENT_SCOPE PARENT_SCOPE
) )
+10 -8
View File
@@ -37,7 +37,8 @@ const QString OCIOLutNode::kDirectionInput = QStringLiteral("lut_dir_in");
#define super OCIOBaseNode #define super OCIOBaseNode
namespace { namespace
{
bool IsSupportedLutExtension(const QString &suffix) bool IsSupportedLutExtension(const QString &suffix)
{ {
@@ -47,7 +48,8 @@ bool IsSupportedLutExtension(const QString &suffix)
bool IsMainProcess() bool IsMainProcess()
{ {
return qobject_cast<QApplication *>(QCoreApplication::instance()) != nullptr; return qobject_cast<QApplication *>(QCoreApplication::instance()) !=
nullptr;
} }
int ReadDirectionInput(const Node *node) int ReadDirectionInput(const Node *node)
@@ -245,9 +247,8 @@ bool OCIOLutNode::CreateProcessorFromInputs() const
ColorProcessorPtr processor; ColorProcessorPtr processor;
try { try {
const bool forward = const bool forward = static_cast<ColorProcessor::Direction>(
static_cast<ColorProcessor::Direction>(direction) == direction) == ColorProcessor::kNormal;
ColorProcessor::kNormal;
qDebug() << "OCIOLutNode: creating processor for" << path qDebug() << "OCIOLutNode: creating processor for" << path
<< "direction=" << direction << "direction=" << direction
<< "ocio_dir=" << (forward ? "FORWARD" : "INVERSE") << "ocio_dir=" << (forward ? "FORWARD" : "INVERSE")
@@ -256,10 +257,11 @@ bool OCIOLutNode::CreateProcessorFromInputs() const
OCIO::FileTransformRcPtr transform = OCIO::FileTransform::Create(); OCIO::FileTransformRcPtr transform = OCIO::FileTransform::Create();
transform->setSrc(path.toUtf8().constData()); transform->setSrc(path.toUtf8().constData());
transform->setInterpolation(OCIO::INTERP_LINEAR); transform->setInterpolation(OCIO::INTERP_LINEAR);
transform->setDirection( transform->setDirection(forward ? OCIO::TRANSFORM_DIR_FORWARD :
forward ? OCIO::TRANSFORM_DIR_FORWARD : OCIO::TRANSFORM_DIR_INVERSE); OCIO::TRANSFORM_DIR_INVERSE);
processor = ColorProcessor::Create(manager()->GetConfig()->getProcessor(transform)); processor = ColorProcessor::Create(
manager()->GetConfig()->getProcessor(transform));
} catch (const std::exception &e) { } catch (const std::exception &e) {
qWarning() << "OCIO LUT processor error:" << e.what(); qWarning() << "OCIO LUT processor error:" << e.what();
processor = nullptr; processor = nullptr;
+1 -1
View File
@@ -43,7 +43,7 @@ public:
virtual void Retranslate() override; virtual void Retranslate() override;
virtual void InputValueChangedEvent(const QString &input, virtual void InputValueChangedEvent(const QString &input,
int element) override; int element) override;
virtual void Value(const NodeValueRow &value, const NodeGlobals &globals, virtual void Value(const NodeValueRow &value, const NodeGlobals &globals,
NodeValueTable *table) const override; NodeValueTable *table) const override;
+4 -4
View File
@@ -15,8 +15,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
set(OLIVE_SOURCES set(OLIVE_SOURCES
${OLIVE_SOURCES} ${OLIVE_SOURCES}
node/color/threewaycolor/threewaycolor.h node/color/threewaycolor/threewaycolor.h
node/color/threewaycolor/threewaycolor.cpp node/color/threewaycolor/threewaycolor.cpp
PARENT_SCOPE PARENT_SCOPE
) )
@@ -87,8 +87,7 @@ void ThreeWayColorNode::Retranslate()
SetInputName(kHighlightsAmountInput, tr("Highlights Amount")); SetInputName(kHighlightsAmountInput, tr("Highlights Amount"));
} }
ShaderCode ShaderCode ThreeWayColorNode::GetShaderCode(const ShaderRequest &request) const
ThreeWayColorNode::GetShaderCode(const ShaderRequest &request) const
{ {
Q_UNUSED(request) Q_UNUSED(request)
return ShaderCode( return ShaderCode(
+2 -2
View File
@@ -25,6 +25,6 @@ add_subdirectory(transform)
add_subdirectory(wave) add_subdirectory(wave)
set(OLIVE_SOURCES set(OLIVE_SOURCES
${OLIVE_SOURCES} ${OLIVE_SOURCES}
PARENT_SCOPE PARENT_SCOPE
) )
+4 -4
View File
@@ -15,8 +15,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
set(OLIVE_SOURCES set(OLIVE_SOURCES
${OLIVE_SOURCES} ${OLIVE_SOURCES}
node/distort/cornerpin/cornerpindistortnode.cpp node/distort/cornerpin/cornerpindistortnode.cpp
node/distort/cornerpin/cornerpindistortnode.h node/distort/cornerpin/cornerpindistortnode.h
PARENT_SCOPE PARENT_SCOPE
) )
+4 -4
View File
@@ -15,8 +15,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
set(OLIVE_SOURCES set(OLIVE_SOURCES
${OLIVE_SOURCES} ${OLIVE_SOURCES}
node/distort/crop/cropdistortnode.cpp node/distort/crop/cropdistortnode.cpp
node/distort/crop/cropdistortnode.h node/distort/crop/cropdistortnode.h
PARENT_SCOPE PARENT_SCOPE
) )
+4 -4
View File
@@ -15,8 +15,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
set(OLIVE_SOURCES set(OLIVE_SOURCES
${OLIVE_SOURCES} ${OLIVE_SOURCES}
node/distort/flip/flipdistortnode.cpp node/distort/flip/flipdistortnode.cpp
node/distort/flip/flipdistortnode.h node/distort/flip/flipdistortnode.h
PARENT_SCOPE PARENT_SCOPE
) )
+4 -4
View File
@@ -15,8 +15,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
set(OLIVE_SOURCES set(OLIVE_SOURCES
${OLIVE_SOURCES} ${OLIVE_SOURCES}
node/distort/mask/mask.cpp node/distort/mask/mask.cpp
node/distort/mask/mask.h node/distort/mask/mask.h
PARENT_SCOPE PARENT_SCOPE
) )
+4 -4
View File
@@ -15,8 +15,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
set(OLIVE_SOURCES set(OLIVE_SOURCES
${OLIVE_SOURCES} ${OLIVE_SOURCES}
node/distort/ripple/rippledistortnode.cpp node/distort/ripple/rippledistortnode.cpp
node/distort/ripple/rippledistortnode.h node/distort/ripple/rippledistortnode.h
PARENT_SCOPE PARENT_SCOPE
) )
+4 -4
View File
@@ -15,8 +15,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
set(OLIVE_SOURCES set(OLIVE_SOURCES
${OLIVE_SOURCES} ${OLIVE_SOURCES}
node/distort/swirl/swirldistortnode.cpp node/distort/swirl/swirldistortnode.cpp
node/distort/swirl/swirldistortnode.h node/distort/swirl/swirldistortnode.h
PARENT_SCOPE PARENT_SCOPE
) )
+4 -4
View File
@@ -15,8 +15,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
set(OLIVE_SOURCES set(OLIVE_SOURCES
${OLIVE_SOURCES} ${OLIVE_SOURCES}
node/distort/tile/tiledistortnode.cpp node/distort/tile/tiledistortnode.cpp
node/distort/tile/tiledistortnode.h node/distort/tile/tiledistortnode.h
PARENT_SCOPE PARENT_SCOPE
) )
+4 -4
View File
@@ -15,8 +15,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
set(OLIVE_SOURCES set(OLIVE_SOURCES
${OLIVE_SOURCES} ${OLIVE_SOURCES}
node/distort/transform/transformdistortnode.cpp node/distort/transform/transformdistortnode.cpp
node/distort/transform/transformdistortnode.h node/distort/transform/transformdistortnode.h
PARENT_SCOPE PARENT_SCOPE
) )
+4 -4
View File
@@ -15,8 +15,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
set(OLIVE_SOURCES set(OLIVE_SOURCES
${OLIVE_SOURCES} ${OLIVE_SOURCES}
node/distort/wave/wavedistortnode.cpp node/distort/wave/wavedistortnode.cpp
node/distort/wave/wavedistortnode.h node/distort/wave/wavedistortnode.h
PARENT_SCOPE PARENT_SCOPE
) )
+2 -2
View File
@@ -17,6 +17,6 @@
add_subdirectory(opacity) add_subdirectory(opacity)
set(OLIVE_SOURCES set(OLIVE_SOURCES
${OLIVE_SOURCES} ${OLIVE_SOURCES}
PARENT_SCOPE PARENT_SCOPE
) )
+4 -4
View File
@@ -15,8 +15,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
set(OLIVE_SOURCES set(OLIVE_SOURCES
${OLIVE_SOURCES} ${OLIVE_SOURCES}
node/effect/opacity/opacityeffect.cpp node/effect/opacity/opacityeffect.cpp
node/effect/opacity/opacityeffect.h node/effect/opacity/opacityeffect.h
PARENT_SCOPE PARENT_SCOPE
) )
+4 -7
View File
@@ -94,7 +94,6 @@ void NodeFactory::Initialize()
} }
RegisterPluginNodes(); RegisterPluginNodes();
} }
void NodeFactory::Destroy() void NodeFactory::Destroy()
@@ -151,8 +150,7 @@ Menu *NodeFactory::CreateMenu(QWidget *parent, bool create_none_item,
// Determine final destination (support secondary grouping) // Determine final destination (support secondary grouping)
Menu *destination = top_menu; Menu *destination = top_menu;
QString sub = n->SubCategory(); QString sub = n->SubCategory();
if (!sub.isEmpty() && if (!sub.isEmpty() && n->Category().contains(Node::kCategoryOpenFX)) {
n->Category().contains(Node::kCategoryOpenFX)) {
QList<QAction *> sub_actions = top_menu->actions(); QList<QAction *> sub_actions = top_menu->actions();
foreach (QAction *action, sub_actions) { foreach (QAction *action, sub_actions) {
if (action->menu() && action->menu()->title() == sub) { if (action->menu() && action->menu()->title() == sub) {
@@ -249,16 +247,15 @@ void NodeFactory::RegisterPluginNodes()
continue; continue;
} }
const QString plugin_id = QString::fromStdString( const QString plugin_id =
image_effect->getIdentifier()); QString::fromStdString(image_effect->getIdentifier());
if (existing_ids.contains(plugin_id)) { if (existing_ids.contains(plugin_id)) {
continue; continue;
} }
const auto &contexts = image_effect->getContexts(); const auto &contexts = image_effect->getContexts();
if (contexts.empty()) { if (contexts.empty()) {
qWarning() << "Skipping OFX plugin with no contexts:" qWarning() << "Skipping OFX plugin with no contexts:" << plugin_id;
<< plugin_id;
continue; continue;
} }
std::string context = kOfxImageEffectContextFilter; std::string context = kOfxImageEffectContextFilter;
+2 -2
View File
@@ -20,6 +20,6 @@ add_subdirectory(mosaic)
add_subdirectory(stroke) add_subdirectory(stroke)
set(OLIVE_SOURCES set(OLIVE_SOURCES
${OLIVE_SOURCES} ${OLIVE_SOURCES}
PARENT_SCOPE PARENT_SCOPE
) )
+4 -4
View File
@@ -15,8 +15,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
set(OLIVE_SOURCES set(OLIVE_SOURCES
${OLIVE_SOURCES} ${OLIVE_SOURCES}
node/filter/blur/blur.h node/filter/blur/blur.h
node/filter/blur/blur.cpp node/filter/blur/blur.cpp
PARENT_SCOPE PARENT_SCOPE
) )

Some files were not shown because too many files have changed in this diff Show More