Skip to content

Commit

Permalink
Revert "Merge branch 'main' into password-helper"
Browse files Browse the repository at this point in the history
This reverts commit 66fe798, reversing
changes made to 651d7c0.
  • Loading branch information
dndrks committed Jun 13, 2022
1 parent 05641d4 commit b797f04
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 24 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[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
Expand Down
42 changes: 22 additions & 20 deletions matron/src/clocks/clock_link.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include <time.h>
#include <unistd.h>

#include <abl_link.h>
#include <ableton_link.h>

#include "clock.h"

Expand All @@ -28,59 +28,61 @@ static clock_reference_t clock_link_reference;
static void *clock_link_run(void *p) {
(void)p;

abl_link link;
abl_link_session_state state;
AbletonLink *link;
AbletonLinkClock *clock;
AbletonLinkSessionState *state;

link = abl_link_create(120);
state = abl_link_create_session_state();
link = ableton_link_new(120);
clock = ableton_link_clock(link);

while (true) {
if (pthread_mutex_trylock(&clock_link_shared_data.lock) == 0) {
abl_link_capture_app_session_state(link, state);
state = ableton_link_capture_app_session_state(link);

uint64_t micros = abl_link_clock_micros(link);
double link_tempo = abl_link_tempo(state);
bool link_playing = abl_link_is_playing(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);


if (clock_link_shared_data.transport_start) {
abl_link_set_is_playing(state, true, 0);
abl_link_commit_app_session_state(link, state);
ableton_link_session_state_set_is_playing(state, true, 0);
ableton_link_commit_app_session_state(link, state);
clock_link_shared_data.transport_start = false;
}

if (clock_link_shared_data.transport_stop) {
abl_link_set_is_playing(state, false, 0);
abl_link_commit_app_session_state(link, state);
ableton_link_session_state_set_is_playing(state, false, 0);
ableton_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) {
abl_link_request_beat_at_start_playing_time(state, 0, clock_link_shared_data.quantum);
ableton_link_session_state_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);
abl_link_commit_app_session_state(link, state);
ableton_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 = abl_link_beat_at_time(state, micros, clock_link_shared_data.quantum);
double link_beat = ableton_link_session_state_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) {
abl_link_set_tempo(state, clock_link_shared_data.requested_tempo, micros);
abl_link_commit_app_session_state(link, state);
ableton_link_session_state_set_tempo(state, clock_link_shared_data.requested_tempo, micros);
ableton_link_commit_app_session_state(link, state);
clock_link_shared_data.requested_tempo = 0;
}

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_enable(link, clock_link_shared_data.enabled);
ableton_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);
}

Expand Down
3 changes: 2 additions & 1 deletion matron/wscript
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,11 @@ def build(bld):

if bld.env.ENABLE_ABLETON_LINK:
matron_sources += ['src/clocks/clock_link.c']
matron_includes += ['../third-party/link/extensions/abl_link/include']
matron_includes += ['../third-party/link-c']
matron_libs += ['stdc++']
matron_use += ['LIBLINK_C']


matron_cflags=['-O3', '-Wall', '-std=c11']

if bld.env.NORNS_RELEASE:
Expand Down
2 changes: 1 addition & 1 deletion third-party/link
Submodule link updated 93 files
+63 −119 .appveyor.yml
+167 −0 .travis.yml
+1 −1 AbletonLinkConfig.cmake
+0 −2 CMakeLists.txt
+2 −2 README.md
+1 −3 TEST-PLAN.md
+4 −4 ci/check-formatting.py
+0 −6 ci/configure.py
+1 −1 cmake_include/CatchConfig.cmake
+0 −4 cmake_include/ConfigureCompileFlags.cmake
+6 −6 examples/CMakeLists.txt
+1 −1 examples/esp32/README.md
+2 −3 examples/esp32/main/main.cpp
+1 −2 examples/linkaudio/AudioEngine.cpp
+2 −2 examples/linkaudio/AudioPlatform_Asio.cpp
+1 −2 examples/linkaudio/AudioPlatform_CoreAudio.cpp
+2 −2 examples/linkaudio/AudioPlatform_Portaudio.cpp
+45 −46 examples/linkhut/main.cpp
+0 −44 extensions/abl_link/.clang-format
+0 −19 extensions/abl_link/CMakeLists.txt
+0 −17 extensions/abl_link/README.md
+0 −19 extensions/abl_link/abl_link.cmake
+0 −269 extensions/abl_link/examples/link_hut/main.c
+0 −352 extensions/abl_link/include/abl_link.h
+0 −214 extensions/abl_link/src/abl_link.cpp
+4 −12 include/CMakeLists.txt
+2 −1 include/ableton/Link.hpp
+9 −11 include/ableton/Link.ipp
+7 −10 include/ableton/discovery/NetworkByteStreamSerializable.hpp
+2 −4 include/ableton/discovery/Payload.hpp
+2 −2 include/ableton/discovery/PeerGateway.hpp
+60 −13 include/ableton/discovery/PeerGateways.hpp
+2 −2 include/ableton/discovery/Service.hpp
+2 −2 include/ableton/discovery/v1/Messages.hpp
+1 −1 include/ableton/link/Beats.hpp
+95 −0 include/ableton/link/CircularFifo.hpp
+87 −94 include/ableton/link/Controller.hpp
+2 −2 include/ableton/link/Gateway.hpp
+8 −12 include/ableton/link/HostTimeFilter.hpp
+143 −0 include/ableton/link/Kalman.hpp
+30 −27 include/ableton/link/LinearRegression.hpp
+47 −28 include/ableton/link/Measurement.hpp
+2 −3 include/ableton/link/MeasurementEndpointV4.hpp
+55 −26 include/ableton/link/MeasurementService.hpp
+2 −2 include/ableton/link/NodeId.hpp
+1 −2 include/ableton/link/NodeState.hpp
+2 −4 include/ableton/link/PeerState.hpp
+74 −45 include/ableton/link/Peers.hpp
+13 −2 include/ableton/link/PingResponder.hpp
+0 −34 include/ableton/link/SessionState.hpp
+7 −4 include/ableton/link/Sessions.hpp
+2 −2 include/ableton/link/StartStopState.hpp
+1 −2 include/ableton/link/Timeline.hpp
+0 −121 include/ableton/link/TripleBuffer.hpp
+2 −2 include/ableton/link/v1/Messages.hpp
+4 −24 include/ableton/platforms/Config.hpp
+0 −2 include/ableton/platforms/asio/AsioWrapper.hpp
+29 −33 include/ableton/platforms/asio/Context.hpp
+7 −3 include/ableton/platforms/asio/LockFreeCallbackDispatcher.hpp
+0 −48 include/ableton/platforms/darwin/ThreadFactory.hpp
+14 −34 include/ableton/platforms/esp32/Context.hpp
+1 −1 include/ableton/platforms/esp32/LockFreeCallbackDispatcher.hpp
+2 −3 include/ableton/platforms/esp32/ScanIpIfAddrs.hpp
+0 −4 include/ableton/platforms/linux/Clock.hpp
+0 −45 include/ableton/platforms/linux/ThreadFactory.hpp
+1 −2 include/ableton/platforms/stl/Random.hpp
+0 −52 include/ableton/platforms/windows/ThreadFactory.hpp
+2 −2 include/ableton/platforms/windows/Windows.hpp
+0 −2 include/ableton/test/CatchWrapper.hpp
+5 −0 include/ableton/test/serial_io/Context.hpp
+3 −4 src/CMakeLists.txt
+30 −35 src/ableton/discovery/tst_InterfaceScanner.cpp
+150 −154 src/ableton/discovery/tst_Payload.cpp
+66 −49 src/ableton/discovery/tst_PeerGateway.cpp
+54 −43 src/ableton/discovery/tst_PeerGateways.cpp
+140 −119 src/ableton/discovery/tst_UdpMessenger.cpp
+53 −56 src/ableton/link/tst_Beats.cpp
+83 −0 src/ableton/link/tst_CircularFifo.cpp
+116 −117 src/ableton/link/tst_ClientSessionTimelines.cpp
+139 −139 src/ableton/link/tst_Controller.cpp
+26 −27 src/ableton/link/tst_HostTimeFilter.cpp
+35 −17 src/ableton/link/tst_Kalman.cpp
+35 −59 src/ableton/link/tst_LinearRegression.cpp
+54 −51 src/ableton/link/tst_Measurement.cpp
+0 −66 src/ableton/link/tst_Median.cpp
+104 −87 src/ableton/link/tst_Peers.cpp
+138 −141 src/ableton/link/tst_Phase.cpp
+54 −47 src/ableton/link/tst_PingResponder.cpp
+1 −1 src/ableton/link/tst_StartStopState.cpp
+72 −44 src/ableton/link/tst_Tempo.cpp
+16 −20 src/ableton/link/tst_Timeline.cpp
+0 −165 src/ableton/link/tst_TripleBuffer.cpp
+8,810 −15,163 third_party/catch/catch.hpp
1 change: 1 addition & 0 deletions third-party/link-c
Submodule link-c added at cfab77
3 changes: 1 addition & 2 deletions third-party/wscript
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@ top = '..'
def build_link(bld):
bld.stlib(features='c cxx cxxstlib',
source=[
'link/extensions/abl_link/src/abl_link.cpp',
'link-c/ableton_link.cpp',
],
target='link-c',
includes=[
'link/extensions/abl_link/include',
'link/include',
'link/modules/asio-standalone/asio/include',
],
Expand Down

0 comments on commit b797f04

Please sign in to comment.