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.

66 lines
1.4KB

  1. #pragma once
  2. #include <stdint.h>
  3. namespace rack {
  4. // TODO Change driver and port number to something less common
  5. /** Driver ID in AudioIO and MidiIO */
  6. #define BRIDGE_DRIVER -5000
  7. #define BRIDGE_HOST "127.0.0.1"
  8. #define BRIDGE_PORT 5000
  9. #define BRIDGE_NUM_PORTS 16
  10. /** Number of VST/AU automation parameters */
  11. #define BRIDGE_NUM_PARAMS 16
  12. /** An arbitrary number which prevents connection from other protocols (like WebSockets) and old Bridge versions */
  13. #define BRIDGE_HELLO 0xff00fefd
  14. /** All commands are called from the client and served by the server
  15. send
  16. - uint8_t cmd
  17. */
  18. enum BridgeCommand {
  19. NO_COMMAND = 0,
  20. /** Requests the server to shut down the client */
  21. QUIT_COMMAND,
  22. /** Sets the port
  23. send
  24. - uint8_t port
  25. */
  26. PORT_SET_COMMAND,
  27. /** Sends a 3-byte MIDI command
  28. send
  29. - uint8_t msg[3]
  30. */
  31. MIDI_MESSAGE_SEND_COMMAND,
  32. /** Sets the audio sample rate
  33. send
  34. - uint32_t sampleRate
  35. */
  36. AUDIO_SAMPLE_RATE_SET_COMMAND,
  37. /** Sets the number of audio channels
  38. Currently not supported, hard-coded at 2.
  39. send
  40. - uint8_t channels
  41. */
  42. AUDIO_CHANNELS_SET_COMMAND,
  43. /** Sends and receives an audio buffer
  44. send
  45. - uint32_t length
  46. - float input[length]
  47. recv
  48. - float output[length]
  49. */
  50. AUDIO_PROCESS_COMMAND,
  51. /** Resumes the audio buffer, forcing Rack to wait on an audio buffer */
  52. AUDIO_ACTIVATE,
  53. /** Pauses the audio buffer, allowing Rack to not wait on an audio buffer */
  54. AUDIO_DEACTIVATE,
  55. NUM_COMMANDS
  56. };
  57. } // namespace rack