@@ -4189,8 +4189,6 @@ def current_sched_ahead_time
4189
4189
4190
4190
def sleep ( beats )
4191
4191
__system_thread_locals . set_local ( :sonic_pi_spider_time_state_cache , [ ] )
4192
- __system_thread_locals . set_local ( :sonic_pi_local_last_sync , nil )
4193
-
4194
4192
4195
4193
# Schedule messages
4196
4194
__schedule_delayed_blocks_and_messages!
@@ -4330,12 +4328,11 @@ def sync_event(*args)
4330
4328
k = params [ 0 ]
4331
4329
4332
4330
__system_thread_locals . set_local ( :sonic_pi_spider_time_state_cache , [ ] )
4333
- # TODO: need to add this
4331
+
4334
4332
bpm_sync = truthy? ( opts [ :bpm_sync ] )
4335
4333
arg_matcher = opts [ :arg_matcher ]
4336
4334
4337
4335
cue_id = __sync_path ( k )
4338
- last_sync = __system_thread_locals . get ( :sonic_pi_local_last_sync , nil )
4339
4336
4340
4337
__system_thread_locals . set_local :sonic_pi_local_control_deltas , { }
4341
4338
@@ -4345,27 +4342,16 @@ def sync_event(*args)
4345
4342
4346
4343
__schedule_delayed_blocks_and_messages!
4347
4344
4348
- if last_sync
4349
- t = last_sync . time
4350
- i = last_sync . thread_id
4351
- p = last_sync . priority
4352
- d = last_sync . delta
4353
- b = last_sync . beat
4354
- m = last_sync . bpm
4355
- else
4356
- # TODO insert priority and delta values here:
4357
- t = current_time
4358
- p = __system_thread_locals . get ( :sonic_pi_spider_thread_priority , -100 )
4359
- i = __current_thread_id
4360
- d = __system_thread_locals . get ( :sonic_pi_spider_thread_delta , 0 )
4361
- b = current_beat
4362
- m = current_bpm
4363
- end
4345
+ t = current_time
4346
+ p = __system_thread_locals . get ( :sonic_pi_spider_thread_priority , -100 )
4347
+ i = __current_thread_id
4348
+ d = __system_thread_locals . get ( :sonic_pi_spider_thread_delta , 0 )
4349
+ b = current_beat
4350
+ m = current_bpm_mode
4364
4351
4365
4352
se = @event_history . sync ( t , p , i , d , b , m , cue_id , arg_matcher )
4366
4353
4367
4354
__system_thread_locals . set ( :sonic_pi_spider_synced , true )
4368
- __system_thread_locals . set_local :sonic_pi_local_last_sync , se
4369
4355
4370
4356
if bpm_sync
4371
4357
raise StandardError , "Incorrect bpm value. Expecting either :link or a number such as 120" unless ( ( se . bpm == :link ) || se . bpm . is_a? ( Numeric ) )
@@ -4384,7 +4370,6 @@ def sync_event(*args)
4384
4370
__delayed_highlight2_message "synced #{ cue_id . inspect } " + run_info
4385
4371
end
4386
4372
end
4387
- __system_thread_locals . set_local :sonic_pi_local_last_sync , se
4388
4373
se
4389
4374
end
4390
4375
0 commit comments