Skip to content

Commit

Permalink
Partial LV2 support, SF2 support
Browse files Browse the repository at this point in the history
  • Loading branch information
reduz committed Aug 6, 2020
1 parent c6e3cd4 commit 6eb4092
Show file tree
Hide file tree
Showing 31 changed files with 4,324 additions and 517 deletions.
6 changes: 6 additions & 0 deletions SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ opts.Add(BoolVariable("use_wasapi","Enable Wasapi",True))
opts.Add(BoolVariable("use_directsound","Enable Wasapi",True))
opts.Add(BoolVariable("enable_rtmidi","Use RtMidi as MIDI Driver",True))
opts.Add(BoolVariable("use_winmm","Enable WinMM for RtMidi",True))
opts.Add(BoolVariable("enable_lv2","Enable LV2",False)) # Experimental, no UI

opts.Update(env) # update environment
Help(opts.GenerateHelpText(env)) # generate help
Expand All @@ -46,6 +47,7 @@ if (env["enable_rtmidi"]):


if (env["platform"]=="windows"):
env["enable_lv2"]=False
env.Append(CXXFLAGS=["-DWINDOWS_ENABLED"])
if (env["enable_vst2"]):
env.Append(CXXFLAGS=["-DVST2_ENABLED"])
Expand Down Expand Up @@ -75,6 +77,10 @@ if (env["platform"]=="freedesktop"):
if (env["use_jack"]):
env.Append(CXXFLAGS=["-D__LINUX_JACK__"])
env.ParseConfig("pkg-config jack --libs --cflags")
if (env["enable_lv2"]):
env.ParseConfig("pkg-config lilv-0 --libs --cflags")
env.ParseConfig("pkg-config suil-0 --libs --cflags")
env.Append(CXXFLAGS=["-DLV2_ENABLED"])


env.ParseConfig("pkg-config x11 --libs --cflags")
Expand Down
4 changes: 2 additions & 2 deletions bin/SCsub
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ Import('env')


ctfiles=['zytrax.cpp'];

env.Append(LINKFLAGS=["-Wl,--start-group"])
env["LINKCOM"] = '$LINK -o $TARGET $LINKFLAGS $__RPATH $SOURCES $_LIBDIRFLAGS -Wl,--start-group $_LIBFLAGS -Wl,--end-group'
#env.Append(LINKFLAGS=["-Wl,--start-group"])
env.Append(LIBS=env.libs)
env.Program('zytrax', ctfiles);

Expand Down
16 changes: 16 additions & 0 deletions bin/zytrax.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
#include "drivers/vst2/factory_wrapper_vst2.h"
#endif

#ifdef LV2_ENABLED
#include "drivers/lv2/audio_effect_provider_lv2.h"
#endif

#include "effects/effects.h"
#include "engine/song.h"
#include "globals/json_file.h"
Expand All @@ -20,11 +24,18 @@ int main(int argc, char *argv[]) {

AudioEffectFactory effect_factory;

printf("one\n");
#ifdef VST2_ENABLED
AudioEffectProvider *provider_vst2 = create_vst2_provider();
effect_factory.add_provider(provider_vst2);
#endif

printf("two\n");
#ifdef LV2_ENABLED
AudioEffectProviderLV2 provider_lv2(&argc, &argv);
effect_factory.add_provider(&provider_lv2);
#endif
printf("three\n");
#ifdef RTAUDIO_ENABLED
register_rtaudio_driver();
#endif
Expand Down Expand Up @@ -179,6 +190,7 @@ int main(int argc, char *argv[]) {
MIDIDriverManager::init_input_driver(use_midi_in_driver_index);
}

printf("regfx\n");
register_effects(&effect_factory);

/* make it dark */
Expand Down Expand Up @@ -225,13 +237,17 @@ int main(int argc, char *argv[]) {

/* Initialize the UI */

printf("go\n");

Interface window(app.operator->(), &effect_factory, &theme, &key_bindings);
window.set_default_size(1280, 720);
#ifdef VST2_ENABLED
window.add_editor_plugin_function(get_vst2_editor_function());
#endif
int ret = app->run(window);

printf("bye\n");

SoundDriverManager::finish_driver();

#ifdef VST2_ENABLED
Expand Down
4 changes: 4 additions & 0 deletions drivers/SCsub
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ Export('env');

targets=[]

if (env["enable_lv2"]):
env.add_sources(targets,"lv2/*.cpp")
env.add_sources(targets,"lv2/*.c")

if (env["enable_vst2"]):
env.add_sources(targets,"vst2/*.cpp")
if (env["enable_rtaudio"]):
Expand Down
Loading

0 comments on commit 6eb4092

Please sign in to comment.