diff --git a/CMakeLists.txt b/CMakeLists.txt index 8b821505e..81fc1fe33 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,3 +1,19 @@ +# Olive - Non-Linear Video Editor +# Copyright (C) 2019 Olive Team +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + cmake_minimum_required(VERSION 3.9 FATAL_ERROR) project(olive-editor LANGUAGES CXX) @@ -72,515 +88,6 @@ endif() find_package(Doxygen) -set(OLIVE_SOURCES - decoders/decoder.cpp - decoders/decoder.h - decoders/ffmpegdecoder.cpp - decoders/ffmpegdecoder.h - decoders/ffmpegvideodecoder.cpp - decoders/ffmpegvideodecoder.h - decoders/frame.cpp - decoders/frame.h - decoders/pixelformatconverter.cpp - decoders/pixelformatconverter.h - decoders/audio/ffmpegaudiodecoder.cpp - decoders/audio/ffmpegaudiodecoder.h - dialogs/aboutdialog.cpp - dialogs/aboutdialog.h - dialogs/actionsearch.cpp - dialogs/actionsearch.h - dialogs/advancedvideodialog.cpp - dialogs/advancedvideodialog.h - dialogs/autocutsilencedialog.cpp - dialogs/autocutsilencedialog.h - dialogs/clippropertiesdialog.cpp - dialogs/clippropertiesdialog.h - dialogs/crashdialog.cpp - dialogs/crashdialog.h - dialogs/debugdialog.cpp - dialogs/debugdialog.h - dialogs/demonotice.cpp - dialogs/demonotice.h - dialogs/exportdialog.cpp - dialogs/exportdialog.h - dialogs/loaddialog.cpp - dialogs/loaddialog.h - dialogs/mediapropertiesdialog.cpp - dialogs/mediapropertiesdialog.h - dialogs/newsequencedialog.cpp - dialogs/newsequencedialog.h - dialogs/preferencesdialog.cpp - dialogs/preferencesdialog.h - dialogs/proxydialog.cpp - dialogs/proxydialog.h - dialogs/replaceclipmediadialog.cpp - dialogs/replaceclipmediadialog.h - dialogs/speeddialog.cpp - dialogs/speeddialog.h - dialogs/texteditdialog.cpp - dialogs/texteditdialog.h - effects/effectfield.cpp - effects/effectfield.h - effects/effectfields.h - effects/effectgizmo.cpp - effects/effectgizmo.h - effects/effectloaders.cpp - effects/effectloaders.h - effects/fields/boolfield.cpp - effects/fields/boolfield.h - effects/fields/buttonfield.cpp - effects/fields/buttonfield.h - effects/fields/colorfield.cpp - effects/fields/colorfield.h - effects/fields/combofield.cpp - effects/fields/combofield.h - effects/fields/doublefield.cpp - effects/fields/doublefield.h - effects/fields/filefield.cpp - effects/fields/filefield.h - effects/fields/fontfield.cpp - effects/fields/fontfield.h - effects/fields/labelfield.cpp - effects/fields/labelfield.h - effects/fields/stringfield.cpp - effects/fields/stringfield.h - effects/internal/audionoiseeffect.cpp - effects/internal/audionoiseeffect.h - effects/internal/cornerpineffect.cpp - effects/internal/cornerpineffect.h - effects/internal/crossdissolvetransition.cpp - effects/internal/crossdissolvetransition.h - effects/internal/cubetransition.h - effects/internal/dropshadoweffect.cpp - effects/internal/dropshadoweffect.h - effects/internal/exponentialfadetransition.cpp - effects/internal/exponentialfadetransition.h - effects/internal/fillleftrighteffect.cpp - effects/internal/fillleftrighteffect.h - effects/internal/linearfadetransition.cpp - effects/internal/linearfadetransition.h - effects/internal/logarithmicfadetransition.cpp - effects/internal/logarithmicfadetransition.h - effects/internal/paneffect.cpp - effects/internal/paneffect.h - effects/internal/richtexteffect.cpp - effects/internal/richtexteffect.h - effects/internal/shakeeffect.cpp - effects/internal/shakeeffect.h - effects/internal/solideffect.cpp - effects/internal/solideffect.h - effects/internal/texteffect.cpp - effects/internal/texteffect.h - effects/internal/timecodeeffect.cpp - effects/internal/timecodeeffect.h - effects/internal/toneeffect.cpp - effects/internal/toneeffect.h - effects/internal/transformeffect.cpp - effects/internal/transformeffect.h - effects/internal/voideffect.cpp - effects/internal/voideffect.h - effects/internal/volumeeffect.cpp - effects/internal/volumeeffect.h - effects/internal/vsthost.cpp - effects/internal/vsthost.h - effects/keyframe.cpp - effects/keyframe.h - effects/transition.cpp - effects/transition.h - global/clipboard.cpp - global/clipboard.h - global/config.cpp - global/config.h - global/crashhandler.cpp - global/crashhandler.h - global/debug.cpp - global/debug.h - global/global.cpp - global/global.h - global/math.cpp - global/math.h - global/path.cpp - global/path.h - global/rational.h - global/rational.cpp - global/timing.cpp - global/timing.h - nodes/inputs/boolinput.cpp - nodes/inputs/boolinput.h - nodes/inputs/colorinput.cpp - nodes/inputs/colorinput.h - nodes/inputs/comboinput.cpp - nodes/inputs/comboinput.h - nodes/inputs/fileinput.cpp - nodes/inputs/fileinput.h - nodes/inputs/fontinput.cpp - nodes/inputs/fontinput.h - nodes/inputs.h - nodes/inputs/stringinput.cpp - nodes/inputs/stringinput.h - nodes/inputs/vecinput.cpp - nodes/inputs/vecinput.h - nodes/node.cpp - nodes/nodedatatypes.cpp - nodes/nodedatatypes.h - nodes/nodeedge.cpp - nodes/nodeedge.h - nodes/nodegraph.cpp - nodes/nodegraph.h - nodes/nodeio.cpp - nodes/nodeio.h - nodes/node.h - nodes/nodes.h - nodes/oldeffectnode.h - nodes/oldeffectnode.cpp - nodes/nodes/nodeblock.h - nodes/nodes/nodeblock.cpp - nodes/nodes/nodetexturepassthru.cpp - nodes/nodes/nodetexturepassthru.h - nodes/nodes/nodemedia.cpp - nodes/nodes/nodemedia.h - nodes/nodes/nodeshader.cpp - nodes/nodes/nodeshader.h - nodes/nodes/nodevideoclip.cpp - nodes/nodes/nodevideoclip.h - nodes/widgets/buttonwidget.cpp - nodes/widgets/buttonwidget.h - nodes/widgets/labelwidget.cpp - nodes/widgets/labelwidget.h - panels/effectcontrols.cpp - panels/effectcontrols.h - panels/effectspanel.cpp - panels/effectspanel.h - panels/grapheditor.cpp - panels/grapheditor.h - panels/nodeeditor.cpp - panels/nodeeditor.h - panels/panels.cpp - panels/panels.h - panels/project.cpp - panels/project.h - panels/timeline.cpp - panels/timeline.h - panels/viewer.cpp - panels/viewer.h - project/footage.cpp - project/footage.h - project/loadthread.cpp - project/loadthread.h - project/media.cpp - project/media.h - project/previewgenerator.cpp - project/previewgenerator.h - project/projectelements.h - project/projectfilter.cpp - project/projectfilter.h - project/projectfunctions.cpp - project/projectfunctions.h - project/projectmodel.cpp - project/projectmodel.h - project/proxygenerator.cpp - project/proxygenerator.h - project/savethread.cpp - project/savethread.h - project/sourcescommon.cpp - project/sourcescommon.h - rendering/audio.cpp - rendering/audio.h - rendering/cacher.cpp - rendering/cacher.h - rendering/clipqueue.cpp - rendering/clipqueue.h - rendering/exportthread.cpp - rendering/exportthread.h - rendering/framebufferobject.cpp - rendering/framebufferobject.h - rendering/imagecache.h - rendering/imagecache.cpp - rendering/memorybuffer.h - rendering/memorybuffer.cpp - rendering/pixelformats.cpp - rendering/pixelformats.h - rendering/qopenglshaderprogramptr.h - rendering/renderfunctions.cpp - rendering/renderfunctions.h - rendering/renderthread.cpp - rendering/renderthread.h - rendering/shadergenerators.cpp - rendering/shadergenerators.h - timeline/clip.cpp - timeline/clip.h - timeline/ghost.cpp - timeline/ghost.h - timeline/marker.cpp - timeline/marker.h - timeline/mediaimportdata.cpp - timeline/mediaimportdata.h - timeline/selection.cpp - timeline/selection.h - timeline/sequence.cpp - timeline/sequence.h - timeline/timelinefunctions.cpp - timeline/timelinefunctions.h - timeline/timelineshared.cpp - timeline/timelineshared.h - timeline/timelinetools.cpp - timeline/timelinetools.h - timeline/track.cpp - timeline/track.h - timeline/tracktypes.h - ui/audiomonitor.cpp - ui/audiomonitor.h - ui/blur.cpp - ui/blur.h - ui/clickablelabel.cpp - ui/clickablelabel.h - ui/collapsiblewidget.cpp - ui/collapsiblewidget.h - ui/colorbutton.cpp - ui/colorbutton.h - ui/columnedgridlayout.cpp - ui/columnedgridlayout.h - ui/comboboxex.cpp - ui/comboboxex.h - ui/cursors.cpp - ui/cursors.h - ui/effectui.cpp - ui/effectui.h - ui/embeddedfilechooser.cpp - ui/embeddedfilechooser.h - ui/flowlayout.cpp - ui/flowlayout.h - ui/focusfilter.cpp - ui/focusfilter.h - ui/graphview.cpp - ui/graphview.h - ui/icons.cpp - ui/icons.h - ui/keyframedrawing.cpp - ui/keyframedrawing.h - ui/keyframenavigator.cpp - ui/keyframenavigator.h - ui/keyframeview.cpp - ui/keyframeview.h - ui/labelslider.cpp - ui/labelslider.h - ui/mainwindow.cpp - ui/mainwindow.h - ui/mediaiconservice.cpp - ui/mediaiconservice.h - ui/menu.cpp - ui/menu.h - ui/menuhelper.cpp - ui/menuhelper.h - ui/nodeedgeui.cpp - ui/nodeedgeui.h - ui/nodeui.cpp - ui/nodeui.h - ui/nodeview.cpp - ui/nodeview.h - ui/panel.cpp - ui/panel.h - ui/rectangleselect.cpp - ui/rectangleselect.h - ui/resizablescrollbar.cpp - ui/resizablescrollbar.h - ui/sourceiconview.cpp - ui/sourceiconview.h - ui/sourcetable.cpp - ui/sourcetable.h - ui/styling.cpp - ui/styling.h - ui/texteditex.cpp - ui/texteditex.h - ui/timelinearea.cpp - ui/timelinearea.h - ui/timelineheader.cpp - ui/timelineheader.h - ui/timelinelabel.cpp - ui/timelinelabel.h - ui/timelineview.cpp - ui/timelineview.h - ui/updatenotification.cpp - ui/updatenotification.h - ui/viewercontainer.cpp - ui/viewercontainer.h - ui/viewerwidget.cpp - ui/viewerwidget.h - ui/viewerwindow.cpp - ui/viewerwindow.h - ui/waveform.cpp - ui/waveform.h - undo/comboaction.cpp - undo/comboaction.h - undo/undo.cpp - undo/undo.h - undo/undostack.cpp - undo/undostack.h - main.cpp -) - -set(OLIVE_RESOURCES - cursors/cursors.qrc - effects/internal/internalshaders.qrc - icons/icons.qrc -) - -set(OLIVE_EFFECTS - effects/internal/cornerpin.frag - effects/internal/dropshadow.frag - effects/internal/ocio.frag - effects/internal/premultiply.frag - effects/shaders/boxblur.frag - effects/shaders/boxblur.xml - effects/shaders/bulge.frag - effects/shaders/bulge.xml - effects/shaders/chromaticaberration.frag - effects/shaders/chromaticaberration.xml - effects/shaders/crop.frag - effects/shaders/crop.xml - effects/shaders/despill.frag - effects/shaders/despill.xml - effects/shaders/directionalblur.frag - effects/shaders/directionalblur.xml - effects/shaders/flip.frag - effects/shaders/flip.xml - effects/shaders/gaussianblur.frag - effects/shaders/gaussianblur.xml - effects/shaders/need\ checking/chromakey.frag - effects/shaders/need\ checking/chromakey.xml - effects/shaders/need\ checking/colorcorrection.frag - effects/shaders/need\ checking/colorcorrection.xml - effects/shaders/need\ checking/colorsel.frag - effects/shaders/need\ checking/colorsel.xml - effects/shaders/need\ checking/common.frag - effects/shaders/need\ checking/crossstitch.frag - effects/shaders/need\ checking/crossstitch.xml - effects/shaders/need\ checking/emboss.frag - effects/shaders/need\ checking/emboss.xml - effects/shaders/need\ checking/findedges.frag - effects/shaders/need\ checking/fisheye.frag - effects/shaders/need\ checking/fisheye.xml - effects/shaders/need\ checking/huesatbri.frag - effects/shaders/need\ checking/huesatbri.xml - effects/shaders/need\ checking/invert.frag - effects/shaders/need\ checking/invert.xml - effects/shaders/need\ checking/lumakey.frag - effects/shaders/need\ checking/lumakey.xml - effects/shaders/need\ checking/posterize.frag - effects/shaders/need\ checking/posterize.xml - effects/shaders/need\ checking/toonify.frag - effects/shaders/need\ checking/toonify.xml - effects/shaders/need\ checking/volumetriclight.frag - effects/shaders/need\ checking/volumetriclight.xml - effects/shaders/noise.frag - effects/shaders/noise.xml - effects/shaders/pixelate.frag - effects/shaders/pixelate.xml - effects/shaders/radialblur.frag - effects/shaders/radialblur.xml - effects/shaders/ripple.frag - effects/shaders/ripple.xml - effects/shaders/sphere.frag - effects/shaders/sphere.xml - effects/shaders/swirl.frag - effects/shaders/swirl.xml - effects/shaders/tile.frag - effects/shaders/tile.xml - effects/shaders/vignette.frag - effects/shaders/vignette.xml - effects/shaders/wave.frag - effects/shaders/wave.xml -) - -qt5_create_translation(OLIVE_QM_FILES - ${CMAKE_SOURCE_DIR} - ts/olive_ar.ts - ts/olive_bs.ts - ts/olive_cs.ts - ts/olive_de.ts - ts/olive_es.ts - ts/olive_fr.ts - ts/olive_it.ts - ts/olive_ru.ts - ts/olive_sr.ts - ts/olive_id.ts -) - -set(OLIVE_TARGET "olive-editor") -if(APPLE) - set(OLIVE_TARGET "Olive") -endif() - -add_executable(${OLIVE_TARGET} - ${OLIVE_SOURCES} - ${OLIVE_RESOURCES} - ${OLIVE_EFFECTS} - ${OLIVE_QM_FILES} -) - -target_compile_definitions(${OLIVE_TARGET} PRIVATE ${OLIVE_DEFINITIONS}) - -target_compile_options(${OLIVE_TARGET} PRIVATE $<$:-Wno-reorder>) - set(CMAKE_INCLUDE_CURRENT_DIR ON) -target_link_libraries(${OLIVE_TARGET} - PRIVATE - OpenGL::GL - Qt5::Core - Qt5::Gui - Qt5::Widgets - Qt5::Multimedia - Qt5::OpenGL - Qt5::Svg - FFMPEG::avutil - FFMPEG::avcodec - FFMPEG::avformat - FFMPEG::avfilter - FFMPEG::swscale - FFMPEG::swresample - OpenColorIO -) - -if(MINGW) - target_link_libraries(${OLIVE_TARGET} PRIVATE DbgHelp) - - # Crash report uses MSVC-style PDBs, we convert symbols to this format here - #add_custom_command(TARGET ${OLIVE_TARGET} - # POST_BUILD - # COMMAND ${CMAKE_SOURCE_DIR}/packaging/windows/cv2pdb -C -n "${CMAKE_BINARY_DIR}/${OLIVE_TARGET}.exe") -endif() - -if(DOXYGEN_FOUND AND BUILD_DOXYGEN) - set(DOXYGEN_PROJECT_NAME "Olive") - set(DOXYGEN_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/docs") - set(DOXYGEN_EXTRACT_ALL "YES") - set(DOXYGEN_EXTRACT_PRIVATE "YES") - doxygen_add_docs(docs ALL ${OLIVE_SOURCES}) -endif() - -if(UNIX AND NOT APPLE) - install(TARGETS ${OLIVE_TARGET} RUNTIME DESTINATION bin) - install(FILES ${OLIVE_EFFECTS} DESTINATION share/olive-editor/effects) - install(FILES packaging/linux/org.olivevideoeditor.Olive.desktop DESTINATION share/applications) - install(FILES packaging/linux/org.olivevideoeditor.Olive.appdata.xml DESTINATION share/metainfo) - install(FILES packaging/linux/org.olivevideoeditor.Olive.xml DESTINATION share/mime/packages) - install(FILES packaging/linux/icons/16x16/org.olivevideoeditor.Olive.png DESTINATION share/icons/hicolor/16x16/apps) - install(FILES packaging/linux/icons/32x32/org.olivevideoeditor.Olive.png DESTINATION share/icons/hicolor/32x32/apps) - install(FILES packaging/linux/icons/48x48/org.olivevideoeditor.Olive.png DESTINATION share/icons/hicolor/48x48/apps) - install(FILES packaging/linux/icons/64x64/org.olivevideoeditor.Olive.png DESTINATION share/icons/hicolor/64x64/apps) - install(FILES packaging/linux/icons/128x128/org.olivevideoeditor.Olive.png DESTINATION share/icons/hicolor/128x128/apps) - install(FILES packaging/linux/icons/256x256/org.olivevideoeditor.Olive.png DESTINATION share/icons/hicolor/256x256/apps) - install(FILES packaging/linux/icons/512x512/org.olivevideoeditor.Olive.png DESTINATION share/icons/hicolor/512x512/apps) - install(FILES packaging/linux/icons/16x16/application-vnd.olive-project.png DESTINATION share/icons/hicolor/16x16/mimetypes) - install(FILES packaging/linux/icons/32x32/application-vnd.olive-project.png DESTINATION share/icons/hicolor/32x32/mimetypes) - install(FILES packaging/linux/icons/48x48/application-vnd.olive-project.png DESTINATION share/icons/hicolor/48x48/mimetypes) - install(FILES packaging/linux/icons/64x64/application-vnd.olive-project.png DESTINATION share/icons/hicolor/64x64/mimetypes) - install(FILES packaging/linux/icons/128x128/application-vnd.olive-project.png DESTINATION share/icons/hicolor/128x128/mimetypes) - install(FILES packaging/linux/icons/256x256/application-vnd.olive-project.png DESTINATION share/icons/hicolor/256x256/mimetypes) - install(FILES packaging/linux/icons/512x512/application-vnd.olive-project.png DESTINATION share/icons/hicolor/512x512/mimetypes) - install(FILES ${OLIVE_QM_FILES} DESTINATION share/olive-editor/ts) - - set(CMAKE_CXX_FLAGS "-rdynamic ${CMAKE_CXX_FLAGS}") - set(CMAKE_SHARED_LINKER_FLAGS "-rdynamic ${CMAKE_SHARED_LINKER_FLAGS}") -endif() +add_subdirectory(app) diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt new file mode 100644 index 000000000..8287b07d0 --- /dev/null +++ b/app/CMakeLists.txt @@ -0,0 +1,178 @@ +# Olive - Non-Linear Video Editor +# Copyright (C) 2019 Olive Team +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +set(OLIVE_SOURCES + ${OLIVE_SOURCES} + main.cpp +) + +add_subdirectory(panel) +add_subdirectory(project) +add_subdirectory(render) +add_subdirectory(widget) +add_subdirectory(window) + +set(OLIVE_TARGET "olive-editor") +if(APPLE) + set(OLIVE_TARGET "Olive") +endif() + +add_executable(${OLIVE_TARGET} + ${OLIVE_SOURCES} + ${OLIVE_RESOURCES} + ${OLIVE_EFFECTS} + ${OLIVE_QM_FILES} +) + +target_compile_definitions(${OLIVE_TARGET} PRIVATE ${OLIVE_DEFINITIONS}) + +target_compile_options(${OLIVE_TARGET} PRIVATE $<$:-Wno-reorder>) + +target_link_libraries(${OLIVE_TARGET} + PRIVATE + OpenGL::GL + Qt5::Core + Qt5::Gui + Qt5::Widgets + Qt5::Multimedia + Qt5::OpenGL + Qt5::Svg + FFMPEG::avutil + FFMPEG::avcodec + FFMPEG::avformat + FFMPEG::avfilter + FFMPEG::swscale + FFMPEG::swresample + OpenColorIO +) + +set(OLIVE_RESOURCES + cursors/cursors.qrc + effects/internal/internalshaders.qrc + icons/icons.qrc +) + +set(OLIVE_EFFECTS + effects/internal/cornerpin.frag + effects/internal/dropshadow.frag + effects/internal/ocio.frag + effects/internal/premultiply.frag + effects/shaders/boxblur.frag + effects/shaders/boxblur.xml + effects/shaders/bulge.frag + effects/shaders/bulge.xml + effects/shaders/chromaticaberration.frag + effects/shaders/chromaticaberration.xml + effects/shaders/crop.frag + effects/shaders/crop.xml + effects/shaders/despill.frag + effects/shaders/despill.xml + effects/shaders/directionalblur.frag + effects/shaders/directionalblur.xml + effects/shaders/flip.frag + effects/shaders/flip.xml + effects/shaders/gaussianblur.frag + effects/shaders/gaussianblur.xml + effects/shaders/need\ checking/chromakey.frag + effects/shaders/need\ checking/chromakey.xml + effects/shaders/need\ checking/colorcorrection.frag + effects/shaders/need\ checking/colorcorrection.xml + effects/shaders/need\ checking/colorsel.frag + effects/shaders/need\ checking/colorsel.xml + effects/shaders/need\ checking/common.frag + effects/shaders/need\ checking/crossstitch.frag + effects/shaders/need\ checking/crossstitch.xml + effects/shaders/need\ checking/emboss.frag + effects/shaders/need\ checking/emboss.xml + effects/shaders/need\ checking/findedges.frag + effects/shaders/need\ checking/fisheye.frag + effects/shaders/need\ checking/fisheye.xml + effects/shaders/need\ checking/huesatbri.frag + effects/shaders/need\ checking/huesatbri.xml + effects/shaders/need\ checking/invert.frag + effects/shaders/need\ checking/invert.xml + effects/shaders/need\ checking/lumakey.frag + effects/shaders/need\ checking/lumakey.xml + effects/shaders/need\ checking/posterize.frag + effects/shaders/need\ checking/posterize.xml + effects/shaders/need\ checking/toonify.frag + effects/shaders/need\ checking/toonify.xml + effects/shaders/need\ checking/volumetriclight.frag + effects/shaders/need\ checking/volumetriclight.xml + effects/shaders/noise.frag + effects/shaders/noise.xml + effects/shaders/pixelate.frag + effects/shaders/pixelate.xml + effects/shaders/radialblur.frag + effects/shaders/radialblur.xml + effects/shaders/ripple.frag + effects/shaders/ripple.xml + effects/shaders/sphere.frag + effects/shaders/sphere.xml + effects/shaders/swirl.frag + effects/shaders/swirl.xml + effects/shaders/tile.frag + effects/shaders/tile.xml + effects/shaders/vignette.frag + effects/shaders/vignette.xml + effects/shaders/wave.frag + effects/shaders/wave.xml +) + +qt5_create_translation(OLIVE_QM_FILES + ${CMAKE_SOURCE_DIR} + ts/olive_ar.ts + ts/olive_bs.ts + ts/olive_cs.ts + ts/olive_de.ts + ts/olive_es.ts + ts/olive_fr.ts + ts/olive_it.ts + ts/olive_ru.ts + ts/olive_sr.ts + ts/olive_id.ts +) + +if(UNIX AND NOT APPLE) + install(TARGETS ${OLIVE_TARGET} RUNTIME DESTINATION bin) + install(FILES ${OLIVE_EFFECTS} DESTINATION share/olive-editor/effects) + install(FILES packaging/linux/org.olivevideoeditor.Olive.desktop DESTINATION share/applications) + install(FILES packaging/linux/org.olivevideoeditor.Olive.appdata.xml DESTINATION share/metainfo) + install(FILES packaging/linux/org.olivevideoeditor.Olive.xml DESTINATION share/mime/packages) + install(FILES packaging/linux/icons/16x16/org.olivevideoeditor.Olive.png DESTINATION share/icons/hicolor/16x16/apps) + install(FILES packaging/linux/icons/32x32/org.olivevideoeditor.Olive.png DESTINATION share/icons/hicolor/32x32/apps) + install(FILES packaging/linux/icons/48x48/org.olivevideoeditor.Olive.png DESTINATION share/icons/hicolor/48x48/apps) + install(FILES packaging/linux/icons/64x64/org.olivevideoeditor.Olive.png DESTINATION share/icons/hicolor/64x64/apps) + install(FILES packaging/linux/icons/128x128/org.olivevideoeditor.Olive.png DESTINATION share/icons/hicolor/128x128/apps) + install(FILES packaging/linux/icons/256x256/org.olivevideoeditor.Olive.png DESTINATION share/icons/hicolor/256x256/apps) + install(FILES packaging/linux/icons/512x512/org.olivevideoeditor.Olive.png DESTINATION share/icons/hicolor/512x512/apps) + install(FILES packaging/linux/icons/16x16/application-vnd.olive-project.png DESTINATION share/icons/hicolor/16x16/mimetypes) + install(FILES packaging/linux/icons/32x32/application-vnd.olive-project.png DESTINATION share/icons/hicolor/32x32/mimetypes) + install(FILES packaging/linux/icons/48x48/application-vnd.olive-project.png DESTINATION share/icons/hicolor/48x48/mimetypes) + install(FILES packaging/linux/icons/64x64/application-vnd.olive-project.png DESTINATION share/icons/hicolor/64x64/mimetypes) + install(FILES packaging/linux/icons/128x128/application-vnd.olive-project.png DESTINATION share/icons/hicolor/128x128/mimetypes) + install(FILES packaging/linux/icons/256x256/application-vnd.olive-project.png DESTINATION share/icons/hicolor/256x256/mimetypes) + install(FILES packaging/linux/icons/512x512/application-vnd.olive-project.png DESTINATION share/icons/hicolor/512x512/mimetypes) + install(FILES ${OLIVE_QM_FILES} DESTINATION share/olive-editor/ts) +endif() + +if(DOXYGEN_FOUND AND BUILD_DOXYGEN) + set(DOXYGEN_PROJECT_NAME "Olive") + set(DOXYGEN_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/docs") + set(DOXYGEN_EXTRACT_ALL "YES") + set(DOXYGEN_EXTRACT_PRIVATE "YES") + doxygen_add_docs(docs ALL ${OLIVE_SOURCES}) +endif() diff --git a/app/main.cpp b/app/main.cpp new file mode 100644 index 000000000..5232a3dae --- /dev/null +++ b/app/main.cpp @@ -0,0 +1,53 @@ +/*** + + Olive - Non-Linear Video Editor + Copyright (C) 2019 Olive Team + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +***/ + +#include +#include + +#include "window/mainwindow/mainwindow.h" + +int main(int argc, char *argv[]) { + // Create application instance + QApplication a(argc, argv); + + // Set application metadata + QCoreApplication::setOrganizationName("olivevideoeditor.org"); + QCoreApplication::setOrganizationDomain("olivevideoeditor.org"); + QCoreApplication::setApplicationName("Olive"); + +#if (QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)) + QGuiApplication::setDesktopFileName("org.olivevideoeditor.Olive"); +#endif + + // Set OpenGL display profile (3.2 Core) + QSurfaceFormat format; + format.setVersion(3, 2); + format.setDepthBufferSize(24); + format.setProfile(QSurfaceFormat::CoreProfile); + QSurfaceFormat::setDefaultFormat(format); + + // Create main window instance + olive::MainWindow w; + + // Show main window + w.showMaximized(); + + return a.exec(); +} diff --git a/app/panel/CMakeLists.txt b/app/panel/CMakeLists.txt new file mode 100644 index 000000000..1af491378 --- /dev/null +++ b/app/panel/CMakeLists.txt @@ -0,0 +1,22 @@ +# Olive - Non-Linear Video Editor +# Copyright (C) 2019 Olive Team +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +add_subdirectory(viewer) + +set(OLIVE_SOURCES + ${OLIVE_SOURCES} + PARENT_SCOPE +) diff --git a/app/panel/viewer/CMakeLists.txt b/app/panel/viewer/CMakeLists.txt new file mode 100644 index 000000000..b2ccf398b --- /dev/null +++ b/app/panel/viewer/CMakeLists.txt @@ -0,0 +1,22 @@ +# Olive - Non-Linear Video Editor +# Copyright (C) 2019 Olive Team +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +set(OLIVE_SOURCES + ${OLIVE_SOURCES} + panel/viewer/viewer.h + panel/viewer/viewer.cpp + PARENT_SCOPE +) diff --git a/app/panel/viewer/viewer.cpp b/app/panel/viewer/viewer.cpp new file mode 100644 index 000000000..6e367b9cf --- /dev/null +++ b/app/panel/viewer/viewer.cpp @@ -0,0 +1,16 @@ +#include "viewer.h" + +#include "widget/viewer/viewer.h" + +ViewerPanel::ViewerPanel(QWidget *parent) : + PanelWidget(parent) +{ + SetTitle(tr("Viewer")); + SetSubtitle(tr("(None)")); + + // QObject system handles deleting this + ViewerWidget* viewer = new ViewerWidget(this); + + // Set ViewerWidget as the central widget + setWidget(viewer); +} diff --git a/app/panel/viewer/viewer.h b/app/panel/viewer/viewer.h new file mode 100644 index 000000000..5a0a9c946 --- /dev/null +++ b/app/panel/viewer/viewer.h @@ -0,0 +1,18 @@ +#ifndef VIEWER_PANEL_H +#define VIEWER_PANEL_H + +#include "widget/panel/panel.h" + +/** + * @brief The ViewerPanel class + * + * Dockable wrapper around a ViewerWidget + */ +class ViewerPanel : public PanelWidget { + Q_OBJECT +public: + ViewerPanel(QWidget* parent); +private: +}; + +#endif // VIEWER_PANEL_H diff --git a/app/project/CMakeLists.txt b/app/project/CMakeLists.txt new file mode 100644 index 000000000..3cfb0783f --- /dev/null +++ b/app/project/CMakeLists.txt @@ -0,0 +1,16 @@ +# Olive - Non-Linear Video Editor +# Copyright (C) 2019 Olive Team +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + diff --git a/app/render/CMakeLists.txt b/app/render/CMakeLists.txt new file mode 100644 index 000000000..4c826af41 --- /dev/null +++ b/app/render/CMakeLists.txt @@ -0,0 +1,23 @@ +# Olive - Non-Linear Video Editor +# Copyright (C) 2019 Olive Team +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +set(OLIVE_SOURCES + ${OLIVE_SOURCES} + render/glfunc.h + render/glfunc.cpp + render/qopenglshaderprogramptr.h + PARENT_SCOPE +) diff --git a/app/render/glfunc.cpp b/app/render/glfunc.cpp new file mode 100644 index 000000000..6f4e2f05d --- /dev/null +++ b/app/render/glfunc.cpp @@ -0,0 +1,90 @@ +#include "glfunc.h" + +#include +#include +#include + +const GLfloat blit_vertices[] = { + -1.0f, -1.0f, 0.0f, + 1.0f, -1.0f, 0.0f, + 1.0f, 1.0f, 0.0f, + + -1.0f, -1.0f, 0.0f, + -1.0f, 1.0f, 0.0f, + 1.0f, 1.0f, 0.0f +}; + +const GLfloat blit_texcoords[] = { + 0.0, 0.0, + 1.0, 0.0, + 1.0, 1.0, + + 0.0, 0.0, + 0.0, 1.0, + 1.0, 1.0 +}; + +const GLfloat flipped_blit_texcoords[] = { + 0.0, 1.0, + 1.0, 1.0, + 1.0, 0.0, + + 0.0, 1.0, + 0.0, 0.0, + 1.0, 0.0 +}; + +/** + * @brief Set up texture mipmaps + * @param f + */ +void PrepareToDraw(QOpenGLFunctions* f) { + f->glGenerateMipmap(GL_TEXTURE_2D); + f->glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR); + f->glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + f->glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_BORDER); + f->glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_BORDER); +} + +void olive::gl::Blit(QOpenGLShaderProgram* pipeline, bool flipped, QMatrix4x4 matrix) { + + QOpenGLFunctions* func = QOpenGLContext::currentContext()->functions(); + PrepareToDraw(func); + + QOpenGLVertexArrayObject m_vao; + m_vao.create(); + m_vao.bind(); + + QOpenGLBuffer m_vbo; + m_vbo.create(); + m_vbo.bind(); + m_vbo.allocate(blit_vertices, 18 * sizeof(GLfloat)); + m_vbo.release(); + + QOpenGLBuffer m_vbo2; + m_vbo2.create(); + m_vbo2.bind(); + m_vbo2.allocate(flipped ? flipped_blit_texcoords : blit_texcoords, 12 * sizeof(GLfloat)); + m_vbo2.release(); + + pipeline->bind(); + + pipeline->setUniformValue("mvp_matrix", matrix); + pipeline->setUniformValue("texture", 0); + + GLuint vertex_location = pipeline->attributeLocation("a_position"); + m_vbo.bind(); + func->glEnableVertexAttribArray(vertex_location); + func->glVertexAttribPointer(vertex_location, 3, GL_FLOAT, GL_FALSE, 0, 0); + m_vbo.release(); + + GLuint tex_location = pipeline->attributeLocation("a_texcoord"); + m_vbo2.bind(); + func->glEnableVertexAttribArray(tex_location); + func->glVertexAttribPointer(tex_location, 2, GL_FLOAT, GL_FALSE, 0, 0); + m_vbo2.release(); + + func->glDrawArrays(GL_TRIANGLES, 0, 6); + + pipeline->release(); +} diff --git a/app/render/glfunc.h b/app/render/glfunc.h new file mode 100644 index 000000000..4e607ed64 --- /dev/null +++ b/app/render/glfunc.h @@ -0,0 +1,30 @@ +#ifndef GLFUNC_H +#define GLFUNC_H + +#include +#include + +namespace olive { +namespace gl { + +/** + * @brief Draw texture on screen + * + * @param pipeline + * + * Shader to use for the texture drawing + * + * @param flipped + * + * Draw the texture vertically flipped (defaults to FALSE) + * + * @param matrix + * + * Transformation matrix to use when drawing (defaults to no transform) + */ +void Blit(QOpenGLShaderProgram* pipeline, bool flipped = false, QMatrix4x4 matrix = QMatrix4x4()); + +} +} + +#endif // GLFUNC_H diff --git a/app/render/qopenglshaderprogramptr.h b/app/render/qopenglshaderprogramptr.h new file mode 100644 index 000000000..a89993ffd --- /dev/null +++ b/app/render/qopenglshaderprogramptr.h @@ -0,0 +1,29 @@ +/*** + + Olive - Non-Linear Video Editor + Copyright (C) 2019 Olive Team + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +***/ + +#ifndef QOPENGLSHADERPROGRAMPTR_H +#define QOPENGLSHADERPROGRAMPTR_H + +#include +#include + +using QOpenGLShaderProgramPtr = std::shared_ptr; + +#endif // QOPENGLSHADERPROGRAMPTR_H diff --git a/app/widget/CMakeLists.txt b/app/widget/CMakeLists.txt new file mode 100644 index 000000000..6d5ad3314 --- /dev/null +++ b/app/widget/CMakeLists.txt @@ -0,0 +1,24 @@ +# Olive - Non-Linear Video Editor +# Copyright (C) 2019 Olive Team +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +add_subdirectory(viewer) +add_subdirectory(panel) +add_subdirectory(projectexplorer) + +set(OLIVE_SOURCES + ${OLIVE_SOURCES} + PARENT_SCOPE +) diff --git a/app/widget/panel/CMakeLists.txt b/app/widget/panel/CMakeLists.txt new file mode 100644 index 000000000..db88a9b47 --- /dev/null +++ b/app/widget/panel/CMakeLists.txt @@ -0,0 +1,22 @@ +# Olive - Non-Linear Video Editor +# Copyright (C) 2019 Olive Team +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +set(OLIVE_SOURCES + ${OLIVE_SOURCES} + widget/panel/panel.h + widget/panel/panel.cpp + PARENT_SCOPE +) diff --git a/app/widget/panel/panel.cpp b/app/widget/panel/panel.cpp new file mode 100644 index 000000000..89849394b --- /dev/null +++ b/app/widget/panel/panel.cpp @@ -0,0 +1,25 @@ +#include "panel.h" + +PanelWidget::PanelWidget(QWidget *parent) { +} + +void PanelWidget::SetTitle(const QString &t) +{ + title_ = t; + UpdateTitle(); +} + +void PanelWidget::SetSubtitle(const QString &t) +{ + subtitle_ = t; + UpdateTitle(); +} + +void PanelWidget::UpdateTitle() +{ + if (subtitle_.isEmpty()) { + setWindowTitle(title_); + } else { + setWindowTitle(tr("%1: %2").arg(title_, subtitle_)); + } +} diff --git a/app/widget/panel/panel.h b/app/widget/panel/panel.h new file mode 100644 index 000000000..db1d76b71 --- /dev/null +++ b/app/widget/panel/panel.h @@ -0,0 +1,70 @@ +#ifndef PANEL_WIDGET_H +#define PANEL_WIDGET_H + +#include + +/** + * @brief The PanelWidget class + * + * A widget that is always dockable within the MainWindow. + */ +class PanelWidget : public QDockWidget { + Q_OBJECT +public: + /** + * @brief PanelWidget Constructor + * + * @param parent + * + * The PanelWidget's parent, enforced to help with memory handling. Most of the time this will be an instance of + * MainWindow. + */ + PanelWidget(QWidget* parent); +protected: + /** + * @brief Set panel's title + * + * Use this function to set the title of the panel. + * + * A PanelWidget has the default format of "Title: Subtitle" (can differ depending on translation). If no Subtitle + * is set, the title will just be formatted "Title". + * + * @param t + * + * String to set the title to + */ + void SetTitle(const QString& t); + + /** + * @brief Set panel's subtitle + * + * Use this function to set the subtitle of the panel. + * + * A PanelWidget has the default format of "Title: Subtitle" (can differ depending on translation). If no Subtitle + * is set, the title will just be formatted "Title". + * + * @param t + * + * String to set the subtitle to + */ + void SetSubtitle(const QString& t); +private: + /** + * @brief Internal function that sets the QDockWidget's window title whenever the title/subtitle change. + * + * Should be called any time a change is made to title_ or subtitle_ + */ + void UpdateTitle(); + + /** + * @brief Internal title string + */ + QString title_; + + /** + * @brief Internal subtitle string + */ + QString subtitle_; +}; + +#endif // PANEL_WIDGET_H diff --git a/app/widget/projectexplorer/CMakeLists.txt b/app/widget/projectexplorer/CMakeLists.txt new file mode 100644 index 000000000..f6a8d656e --- /dev/null +++ b/app/widget/projectexplorer/CMakeLists.txt @@ -0,0 +1,22 @@ +# Olive - Non-Linear Video Editor +# Copyright (C) 2019 Olive Team +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +set(OLIVE_SOURCES + ${OLIVE_SOURCES} + widget/projectexplorer/projectexplorer.h + widget/projectexplorer/projectexplorer.cpp + PARENT_SCOPE +) diff --git a/app/widget/projectexplorer/projectexplorer.cpp b/app/widget/projectexplorer/projectexplorer.cpp new file mode 100644 index 000000000..7436ea75c --- /dev/null +++ b/app/widget/projectexplorer/projectexplorer.cpp @@ -0,0 +1,17 @@ +#include "projectexplorer.h" + +ProjectExplorer::ProjectExplorer(QWidget *parent) : + QWidget(parent), + view_type_(TreeView) +{ +} + +const ProjectExplorer::ViewType &ProjectExplorer::view_type() +{ + return view_type_; +} + +void ProjectExplorer::set_view_type(const ProjectExplorer::ViewType &type) +{ + view_type_ = type; +} diff --git a/app/widget/projectexplorer/projectexplorer.h b/app/widget/projectexplorer/projectexplorer.h new file mode 100644 index 000000000..5a5d5cefb --- /dev/null +++ b/app/widget/projectexplorer/projectexplorer.h @@ -0,0 +1,25 @@ +#ifndef PROJECTEXPLORER_H +#define PROJECTEXPLORER_H + +#include + +class ProjectExplorer : public QWidget +{ +public: + enum ViewType { + TreeView, + ListView, + IconView + }; + + ProjectExplorer(QWidget* parent); + + const ViewType& view_type(); + void set_view_type(const ViewType& type); + +private: + ViewType view_type_; + +}; + +#endif // PROJECTEXPLORER_H diff --git a/app/widget/viewer/CMakeLists.txt b/app/widget/viewer/CMakeLists.txt new file mode 100644 index 000000000..32035e424 --- /dev/null +++ b/app/widget/viewer/CMakeLists.txt @@ -0,0 +1,24 @@ +# Olive - Non-Linear Video Editor +# Copyright (C) 2019 Olive Team +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +set(OLIVE_SOURCES + ${OLIVE_SOURCES} + widget/viewer/viewer.h + widget/viewer/viewer.cpp + widget/viewer/viewerglwidget.h + widget/viewer/viewerglwidget.cpp + PARENT_SCOPE +) diff --git a/app/widget/viewer/viewer.cpp b/app/widget/viewer/viewer.cpp new file mode 100644 index 000000000..1d57cc034 --- /dev/null +++ b/app/widget/viewer/viewer.cpp @@ -0,0 +1,69 @@ +#include "viewer.h" + +#include +#include + +ViewerWidget::ViewerWidget(QWidget *parent) : + QWidget(parent) +{ + // Set up main layout + QVBoxLayout* layout = new QVBoxLayout(this); + layout->setSpacing(0); + layout->setMargin(0); + + // Create main OpenGL-based view + gl_widget_ = new ViewerGLWidget(); + layout->addWidget(gl_widget_); + + // Create lower controls + QWidget* lower_control_container = new QWidget(); + lower_control_container->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Maximum); + QHBoxLayout* lower_control_layout = new QHBoxLayout(lower_control_container); + lower_control_layout->setSpacing(0); + lower_control_layout->setMargin(0); + layout->addWidget(lower_control_container); + + QSizePolicy lower_container_size_policy = QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Expanding); + + // In the lower-left, we create a current timecode label wrapped in a QWidget for fixed sizing + QWidget* lower_left_container = new QWidget(); + lower_left_container->setSizePolicy(lower_container_size_policy); + lower_control_layout->addWidget(lower_left_container); + + QHBoxLayout* lower_left_layout = new QHBoxLayout(lower_left_container); + lower_left_layout->setSpacing(0); + lower_left_layout->setMargin(0); + + cur_tc_lbl_ = new QLabel("00:00:00;00"); + lower_left_layout->addWidget(cur_tc_lbl_); + lower_left_layout->addStretch(); + + // In the lower-middle, we create playback control buttons + QWidget* lower_middle_container = new QWidget(); + lower_left_container->setSizePolicy(lower_container_size_policy); + lower_control_layout->addWidget(lower_middle_container); + + QHBoxLayout* lower_middle_layout = new QHBoxLayout(lower_middle_container); + lower_middle_layout->setSpacing(0); + lower_middle_layout->setMargin(0); + + lower_middle_layout->addStretch(); + + QPushButton* play_button = new QPushButton("Play"); + lower_middle_layout->addWidget(play_button); + + lower_middle_layout->addStretch(); + + // The lower-right, we create another timecode label, this time to show the end timecode + QWidget* lower_right_container = new QWidget(); + lower_left_container->setSizePolicy(lower_container_size_policy); + lower_control_layout->addWidget(lower_right_container); + + QHBoxLayout* lower_right_layout = new QHBoxLayout(lower_right_container); + lower_right_layout->setSpacing(0); + lower_right_layout->setMargin(0); + + lower_right_layout->addStretch(); + end_tc_lbl_ = new QLabel("00:00:00;00"); + lower_right_layout->addWidget(end_tc_lbl_); +} diff --git a/app/widget/viewer/viewer.h b/app/widget/viewer/viewer.h new file mode 100644 index 000000000..82cd007bd --- /dev/null +++ b/app/widget/viewer/viewer.h @@ -0,0 +1,28 @@ +#ifndef VIEWER_WIDGET_H +#define VIEWER_WIDGET_H + +#include +#include +#include + +#include "viewerglwidget.h" + +/** + * @brief The ViewerWidget class + * + * An OpenGL-based viewer widget with playback controls. + */ +class ViewerWidget : public QWidget +{ + Q_OBJECT +public: + ViewerWidget(QWidget* parent); + +private: + ViewerGLWidget* gl_widget_; + + QLabel* cur_tc_lbl_; + QLabel* end_tc_lbl_; +}; + +#endif // VIEWER_WIDGET_H diff --git a/app/widget/viewer/viewerglwidget.cpp b/app/widget/viewer/viewerglwidget.cpp new file mode 100644 index 000000000..5b6936b0c --- /dev/null +++ b/app/widget/viewer/viewerglwidget.cpp @@ -0,0 +1,17 @@ +#include "viewerglwidget.h" + +#include +#include + +ViewerGLWidget::ViewerGLWidget() +{ + +} + +void ViewerGLWidget::paintGL() +{ + QOpenGLFunctions* f = context()->functions(); + + f->glClearColor(1.0f, 0.0f, 0.0f, 1.0f); + f->glClear(GL_COLOR_BUFFER_BIT); +} diff --git a/app/widget/viewer/viewerglwidget.h b/app/widget/viewer/viewerglwidget.h new file mode 100644 index 000000000..9349d5307 --- /dev/null +++ b/app/widget/viewer/viewerglwidget.h @@ -0,0 +1,18 @@ +#ifndef VIEWERGLWIDGET_H +#define VIEWERGLWIDGET_H + +#include + +class ViewerGLWidget : public QOpenGLWidget +{ +public: + ViewerGLWidget(); + + void SetTexture(GLuint tex); +protected: + virtual void paintGL() override; +private: + GLuint texture_; +}; + +#endif // VIEWERGLWIDGET_H diff --git a/app/window/CMakeLists.txt b/app/window/CMakeLists.txt new file mode 100644 index 000000000..488b0686e --- /dev/null +++ b/app/window/CMakeLists.txt @@ -0,0 +1,23 @@ +# Olive - Non-Linear Video Editor +# Copyright (C) 2019 Olive Team +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +add_subdirectory(mainwindow) + +set(OLIVE_SOURCES + ${OLIVE_SOURCES} + PARENT_SCOPE +) + diff --git a/app/window/mainwindow/CMakeLists.txt b/app/window/mainwindow/CMakeLists.txt new file mode 100644 index 000000000..b672f2ee5 --- /dev/null +++ b/app/window/mainwindow/CMakeLists.txt @@ -0,0 +1,22 @@ +# Olive - Non-Linear Video Editor +# Copyright (C) 2019 Olive Team +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +set(OLIVE_SOURCES + ${OLIVE_SOURCES} + window/mainwindow/mainwindow.h + window/mainwindow/mainwindow.cpp + PARENT_SCOPE +) diff --git a/app/window/mainwindow/mainwindow.cpp b/app/window/mainwindow/mainwindow.cpp new file mode 100644 index 000000000..f5ae11b18 --- /dev/null +++ b/app/window/mainwindow/mainwindow.cpp @@ -0,0 +1,30 @@ +#include "mainwindow.h" + +// Panel objects +#include "panel/viewer/viewer.h" + +olive::MainWindow::MainWindow(QWidget *parent) : + QMainWindow(parent) +{ + // Create empty central widget - we don't actually want a central widget but some of Qt's docking/undocking fails + // without it + QWidget* centralWidget = new QWidget(this); + centralWidget->setMaximumSize(QSize(0, 0)); + setCentralWidget(centralWidget); + + // Set tabs to be on top of panels (default behavior is bottom) + setTabPosition(Qt::AllDockWidgetAreas, QTabWidget::North); + + // Allow panels to be tabbed within each other + setDockNestingEnabled(true); + + // TODO Use settings data to create panels and restore state if they exist + ViewerPanel* viewer_panel = new ViewerPanel(this); + addDockWidget(Qt::TopDockWidgetArea, viewer_panel); + ViewerPanel* viewer_panel2 = new ViewerPanel(this); + addDockWidget(Qt::TopDockWidgetArea, viewer_panel2); + ViewerPanel* viewer_panel3 = new ViewerPanel(this); + addDockWidget(Qt::BottomDockWidgetArea, viewer_panel3); + ViewerPanel* viewer_panel4 = new ViewerPanel(this); + addDockWidget(Qt::BottomDockWidgetArea, viewer_panel4); +} diff --git a/app/window/mainwindow/mainwindow.h b/app/window/mainwindow/mainwindow.h new file mode 100644 index 000000000..94b7840e5 --- /dev/null +++ b/app/window/mainwindow/mainwindow.h @@ -0,0 +1,22 @@ +#ifndef MAINWINDOW_H +#define MAINWINDOW_H + +#include + +namespace olive { + +/** + * @brief The MainWindow class + * + * Olive's main window responsible for docking widgets. + */ +class MainWindow : public QMainWindow { + Q_OBJECT +public: + MainWindow(QWidget* parent = nullptr); +private: +}; + +} + +#endif diff --git a/main.cpp b/main.cpp deleted file mode 100644 index 5c397b7e0..000000000 --- a/main.cpp +++ /dev/null @@ -1,167 +0,0 @@ -/*** - - Olive - Non-Linear Video Editor - Copyright (C) 2019 Olive Team - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - -***/ - -#include -#include - -#include "decoders/pixelformatconverter.h" -#include "dialogs/crashdialog.h" -#include "global/crashhandler.h" -#include "global/debug.h" -#include "global/config.h" -#include "global/global.h" -#include "panels/timeline.h" -#include "rendering/pixelformats.h" -#include "ui/mediaiconservice.h" -#include "ui/mainwindow.h" - -extern "C" { -#include -#include -} - -int main(int argc, char *argv[]) { -#ifdef __GNUC__ - signal(SIGSEGV, handler); -#endif - - olive::Global = std::unique_ptr(new OliveGlobal); - - bool launch_fullscreen = false; - QString load_proj; - - bool use_internal_logger = true; - - if (argc > 1) { - for (int i=1;i\tSet an external language file to use\n" - "\n" - "Environment Variables:\n" - "\tOLIVE_EFFECTS_PATH\tSpecify a path to search for GLSL shader effects\n" - "\tFREI0R_PATH\t\tSpecify a path to search for Frei0r effects\n" - "\tOLIVE_LANG_PATH\t\tSpecify a path to search for translation files\n" - "\n", argv[0]); - return 0; - } else if (!strcmp(argv[i], "--fullscreen") || !strcmp(argv[i], "-f")) { - launch_fullscreen = true; - } else if (!strcmp(argv[i], "--disable-shaders")) { - olive::runtime_config.shaders_are_enabled = false; - } else if (!strcmp(argv[i], "--no-debug")) { - use_internal_logger = false; - } else if (!strcmp(argv[i], "--translation")) { - if (i + 1 < argc && argv[i + 1][0] != '-') { - // load translation file - olive::runtime_config.external_translation_file = argv[i + 1]; - - i++; - } else { - printf("[ERROR] No translation file specified\n"); - return 1; - } - } else { - printf("[ERROR] Unknown argument '%s'\n", argv[1]); - return 1; - } - } else if (load_proj.isEmpty()) { - load_proj = argv[i]; - } - } - } - - if (use_internal_logger) { - qInstallMessageHandler(debug_message_handler); - } - - // Initialize ffmpeg subsystem - // (these have been deprecated in FFmpeg 4, but are still necessary for FFmpeg 3) -#if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(58, 9, 100) - av_register_all(); -#endif - -#if LIBAVFILTER_VERSION_INT < AV_VERSION_INT(7, 14, 100) - avfilter_register_all(); -#endif - - QCoreApplication::setAttribute(Qt::AA_ShareOpenGLContexts); - - QSurfaceFormat format; - format.setVersion(3, 2); - format.setDepthBufferSize(24); - format.setProfile(QSurfaceFormat::CoreProfile); - QSurfaceFormat::setDefaultFormat(format); - - QApplication a(argc, argv); - a.setWindowIcon(QIcon(":/icons/olive64.png")); - - // start media icon service (uses QPixmaps which require a QGuiApplication to have been created) - olive::media_icon_service = std::unique_ptr(new MediaIconService()); - - // set app name data - QCoreApplication::setOrganizationName("olivevideoeditor.org"); - QCoreApplication::setOrganizationDomain("olivevideoeditor.org"); - QCoreApplication::setApplicationName("Olive"); - -#if (QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)) - QGuiApplication::setDesktopFileName("org.olivevideoeditor.Olive"); -#endif - - olive::crash_dialog = new CrashDialog(); - - MainWindow w(nullptr); - - // multiply track height constants by the current DPI scale - olive::timeline::MultiplyTrackSizesByDPI(); - - // set up rendering bit depths - olive::InitializePixelFormats(); - - // initialize pixel format converter - olive::pix_fmt_conv = new PixelFormatConverter(); - - // connect main window's first paint to global's init finished function - QObject::connect(&w, SIGNAL(finished_first_paint()), olive::Global.get(), SLOT(finished_initialize()), Qt::QueuedConnection); - - if (!load_proj.isEmpty()) { - olive::Global->load_project_on_launch(load_proj); - } - if (launch_fullscreen) { - w.showFullScreen(); - } else { - w.showMaximized(); - } - - return a.exec(); -} diff --git a/include/vestige.h b/thirdparty/vestige/include/vestige.h similarity index 100% rename from include/vestige.h rename to thirdparty/vestige/include/vestige.h diff --git a/ts/olive_ar.ts b/ts/olive_ar.ts index badaa17ce..c33f59421 100644 --- a/ts/olive_ar.ts +++ b/ts/olive_ar.ts @@ -2023,118 +2023,118 @@ Audio Layout: %6 مقطع جديد - + Preset: قالب: - + Film 4K فلم 4K - + TV 4K (Ultra HD/2160p) 4K تلفاز (أقصى-عالي الدقة/2160p) - + 1080p - + 720p - + 480p - + 360p - + 240p - + 144p - + NTSC (480i) - + PAL (576i) - + Custom مخصوص - + Video فيديو - + Width: العرض: - + Height: الطول: - + Frame Rate: معدل اﻹطارات: - + Pixel Aspect Ratio: للمراجعة معدل نسبة البيكسل: - + Square Pixels (1.0) بكسيل مربع (1.0) - + Interlacing: المشابكة: - + None (Progressive) لا شيء (متفاقم) - + Audio الصوت - + Sample Rate: معدل الإعتيان: - + Name: اﻷسم: diff --git a/ts/olive_bs.ts b/ts/olive_bs.ts index a7acf863c..081f4188d 100644 --- a/ts/olive_bs.ts +++ b/ts/olive_bs.ts @@ -1828,117 +1828,117 @@ Audio Layout: %6 - + Preset: - + Film 4K - + TV 4K (Ultra HD/2160p) - + 1080p - + 720p - + 480p - + 360p - + 240p - + 144p - + NTSC (480i) - + PAL (576i) - + Custom - + Video Video - + Width: Širina: - + Height: Visina: - + Frame Rate: Okvirna stopa: - + Pixel Aspect Ratio: - + Square Pixels (1.0) - + Interlacing: - + None (Progressive) Nema (progresivno) - + Audio Audio - + Sample Rate: - + Name: diff --git a/ts/olive_de.ts b/ts/olive_de.ts index 8babd7b2a..9ee9d2ded 100644 --- a/ts/olive_de.ts +++ b/ts/olive_de.ts @@ -2040,121 +2040,121 @@ Audio Layout: %6 Neue Sequenz - + Preset: Could be also preset Vorgabe: - + Film 4K Film 4K - + TV 4K (Ultra HD/2160p) TV 4K (Ultra HD/2160p) - + 1080p 1080p - + 720p 720p - + 480p 480p - + 360p 360p - + 240p 240p - + 144p 144p - + NTSC (480i) NTSC (480i) - + PAL (576i) PAL (576i) - + Custom Benutzerdefiniert - + Video Same as in english Video - + Width: Breite: - + Height: Höhe: - + Frame Rate: Bildrate: - + Pixel Aspect Ratio: Pixel-Seitenverhältnis: - + Square Pixels (1.0) Quadratische Pixel (1.0) - + Interlacing: Same as in english Interlacing: - + None (Progressive) Keine (Progressive) - + Audio Same as in english Audio - + Sample Rate: Abtastrate: - + Name: Name: diff --git a/ts/olive_es.ts b/ts/olive_es.ts index 2ddb4411e..aaf3e1632 100644 --- a/ts/olive_es.ts +++ b/ts/olive_es.ts @@ -1679,117 +1679,117 @@ Audio Layout: %6 - + Preset: - + Film 4K - + TV 4K (Ultra HD/2160p) - + 1080p - + 720p - + 480p - + 360p - + 240p - + 144p - + NTSC (480i) - + PAL (576i) - + Custom - + Video - + Width: - + Height: - + Frame Rate: - + Pixel Aspect Ratio: - + Square Pixels (1.0) - + Interlacing: - + None (Progressive) - + Audio - + Sample Rate: - + Name: diff --git a/ts/olive_fr.ts b/ts/olive_fr.ts index ad06dacf1..f8475eb4b 100644 --- a/ts/olive_fr.ts +++ b/ts/olive_fr.ts @@ -2008,117 +2008,117 @@ Canaux audio : %6 Nouvelle séquence - + Preset: Préréglage : - + Film 4K Film 4K - + TV 4K (Ultra HD/2160p) TV 4K (Ultra HD/2160p) - + 1080p 1080p - + 720p 720p - + 480p 480p - + 360p 360p - + 240p 240p - + 144p 144p - + NTSC (480i) NTSC (480i) - + PAL (576i) PAL (576i) - + Custom Personnalisé - + Video Vidéo - + Width: Largeur : - + Height: Hauteur : - + Frame Rate: Images par seconde : - + Pixel Aspect Ratio: Ratio des pixels : - + Square Pixels (1.0) Pixels carré (1,0) - + Interlacing: Entrelacement : - + None (Progressive) Aucun (Progressif) - + Audio Audio - + Sample Rate: Taux d'échantillonnage : - + Name: Nom : diff --git a/ts/olive_id.ts b/ts/olive_id.ts index c8a96359d..1a462f959 100644 --- a/ts/olive_id.ts +++ b/ts/olive_id.ts @@ -1869,117 +1869,117 @@ Tata Audio: %6 Rangkaian Baru - + Preset: - + Film 4K - + TV 4K (Ultra HD/2160p) - + 1080p - + 720p - + 480p - + 360p - + 240p - + 144p - + NTSC (480i) - + PAL (576i) - + Custom Kustom - + Video - + Width: Lebar: - + Height: Tinggi: - + Frame Rate: Laju frame (fps): - + Pixel Aspect Ratio: Rasio aspek piksel: - + Square Pixels (1.0) Persegi (1.0) - + Interlacing: Mode interlace: - + None (Progressive) Tidak ada (Progresif) - + Audio - + Sample Rate: Laju sampel: - + Name: Nama: diff --git a/ts/olive_it.ts b/ts/olive_it.ts index 2cfb3ba7a..4ed36bd50 100644 --- a/ts/olive_it.ts +++ b/ts/olive_it.ts @@ -1862,117 +1862,117 @@ Disposizione audio: %6 Nuova sequenza - + Preset: Preimpostazioni: - + Film 4K Film 4K - + TV 4K (Ultra HD/2160p) TV 4K (Ultra HD/2160p) - + 1080p 1080p - + 720p 720p - + 480p 480p - + 360p 360p - + 240p 240p - + 144p 144p - + NTSC (480i) NTSC (480i) - + PAL (576i) PAL (576i) - + Custom Personalizzato - + Video Video - + Width: Larghezza: - + Height: Altezza: - + Frame Rate: Velocità fotogrammi: - + Pixel Aspect Ratio: Proporzioni dei pixel: - + Square Pixels (1.0) Pixel quadrati (1.0) - + Interlacing: Interlacciamento: - + None (Progressive) Nessuno (progressivo) - + Audio Audio - + Sample Rate: Frequenza di campionamento: - + Name: Nome: diff --git a/ts/olive_ru.ts b/ts/olive_ru.ts index fb78426e5..d3d635b89 100644 --- a/ts/olive_ru.ts +++ b/ts/olive_ru.ts @@ -1759,117 +1759,117 @@ Audio Layout: %6 Новая последовательность - + Preset: Предстановка: - + Film 4K Кино 4К - + TV 4K (Ultra HD/2160p) TV 4K (Ultra HD/2160p) - + 1080p 1080p - + 720p 720p - + 480p 480p - + 360p 360p - + 240p 240p - + 144p 144p - + NTSC (480i) NTSC (480i) - + PAL (576i) PAL (576i) - + Custom Другое - + Video Видео - + Width: Ширина: - + Height: Высота: - + Frame Rate: Частота кадров: - + Pixel Aspect Ratio: Соотношение сторон пикселя: - + Square Pixels (1.0) Квадратные пиксели (1.0) - + Interlacing: Чересстрочность: - + None (Progressive) Нет (прогрессивно) - + Audio Звук - + Sample Rate: Частота дискретизации: - + Name: Название: diff --git a/ts/olive_sr.ts b/ts/olive_sr.ts index 1064d35df..2ccaf0e78 100644 --- a/ts/olive_sr.ts +++ b/ts/olive_sr.ts @@ -1815,117 +1815,117 @@ Audio Layout: %6 - + Preset: - + Film 4K - + TV 4K (Ultra HD/2160p) - + 1080p - + 720p - + 480p - + 360p - + 240p - + 144p - + NTSC (480i) - + PAL (576i) - + Custom - + Video Видео - + Width: Ширина: - + Height: Висина: - + Frame Rate: Оквирна стопа: - + Pixel Aspect Ratio: - + Square Pixels (1.0) - + Interlacing: - + None (Progressive) Нема (прогресивно) - + Audio Аудио - + Sample Rate: - + Name: