Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MAJOR CHANGE (but not really): Move headers to src/ directory #504

Closed
wants to merge 9 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 21 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,19 @@ For more information, please visit <http://www.openshot.org/>.
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/Modules")

################ PROJECT VERSION ####################
set(PROJECT_VERSION_FULL "0.2.5-dev2")
set(PROJECT_SO_VERSION 19)
set(PROJECT_VERSION_FULL "0.2.5-dev2" CACHE STRING "Extended version string" FORCE)
set(PROJECT_SO_VERSION 19 CACHE STRING "library API version" FORCE)

### METADATA
set(PROJECT_AUTHOR "Jonathan Thomas and contributors")
set(PROJECT_AUTHOR_EMAIL "[email protected]")
set(PROJECT_MAINTAINER "Jonathan Thomas")
set(PROJECT_MAINTAINER_EMAIL "[email protected]")
set(PROJECT_URL "https://github.com/OpenShot/libopenshot/")
set(PROJECT_SUMMARY "C++ audio-video processing library that enables high-quality video editing.")
set(PROJECT_DESCRIPTION [=[
OpenShot Library (libopenshot) is a free, open-source project that enables high-quality video editing.
]=])

# Remove the dash and anything following, to get the #.#.# version for project()
STRING(REGEX REPLACE "\-.*$" "" VERSION_NUM "${PROJECT_VERSION_FULL}")
Expand All @@ -57,7 +68,7 @@ PROJECT(libopenshot LANGUAGES C CXX VERSION ${VERSION_NUM})

message("
Generating build files for OpenShot with CMake ${CMAKE_VERSION}
Building ${PROJECT_NAME} (version ${PROJECT_VERSION})
Building ${PROJECT_NAME} version ${PROJECT_VERSION_FULL}
SO/API/ABI Version: ${PROJECT_SO_VERSION}
")

Expand Down Expand Up @@ -91,12 +102,6 @@ if(DEFINED ENABLE_TESTS)
set(ENABLE_TESTS ${ENABLE_TESTS} CACHE BOOL "Build unit tests (requires UnitTest++)" FORCE)
endif()

########## Configure Version.h header ##############
configure_file(include/OpenShotVersion.h.in include/OpenShotVersion.h @ONLY)
# We'll want that installed later
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/include/OpenShotVersion.h
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/libopenshot)

