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.

42 lines
1.5KB

  1. #ifndef TSOSCCOMMON_HPP
  2. #define TSOSCCOMMON_HPP
  3. #include <string>
  4. // What client are we talking to. touchOSC and Lemur are a little limited, so they need special treatment.
  5. enum OSCClient : uint8_t {
  6. // Interface will closely match how the sequencer acts. Accepts multiple parameters.
  7. GenericClient,
  8. // touchOSC : Can only take 1 parameter. Only strings or floats as data types.
  9. // toggleGrid control in touchOSC is addressed by 1-based /row/col/ starting from THE BOTTOM. (ghey)
  10. touchOSCClient,
  11. // Lemur : Special treatment not implemented yet.
  12. //LemurClient,
  13. NUM_OSC_CLIENTS
  14. };
  15. // The OSC client labels/strings. Currently defined in ConfigWidget.
  16. extern std::string OSCClientStr[NUM_OSC_CLIENTS];
  17. // OSC Client abbreviations.
  18. extern std::string OSCClientAbbr[NUM_OSC_CLIENTS];
  19. //-------- Helpers -------------
  20. namespace touchOSC
  21. {
  22. // touchOSC color strings for our channels. In future, this should maybe live in sequencer file since this is for sequencers (if we do touchOSC for other types of modules).
  23. extern const char* ChannelColors[16];
  24. // Convert the 1-based row, col from a touchOSC multi-push/multi-toggle grid control to a 0-based step index.
  25. int mcRowCol_to_stepIndex(/*in*/ int row, /*in*/ int col, /*in*/ int numRows, /*in*/ int numCols);
  26. // Convert the 0-based step index to 1-based row, col from a touchOSC multi-push/multi-toggle grid control.
  27. void stepIndex_to_mcRowCol(/*in*/ int stepIx, /*in*/ int numRows, /*in*/ int numCols, /*out*/ int* row, /*out*/ int* col);
  28. }
  29. #endif // !TSOSCCOMMON_HPP