Skip to content

Commit 1f6b431

Browse files
committed
Add sources
1 parent 7bc2e4d commit 1f6b431

File tree

132 files changed

+16164
-2
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

132 files changed

+16164
-2
lines changed

.appveyor.yml

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
clone_depth: 50
2+
3+
branches:
4+
only:
5+
- master
6+
7+
# Also includes VS2013 pre-installed
8+
image: Visual Studio 2015
9+
10+
environment:
11+
matrix:
12+
# Visual Studio 2013, 32-bit Release, Asio driver
13+
- WORDSIZE: 32
14+
AUDIO_DRIVER: Asio
15+
CONFIGURATION: Release
16+
GENERATOR: Visual Studio 12 2013
17+
# Visual Studio 2013, 64-bit Release, Asio driver
18+
- WORDSIZE: 64
19+
AUDIO_DRIVER: Asio
20+
CONFIGURATION: Release
21+
GENERATOR: Visual Studio 12 2013 Win64
22+
# Visual Studio 2015, 32-bit Release, Asio driver
23+
- WORDSIZE: 32
24+
AUDIO_DRIVER: Asio
25+
CONFIGURATION: Release
26+
GENERATOR: Visual Studio 14 2015
27+
# Visual Studio 2015, 64-bit Debug, Asio driver
28+
- WORDSIZE: 64
29+
AUDIO_DRIVER: Asio
30+
CONFIGURATION: Debug
31+
GENERATOR: Visual Studio 14 2015 Win64
32+
# Visual Studio 2015, 64-bit Release, Asio driver
33+
- WORDSIZE: 64
34+
AUDIO_DRIVER: Asio
35+
CONFIGURATION: Release
36+
GENERATOR: Visual Studio 14 2015 Win64
37+
# Visual Studio 2015, 64-bit Release, Wasapi driver
38+
- WORDSIZE: 64
39+
AUDIO_DRIVER: Wasapi
40+
CONFIGURATION: Release
41+
GENERATOR: Visual Studio 14 2015 Win64
42+
43+
install:
44+
- git submodule update --init --recursive
45+
- if %WORDSIZE% == 32 (set QT=msvc2013)
46+
- if %WORDSIZE% == 64 (set QT=msvc2013_64)
47+
- set PATH=%PATH%;C:\Qt\5.5\%QT%\bin
48+
49+
build_script:
50+
- if %WORDSIZE% == 64 ( python ci/configure.py -w %WORDSIZE% -q -a %AUDIO_DRIVER% -g "%GENERATOR%" )
51+
- if %WORDSIZE% == 32 ( python ci/configure.py -w %WORDSIZE% -q -g "%GENERATOR%" )
52+
- python ci/build.py --configuration %CONFIGURATION%
53+
54+
test_script:
55+
- python ci/run-tests.py --target LinkCoreTest
56+
- python ci/run-tests.py --target LinkDiscoveryTest

.clang-format

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
Language: Cpp
2+
BasedOnStyle: LLVM
3+
AccessModifierOffset: -2
4+
AlignAfterOpenBracket: false
5+
AlignEscapedNewlinesLeft: false
6+
AlignTrailingComments: true
7+
AllowAllParametersOfDeclarationOnNextLine: true
8+
AllowShortBlocksOnASingleLine: false
9+
AllowShortCaseLabelsOnASingleLine: false
10+
AllowShortFunctionsOnASingleLine: None
11+
AllowShortIfStatementsOnASingleLine: false
12+
AllowShortLoopsOnASingleLine: false
13+
AlwaysBreakBeforeMultilineStrings: true
14+
AlwaysBreakTemplateDeclarations: true
15+
BinPackParameters: false
16+
BreakBeforeBinaryOperators: NonAssignment
17+
BreakBeforeBraces: Allman
18+
BreakBeforeTernaryOperators: true
19+
BreakConstructorInitializersBeforeComma: true
20+
ColumnLimit: 90
21+
ConstructorInitializerAllOnOneLineOrOnePerLine: false
22+
ConstructorInitializerIndentWidth: 2
23+
ContinuationIndentWidth: 2
24+
Cpp11BracedListStyle: true
25+
DerivePointerAlignment: false
26+
DerivePointerBinding: false
27+
IndentCaseLabels: false
28+
IndentFunctionDeclarationAfterType: false
29+
IndentWidth: 2
30+
KeepEmptyLinesAtTheStartOfBlocks: true
31+
MaxEmptyLinesToKeep: 2
32+
NamespaceIndentation: None
33+
PenaltyBreakBeforeFirstCallParameter: 0
34+
PenaltyReturnTypeOnItsOwnLine: 1000
35+
PointerAlignment: Left
36+
PointerBindsToType: true
37+
SpaceBeforeAssignmentOperators: true
38+
SpaceBeforeParens: ControlStatements
39+
SpaceInEmptyParentheses: false
40+
SpacesBeforeTrailingComments: 1
41+
SpacesInAngles: false
42+
SpacesInCStyleCastParentheses: false
43+
SpacesInParentheses: false
44+
Standard: C++11
45+
UseTab: Never