#### Work around a GCC < 9 bug with handling of _Pragma() in macros
#### See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55578
if ((${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU") AND
Expand Down Expand Up @@ -140,7 +145,13 @@ if(NOT DEFINED CMAKE_BUILD_TYPE OR CMAKE_BUILD_TYPE STREQUAL "")
endif()

############## PROCESS src/ DIRECTORIES ##############
### Set up include paths
find_package(OpenShotAudio 0.2.0 REQUIRED)
include_directories(${LIBOPENSHOT_AUDIO_INCLUDE_DIRS})

add_subdirectory(src)
add_subdirectory(examples)
add_subdirectory(bindings)

################### DOCUMENTATION ###################
# Find Doxygen (used for documentation)
Expand Down Expand Up @@ -180,6 +191,7 @@ if (ENABLE_COVERAGE)
EXECUTABLE openshot-test
DEPENDENCIES openshot-test)
message("Generate coverage report with 'make coverage'")
add_feature_info("Coverage unit" ENABLE_COVERAGE "generate report with 'make coverage'")
endif()

########### PRINT FEATURE SUMMARY ##############
Expand Down
37 changes: 18 additions & 19 deletions Doxyfile.in
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@ PROJECT_NUMBER = "@PROJECT_VERSION@"
# for a project that appears at the top of each page and should give viewer a
# quick idea about the purpose of the project. Keep the description short.

PROJECT_BRIEF =
PROJECT_BRIEF = "@PROJECT_SUMMARY@"

# With the PROJECT_LOGO tag one can specify a logo or an icon that is included
# in the documentation. The maximum height of the logo should not exceed 55
# pixels and the maximum width should not exceed 200 pixels. Doxygen will copy
# the logo to the output directory.

PROJECT_LOGO =
PROJECT_LOGO = "@PROJECT_SOURCE_DIR@/doc/images/openshot-qt.png"

# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path
# into which the generated documentation will be written. If a relative path is
Expand Down Expand Up @@ -148,7 +148,7 @@ INLINE_INHERITED_MEMB = NO
# shortest path that makes the file name unique will be used
# The default value is: YES.

FULL_PATH_NAMES = NO
FULL_PATH_NAMES = YES

# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path.
# Stripping is only done if one of the specified strings matches the left-hand
Expand All @@ -160,7 +160,8 @@ FULL_PATH_NAMES = NO
# will be relative from the directory where doxygen is started.
# This tag requires that the tag FULL_PATH_NAMES is set to YES.

STRIP_FROM_PATH =
STRIP_FROM_PATH = "@PROJECT_SOURCE_DIR@/src" \
"@PROJECT_BINARY_DIR@/src"

# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the
# path mentioned in the documentation of a class, which tells the reader which
Expand All @@ -169,7 +170,8 @@ STRIP_FROM_PATH =
# specify the list of include paths that are normally passed to the compiler
# using the -I flag.

STRIP_FROM_INC_PATH =
STRIP_FROM_INC_PATH = "@PROJECT_SOURCE_DIR@/src" \
"@PROJECT_BINARY_DIR@/src"

# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but
# less readable) file names. This can be useful is your file systems doesn't
Expand Down Expand Up @@ -340,7 +342,7 @@ AUTOLINK_SUPPORT = YES
# diagrams that involve STL classes more complete and accurate.
# The default value is: NO.

BUILTIN_STL_SUPPORT = YES
BUILTIN_STL_SUPPORT = NO

# If you use Microsoft's C++/CLI language, you should set this option to YES to
# enable parsing support.
Expand Down Expand Up @@ -803,9 +805,9 @@ WARN_LOGFILE =
# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING
# Note: If this tag is empty the current directory is searched.

INPUT = "@CMAKE_CURRENT_SOURCE_DIR@/include" \
"@CMAKE_CURRENT_SOURCE_DIR@/src" \
"@CMAKE_CURRENT_SOURCE_DIR@/doc"
INPUT = "@PROJECT_SOURCE_DIR@/src" \
"@PROJECT_BINARY_DIR@/src" \
"@PROJECT_SOURCE_DIR@/doc"


# This tag can be used to specify the character encoding of the source files
Expand Down Expand Up @@ -862,11 +864,8 @@ EXCLUDE_SYMLINKS = NO
# Note that the wildcards are matched against the file with absolute path, so to
# exclude all test directories for example use the pattern */test/*

EXCLUDE_PATTERNS = "*/.*" \
"*/.*/*" \
"*/src/examples/*" \
"*/src/bindings/*" \
"*.py"
EXCLUDE_PATTERNS = "*/moc_*.cpp" \
"*/*_automoc.cpp"

# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
# (namespaces, classes, functions, etc.) that should be excluded from the
Expand All @@ -883,27 +882,27 @@ EXCLUDE_SYMBOLS =
# that contain example code fragments that are included (see the \include
# command).

EXAMPLE_PATH = "@CMAKE_CURRENT_SOURCE_DIR@/tests"
EXAMPLE_PATH = "@PROJECT_SOURCE_DIR@/examples"

# If the value of the EXAMPLE_PATH tag contains directories, you can use the
# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and
# *.h) to filter out the source-files in the directories. If left blank all
# files are included.

EXAMPLE_PATTERNS =
EXAMPLE_PATTERNS = "*.cpp"

# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
# searched for input files to be used with the \include or \dontinclude commands
# irrespective of the value of the RECURSIVE tag.
# The default value is: NO.

EXAMPLE_RECURSIVE = NO
EXAMPLE_RECURSIVE = YES

# The IMAGE_PATH tag can be used to specify one or more files or directories
# that contain images that are to be included in the documentation (see the
# \image command).

IMAGE_PATH = "@CMAKE_CURRENT_SOURCE_DIR@"
IMAGE_PATH = "@PROJECT_SOURCE_DIR@"

# The INPUT_FILTER tag can be used to specify a program that doxygen should
# invoke to filter for each input file. Doxygen will invoke the filter program
Expand Down Expand Up @@ -2086,7 +2085,7 @@ INCLUDE_PATH =
# used.
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.

INCLUDE_FILE_PATTERNS =
INCLUDE_FILE_PATTERNS = "*.h"

# The PREDEFINED tag can be used to specify one or more macro names that are
# defined before the preprocessor is started (similar to the -D option of e.g.
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ include_directories(${PYTHON_INCLUDE_PATH})
if (CMAKE_VERSION VERSION_LESS 3.12)
### Include project headers
include_directories(
"${PROJECT_SOURCE_DIR}/include"
"${PROJECT_BINARY_DIR}/include")
"${PROJECT_SOURCE_DIR}/src"
"${PROJECT_BINARY_DIR}/src")
endif()

### Enable C++ support in SWIG
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@ endif()
include_directories(${RUBY_INCLUDE_DIRS})

if (CMAKE_VERSION VERSION_LESS 3.12)
### Include Ruby header files and project headers
### Include the project headers
include_directories(
"${PROJECT_SOURCE_DIR}/include"
"${PROJECT_BINARY_DIR}/include")
"${PROJECT_SOURCE_DIR}/src"
"${PROJECT_BINARY_DIR}/src")
endif()

### Enable C++ in SWIG
Expand Down
File renamed without changes.
13 changes: 13 additions & 0 deletions bindings/ruby/test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Find and load the ruby libopenshot wrapper library
require "./openshot"

# Create a new FFmpegReader and Open it
r = OpenShot::FFmpegReader.new("myfile.mp4")
r.Open()

# Get frame 1
f = r.GetFrame(1)

# Display the frame
f.Display()

