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.

58 lines
1.2KB

  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. #define BRIDGE_INPUTS 8
  15. #define BRIDGE_OUTPUTS 8
  16. /** All commands are called from the client and served by the server
  17. send
  18. - uint8_t cmd
  19. */
  20. enum BridgeCommand {
  21. NO_COMMAND = 0,
  22. /** Requests the server to shut down the client */
  23. QUIT_COMMAND,
  24. /** Sets the port
  25. send
  26. - uint8_t port
  27. */
  28. PORT_SET_COMMAND,
  29. /** Sends a 3-byte MIDI command
  30. send
  31. - uint8_t msg[3]
  32. */
  33. MIDI_MESSAGE_COMMAND,
  34. /** Sets the audio sample rate
  35. send
  36. - uint32_t sampleRate
  37. */
  38. AUDIO_SAMPLE_RATE_SET_COMMAND,
  39. /** Sends and receives an audio buffer
  40. send
  41. - uint32_t frames
  42. - float input[BRIDGE_INPUTS * frames]
  43. recv
  44. - float output[BRIDGE_OUTPUTS * frames]
  45. */
  46. AUDIO_PROCESS_COMMAND,
  47. NUM_COMMANDS
  48. };
  49. } // namespace rack