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
+17 -22
View File
@@ -1,6 +1,8 @@
#pragma once
#include <libremidi/api-c.h>
#include <libremidi/config.hpp>
#include <any>
#include <string_view>
#include <vector>
@@ -9,28 +11,7 @@ namespace libremidi
//! MIDI API specifier arguments.
//! To get information on which feature is supported by each back-end, check their backend file
//! in e.g. backends/winmm.hpp, etc.
enum class API
{
UNSPECIFIED, /*!< Search for a working compiled API. */
// MIDI 1.0 APIs
COREMIDI, /*!< macOS CoreMidi API. */
ALSA_SEQ, /*!< Linux ALSA Sequencer API. */
ALSA_RAW, /*!< Linux Raw ALSA API. */
JACK_MIDI, /*!< JACK Low-Latency MIDI Server API. */
WINDOWS_MM, /*!< Microsoft Multimedia MIDI API. */
WINDOWS_UWP, /*!< Microsoft WinRT MIDI API. */
WEBMIDI, /*!< Web MIDI API through Emscripten */
PIPEWIRE, /*!< PipeWire */
// MIDI 2.0 APIs
ALSA_RAW_UMP, /*!< Raw ALSA API for MIDI 2.0 */
ALSA_SEQ_UMP, /*!< Linux ALSA Sequencer API for MIDI 2.0 */
COREMIDI_UMP, /*!< macOS CoreMidi API for MIDI 2.0. Requires macOS 11+ */
WINDOWS_MIDI_SERVICES, /*!< Windows API for MIDI 2.0. Requires Windows 11 */
DUMMY /*!< A compilable but non-functional API. */
};
using API = libremidi_api;
/**
* \brief A function to determine the available compiled MIDI 1.0 APIs.
@@ -50,6 +31,9 @@ LIBREMIDI_EXPORT std::vector<libremidi::API> available_apis() noexcept;
*/
LIBREMIDI_EXPORT std::vector<libremidi::API> available_ump_apis() noexcept;
LIBREMIDI_EXPORT
libremidi::API midi_api(const std::any& conf);
//! A static function to determine the current version.
LIBREMIDI_EXPORT std::string_view get_version() noexcept;
@@ -60,6 +44,17 @@ LIBREMIDI_EXPORT std::string_view get_api_display_name(libremidi::API api);
//! Look-up an API through its name
LIBREMIDI_EXPORT libremidi::API get_compiled_api_by_name(std::string_view api);
inline constexpr bool is_midi1(libremidi::API api)
{
return (static_cast<int>(api) >= 0x1 && static_cast<int>(api) < 0x1000)
|| api == libremidi::API::DUMMY;
}
inline constexpr bool is_midi2(libremidi::API api)
{
return static_cast<int>(api) >= 0x1000;
}
namespace midi1
{
//! Returns the default MIDI 1.0 backend to use for the target OS.