tuningbase.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. /*
  2. * tuningbase.h
  3. * ------------
  4. * Purpose: Alternative sample tuning.
  5. * Notes : (currently none)
  6. * Authors: OpenMPT Devs
  7. * The OpenMPT source code is released under the BSD license. Read LICENSE for more details.
  8. */
  9. #pragma once
  10. #include "openmpt/all/BuildSettings.hpp"
  11. #include <limits>
  12. OPENMPT_NAMESPACE_BEGIN
  13. namespace Tuning {
  14. enum class SerializationResult : int {
  15. Success = 1,
  16. NoMagic = 0,
  17. Failure = -1
  18. };
  19. using NOTEINDEXTYPE = int16; // Some signed integer-type.
  20. using UNOTEINDEXTYPE = uint16; // Unsigned NOTEINDEXTYPE.
  21. using RATIOTYPE = float32; // Some 'real figure' type able to present ratios. If changing RATIOTYPE, serialization methods may need modifications.
  22. // Counter of steps between notes. If there is no 'finetune'(finestepcount == 0),
  23. // then 'step difference' between notes is the
  24. // same as differences in NOTEINDEXTYPE. In a way similar to ticks and rows in pattern -
  25. // ticks <-> STEPINDEX, rows <-> NOTEINDEX
  26. using STEPINDEXTYPE = int32;
  27. using USTEPINDEXTYPE = uint32;
  28. struct NoteRange
  29. {
  30. NOTEINDEXTYPE first;
  31. NOTEINDEXTYPE last;
  32. };
  33. // Derived from old IsStepCountRangeSufficient(), this is actually a more
  34. // sensible value than what was calculated in earlier versions.
  35. inline constexpr STEPINDEXTYPE FINESTEPCOUNT_MAX = 0xffff;
  36. inline constexpr auto NOTEINDEXTYPE_MIN = std::numeric_limits<NOTEINDEXTYPE>::min();
  37. inline constexpr auto NOTEINDEXTYPE_MAX = std::numeric_limits<NOTEINDEXTYPE>::max();
  38. inline constexpr auto UNOTEINDEXTYPE_MAX = std::numeric_limits<UNOTEINDEXTYPE>::max();
  39. inline constexpr auto STEPINDEXTYPE_MIN = std::numeric_limits<STEPINDEXTYPE>::min();
  40. inline constexpr auto STEPINDEXTYPE_MAX = std::numeric_limits<STEPINDEXTYPE>::max();
  41. inline constexpr auto USTEPINDEXTYPE_MAX = std::numeric_limits<USTEPINDEXTYPE>::max();
  42. enum class Type : uint16
  43. {
  44. GENERAL = 0,
  45. GROUPGEOMETRIC = 1,
  46. GEOMETRIC = 3,
  47. };
  48. class CTuning;
  49. } // namespace Tuning
  50. typedef Tuning::CTuning CTuning;
  51. OPENMPT_NAMESPACE_END