Skip to content

Commit

Permalink
Fix build deps
Browse files Browse the repository at this point in the history
  • Loading branch information
SubhadeepJasu committed Jul 29, 2022
1 parent 32527a4 commit d05adae
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 15 deletions.
20 changes: 17 additions & 3 deletions com.github.subhadeepjasu.ensembles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,20 @@ modules:
- /share/man

# Synthesizer backend
# - name: fluidsynth
# buildsystem: cmake-ninja
# config-opts:
# - -DLIB_SUFFIX=
# cleanup:
# - /bin
# - /include
# - /lib/pkgconfig
# - /share/man
# - '*.so'
# sources:
# - type: archive
# url: https://github.com/FluidSynth/fluidsynth/archive/v2.2.4.tar.gz
# sha256: 83cb1dba04c632ede74f0c0717018b062c0e00b639722203b23f77a961afd390
- name: fluidsynth
buildsystem: cmake-ninja
config-opts:
Expand All @@ -136,10 +150,10 @@ modules:
- /lib/pkgconfig
- /share/man
- '*.so'
- '*.a'
sources:
- type: archive
url: https://github.com/FluidSynth/fluidsynth/archive/v2.2.4.tar.gz
sha256: 83cb1dba04c632ede74f0c0717018b062c0e00b639722203b23f77a961afd390
- type: git
url: https://github.com/FluidSynth/fluidsynth

# MIDI controller support
- name: portmidi
Expand Down
3 changes: 2 additions & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ i18n = import ('i18n')
add_project_arguments (
'-DGETTEXT_PACKAGE="@0@"'.format (meson.project_name ()),
'-DHANDY_USE_UNSTABLE_API',
'-DPIPEWIRE_CORE_DRIVER', # Uncomment to enable pipewire core support provided fluidsynth supports it
language: 'c'
)

Expand Down Expand Up @@ -54,7 +55,7 @@ dependencies = [
dependency ('lv2'),
dependency ('lilv-0'),
dependency ('suil-0'),
dependency ('libpipewire-0.3', version: '>= 0.3.52'),
dependency ('libpipewire-0.3'), # Uncomment to enable pipewire core support provided fluidsynth supports it
meson.get_compiler ('vala').find_library ('posix'),
meson.get_compiler ('c').find_library ('m', required : true),
meson.get_compiler ('c').find_library ('fluidsynth', required : true),
Expand Down
8 changes: 2 additions & 6 deletions src/Core/Synthesizer/Synthesizer.vala
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,7 @@ namespace Ensembles.Core {
public int chord_type = 0;
public signal void detected_chord (int chord_main, int type);
public Synthesizer (string soundfont, string driver_name, double buffer_size) {
bool use_pipewire = false;
#if PIPEWIRE_CORE_DRIVER
use_pipewire = true;
#endif
synthesizer_init (soundfont, driver_name, buffer_size, use_pipewire);
synthesizer_init (soundfont, driver_name, buffer_size);
synthesizer_set_fx_callback ((buffer_l_in, buffer_r_in, out buffer_out_l, out buffer_out_r) => {
EffectRack.set_synth_callback (buffer_l_in, buffer_r_in, out buffer_out_l, out buffer_out_r);
});
Expand Down Expand Up @@ -196,7 +192,7 @@ namespace Ensembles.Core {
}

// synthesizer.c
extern void synthesizer_init (string loc, string dname, double buffer_size, bool pw_enabled = false);
extern void synthesizer_init (string loc, string dname, double buffer_size);
extern void synthesizer_destruct ();
extern int synthesizer_set_driver_configuration (string dname, double buffer_size);
extern int synthesizer_send_notes (int key, int on, int velocity, int channel, out int type);
Expand Down
9 changes: 4 additions & 5 deletions src/Core/Synthesizer/synthesizer.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,11 @@ set_note_callback (synthesizer_note_event_callback callback) {
}

void
synthesizer_init(const char* loc, const char* dname, double buffer_size, __uint8_t pw_enabled)
synthesizer_init(const char* loc, const char* dname, double buffer_size)
{
if (pw_enabled)
{
pw_init(NULL, NULL);
}
#ifdef PIPEWIRE_CORE_DRIVER
pw_init(NULL, NULL);
#endif
set_driver_configuration(dname, buffer_size);
realtime_render_synth = get_synthesizer(RENDER);
if (fluid_is_soundfont(loc)) {
Expand Down

0 comments on commit d05adae

Please sign in to comment.