Skip to content

Commit 068811a

Browse files
release: v0.3.1
ESP Component Registry support. Adds an `idf_component.yml` at the root (description, version, license, maintainers, tags, and `dependencies.sauloverissimo/midi2 >= 0.3.4` + `idf >= 5.0`) and an `if(ESP_PLATFORM)` gate in CMakeLists.txt that routes to `idf_component_register(SRCS src/midi2_*.cpp INCLUDE_DIRS src REQUIRES midi2)` with `cxx_std_17`. ESP-IDF consumers can now write: dependencies: sauloverissimo/midi2cpp: ">=0.3.1" instead of pinning a git tag, and the Component Manager resolves the midi2 C99 dependency transitively. Native CMake (find_package / FetchContent / add_subdirectory), PlatformIO, and Arduino consumers are untouched -- the ESP-IDF gate only fires when `ESP_PLATFORM` is set. Verified locally: cmake configure + ctest 7/7 pass.
1 parent 3177103 commit 068811a

5 files changed

Lines changed: 89 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,35 @@ All notable changes to `midi2cpp` are recorded here. Format follows
55
adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html),
66
mirrored from the upstream midi2 C99 policy.
77

8+
## [0.3.1]
9+
10+
ESP Component Registry support. midi2cpp now ships an `idf_component.yml`
11+
at the root and an `if(ESP_PLATFORM)` gate in `CMakeLists.txt`, so
12+
ESP-IDF projects can pull it through the official Espressif registry
13+
with semver constraints instead of hard-pinning a git tag.
14+
15+
### Added
16+
17+
- **`idf_component.yml`** at the repo root (description, version,
18+
url, license, maintainers, tags, and `dependencies.sauloverissimo/midi2`
19+
+ `idf >= 5.0`). Uploaded to https://components.espressif.com/components/sauloverissimo/midi2cpp
20+
- **ESP-IDF gate** at the top of `CMakeLists.txt`: when `ESP_PLATFORM`
21+
is set, calls `idf_component_register(SRCS src/midi2_*.cpp INCLUDE_DIRS src REQUIRES midi2)`
22+
with `cxx_std_17` and returns before `project()` runs. Native CMake
23+
consumers (Pico SDK, vcpkg, FetchContent, system installs) are
24+
unaffected by the gate.
25+
26+
### Install (ESP-IDF, new)
27+
28+
```yaml
29+
# main/idf_component.yml
30+
dependencies:
31+
sauloverissimo/midi2cpp: ">=0.3.1"
32+
```
33+
34+
The Component Manager pulls midi2cpp from the registry; midi2 is
35+
resolved transitively (declared in midi2cpp's own `idf_component.yml`).
36+
837
## [0.3.0]
938

1039
Renamed from `midi2_cpp` to `midi2cpp` in deference to [`starfishmod/MIDI2_CPP`](https://github.com/starfishmod/MIDI2_CPP) (maintained since 2021 by Andrew Mee, MIDI Association TSB Rep), which operates in the same domain. Keeping the namespaces disjoint avoids confusion in package managers and search.

CMakeLists.txt

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,26 @@
11
cmake_minimum_required(VERSION 3.14)
2-
project(midi2cpp VERSION 0.3.0 LANGUAGES C CXX)
2+
3+
# ESP-IDF Component Manager path. When IDF resolves this directory as
4+
# a component (clone under managed_components/midi2cpp + idf_component.yml
5+
# at the root), it sets ESP_PLATFORM before processing this file. Route
6+
# to idf_component_register and skip the rest, leaving the native CMake
7+
# build (project / install / export / find_package fallback) untouched
8+
# for every other consumer.
9+
if(ESP_PLATFORM)
10+
idf_component_register(
11+
SRCS
12+
src/midi2_device.cpp
13+
src/midi2_ci.cpp
14+
src/midi2_host.cpp
15+
src/midi2_bridge.cpp
16+
INCLUDE_DIRS src
17+
REQUIRES midi2
18+
)
19+
target_compile_features(${COMPONENT_LIB} PUBLIC cxx_std_17)
20+
return()
21+
endif()
22+
23+
project(midi2cpp VERSION 0.3.1 LANGUAGES C CXX)
324

425
set(CMAKE_C_STANDARD 99)
526
set(CMAKE_C_STANDARD_REQUIRED ON)

idf_component.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
## ESP-IDF Component Manager manifest.
2+
##
3+
## Lets ESP-IDF projects pull midi2cpp directly from the
4+
## ESP Component Registry without vendoring src/ into the
5+
## consumer tree:
6+
##
7+
## # in your_app/main/idf_component.yml
8+
## dependencies:
9+
## sauloverissimo/midi2cpp: ">=0.3.1"
10+
##
11+
## The Component Manager clones midi2cpp into managed_components/,
12+
## ESP-IDF picks it up as a component because the top-level CMakeLists
13+
## detects ESP_PLATFORM and calls idf_component_register at the top of
14+
## the file. midi2 (the C99 core) is pulled transitively because it
15+
## is declared in the dependencies block below.
16+
17+
description: "C++17 callback-first wrapper for MIDI 2.0 on embedded devices, layered over the portable midi2 C99 library. Covers UMP transport (M2-104), MIDI-CI with Appendix E (M2-101), Property Exchange Subscribe/Notify, Profile Configuration, Process Inquiry, Flex Data, and Bit Scaling (M2-115)."
18+
version: "0.3.1"
19+
url: "https://github.com/sauloverissimo/midi2cpp"
20+
documentation: "https://github.com/sauloverissimo/midi2cpp#readme"
21+
issues: "https://github.com/sauloverissimo/midi2cpp/issues"
22+
license: "MIT"
23+
maintainers:
24+
- "Saulo Verissimo <sauloverissimo@gmail.com>"
25+
tags:
26+
- midi
27+
- midi2
28+
- ump
29+
- usb
30+
- capability-inquiry
31+
- property-exchange
32+
- cpp17
33+
34+
dependencies:
35+
idf: ">=5.0"
36+
sauloverissimo/midi2: ">=0.3.4"

library.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "midi2cpp",
3-
"version": "0.3.0",
3+
"version": "0.3.1",
44
"description": "C++17 Arduino-style wrapper for MIDI 2.0 on embedded devices. Thin wrapper over the portable midi2 C99 library. Covers UMP, MIDI-CI with Appendix E, Profile, PE Subscribe/Notify, Process Inquiry, Flex Data, and Bit Scaling. Targets RP2040, RP2350, Teensy, ESP32 family, nRF52, and SAMD21.",
55
"keywords": "midi, midi2, usb, ump, capability-inquiry, property-exchange, profile",
66
"authors": [

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=midi2cpp
2-
version=0.3.0
2+
version=0.3.1
33
author=Saulo Verissimo <sauloverissimo@gmail.com>
44
maintainer=Saulo Verissimo <sauloverissimo@gmail.com>
55
sentence=C++17 Arduino-style wrapper for MIDI 2.0 on embedded devices.

0 commit comments

Comments
 (0)