Skip to content

Commit d97ab35

Browse files
committed
android: add ci worfklow
1 parent f855e27 commit d97ab35

File tree

4 files changed

+60
-6
lines changed

4 files changed

+60
-6
lines changed

.github/workflows/android.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Android Build
2+
3+
on:
4+
push:
5+
paths-ignore:
6+
- 'docs/**'
7+
- '**.md'
8+
pull_request:
9+
paths-ignore:
10+
- '**.md'
11+
- 'docs/**'
12+
13+
jobs:
14+
build:
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- uses: actions/setup-java@v4
21+
with:
22+
java-version: '17'
23+
distribution: 'temurin'
24+
25+
- uses: android-actions/setup-android@v3
26+
27+
- run: yes | sdkmanager --licenses || true
28+
29+
- run: |
30+
sdkmanager --install "platforms;android-34"
31+
sdkmanager --install "build-tools;34.0.0"
32+
sdkmanager --install "ndk;25.2.9519653"
33+
sdkmanager --install "cmake;3.22.1"
34+
35+
- uses: actions/cache@v4
36+
with:
37+
path: |
38+
~/.gradle/caches
39+
~/.gradle/wrapper
40+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
41+
restore-keys: |
42+
${{ runner.os }}-gradle-
43+
44+
- run: chmod +x examples/android/gradlew
45+
46+
- run: |
47+
cd examples/android
48+
./gradlew assembleDebug --no-daemon
49+

.github/workflows/build_cmake.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ on:
99
paths-ignore:
1010
- '**.md'
1111
- 'docs/**'
12+
1213
jobs:
1314
build:
1415
name: ${{ matrix.config.name }}

.github/workflows/mingw.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
name: MSYS2 build
22

3-
on: push
3+
on:
4+
push:
5+
paths-ignore:
6+
- 'docs/**'
7+
- '**.md'
8+
pull_request:
9+
paths-ignore:
10+
- '**.md'
11+
- 'docs/**'
412

513
jobs:
614
mingw:

include/libremidi/backends/android/midi_in.hpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -148,13 +148,9 @@ class midi_in
148148

149149
if (num_messages > 0 && num_bytes > 0)
150150
{
151-
libremidi::message msg;
152-
msg.bytes.assign(buffer, buffer + num_bytes);
153-
msg.timestamp = timestamp / 1000000.0; // Convert nanoseconds to milliseconds
154-
155151
const auto to_ns = [=] { return timestamp; };
156152

157-
m_processing.on_bytes(
153+
m_processing.on_bytes_multi(
158154
{buffer, buffer + num_bytes},
159155
m_processing.timestamp<timestamp_info>(to_ns, timestamp));
160156
}

0 commit comments

Comments
 (0)