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.

60 lines
1.2KB

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