Skip to content

Commit

Permalink
Juce plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
pkviet committed Sep 7, 2019
1 parent a14f647 commit dc01775
Show file tree
Hide file tree
Showing 7 changed files with 746 additions and 1,482 deletions.
79 changes: 43 additions & 36 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,25 @@ cmake_minimum_required(VERSION 3.5)
project(obs-asio)

# in cmake gui set the following:
# BASS_ASIO_LIB == path of bassasio.lib
# BASS_ASIO_INCLUDE_DIR == path of bassasio.h
# put also bassasio.dll in obs-plugins/bin folder
# be careful there are two versions of the lib and dll (x86 and x64)
# LIBOBS_INCLUDE_DIR = path to obs.h, obs-studio/libobs
# LIBOBS_LIB = filepath to obs.lib, ex: obs-studio/build/libobs/RelWithDebInfo/obs.lib
# OBS_FRONTEND_LIB = filepath to obs-frontend-api.lib , ex: obs-studio/build/UI/obs-frontend-api/RelWithDebInfo/obs-frontend-api.lib
# QTDIR = path to QT , ex: I:/Qt/5.9/msvc2015_64 for x64
# JUCE_LIBRARY == path of juce.lib
# JUCE_LIBRARY_DEBUG == path of juce_debug.lib (debug version of the lib)
# The Juce lib can be created with ProJucer with either a static lib project or a dynamic lib project.
# JUCE_INCLUDE_DIR == path of Juce includes; if you used ProJucer, this will be the path of JuceLibraryCode.
# If you select to build with a juce dll, you'll have to copy it in the obs-plugins folder.

##########################################
# find libobs #
##########################################
include(external/FindLibobs.cmake)
find_package(Libobs REQUIRED)

if(NOT DEFINED OBS_FRONTEND_LIB)
set(OBS_FRONTEND_LIB "OBS_FRONTEND_LIB-NOTFOUND" CACHE FILEPATH "OBS frontend library")
message(FATAL_ERROR "Could not find OBS Frontend API\'s library !")
endif()
##########################################
# set architecture #
##########################################
Expand All @@ -35,37 +43,51 @@ endif()
##########################################
# QT support #
##########################################
set(CMAKE_PREFIX_PATH "${QTDIR}")
# Find includes in corresponding build directories
#set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
# Instruct CMake to run moc automatically when needed.
#set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)

find_package(Qt5Core REQUIRED)
# Find the QtWidgets library
#find_package(Qt5Widgets)
find_package(Qt5Widgets)


include_directories(
# SYSTEM "${CMAKE_SOURCE_DIR}/libobs"
${BASS_ASIO_INCLUDE_DIR}
SYSTEM "${LIBOBS_INCLUDE_DIR}"
"${LIBOBS_INCLUDE_DIR}/../UI/obs-frontend-api"
"${LIBOBS_INCLUDE_DIR}/../${OBS_BUILDDIR_ARCH}/UI"
${JUCE_INCLUDE_DIR}
${JUCE_INCLUDE_DIR}/modules
${Qt5Core_INCLUDES}
${Qt5Widgets_INCLUDES}
)
)
set(obs-asio-sdk_HEADERS
)

set(obs-asio_HEADERS
)

set(win-asio_QRC
asio-input.qrc)

set(obs-asio_SOURCES
src/asio-input.cpp
)

add_library(obs-asio MODULE
${obs-asio_SOURCES}
${obs-asio_HEADERS}
${obs-asio-sdk_HEADERS}
set(JUCE_LIB optimized ${JUCE_LIBRARY} debug ${JUCE_LIBRARY_DEBUG})

qt5_add_resources(win-asio_QRC_SOURCES ${win-asio_QRC})

add_library(win-asio MODULE
${win-asio_SOURCES}
${win-asio_QRC_SOURCES}
)
target_link_libraries(obs-asio

target_link_libraries(win-asio
libobs
${BASS_ASIO_LIB}
obs-frontend-api
${JUCE_LIB}
Qt5::Core
Qt5::Widgets
)

#install_obs_plugin_with_data(win-asio data) ==> internal plugin install
Expand All @@ -88,18 +110,3 @@ add_custom_command(TARGET obs-asio POST_BUILD
"$<TARGET_FILE:obs-asio>"
"${RELEASE_DIR}/obs-plugins/${OBS_ARCH_NAME}")

#Copy to obs-studio dev environment for immediate testing
COMMAND if $<CONFIG:Debug>==1 (
"${CMAKE_COMMAND}" -E copy
"$<TARGET_FILE:obs-asio>"
"${LIBOBS_INCLUDE_DIR}/../${OBS_BUILDDIR_ARCH}/rundir/$<CONFIG>/obs-plugins/${OBS_ARCH_NAME}")

COMMAND if $<CONFIG:Debug>==1 (
"${CMAKE_COMMAND}" -E make_directory
"${LIBOBS_INCLUDE_DIR}/../${OBS_BUILDDIR_ARCH}/rundir/$<CONFIG>/data/obs-plugins/obs-asio")

COMMAND if $<CONFIG:Debug>==1 (
"${CMAKE_COMMAND}" -E copy_directory
"${PROJECT_SOURCE_DIR}/data"
"${LIBOBS_INCLUDE_DIR}/../${OBS_BUILDDIR_ARCH}/rundir/$<CONFIG>/data/obs-plugins/obs-asio")
)
54 changes: 54 additions & 0 deletions src/_clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
Language: Cpp
Standard: Cpp11
AccessModifierOffset: -8
AlignAfterOpenBracket: DontAlign
AlignConsecutiveAssignments: true
AlignConsecutiveDeclarations: true
AlignEscapedNewlinesLeft: DontAlign
AlignOperands: false
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: false
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
AfterFunction: true
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Custom
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
BreakStringLiterals: true
ColumnLimit: 120
ContinuationIndentWidth: 16
ConstructorInitializerAllOnOneLineOrOnePerLine: true
ConstructorInitializerIndentWidth: 8
Cpp11BracedListStyle: true
DerivePointerAlignment: true
IndentCaseLabels: false
IndentWidth: 8
IndentWrappedFunctionNames: false
KeepEmptyLinesAtTheStartOfBlocks: true
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
PointerAlignment: Right
ReflowComments: true
SortIncludes: false
SpaceAfterCStyleCast: false
SpaceAfterTemplateKeyword: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInCStyleCastParentheses: false
SpacesInContainerLiterals: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
TabWidth: 8
UseTab: ForContinuationAndIndentation
Loading

0 comments on commit dc01775

Please sign in to comment.