Binary file added doc/images/openshot-qt.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
65 changes: 65 additions & 0 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
####################### CMakeLists.txt (libopenshot) #########################
# @brief CMake build file for libopenshot (used to generate makefiles)
# @author Jonathan Thomas <[email protected]>
# @author FeRD (Frank Dana) <[email protected]>
#
# @section LICENSE
#
# Copyright (c) 2008-2020 OpenShot Studios, LLC
# <http://www.openshotstudios.com/>. This file is part of
# OpenShot Library (libopenshot), an open-source project dedicated to
# delivering high quality video editing and animation solutions to the
# world. For more information visit <http://www.openshot.org/>.
#
# OpenShot Library (libopenshot) is free software: you can redistribute it
# and/or modify it under the terms of the GNU Lesser General Public License
# as published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# OpenShot Library (libopenshot) 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 Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with OpenShot Library. If not, see <http://www.gnu.org/licenses/>.
################################################################################

include(GNUInstallDirs)

# Dependencies
find_package(Qt5 COMPONENTS Gui REQUIRED)

############### CLI EXECUTABLES ################
# Create test executable
add_executable(openshot-example Example.cpp)

# Define path to test input files
file(TO_NATIVE_PATH "${PROJECT_SOURCE_DIR}/examples/" TEST_MEDIA_PATH)
target_compile_definitions(openshot-example PRIVATE
-DTEST_MEDIA_PATH="${TEST_MEDIA_PATH}" )

# Link test executable to the new library
target_link_libraries(openshot-example openshot)

add_executable(openshot-html-test ExampleHtml.cpp)
target_link_libraries(openshot-html-test openshot Qt5::Gui)

############### PLAYER EXECUTABLE ################
# Create test executable
add_executable(openshot-player qt-demo/main.cpp)

set_target_properties(openshot-player PROPERTIES AUTOMOC ON)

# Link test executable to the new library
target_link_libraries(openshot-player openshot)

############### TEST BLACKMAGIC CAPTURE APP ################
if (BLACKMAGIC_FOUND)
# Create test executable
add_executable(openshot-blackmagic
examples/ExampleBlackmagic.cpp)

# Link test executable to the new library
target_link_libraries(openshot-blackmagic openshot)
endif()
4 changes: 2 additions & 2 deletions src/examples/Example.cpp → examples/Example.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
#include <fstream>
#include <iostream>
#include <memory>
#include "../../include/OpenShot.h"
#include "../../include/CrashHandler.h"
#include "OpenShot.h"
#include "CrashHandler.h"

using namespace openshot;

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#include <map>
#include <queue>
#include <memory>
#include "../../include/OpenShot.h"
#include "OpenShot.h"
#include <omp.h>
#include <time.h>

Expand Down
4 changes: 2 additions & 2 deletions src/examples/ExampleHtml.cpp → examples/ExampleHtml.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
#include <fstream>
#include <iostream>
#include <memory>
#include "../../include/OpenShot.h"
//#include "../../include/CrashHandler.h"
#include "OpenShot.h"
//#include "CrashHandler.h"
#include <QGuiApplication>
#include <QTimer>

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/Qt/demo/main.cpp → examples/qt-demo/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
* along with OpenShot Library. If not, see <http://www.gnu.org/licenses/>.
*/

#include "../../../include/Qt/PlayerDemo.h"
#include "Qt/PlayerDemo.h"

int main(int argc, char *argv[])
{
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/AudioBufferSource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
* along with OpenShot Library. If not, see <http://www.gnu.org/licenses/>.
*/

#include "../include/AudioBufferSource.h"
#include "AudioBufferSource.h"

using namespace std;
using namespace openshot;
Expand Down
2 changes: 1 addition & 1 deletion include/AudioBufferSource.h → src/AudioBufferSource.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
#define OPENSHOT_AUDIOBUFFERSOURCE_H

#include <iomanip>
#include "JuceHeader.h"
#include <JuceHeader.h>

/// This namespace is the default namespace for all code in the openshot library
namespace openshot
Expand Down
10 changes: 5 additions & 5 deletions include/AudioDeviceInfo.h → src/AudioDeviceInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@
#define OPENSHOT_AUDIODEVICEINFO_H


/**
* @brief This struct hold information about Audio Devices
*
* The type and name of the audio device.
*/
namespace openshot {
/**
* @brief This struct hold information about Audio Devices
*
* The type and name of the audio device.
*/
struct AudioDeviceInfo
{
std::string name;
Expand Down
2 changes: 1 addition & 1 deletion src/AudioReaderSource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
* along with OpenShot Library. If not, see <http://www.gnu.org/licenses/>.
*/

#include "../include/AudioReaderSource.h"
#include "AudioReaderSource.h"

using namespace std;
using namespace openshot;
Expand Down
2 changes: 1 addition & 1 deletion include/AudioReaderSource.h → src/AudioReaderSource.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

#include <iomanip>
#include "ReaderBase.h"
#include "JuceHeader.h"
#include <JuceHeader.h>

/// This namespace is the default namespace for all code in the openshot library
namespace openshot
Expand Down
2 changes: 1 addition & 1 deletion src/AudioResampler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
* along with OpenShot Library. If not, see <http://www.gnu.org/licenses/>.
*/

#include "../include/AudioResampler.h"
#include "AudioResampler.h"

using namespace std;
using namespace openshot;
Expand Down
Loading