diff --git a/.gitmodules b/.gitmodules index 2192f8449..2c6a2452e 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,6 +1,3 @@ -[submodule "third-party/link-c"] - path = third-party/link-c - url = https://github.com/artfwo/link-c.git [submodule "third-party/link"] path = third-party/link url = https://github.com/Ableton/link.git diff --git a/matron/src/clocks/clock_link.c b/matron/src/clocks/clock_link.c index 0350d4378..e9ba389a0 100644 --- a/matron/src/clocks/clock_link.c +++ b/matron/src/clocks/clock_link.c @@ -6,7 +6,7 @@ #include #include -#include +#include #include "clock.h" @@ -28,61 +28,59 @@ static clock_reference_t clock_link_reference; static void *clock_link_run(void *p) { (void)p; - AbletonLink *link; - AbletonLinkClock *clock; - AbletonLinkSessionState *state; + abl_link link; + abl_link_session_state state; - link = ableton_link_new(120); - clock = ableton_link_clock(link); + link = abl_link_create(120); + state = abl_link_create_session_state(); while (true) { if (pthread_mutex_trylock(&clock_link_shared_data.lock) == 0) { - state = ableton_link_capture_app_session_state(link); + abl_link_capture_app_session_state(link, state); - uint64_t micros = ableton_link_clock_micros(clock); - double link_tempo = ableton_link_session_state_tempo(state); - bool link_playing = ableton_link_session_state_is_playing(state); + uint64_t micros = abl_link_clock_micros(link); + double link_tempo = abl_link_tempo(state); + bool link_playing = abl_link_is_playing(state); if (clock_link_shared_data.transport_start) { - ableton_link_session_state_set_is_playing(state, true, 0); - ableton_link_commit_app_session_state(link, state); + abl_link_set_is_playing(state, true, 0); + abl_link_commit_app_session_state(link, state); clock_link_shared_data.transport_start = false; } if (clock_link_shared_data.transport_stop) { - ableton_link_session_state_set_is_playing(state, false, 0); - ableton_link_commit_app_session_state(link, state); + abl_link_set_is_playing(state, false, 0); + abl_link_commit_app_session_state(link, state); clock_link_shared_data.transport_stop = false; } if (clock_link_shared_data.start_stop_sync) { if (!clock_link_shared_data.playing && link_playing) { - ableton_link_session_state_request_beat_at_start_playing_time(state, 0, clock_link_shared_data.quantum); + abl_link_request_beat_at_start_playing_time(state, 0, clock_link_shared_data.quantum); clock_link_shared_data.playing = true; // this will also reschedule pending sync events to beat 0 clock_start_from_source(CLOCK_SOURCE_LINK); - ableton_link_commit_app_session_state(link, state); + abl_link_commit_app_session_state(link, state); } else if (clock_link_shared_data.playing && !link_playing) { clock_link_shared_data.playing = false; clock_stop_from_source(CLOCK_SOURCE_LINK); } } - double link_beat = ableton_link_session_state_beat_at_time(state, micros, clock_link_shared_data.quantum); + double link_beat = abl_link_beat_at_time(state, micros, clock_link_shared_data.quantum); clock_update_source_reference(&clock_link_reference, link_beat, 60.0f / link_tempo); if (clock_link_shared_data.requested_tempo > 0) { - ableton_link_session_state_set_tempo(state, clock_link_shared_data.requested_tempo, micros); - ableton_link_commit_app_session_state(link, state); + abl_link_set_tempo(state, clock_link_shared_data.requested_tempo, micros); + abl_link_commit_app_session_state(link, state); clock_link_shared_data.requested_tempo = 0; } - ableton_link_enable(link, clock_link_shared_data.enabled); - ableton_link_enable_start_stop_sync(link, clock_link_shared_data.start_stop_sync); + abl_link_enable(link, clock_link_shared_data.enabled); + abl_link_enable_start_stop_sync(link, clock_link_shared_data.start_stop_sync); - ableton_link_session_state_destroy(state); pthread_mutex_unlock(&clock_link_shared_data.lock); } diff --git a/matron/wscript b/matron/wscript index 301d179d6..b98e9fca8 100644 --- a/matron/wscript +++ b/matron/wscript @@ -77,11 +77,10 @@ def build(bld): if bld.env.ENABLE_ABLETON_LINK: matron_sources += ['src/clocks/clock_link.c'] - matron_includes += ['../third-party/link-c'] + matron_includes += ['../third-party/link/extensions/abl_link/include'] matron_libs += ['stdc++'] matron_use += ['LIBLINK_C'] - matron_cflags=['-O3', '-Wall', '-std=c11'] if bld.env.NORNS_RELEASE: diff --git a/third-party/link b/third-party/link index 05ef5646c..adbbb5298 160000 --- a/third-party/link +++ b/third-party/link @@ -1 +1 @@ -Subproject commit 05ef5646c3533cd2cff321f3bac8540264812052 +Subproject commit adbbb529831c22edecba20e983343b3b23a73f60 diff --git a/third-party/link-c b/third-party/link-c deleted file mode 160000 index cfab77396..000000000 --- a/third-party/link-c +++ /dev/null @@ -1 +0,0 @@ -Subproject commit cfab77396ea02884aa0b78493eaeae39fa6e361a diff --git a/third-party/wscript b/third-party/wscript index cd6418eae..668bb9da5 100644 --- a/third-party/wscript +++ b/third-party/wscript @@ -3,10 +3,11 @@ top = '..' def build_link(bld): bld.stlib(features='c cxx cxxstlib', source=[ - 'link-c/ableton_link.cpp', + 'link/extensions/abl_link/src/abl_link.cpp', ], target='link-c', includes=[ + 'link/extensions/abl_link/include', 'link/include', 'link/modules/asio-standalone/asio/include', ],