Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 73 additions & 0 deletions .github/workflows/mingw.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: MSYS2 build

on: push

jobs:
mingw:
runs-on: windows-latest
strategy:
matrix:
sys:
- mingw64
- ucrt64
- clang64
# - clangarm64

steps:
- name: Check out repository code
uses: actions/checkout@v4
with:
submodules: 'recursive'

- name: Setup msys2 and mingw-w64
uses: msys2/setup-msys2@v2
with:
msystem: ${{matrix.sys}}
update: true
pacboy: >-
cmake:p
ninja:p
toolchain:p
cppwinrt:p
boost:p

- name: Build debug
shell: msys2 {0}
run: |
cmake -S . -B build-debug \
-DCMAKE_BUILD_TYPE=Debug \
-DBUILD_TESTING=1 \
-DLIBREMIDI_EXAMPLES=1 \
-DLIBREMIDI_TESTS=1 \
-DLIBREMIDI_CI=1 \
-DCMAKE_CTEST_ARGUMENTS="--rerun-failed;--output-on-failure" \
-DCMAKE_INSTALL_PREFIX=install

cmake --build build-debug
cmake --build build-debug --target install

- name: Test debug
shell: msys2 {0}
run: |
cmake --build build-debug --target test

- name: Build release
shell: msys2 {0}
run: |
cmake -S . -B build-release \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_TESTING=1 \
-DLIBREMIDI_EXAMPLES=1 \
-DLIBREMIDI_TESTS=1 \
-DLIBREMIDI_CI=1 \
-DCMAKE_CTEST_ARGUMENTS="--rerun-failed;--output-on-failure" \
-DCMAKE_INSTALL_PREFIX=install

cmake --build build-release
cmake --build build-release --target install

- name: Test release
shell: msys2 {0}
run: |
cmake --build build-release --target test

4 changes: 2 additions & 2 deletions cmake/libremidi.deps.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ if(LIBREMIDI_NEEDS_READERWRITERQUEUE AND NOT TARGET readerwriterqueue)

if(NOT readerwriterqueue_FOUND)
FetchContent_Declare(
readerwriterqueue
rwq
GIT_REPOSITORY https://github.com/cameron314/readerwriterqueue
GIT_TAG master
)

FetchContent_MakeAvailable(readerwriterqueue)
FetchContent_MakeAvailable(rwq)
endif()
endif()
5 changes: 5 additions & 0 deletions cmake/libremidi.tests.cmake
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
if(CMAKE_VERSION VERSION_GREATER 3.25)
set(CMAKE_FETCHCONTENT_SYSTEM_KEYWORD "SYSTEM")
endif()

FetchContent_Declare(
Catch2
GIT_REPOSITORY https://github.com/catchorg/Catch2.git
GIT_TAG v3.4.0
${CMAKE_FETCHCONTENT_SYSTEM_KEYWORD}
)

FetchContent_MakeAvailable(Catch2)
Expand Down
2 changes: 1 addition & 1 deletion include/libremidi/backends/winmidi/observer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ class observer_impl final
}

void on_device_updated(
const MidiEndpointDeviceWatcher& e,
const MidiEndpointDeviceWatcher&,
const MidiEndpointDeviceInformationUpdatedEventArgs& result)
{
// OPTIMIZEME
Expand Down
3 changes: 2 additions & 1 deletion include/libremidi/backends/winuwp/midi_in.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ class midi_in_winuwp final
midi_start_timestamp = std::chrono::steady_clock::now();

port_.MessageReceived(
[=](const winrt::Windows::Devices::Midi::IMidiInPort& inputPort,
[this](
const winrt::Windows::Devices::Midi::IMidiInPort&,
const winrt::Windows::Devices::Midi::MidiMessageReceivedEventArgs& args) {
this->process_message(args.Message());
});
Expand Down
11 changes: 6 additions & 5 deletions include/libremidi/backends/winuwp/observer.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#pragma once
#include <libremidi/backends/winuwp/config.hpp>
#include <libremidi/backends/winuwp/helpers.hpp>
#include <libremidi/detail/observer.hpp>

namespace libremidi
Expand Down Expand Up @@ -33,11 +34,11 @@ class observer_winuwp_internal
cbs.emplace_back(tk, f);
return tk;
}

void remove(int tk)
{
auto it = std::remove_if(
cbs.begin(), cbs.end(), [tk](const callback& c) { return c.token == tk; });
auto r = std::distance(it, cbs.end());
cbs.erase(it, cbs.end());
}
};
Expand Down Expand Up @@ -122,7 +123,7 @@ class observer_winuwp_internal
deviceWatcher_.Added(evTokenOnDeviceAdded_);
}

void on_device_added(DeviceWatcher sender, DeviceInformation deviceInfo)
void on_device_added(const DeviceWatcher&, const DeviceInformation& deviceInfo)
{
port_info p;
{
Expand All @@ -133,7 +134,7 @@ class observer_winuwp_internal
portAddedEvent_(p);
}

void on_device_removed(DeviceWatcher sender, DeviceInformationUpdate deviceUpdate)
void on_device_removed(const DeviceWatcher&, const DeviceInformationUpdate& deviceUpdate)
{
const auto id = deviceUpdate.Id();
auto pred = [&id](const port_info& portInfo) { return portInfo.id == id; };
Expand All @@ -152,9 +153,9 @@ class observer_winuwp_internal
portRemovedEvent_(*p);
}

void on_device_updated(DeviceWatcher sender, DeviceInformationUpdate deviceUpdate) { }
void on_device_updated(const DeviceWatcher&, const DeviceInformationUpdate&) { }

void on_device_enumeration_completed(DeviceWatcher sender, IInspectable const&) { }
void on_device_enumeration_completed(const DeviceWatcher&, const IInspectable&) { }

private:
std::vector<port_info> portList_;
Expand Down
Loading