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.

bridgeprotocol.hpp 1.2KB

6 years ago
6 years ago
6 years ago
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. #pragma once
  2. #include <stdint.h>
  3. namespace rack {
  4. /** Driver ID in AudioIO and MidiIO */
  5. const int BRIDGE_DRIVER = -12512;
  6. const char* const BRIDGE_HOST = "127.0.0.1";
  7. const int BRIDGE_PORT = 12512;
  8. const int BRIDGE_NUM_PORTS = 16;
  9. /** Number of VST/AU automation parameters */
  10. const int BRIDGE_NUM_PARAMS = 16;
  11. /** An arbitrary number which prevents connection from other protocols (like WebSockets) and old Bridge versions */
  12. const uint32_t BRIDGE_HELLO = 0xff00fefd;
  13. const int BRIDGE_INPUTS = 8;
  14. const int BRIDGE_OUTPUTS = 8;
  15. /** All commands are called from the client and served by the server
  16. send
  17. - uint8_t cmd
  18. */
  19. enum BridgeCommand {
  20. NO_COMMAND = 0,
  21. /** Requests the server to shut down the client */
  22. QUIT_COMMAND,
  23. /** Sets the port
  24. send
  25. - uint8_t port
  26. */
  27. PORT_SET_COMMAND,
  28. /** Sends a 3-byte MIDI command
  29. send
  30. - uint8_t msg[3]
  31. */
  32. MIDI_MESSAGE_COMMAND,
  33. /** Sets the audio sample rate
  34. send
  35. - uint32_t sampleRate
  36. */
  37. AUDIO_SAMPLE_RATE_SET_COMMAND,
  38. /** Sends and receives an audio buffer
  39. send
  40. - uint32_t frames
  41. - float input[BRIDGE_INPUTS * frames]
  42. recv
  43. - float output[BRIDGE_OUTPUTS * frames]
  44. */
  45. AUDIO_PROCESS_COMMAND,
  46. NUM_COMMANDS
  47. };
  48. } // namespace rack