Fixed midi handling for control change and implemented tab selection with midi

This commit is contained in:
2022-12-28 04:56:09 +01:00
parent 9d6c73782c
commit 629d2e6cd3
20 changed files with 481 additions and 455 deletions

30
futurecpp.h Normal file
View File

@@ -0,0 +1,30 @@
#pragma once
// system includes
#include <cstring>
#include <limits>
#include <type_traits>
// C++20 backports (until espressif finally updates their aged compiler suite)
namespace std {
template <class To, class From>
typename std::enable_if_t<
sizeof(To) == sizeof(From) && std::is_trivially_copyable_v<From> && std::is_trivially_copyable_v<To>,
To>
// constexpr support needs compiler magic
bit_cast(const From& src) noexcept
{
static_assert(std::is_trivially_constructible_v<To>,
"This implementation additionally requires destination type to be trivially constructible");
To dst;
std::memcpy(&dst, &src, sizeof(To));
return dst;
}
template <typename EnumT, typename = std::enable_if_t<std::is_enum<EnumT>{}>>
constexpr std::underlying_type_t<EnumT> to_underlying(EnumT e) noexcept {
return static_cast<std::underlying_type_t<EnumT>>(e);
}
} // namespace std