libremidi update to v5.4.3 and added virtual midi out as default
This commit is contained in:
@@ -2,12 +2,15 @@
|
||||
#include <libremidi/config.hpp>
|
||||
|
||||
#include <string>
|
||||
|
||||
#if !defined(BOOST_ASIO_IO_CONTEXT_HPP)
|
||||
namespace boost::asio
|
||||
{
|
||||
struct io_context;
|
||||
}
|
||||
#endif
|
||||
|
||||
namespace libremidi::net
|
||||
NAMESPACE_LIBREMIDI::net
|
||||
{
|
||||
enum class protocol
|
||||
{
|
||||
@@ -46,7 +49,7 @@ struct dgram_observer_configuration
|
||||
|
||||
}
|
||||
|
||||
namespace libremidi::net_ump
|
||||
NAMESPACE_LIBREMIDI::net_ump
|
||||
{
|
||||
enum class protocol
|
||||
{
|
||||
|
||||
@@ -23,7 +23,7 @@ public:
|
||||
|
||||
string_ref message(const error& e) const noexcept override {
|
||||
auto err = e.m_value;
|
||||
|
||||
|
||||
}
|
||||
|
||||
[[noreturn]] void throw_exception(const error& e) const override
|
||||
@@ -35,38 +35,41 @@ public:
|
||||
*/
|
||||
}
|
||||
|
||||
namespace libremidi
|
||||
NAMESPACE_LIBREMIDI
|
||||
{
|
||||
template <typename T>
|
||||
struct optionally_owned
|
||||
{
|
||||
public:
|
||||
explicit optionally_owned(T* maybe_existing)
|
||||
: storage{.ref = maybe_existing}
|
||||
: m_storage{.ref = maybe_existing}
|
||||
{
|
||||
if (storage.ref)
|
||||
if (m_storage.ref)
|
||||
{
|
||||
ownership = unowned;
|
||||
m_ownership = unowned;
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
std::destroy_at(&storage.ref);
|
||||
std::construct_at<T>(reinterpret_cast<T*>(storage.object));
|
||||
ownership = owned;
|
||||
std::destroy_at(&m_storage.ref);
|
||||
std::construct_at<T>(reinterpret_cast<T*>(m_storage.object));
|
||||
m_ownership = owned;
|
||||
}
|
||||
}
|
||||
|
||||
~optionally_owned()
|
||||
{
|
||||
if (is_owned())
|
||||
std::destroy_at(reinterpret_cast<T*>(storage.object));
|
||||
std::destroy_at(reinterpret_cast<T*>(m_storage.object));
|
||||
}
|
||||
|
||||
T& get() noexcept { return *(is_owned() ? reinterpret_cast<T*>(&storage.object) : storage.ref); }
|
||||
T& get() noexcept
|
||||
{
|
||||
return *(is_owned() ? reinterpret_cast<T*>(&m_storage.object) : m_storage.ref);
|
||||
}
|
||||
const T& get() const noexcept
|
||||
{
|
||||
return *(is_owned() ? reinterpret_cast<T*>(&storage.object) : storage.ref);
|
||||
return *(is_owned() ? reinterpret_cast<T*>(&m_storage.object) : m_storage.ref);
|
||||
}
|
||||
|
||||
optionally_owned(const optionally_owned&) = delete;
|
||||
@@ -74,18 +77,18 @@ public:
|
||||
optionally_owned& operator=(const optionally_owned&) = delete;
|
||||
optionally_owned& operator=(optionally_owned&&) noexcept = delete;
|
||||
|
||||
bool is_owned() const noexcept { return ownership == owned; }
|
||||
bool is_owned() const noexcept { return m_ownership == owned; }
|
||||
|
||||
private:
|
||||
union
|
||||
{
|
||||
alignas(T) unsigned char object[sizeof(T)];
|
||||
T* ref;
|
||||
} storage;
|
||||
} m_storage;
|
||||
enum
|
||||
{
|
||||
owned,
|
||||
unowned
|
||||
} ownership{};
|
||||
} m_ownership{};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -4,7 +4,8 @@
|
||||
#include <libremidi/detail/midi_in.hpp>
|
||||
#include <libremidi/detail/midi_stream_decoder.hpp>
|
||||
|
||||
namespace libremidi
|
||||
#include <thread>
|
||||
NAMESPACE_LIBREMIDI
|
||||
{
|
||||
template <typename Impl, typename F>
|
||||
struct osc_parser
|
||||
@@ -114,7 +115,7 @@ struct osc_parser
|
||||
|
||||
}
|
||||
|
||||
namespace libremidi::net
|
||||
NAMESPACE_LIBREMIDI::net
|
||||
{
|
||||
|
||||
struct osc_parser_midi1
|
||||
@@ -219,8 +220,6 @@ public:
|
||||
return {};
|
||||
}
|
||||
|
||||
stdx::error set_port_name(std::string_view) override { return stdx::error{}; }
|
||||
|
||||
timestamp absolute_timestamp() const noexcept override
|
||||
{
|
||||
return std::chrono::steady_clock::now().time_since_epoch().count();
|
||||
@@ -265,7 +264,7 @@ public:
|
||||
};
|
||||
}
|
||||
|
||||
namespace libremidi::net_ump
|
||||
NAMESPACE_LIBREMIDI::net_ump
|
||||
{
|
||||
struct osc_parser_midi2
|
||||
{
|
||||
@@ -394,8 +393,6 @@ public:
|
||||
return {};
|
||||
}
|
||||
|
||||
stdx::error set_port_name(std::string_view) override { return stdx::error{}; }
|
||||
|
||||
timestamp absolute_timestamp() const noexcept override
|
||||
{
|
||||
return std::chrono::steady_clock::now().time_since_epoch().count();
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#include <boost/asio/ip/udp.hpp>
|
||||
#include <boost/endian.hpp>
|
||||
|
||||
namespace libremidi::net
|
||||
NAMESPACE_LIBREMIDI::net
|
||||
{
|
||||
|
||||
struct osc_midi1_packet
|
||||
@@ -146,7 +146,7 @@ public:
|
||||
|
||||
}
|
||||
|
||||
namespace libremidi::net_ump
|
||||
NAMESPACE_LIBREMIDI::net_ump
|
||||
{
|
||||
struct osc_midi2_packet
|
||||
{
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
#pragma once
|
||||
#include <libremidi/backends/dummy.hpp>
|
||||
|
||||
namespace libremidi::net
|
||||
NAMESPACE_LIBREMIDI::net
|
||||
{
|
||||
using net_observer_configuration = libremidi::dummy_configuration;
|
||||
using observer = libremidi::observer_dummy;
|
||||
}
|
||||
|
||||
namespace libremidi::net_ump
|
||||
NAMESPACE_LIBREMIDI::net_ump
|
||||
{
|
||||
using net_observer_configuration = libremidi::dummy_configuration;
|
||||
using observer = libremidi::observer_dummy;
|
||||
|
||||
Reference in New Issue
Block a user