working on win32 uwp! and libremidi update

This commit is contained in:
Sebastian @ HfG
2024-10-28 19:24:18 +01:00
parent 06cb6d8319
commit 1e3755148c
106 changed files with 8474 additions and 2198 deletions
+18 -5
View File
@@ -1,7 +1,12 @@
#pragma once
#include <libremidi/config.hpp>
#include <algorithm>
#include <span>
#include <vector>
#if defined(__cpp_exceptions)
#include <stdexcept>
#endif
namespace libremidi
{
@@ -120,7 +125,7 @@ struct message
{
#if defined(__cpp_exceptions)
if (channel <= 0 || channel > 16)
throw std::range_error("message::uses_channel: out of range");
throw std::range_error("out of range");
#endif
return ((bytes[0] & 0xF) == channel - 1) && ((bytes[0] & 0xF0) != 0xF0);
}
@@ -240,7 +245,9 @@ struct meta_events
static_cast<uint8_t>(mpqn)};
}
static message time_signature(int numerator, int denominator)
static message time_signature(
int numerator, int denominator, int clocks_per_click = 1,
int notated_32nd_notes_per_beat = 96)
{
int n = 1;
int powTwo = 0;
@@ -251,8 +258,14 @@ struct meta_events
++powTwo;
}
return {0xff, 0x58, 0x04, static_cast<uint8_t>(numerator), static_cast<uint8_t>(powTwo),
1, 96};
return {
0xff,
0x58,
0x04,
static_cast<uint8_t>(numerator),
static_cast<uint8_t>(powTwo),
static_cast<uint8_t>(clocks_per_click),
static_cast<uint8_t>(notated_32nd_notes_per_beat)};
}
// Where key index goes from -7 (7 flats, C♭ Major) to +7 (7 sharps, C♯
@@ -261,7 +274,7 @@ struct meta_events
{
#if defined(__cpp_exceptions)
if (keyIndex < -7 || keyIndex > 7)
throw std::range_error("meta_events::key_signature: out of range");
throw std::range_error("out of range");
#endif
return {
0xff, 0x59, 0x02, static_cast<uint8_t>(keyIndex),