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 -9
View File
@@ -5,7 +5,6 @@
#include <libremidi/ump.hpp>
#include <functional>
#include <string>
namespace libremidi
{
@@ -41,19 +40,23 @@ enum timestamp_mode
using timestamp = int64_t;
using message_callback = std::function<void(message&& message)>;
using raw_callback = std::function<void(std::span<uint8_t>, timestamp)>;
using raw_callback = std::function<void(std::span<const uint8_t>, timestamp)>;
using timestamp_callback = std::function<timestamp(timestamp)>;
struct input_configuration
{
//! Set a callback function to be invoked for incoming MIDI messages.
//! Mandatory!
message_callback on_message;
//! Either this or on_raw_message must be set
message_callback on_message{};
//! Invoked for incoming MIDI bytes. No transformation, no filtering, no packetization,
//! just the MIDI data straight from the source.
raw_callback on_raw_data{};
//! Set a custom callback function to be invoked for timestamping MIDI messages.
//! Input: the API provided timestamp in nanoseconds, if available, for reference.
//! (e.g. the same as "Absolute").
//! Mandatory if timestamps == timestamp_mode::Custom, unused otherwise.
timestamp_callback get_timestamp;
timestamp_callback get_timestamp{};
//! Set an error callback function to be invoked when an error has occured.
/*!
@@ -61,7 +64,7 @@ struct input_configuration
best to set the error callback function before opening a port.
*/
midi_error_callback on_error{};
midi_error_callback on_warning{};
midi_warning_callback on_warning{};
//! Specify whether certain MIDI message types should be queued or ignored
//! during input.
@@ -81,16 +84,22 @@ struct input_configuration
};
using ump_callback = std::function<void(ump&&)>;
using raw_ump_callback = std::function<void(std::span<const uint32_t>, timestamp)>;
struct ump_input_configuration
{
//! Set a callback function to be invoked for incoming UMP messages.
ump_callback on_message;
//! Either this or on_raw_message must be set
ump_callback on_message{};
//! Invoked for incoming UMP bytes. No transformation, no filtering, no packetization,
//! just the UMP data straight from the source.
raw_ump_callback on_raw_data{};
//! Set a custom callback function to be invoked for timestamping MIDI messages.
//! Input: the API provided timestamp in nanoseconds, if available, for reference.
//! (e.g. the same as "Absolute").
//! Mandatory if timestamps == timestamp_mode::Custom, unused otherwise.
timestamp_callback get_timestamp;
timestamp_callback get_timestamp{};
//! Set an error callback function to be invoked when an error has occured.
/*!
@@ -98,7 +107,7 @@ struct ump_input_configuration
best to set the error callback function before opening a port.
*/
midi_error_callback on_error{};
midi_error_callback on_warning{};
midi_warning_callback on_warning{};
//! Specify whether certain MIDI message types should be queued or ignored
//! during input.