shithub: orca

Download patch

ref: 8a5e7fe3aa272da0b9b02671989b6290d67c820b
parent: e31b72076b8407c5099ba8cb91184e830f48bb7e
author: cancel <cancel@cancel.fm>
date: Thu Dec 27 12:43:40 EST 2018

Add started/stopped osc messages on play/pause

--- a/tui_main.c
+++ b/tui_main.c
@@ -794,6 +794,11 @@
   }
 }
 
+void send_control_message(Oosc_dev* oosc_dev, char const* osc_address) {
+  if (!oosc_dev) return;
+  oosc_send_int32s(oosc_dev, osc_address, NULL, 0);
+}
+
 void apply_time_to_sustained_notes(Oosc_dev* oosc_dev,
                                    Midi_mode const* midi_mode,
                                    double time_elapsed,
@@ -1456,6 +1461,7 @@
       ged_stop_all_sustained_notes(a);
       a->is_playing = false;
       a->meter_level = 0.0f;
+      send_control_message(a->oosc_dev, "/orca/stopped");
     } else {
       undo_history_push(&a->undo_hist, &a->field, a->tick_num);
       a->is_playing = true;
@@ -1462,6 +1468,7 @@
       a->clock = stm_now();
       // dumb'n'dirty, get us close to the next step time, but not quite
       a->accum_secs = 60.0 / (double)a->bpm / 4.0 - 0.02;
+      send_control_message(a->oosc_dev, "/orca/started");
     }
     a->is_draw_dirty = true;
     break;