You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

59 lines
1.2KB

  1. #pragma once
  2. #include <stdint.h>
  3. namespace rack {
  4. static const int BRIDGE_NUM_PORTS = 16;
  5. // A random number which prevents connection from other protocols and old Bridge versions
  6. const uint32_t BRIDGE_HELLO = 0xff00fefd;
  7. /** All commands are called from the client and served by the server
  8. send
  9. - uint8_t cmd
  10. */
  11. enum BridgeCommand {
  12. NO_COMMAND = 0,
  13. /** Requests the server to shut down the client */
  14. QUIT_COMMAND,
  15. /** Sets the port
  16. send
  17. - uint8_t port
  18. */
  19. PORT_SET_COMMAND,
  20. /** Sends a 3-byte MIDI command
  21. send
  22. - uint8_t msg[3]
  23. */
  24. MIDI_MESSAGE_SEND_COMMAND,
  25. /** Sets the audio sample rate
  26. send
  27. - uint32_t sampleRate
  28. */
  29. AUDIO_SAMPLE_RATE_SET_COMMAND,
  30. /** Sets the number of audio channels
  31. Currently not supported, hard-coded at 2.
  32. send
  33. - uint8_t channels
  34. */
  35. AUDIO_CHANNELS_SET_COMMAND,
  36. /** Sends and receives an audio buffer
  37. send
  38. - uint32_t length
  39. - float input[n]
  40. recv
  41. - float output[n]
  42. */
  43. AUDIO_PROCESS_COMMAND,
  44. /** Resumes the audio buffer, forcing Rack to wait on an audio buffer */
  45. AUDIO_ACTIVATE,
  46. /** Pauses the audio buffer, allowing Rack to not wait on an audio buffer */
  47. AUDIO_DEACTIVATE,
  48. NUM_COMMANDS
  49. };
  50. } // namespace rack