annotate CollidoscopeApp/include/Messages.h @ 1:b5bcad8e7803

renamed teensy files added DeviceManageJack.cpp
author Fiore Martin <f.martin@qmul.ac.uk>
date Fri, 08 Jul 2016 11:39:18 +0200
parents 02467299402e
children 7fb593d53361
rev   line source
f@0 1 #pragma once
f@0 2
f@0 3
f@0 4 enum class Command {
f@0 5 // message carrying info about one chunk of recorder audio.
f@0 6 WAVE_CHUNK,
f@0 7 // message sent when a new recording starts. The gui resets the wave upon receiving it.
f@0 8 WAVE_START,
f@0 9
f@0 10 TRIGGER_UPDATE,
f@0 11 TRIGGER_END,
f@0 12
f@0 13 NOTE_ON,
f@0 14 NOTE_OFF,
f@0 15
f@0 16 LOOP_ON,
f@0 17 LOOP_OFF
f@0 18 };
f@0 19
f@0 20 /* Messages sent from the audio thread to the graphic wave.
f@0 21 This includes the wave chunks when the audio is recorder in the buffer and
f@0 22 the cursor position when the grains are reset.
f@0 23 */
f@0 24 struct RecordWaveMsg
f@0 25 {
f@0 26 Command cmd;
f@0 27 std::size_t index;
f@0 28 float arg1;
f@0 29 float arg2;
f@0 30 };
f@0 31
f@0 32
f@0 33 inline RecordWaveMsg makeRecordWaveMsg( Command cmd, std::size_t index, float arg1, float arg2 )
f@0 34 {
f@0 35 RecordWaveMsg msg;
f@0 36 msg.cmd = cmd;
f@0 37 msg.index = index;
f@0 38 msg.arg1 = arg1;
f@0 39 msg.arg2 = arg2;
f@0 40
f@0 41 return msg;
f@0 42 }
f@0 43
f@0 44
f@0 45 struct CursorTriggerMsg
f@0 46 {
f@0 47 Command cmd;
f@0 48 int synthID;
f@0 49 };
f@0 50
f@0 51 inline CursorTriggerMsg makeCursorTriggerMsg( Command cmd, std::uint8_t synthID )
f@0 52 {
f@0 53 CursorTriggerMsg msg;
f@0 54
f@0 55 msg.cmd = cmd;
f@0 56 msg.synthID = synthID;
f@0 57
f@0 58 return msg;
f@0 59 }
f@0 60
f@0 61 struct NoteMsg
f@0 62 {
f@0 63 Command cmd;
f@0 64 int midiNote;
f@0 65 double rate;
f@0 66 };
f@0 67
f@0 68 inline NoteMsg makeNoteMsg( Command cmd, int midiNote, double rate )
f@0 69 {
f@0 70 NoteMsg msg;
f@0 71
f@0 72 msg.cmd = cmd;
f@0 73 msg.midiNote = midiNote;
f@0 74 msg.rate = rate;
f@0 75
f@0 76 return msg;
f@0 77 }