f@0: #pragma once f@0: f@0: f@0: enum class Command { f@0: // message carrying info about one chunk of recorder audio. f@0: WAVE_CHUNK, f@0: // message sent when a new recording starts. The gui resets the wave upon receiving it. f@0: WAVE_START, f@0: f@0: TRIGGER_UPDATE, f@0: TRIGGER_END, f@0: f@0: NOTE_ON, f@0: NOTE_OFF, f@0: f@0: LOOP_ON, f@0: LOOP_OFF f@0: }; f@0: f@0: /* Messages sent from the audio thread to the graphic wave. f@0: This includes the wave chunks when the audio is recorder in the buffer and f@0: the cursor position when the grains are reset. f@0: */ f@0: struct RecordWaveMsg f@0: { f@0: Command cmd; f@0: std::size_t index; f@0: float arg1; f@0: float arg2; f@0: }; f@0: f@0: f@0: inline RecordWaveMsg makeRecordWaveMsg( Command cmd, std::size_t index, float arg1, float arg2 ) f@0: { f@0: RecordWaveMsg msg; f@0: msg.cmd = cmd; f@0: msg.index = index; f@0: msg.arg1 = arg1; f@0: msg.arg2 = arg2; f@0: f@0: return msg; f@0: } f@0: f@0: f@0: struct CursorTriggerMsg f@0: { f@0: Command cmd; f@0: int synthID; f@0: }; f@0: f@0: inline CursorTriggerMsg makeCursorTriggerMsg( Command cmd, std::uint8_t synthID ) f@0: { f@0: CursorTriggerMsg msg; f@0: f@0: msg.cmd = cmd; f@0: msg.synthID = synthID; f@0: f@0: return msg; f@0: } f@0: f@0: struct NoteMsg f@0: { f@0: Command cmd; f@0: int midiNote; f@0: double rate; f@0: }; f@0: f@0: inline NoteMsg makeNoteMsg( Command cmd, int midiNote, double rate ) f@0: { f@0: NoteMsg msg; f@0: f@0: msg.cmd = cmd; f@0: msg.midiNote = midiNote; f@0: msg.rate = rate; f@0: f@0: return msg; f@0: }