summaryrefslogtreecommitdiff
path: root/events
diff options
context:
space:
mode:
Diffstat (limited to 'events')
-rwxr-xr-xevents/dune7
-rwxr-xr-xevents/timer.ml41
-rwxr-xr-xevents/timer.mli11
3 files changed, 0 insertions, 59 deletions
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