.gitignore

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# IDE generated files and build outputs
2+
/build/
3+
/ide/
4+
/output/
5+
/logs/
6+
.idea/*
7+
8+
# System temporary files
9+
.DS_Store
10+
*~
11+
*.swp
12+
13+
# Compiled Object files
14+
*.slo
15+
*.lo
16+
*.o
17+
*.obj
18+
19+
# Compiled Dynamic libraries
20+
*.so
21+
*.dylib
22+
*.dll
23+
24+
# Compiled Static libraries
25+
*.lai
26+
*.la
27+
*.a
28+
*.lib
29+
30+
# Executables
31+
*.exe
32+
*.out
33+
*.app

.gitmodules

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[submodule "modules/asio-standalone"]
2+
path = modules/asio-standalone
3+
url = [email protected]:chriskohlhoff/asio.git
4+
[submodule "modules/catch"]
5+
path = modules/catch
6+
url = https://github.com/philsquared/Catch.git

.travis.yml

+123
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
# Copyright (c) 2016 Ableton. All Rights Reserved.
2+
3+
language: cpp
4+
sudo: required
5+
dist: trusty
6+
branches:
7+
only:
8+
- master
9+
10+
matrix:
11+
include:
12+
###########################################################################
13+
# Build with the main configuration on all the supported compilers
14+
###########################################################################
15+
# Mac OS X / XCode 7.1, 64-bit Debug
16+
- os: osx
17+
env: WORDSIZE=64 CONFIGURATION=Debug
18+
osx_image: xcode7.1
19+
compiler: clang
20+
21+
# Mac OS X / XCode 7.1, 64-bit Release
22+
- os: osx
23+
env: WORDSIZE=64 CONFIGURATION=Release
24+
osx_image: xcode7.1
25+
compiler: clang
26+
27+
# Linux with Clang 3.6, 64-bit Debug
28+
- os: linux
29+
compiler: clang
30+
addons:
31+
apt:
32+
sources: ['ubuntu-toolchain-r-test']
33+
packages: ['clang-3.6', 'g++-5', 'valgrind', 'p7zip-full', 'portaudio19-dev', 'cmake', 'cmake-data']
34+
env: COMPILER=clang++-3.6 WORDSIZE=64 CONFIGURATION=Debug
35+
36+
# Linux with Clang 3.6, 64-bit Release
37+
- os: linux
38+
compiler: clang
39+
addons:
40+
apt:
41+
sources: ['ubuntu-toolchain-r-test']
42+
packages: ['clang-3.6', 'g++-5', 'valgrind', 'p7zip-full', 'portaudio19-dev', 'cmake', 'cmake-data']
43+
env: COMPILER=clang++-3.6 WORDSIZE=64 CONFIGURATION=Release
44+
45+
# Linux with GCC 5.x, 32-bit Release
46+
# - os: linux
47+
# compiler: gcc
48+
# addons:
49+
# apt:
50+
# sources: ['ubuntu-toolchain-r-test']
51+
# packages: ['g++-5', 'g++-5-multilib', 'linux-libc-dev:i386', 'valgrind:i386',
52+
# 'p7zip-full', 'libxext-dev:i386', 'libglapi-mesa:i386',
53+
# 'libgl1-mesa-glx:i386', 'libgl1-mesa-dev:i386',
54+
# 'portaudio19-dev:i386', 'libglib2.0-0:i386', 'cmake', 'cmake-data']
55+
# env: COMPILER=g++-5 WORDSIZE=32 CONFIGURATION=Release
56+
57+
# Linux with GCC 5.x, 64-bit Release
58+
- os: linux
59+
compiler: gcc
60+
addons:
61+
apt:
62+
sources: ['ubuntu-toolchain-r-test', 'george-edison55-precise-backports']
63+
packages: ['g++-5', 'valgrind', 'p7zip-full', 'portaudio19-dev', 'cmake', 'cmake-data']
64+
env: COMPILER=g++-5 WORDSIZE=64 CONFIGURATION=Release
65+
66+
# Code formatting verification
67+
- os: linux
68+
compiler: clang
69+
env: CONFIGURATION=Formatting LLVM_VERSION=3.8.0
70+
71+
before_install:
72+
# Do indentation check
73+
- |
74+
if [ "$CONFIGURATION" = "Formatting" ]; then
75+
wget -O - http://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
76+
echo deb http://apt.llvm.org/trusty/ llvm-toolchain-trusty-3.8 main | sudo tee --append /etc/apt/sources.list
77+
sudo apt-get update && sudo apt-get -y install clang-format-3.8
78+
python ci/check-formatting.py -c $(which clang-format-3.8)
79+
exit $?
80+
fi
81+
82+
# Override Travis' CXX Flag
83+
- CXX=$COMPILER
84+
85+
# Install homebrew packages for Mac OS X
86+
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then brew update && brew install cmake ninja qt5; fi
87+
88+
# Install QT for Linux manually, since the QT packages are not whitelisted by Travis
89+
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then ./ci/install-qt-5.sh $WORDSIZE; fi
90+
91+
install:
92+
- git submodule update --init --recursive
93+
94+
script:
95+
- |
96+
set -e
97+
if [ "$TRAVIS_OS_NAME" = "osx" ]; then
98+
PATH=`brew --prefix qt5`/bin:${PATH}
99+
python ci/configure.py --configuration $CONFIGURATION --generator Ninja --with-qt
100+
python ci/build.py --configuration $CONFIGURATION --arguments "all -v"
101+
else
102+
if [ "$WORDSIZE" -eq 64 ]; then
103+
PATH=$PWD/5.5/gcc_64:${PATH}
104+
python ci/configure.py --configuration $CONFIGURATION --wordsize $WORDSIZE --with-qt
105+
else
106+
PATH=$PWD/5.5/gcc:${PATH}
107+
python ci/configure.py --configuration $CONFIGURATION --wordsize $WORDSIZE --with-qt
108+
fi
109+
python ci/build.py --configuration $CONFIGURATION --arguments "VERBOSE=1 -j8"
110+
fi
111+
112+
# Build Tests and run with Valgrind (Linux 64-bit only). Mac OSX supports
113+
# valgrind via homebrew, but there is no bottle formula, so it must be
114+
# compiled by brew and this takes way too much time on the build server.
115+
- |
116+
set -e
117+
if [ "$TRAVIS_OS_NAME" = "linux" ]; then
118+
python ci/run-tests.py --target LinkCoreTest --valgrind
119+
python ci/run-tests.py --target LinkDiscoveryTest --valgrind
120+
else
121+
python ci/run-tests.py --target LinkCoreTest
122+
python ci/run-tests.py --target LinkDiscoveryTest
123+
fi

AbletonLinkConfig.cmake

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
if(CMAKE_VERSION VERSION_LESS 3.0)
2+
message(FATAL_ERROR "CMake 3.0 or greater is required")
3+
endif()
4+
5+
add_library(Ableton::Link IMPORTED INTERFACE)
6+
set_property(TARGET Ableton::Link APPEND PROPERTY
7+
INTERFACE_INCLUDE_DIRECTORIES
8+
${CMAKE_CURRENT_LIST_DIR}/include
9+
)
10+
11+
# Force C++11 support for consuming targets
12+
set_property(TARGET Ableton::Link APPEND PROPERTY
13+
INTERFACE_COMPILE_FEATURES
14+
cxx_generalized_initializers
15+
)
16+
17+
if(UNIX)
18+
set_property(TARGET Ableton::Link APPEND PROPERTY
19+
INTERFACE_COMPILE_DEFINITIONS
20+
LINK_PLATFORM_UNIX=1
21+
)
22+
endif()
23+
24+
if(APPLE)
25+
set_property(TARGET Ableton::Link APPEND PROPERTY
26+
INTERFACE_COMPILE_DEFINITIONS
27+
LINK_PLATFORM_MACOSX=1
28+
)
29+
elseif(WIN32)
30+
set_property(TARGET Ableton::Link APPEND PROPERTY
31+
INTERFACE_COMPILE_DEFINITIONS
32+
LINK_PLATFORM_WINDOWS=1
33+
)
34+
set_property(TARGET Ableton::Link APPEND PROPERTY
35+
INTERFACE_COMPILE_OPTIONS
36+
"/wd4503" # 'Identifier': decorated name length exceeded, name was truncated
37+
)
38+
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
39+
set_property(TARGET Ableton::Link APPEND PROPERTY
40+
INTERFACE_COMPILE_DEFINITIONS
41+
LINK_PLATFORM_LINUX=1
42+
)
43+
endif()
44+
45+
include(${CMAKE_CURRENT_LIST_DIR}/cmake_include/AsioStandaloneConfig.cmake)
46+
set_property(TARGET Ableton::Link APPEND PROPERTY
47+
INTERFACE_LINK_LIBRARIES
48+
AsioStandalone::AsioStandalone
49+
)
50+
51+
set_property(TARGET Ableton::Link APPEND PROPERTY
52+
INTERFACE_SOURCES
53+
${CMAKE_CURRENT_LIST_DIR}/include/ableton/Link.hpp
54+
)

CMakeLists.txt

+71
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
cmake_minimum_required(VERSION 3.0)
2+
project(Link)
3+
4+
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
5+
6+
# ___ _ _
7+
# / _ \ _ __ | |_(_) ___ _ __ ___
8+
# | | | | '_ \| __| |/ _ \| '_ \/ __|
9+
# | |_| | |_) | |_| | (_) | | | \__ \
10+
# \___/| .__/ \__|_|\___/|_| |_|___/
11+
# |_|
12+
13+
# Note: Please use the LINK_* prefix for all project-specific options
14+
option(LINK_BUILD_QT_EXAMPLES "Build examples (Requires Qt)" OFF)
15+
16+
if(UNIX)
17+
set(LINK_WORD_SIZE "64" CACHE STRING "Set the word size (must be either 32 or 64)")
18+
option(LINK_ENABLE_ASAN "Build with Address Sanitizier (ASan)" OFF)
19+
endif()
20+
21+
if(WIN32)
22+
if(${CMAKE_GENERATOR} MATCHES "Win64")
23+
set(LINK_WORD_SIZE "64")
24+
else()
25+
set(LINK_WORD_SIZE "32")
26+
endif()
27+
28+
option(LINK_BUILD_ASIO "Build example applications with ASIO driver" ON)
29+
option(LINK_BUILD_VLD "Build with VLD support (VLD must be installed separately)" OFF)
30+
endif()
31+
32+
# ____ _ _
33+
# | _ \ __ _| |_| |__ ___
34+
# | |_) / _` | __| '_ \/ __|
35+
# | __/ (_| | |_| | | \__ \
36+
# |_| \__,_|\__|_| |_|___/
37+
#
38+
39+
# Other CMake files must be included only after declaring build options
40+
include(cmake_include/ConfigureCompileFlags.cmake)
41+
include(cmake_include/ConfigureWordSize.cmake)
42+
include(cmake_include/CatchConfig.cmake)
43+
include(AbletonLinkConfig.cmake)
44+
45+
add_subdirectory(include)
46+
add_subdirectory(src)
47+
add_subdirectory(examples)
48+
49+
# ____
50+
# / ___| _ _ _ __ ___ _ __ ___ __ _ _ __ _ _
51+
# \___ \| | | | '_ ` _ \| '_ ` _ \ / _` | '__| | | |
52+
# ___) | |_| | | | | | | | | | | | (_| | | | |_| |
53+
# |____/ \__,_|_| |_| |_|_| |_| |_|\__,_|_| \__, |
54+
# |___/
55+
56+
message(STATUS "Build options")
57+
58+
get_cmake_property(all_variables VARIABLES)
59+
string(REGEX MATCHALL "(^|;)LINK_[A-Z_]+" link_variables "${all_variables}")
60+
foreach(variable ${link_variables})
61+
message(" ${variable}: ${${variable}}")
62+
endforeach()
63+
64+
message(STATUS "Build configuration")
65+
66+
if(CMAKE_BUILD_TYPE)
67+
message(" Build type: ${CMAKE_BUILD_TYPE}")
68+
else()
69+
message(" Build type: Set by IDE")
70+
endif()
71+

0 commit comments

Comments
 (0)