upgrade to libremidi 5.1, raylib and raygui latest

This commit is contained in:
Sebastian @ HfG
2025-06-13 19:16:35 +02:00
parent 62454960d1
commit 2cc6839009
112 changed files with 6484 additions and 1946 deletions
+18 -18
View File
@@ -212,7 +212,7 @@ public:
.count();
}
int process_event(const snd_seq_event_t& ev)
int64_t process_event(const snd_seq_event_t& ev)
{
if constexpr (ConfigurationImpl::midi_version == 1)
{
@@ -258,17 +258,17 @@ public:
return 0;
}
int process_events()
int64_t process_events()
{
if constexpr (ConfigurationImpl::midi_version == 1)
{
snd_seq_event_t* ev{};
event_handle handle{snd};
int result = 0;
int64_t result = 0;
if ((result = snd.seq.event_input(seq, &ev)) > 0)
{
handle.reset(ev);
if (int err = process_event(*ev); err < 0)
if (auto err = process_event(*ev); err < 0)
{
return err;
}
@@ -353,7 +353,7 @@ public:
midi_in_alsa_threaded(ConfigurationBase&& conf, ConfigurationImpl&& apiconf)
: midi_in_impl<ConfigurationBase, ConfigurationImpl>{std::move(conf), std::move(apiconf)}
{
if (this->termination_event < 0)
if (this->m_termination_event < 0)
{
this->libremidi_handle_error(this->configuration, "error creating eventfd.");
return;
@@ -364,7 +364,7 @@ public:
~midi_in_alsa_threaded()
{
this->close_port();
midi_in_alsa_threaded::close_port();
this->client_open_ = std::errc::not_connected;
}
@@ -399,7 +399,7 @@ private:
{
try
{
this->thread = std::thread([this] { thread_handler(); });
this->m_thread = std::thread([this] { thread_handler(); });
return stdx::error{};
}
catch (const std::system_error& e)
@@ -415,12 +415,12 @@ private:
stdx::error stop_thread()
{
termination_event.notify();
m_termination_event.notify();
if (this->thread.joinable())
this->thread.join();
if (this->m_thread.joinable())
this->m_thread.join();
termination_event.consume();
m_termination_event.consume();
return stdx::error{};
}
@@ -428,7 +428,7 @@ private:
{
int poll_fd_count = alsa_data::snd.seq.poll_descriptors_count(this->seq, POLLIN) + 1;
auto poll_fds = (struct pollfd*)alloca(poll_fd_count * sizeof(struct pollfd));
poll_fds[0] = this->termination_event;
poll_fds[0] = this->m_termination_event;
alsa_data::snd.seq.poll_descriptors(this->seq, poll_fds + 1, poll_fd_count - 1, POLLIN);
const auto period
@@ -439,10 +439,10 @@ private:
if (alsa_data::snd.seq.event_input_pending(this->seq, 1) == 0)
{
// No data pending
if (poll(poll_fds, poll_fd_count, period) >= 0)
if (poll(poll_fds, poll_fd_count, static_cast<int32_t>(period)) >= 0)
{
// We got our stop-thread signal
if (termination_event.ready(poll_fds[0]))
if (m_termination_event.ready(poll_fds[0]))
{
break;
}
@@ -450,7 +450,7 @@ private:
continue;
}
int res{};
int64_t res{};
if constexpr (ConfigurationImpl::midi_version == 1)
{
res = this->process_events();
@@ -467,8 +467,8 @@ private:
}
}
std::thread thread{};
eventfd_notifier termination_event{};
std::thread m_thread{};
eventfd_notifier m_termination_event{};
};
template <typename ConfigurationBase, typename ConfigurationImpl>
@@ -497,7 +497,7 @@ public:
return 0;
}
~midi_in_alsa_manual() { this->close_port(); }
~midi_in_alsa_manual() { midi_in_alsa_manual::close_port(); }
stdx::error open_port(const input_port& pt, std::string_view local_port_name) override
{