scheduler_evt   xtlang


Defined in:  https://github.com/digego/extempore/tree/v0.8.9/libs/core/scheduler.xtm

Implementation

(bind-func scheduler_evt:[void,[i64,!a]*,!a,i8*]*
  (let ((evtlist:SchedEvt* null)
        (next:SchedEvt* null)
        (new:SchedEvt* null))
    (lambda (scheduler time fname)
      ;; (println "sched:" scheduler time fname data)
      (if (= (thread_equal_self (scheduler.thread)) 0)
          (mutex_lock (scheduler.mutex)))
      (set! evtlist (scheduler_at (scheduler.evtlist) time))
      (if (null? evtlist)
          (begin
            (set! next (scheduler.evtlist))
            (set! new (SchedEvt_h time fname null next))
            (scheduler.evtlist new)
            void)
          (begin
            (set! next (tref evtlist 3)) ;; get next from previous
            (set! new (SchedEvt_h time fname evtlist next))
            (tset! evtlist 3 new) ;; make us next of previous
            (if (not (null? next)) (tset! next 2 new)) ;; set us to previous of next
            void))
      (if (= (thread_equal_self (scheduler.thread)) 0)
          (mutex_unlock (scheduler.mutex)))
      void)))


Back to Index

Similar Entries

  • beat_scheduler    xtlang
  • clock_scheduler    xtlang
  • clock_scheduler_main_callback    xtlang
  • get_midi_evt_a    xtlang
  • get_midi_evt_b    xtlang
  • get_midi_evt_channel    xtlang
  • get_midi_evt_clocktime    xtlang
  • get_midi_evt_timestamp    xtlang
  • get_midi_evt_type    xtlang
  • scheduler_at    xtlang
  • scheduler_init    xtlang
  • start_midi_scheduler    xtlang