From ec812521b31471ce9ac3d9bdf1288b1569defbc8 Mon Sep 17 00:00:00 2001 From: Sébastien Dailly Date: Wed, 23 Dec 2020 19:11:31 +0100 Subject: Add svg output --- events/dune | 7 ------- events/timer.ml | 41 ----------------------------------------- events/timer.mli | 11 ----------- 3 files changed, 59 deletions(-) delete mode 100755 events/dune delete mode 100755 events/timer.ml delete mode 100755 events/timer.mli (limited to 'events') diff --git a/events/dune b/events/dune deleted file mode 100755 index 68e2dd2..0000000 --- a/events/dune +++ /dev/null @@ -1,7 +0,0 @@ -(library - (name events) - (libraries - brr - brr.note - ) -) diff --git a/events/timer.ml b/events/timer.ml deleted file mode 100755 index 0a75e12..0000000 --- a/events/timer.ml +++ /dev/null @@ -1,41 +0,0 @@ -open Brr_note_kit - -type t = - { mutable id : Brr.G.timer_id - ; send : float Note.E.send - ; mutable counter : Time.counter - } - -let create - : unit -> (t * Brr_note_kit.Time.span Note.E.t) - = fun () -> - let event, send = Note.E.create () - and counter = (Time.counter ()) in - {id = (-1); send; counter}, event - -let stop - : t -> unit - = fun {id; _} -> - Brr.G.stop_timer id - -let start - : t -> float -> unit - = fun t d -> - let {id; send; _} = t in - t.counter <- Time.counter (); - - - Brr.G.stop_timer id; - let timer_id = Brr.G.set_interval - ~ms:(int_of_float @@ d *. 1000.) - (fun () -> - - let span = Time.counter_value t.counter in - t.counter <- Time.counter (); - send span) in - ignore @@ Brr.G.set_timeout ~ms:0 (fun () -> send 0.); - t.id <- timer_id - - -let delay : t -> float - = fun t -> Time.counter_value t.counter diff --git a/events/timer.mli b/events/timer.mli deleted file mode 100755 index 0509ad0..0000000 --- a/events/timer.mli +++ /dev/null @@ -1,11 +0,0 @@ -open Brr_note_kit - -type t - -val create : unit -> t * Time.span Note.E.t - -val start: t -> float -> unit - -val stop: t -> unit - -val delay : t -> float -- cgit v1.2.3