settings.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. #pragma once
  2. //========================================================================================================================
  3. //========================================================================================================================
  4. // Settings
  5. //========================================================================================================================
  6. //========================================================================================================================
  7. enum Type {
  8. TypeDisabled,
  9. TypePiezo,
  10. };
  11. enum Curve {
  12. Normal,
  13. Exp,
  14. Log,
  15. Sigma,
  16. Flat,
  17. eXTRA,
  18. };
  19. struct CurveSettings {
  20. Curve type;
  21. uint8_t value;
  22. int8_t offset;
  23. uint8_t factor;
  24. CurveSettings()
  25. : type(Normal)
  26. , value(127)
  27. , offset(0)
  28. , factor(127)
  29. {}
  30. };
  31. struct ChannelSettings {
  32. Type type;
  33. uint8_t note;
  34. uint8_t threshold;
  35. qint64 scanTime;
  36. qint64 maskTime;
  37. CurveSettings curve;
  38. ChannelSettings()
  39. : type(TypeDisabled)
  40. , note(35)
  41. , threshold(25)
  42. , scanTime(4)
  43. , maskTime(10)
  44. {}
  45. };
  46. struct Settings {
  47. uint8_t midiChannel;
  48. byte prescaler;
  49. byte throttle;
  50. ChannelSettings channelSettings[PORT_CNT* CHAN_CNT];
  51. Settings()
  52. : prescaler(2)
  53. , throttle(1)
  54. , midiChannel(1)
  55. {
  56. }
  57. };