forked from abique/vst-bridge
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
1,221 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
config.h | ||
config.mk | ||
maker/vst-bridge-maker | ||
plugin/vst-bridge-plugin-tpl.so | ||
host/vst-bridge-host-32.exe | ||
host/vst-bridge-host-64.exe | ||
host/vst-bridge-host-32.exe.so | ||
host/vst-bridge-host-64.exe.so |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
Copyright (C) 2011-2012 Alexandre Bique | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in | ||
all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
all: | ||
make -C maker | ||
make -C plugin | ||
make -C host | ||
|
||
install: | ||
make -C maker install | ||
make -C plugin install | ||
make -C host install | ||
|
||
clean: | ||
make -C maker clean | ||
make -C plugin clean | ||
make -C host clean |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
#ifndef COMMON_H | ||
# define COMMON_H | ||
|
||
# include <fcntl.h> | ||
|
||
# include <stdint.h> | ||
# include <stdbool.h> | ||
|
||
# include "../config.h" | ||
|
||
# define VST_BRIDGE_TPL_PLUGIN_PATH "VST-BRIDGE-TPL-PATH" | ||
# define VST_BRIDGE_BUFFER_SIZE (1024 * 1024) | ||
|
||
enum vst_bridge_cmd { | ||
VST_BRIDGE_CMD_PING, | ||
VST_BRIDGE_CMD_PLUGIN_MAIN, | ||
VST_BRIDGE_CMD_AUDIO_MASTER_CALLBACK, | ||
VST_BRIDGE_CMD_EFFECT_DISPATCHER, | ||
VST_BRIDGE_CMD_PROCESS, | ||
VST_BRIDGE_CMD_PROCESS_DOUBLE, | ||
VST_BRIDGE_CMD_SET_PARAMETER, | ||
VST_BRIDGE_CMD_GET_PARAMETER, | ||
}; | ||
|
||
struct vst_bridge_effect_request { | ||
int32_t opcode; | ||
int32_t index; | ||
int64_t value; | ||
float opt; | ||
uint8_t data[0]; | ||
} __attribute__((packed)); | ||
|
||
struct vst_bridge_audio_master_request { | ||
int32_t opcode; | ||
int32_t index; | ||
int64_t value; | ||
float opt; | ||
uint8_t data[0]; | ||
} __attribute__((packed)); | ||
|
||
struct vst_bridge_frames { | ||
uint32_t nframes; | ||
float frames[0]; | ||
} __attribute__((packed)); | ||
|
||
struct vst_bridge_frames_double { | ||
uint32_t nframes; | ||
double frames[0]; | ||
} __attribute__((packed)); | ||
|
||
struct vst_bridge_effect_parameter { | ||
uint32_t index; | ||
float value; | ||
} __attribute__((packed)); | ||
|
||
struct vst_bridge_plugin_data { | ||
bool hasSetParameter; | ||
bool hasGetParameter; | ||
bool hasProcessReplacing; | ||
bool hasProcessDoubleReplacing; | ||
int32_t numPrograms; | ||
int32_t numParams; | ||
int32_t numInputs; | ||
int32_t numOutputs; | ||
int32_t flags; | ||
int32_t initialDelay; | ||
int32_t uniqueID; | ||
int32_t version; | ||
}; | ||
|
||
struct vst_bridge_midi_event { | ||
int32_t type; | ||
int32_t byteSize; | ||
int32_t deltaFrames; | ||
int32_t flags; | ||
uint8_t data[0]; | ||
}; | ||
|
||
struct vst_bridge_midi_events { | ||
uint32_t nb; | ||
struct vst_bridge_midi_event events[0]; | ||
}; | ||
|
||
struct vst_bridge_request { | ||
uint32_t tag; | ||
uint32_t cmd; | ||
union { | ||
uint8_t data[16 * 1024]; | ||
struct vst_bridge_effect_request erq; | ||
struct vst_bridge_audio_master_request amrq; | ||
struct vst_bridge_frames frames; | ||
struct vst_bridge_frames_double framesd; | ||
struct vst_bridge_effect_parameter param; | ||
struct vst_bridge_plugin_data plugin_data; | ||
}; | ||
} __attribute__((packed)); | ||
|
||
union vst_bridge_buffer { | ||
struct vst_bridge_request rq; | ||
uint8_t buffer[VST_BRIDGE_BUFFER_SIZE]; | ||
}; | ||
|
||
#endif /* !COMMON_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
#! /bin/sh | ||
|
||
DEBUG=1 | ||
CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE" | ||
CFLAGS="$CFLAGS -W -Wall -Wstrict-prototypes -pipe" | ||
CFLAGS="$CFLAGS -Wfloat-equal -Wundef -Wshadow -Wpointer-arith" | ||
CFLAGS="$CFLAGS -Wmissing-declarations -Wnested-externs" | ||
CFLAGS="$CFLAGS -Wmissing-prototypes -fPIC" | ||
CXXFLAGS="$CXXFLAGS -W -Wall -pipe -Wundef -Wshadow -Wpointer-arith -Wabi -std=c++11 -fPIC" | ||
LDFLAGS="$LDFLAGS" | ||
|
||
if [[ -z "$CC" ]]; then | ||
CC=gcc | ||
fi | ||
|
||
if [[ -z "$CXX" ]]; then | ||
CXX=g++ | ||
fi | ||
|
||
if [[ -z "$WINCC" ]]; then | ||
WINCC=i486-mingw32-gcc | ||
fi | ||
|
||
if [[ -z "$WINCXX" ]]; then | ||
WINCXX=i486-mingw32-g++ | ||
fi | ||
|
||
if [[ -z "$PREFIX" ]]; then | ||
PREFIX=/usr/local | ||
fi | ||
|
||
function usage() | ||
{ | ||
echo -n "usage: $0 | ||
--release disable debug | ||
--debug enables debug | ||
--prefix=<dir> the installation prefix path | ||
" | ||
exit | ||
} | ||
|
||
until [[ $# -eq 0 ]] ; | ||
do | ||
case "$1" in | ||
--release) | ||
DEBUG=0 | ||
;; | ||
--debug) | ||
DEBUG=1 | ||
;; | ||
--prefix=*) | ||
PREFIX="${1/--prefix=/}" | ||
;; | ||
-h|--help|help) | ||
usage | ||
;; | ||
*) | ||
echo wrong argument "$1" | ||
usage | ||
;; | ||
esac | ||
shift | ||
done | ||
|
||
if [[ $DEBUG -eq 0 ]]; then | ||
CFLAGS="$CFLAGS -DNDEBUG -O2" | ||
CXXFLAGS="$CXXFLAGS -DNDEBUG -O2" | ||
else | ||
CFLAGS="$CFLAGS -g" | ||
CXXFLAGS="$CXXFLAGS -g" | ||
fi | ||
|
||
CFLAGS="${CPPFLAGS} ${CFLAGS}" | ||
CXXFLAGS="${CPPFLAGS} ${CXXFLAGS}" | ||
|
||
cat >config.h <<EOF | ||
#ifndef CONFIG_H | ||
# define CONFIG_H | ||
# define INSTALL_PREFIX "${PREFIX}" | ||
#endif /* !CONFIG_H */ | ||
EOF | ||
|
||
cat >config.mk <<EOF | ||
CPPFLAGS = $CPPFLAGS | ||
CFLAGS = $CFLAGS | ||
CXXFLAGS = $CXXFLAGS | ||
CC = $CC | ||
CXX = $CXX | ||
WINCC = $WINCC | ||
WINCXX = $WINCXX | ||
PREFIX = $PREFIX | ||
EOF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
include ../config.mk | ||
|
||
SRC = host.cc | ||
|
||
all: vst-bridge-host-32.exe vst-bridge-host-64.exe | ||
|
||
vst-bridge-host-32.exe: $(SRC) ../common/common.h ../config.h | ||
$(WINCXX) -m32 $(CPPFLAGS) $(CFLAGS) $(SRC) -lpthread -o $@ | ||
|
||
vst-bridge-host-64.exe: $(SRC) ../common/common.h ../config.h | ||
$(WINCXX) -m64 $(CPPFLAGS) $(CFLAGS) $(SRC) -lpthread -o $@ | ||
|
||
clean: | ||
rm -f vst-bridge-host-*.exe* | ||
|
||
install: all | ||
install -m 755 -d $(DESTDIR)$(PREFIX)/lib/vst-bridge | ||
install -m 755 vst-bridge-host-*.exe* $(DESTDIR)$(PREFIX)/lib/vst-bridge/ |
Oops, something went wrong.