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

VST support for macOS. #70

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 32 additions & 4 deletions .appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,27 @@
version: '{build}'
image: Visual Studio 2013

image:
- Visual Studio 2013
- macOS

platform:
- Win32
- x64

matrix:
exclude:
- image: macOS
platform: Win32

cache:
- C:\tmp\VST3 SDK
- c:\tmp\VST3 SDK -> Data/vstgui.patch

install:
- ps: |
if (-Not (Test-Path "C:\tmp\VST3 SDK")) {
if (-Not (Test-Path "c:\tmp\VST3 SDK")) {
Invoke-WebRequest "https://www.steinberg.net/sdk_downloads/vstsdk366_27_06_2016_build_61.zip" -OutFile "vstsdk.zip"
Expand-Archive "vstsdk.zip" "C:\tmp"
Expand-Archive "vstsdk.zip" "c:\tmp"
& git apply -p2 --unsafe-paths --directory /tmp Data/vstgui.patch
}

build_script:
Expand All @@ -22,3 +31,22 @@ build_script:
- msbuild /v:minimal /nologo WaveSabre.sln
- msbuild /v:minimal /nologo /property:Configuration="MinSizeRel" WaveSabre.sln
- cd ..

for:
-
matrix:
only:
- image: macOS
cache: /private/tmp/VST3 SDK -> Data/vstgui.patch
install:
- ps: |
if (-Not (Test-Path "/private/tmp/VST3 SDK")) {
Invoke-WebRequest "https://www.steinberg.net/sdk_downloads/vstsdk366_27_06_2016_build_61.zip" -OutFile "vstsdk.zip"
Expand-Archive "vstsdk.zip" "/private/tmp"
& git apply -p2 --unsafe-paths --directory /private/tmp Data/vstgui.patch
}
- HOMEBREW_NO_AUTO_UPDATE=1 HOMEBREW_NO_INSTALL_CLEANUP=1 brew install libgsm
build_script:
- cmake -B build -G Xcode -DVSTSDK3_DIR="/private/tmp/VST3 SDK"
- xcodebuild -project build/WaveSabre.xcodeproj -scheme ALL_BUILD -configuration Release build

5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
project("WaveSabre")

set (CMAKE_CXX_STANDARD 11)
cmake_minimum_required(VERSION 3.11)
set_property(GLOBAL PROPERTY USE_FOLDERS ON)

Expand All @@ -11,13 +12,17 @@ endif()
set(VSTSDK3_DIR "${CMAKE_SOURCE_DIR}/Vst3.x/" CACHE PATH "VSTSDK location")

# shared code
if(MSVC)
add_subdirectory(MSVCRT)
endif()
add_subdirectory(WaveSabreCore)
if(MSVC)
add_subdirectory(WaveSabrePlayerLib)

# binaries
add_subdirectory(Tests/PlayerTest)
add_subdirectory(WaveSabreStandAlonePlayer)
endif()

# VSTs
if(VSTSDK3_DIR)
Expand Down
34 changes: 34 additions & 0 deletions Data/Info.plist.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>${MACOSX_BUNDLE_EXECUTABLE_NAME}</string>
<key>CFBundleGetInfoString</key>
<string>${MACOSX_BUNDLE_INFO_STRING}</string>
<key>CFBundleIconFile</key>
<string>${MACOSX_BUNDLE_ICON_FILE}</string>
<key>CFBundleIdentifier</key>
<string>${MACOSX_BUNDLE_GUI_IDENTIFIER}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleLongVersionString</key>
<string>${MACOSX_BUNDLE_LONG_VERSION_STRING}</string>
<key>CFBundleName</key>
<string>${MACOSX_BUNDLE_BUNDLE_NAME}</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>${MACOSX_BUNDLE_SHORT_VERSION_STRING}</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>${MACOSX_BUNDLE_BUNDLE_VERSION}</string>
<key>CSResourcesFileMapped</key>
<true/>
<key>NSHumanReadableCopyright</key>
<string>${MACOSX_BUNDLE_COPYRIGHT}</string>
</dict>
</plist>
7 changes: 7 additions & 0 deletions Data/resourcestr.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/* For using CResourceDescription(const char* name) instead of CResourceDescription(int id). */

#define IDB_PNG1 "background.png"
#define IDB_PNG2 "knob1.png"
#define IDB_PNG3 "tinybutton.png"
#define IDB_PNG4 "optionmenu-unpressed.png"
#define IDB_PNG5 "optionmenu-pressed.png"
26 changes: 26 additions & 0 deletions Data/vstgui.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
diff --git a/vstsdk.orig/VST3 SDK/vstgui.sf/vstgui/vstgui.cpp b/vstsdk/VST3 SDK/vstgui.sf/vstgui/vstgui.cpp
index dd081cf..29f0467 100644
--- a/vstsdk.orig/VST3 SDK/vstgui.sf/vstgui/vstgui.cpp
+++ b/vstsdk/VST3 SDK/vstgui.sf/vstgui/vstgui.cpp
@@ -217,7 +217,7 @@ END_NAMESPACE_VSTGUI
//-----------------------------------------------------------------------------
#if MAC
//-----------------------------------------------------------------------------
-#include <QuickTime/QuickTime.h>
+#include <Carbon/Carbon.h>
#include <CoreServices/CoreServices.h>

#if MAC_CARBON
diff --git a/vstsdk.orig/VST3 SDK/vstgui.sf/vstgui/vstgui.h b/vstsdk/VST3 SDK/vstgui.sf/vstgui/vstgui.h
index ad75218..86db083 100644
--- a/vstsdk.orig/VST3 SDK/vstgui.sf/vstgui/vstgui.h
+++ b/vstsdk/VST3 SDK/vstgui.sf/vstgui/vstgui.h
@@ -66,7 +66,7 @@
#endif

#if WINDOWS
- #define _WIN32_WINNT 0x0501
+ #define _WIN32_WINNT 0x0600
#ifndef GDIPLUS
#define GDIPLUS 1 // by default we use GDIPlus
#endif
66 changes: 58 additions & 8 deletions Vsts/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,18 +1,68 @@
set(VSTDIR "" CACHE PATH "VST system directory")

find_path(LIBGSM_INCLUDE_DIR NAMES gsm.h
PATHS
/usr/local/include/gsm
/usr/local/include
/usr/include/gsm
/usr/include
)

find_library(LIBGSM_LIBRARY NAMES gsm
PATHS
/usr/local/lib
/usr/lib
)

if(LIBGSM_INCLUDE_DIR AND LIBGSM_LIBRARY)
add_definitions(-DHAVE_LIBGSM)
endif(LIBGSM_INCLUDE_DIR AND LIBGSM_LIBRARY)

if(APPLE)
find_library(CARBON_LIBRARY Carbon)
find_library(COCOA_LIBRARY Cocoa)
find_library(AUDIO_TOOLBOX_LIBRARY AudioToolbox)
mark_as_advanced(CARBON_LIBRARY COCOA_LIBRARY)
set(EXTRA_LIBS ${CARBON_LIBRARY} ${COCOA_LIBRARY} ${AUDIO_TOOLBOX_LIBRARY} ${LIBGSM_LIBRARY})
file(GLOB RESOURCE_FILES ../Data/*.png)
endif(APPLE)

file(GLOB children RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*)
foreach(child ${children})
if(IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/${child})
file(GLOB sources ${CMAKE_CURRENT_SOURCE_DIR}/${child}/*.h)
aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/${child} sources)
file(WRITE "${CMAKE_BINARY_DIR}/${child}.def"
"LIBRARY ${child}\nEXPORTS\nVSTPluginMain\nmain=VSTPluginMain")
add_library(${child} SHARED
${sources} ../Data/data.rc ${CMAKE_BINARY_DIR}/${child}.def)
target_link_libraries(${child} WaveSabreCore WaveSabreVstLib)
set_property(TARGET ${child} APPEND_STRING PROPERTY LINK_FLAGS_MINSIZEREL
" /LTCG")
set_property(TARGET ${child} PROPERTY FOLDER VSTs)

if(WIN32)
file(WRITE "${CMAKE_BINARY_DIR}/${child}.def"
"LIBRARY ${child}\nEXPORTS\nVSTPluginMain\nmain=VSTPluginMain")
add_library(${child} SHARED
${sources} ../Data/data.rc ${CMAKE_BINARY_DIR}/${child}.def)
set_property(TARGET ${child} APPEND_STRING PROPERTY LINK_FLAGS_MINSIZEREL
" /LTCG")
set_property(TARGET ${child} PROPERTY FOLDER VSTs)
endif(WIN32)

if(APPLE)
add_library(${child} MODULE ${sources} ${RESOURCE_FILES})
set_target_properties(${child} PROPERTIES
BUNDLE true
BUNDLE_EXTENSION "vst"
XCODE_ATTRIBUTE_WRAPPER_EXTENSION "vst"
MACOSX_BUNDLE_INFO_PLIST "Data/Info.plist.in"
MACOSX_BUNDLE_BUNDLE_NAME "${child}"
MACOSX_BUNDLE_GUI_IDENTIFIER "io.logicoma.wavesabre.${child}"
MACOSX_BUNDLE_ICON_FILE ""
MACOSX_BUNDLE_SHORT_VERSION_STRING "1.0.0"
MACOSX_BUNDLE_COPYRIGHT "Copyright 2012-2021 WaveSabre Team"
XCODE_ATTRIBUTE_USE_HEADERMAP YES
RESOURCE "${RESOURCE_FILES}"
)
target_include_directories(${child} PUBLIC ${LIBGSM_INCLUDE_DIR})
target_link_options(${child} PUBLIC "LINKER:-all_load")
endif(APPLE)

target_link_libraries(${child} WaveSabreCore WaveSabreVstLib ${EXTRA_LIBS})

if(VSTDIR)
add_custom_command(TARGET ${child} POST_BUILD
Expand Down
Loading