Skip to content

Commit 6a40392

Browse files
committed
Add Apache-2.0 headers to MoonBit sources
1 parent ddc9546 commit 6a40392

99 files changed

Lines changed: 1360 additions & 2 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.beads/issues.jsonl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
{"id":"moon_cpal-da4.1","title":"SupportedStreamConfigRange sample-rate helpers","description":"Add API parity for:\\n- SupportedStreamConfigRange::with_sample_rate(sample_rate) -\u003e SupportedStreamConfig (panics on out-of-range, like upstream)\\n- SupportedStreamConfigRange::try_with_sample_rate(sample_rate) -\u003e SupportedStreamConfig?\\n- SupportedStreamConfigRange::with_max_sample_rate() -\u003e SupportedStreamConfig\\n\\nThen add MoonBit tests that lock the behavior (range check + buffer_size passthrough + sample_format passthrough).","status":"closed","priority":2,"issue_type":"feature","owner":"842376130@qq.com","created_at":"2026-02-02T17:12:38.487017+08:00","created_by":"Milky2018","updated_at":"2026-02-02T17:24:03.894619+08:00","closed_at":"2026-02-02T17:24:03.894619+08:00","close_reason":"Closed","dependencies":[{"issue_id":"moon_cpal-da4.1","depends_on_id":"moon_cpal-da4","type":"parent-child","created_at":"2026-02-02T17:12:38.487723+08:00","created_by":"Milky2018"},{"issue_id":"moon_cpal-da4.1","depends_on_id":"moon_cpal-c8w.3","type":"blocks","created_at":"2026-02-02T17:13:17.048828+08:00","created_by":"Milky2018"},{"issue_id":"moon_cpal-da4.1","depends_on_id":"moon_cpal-da4.2","type":"blocks","created_at":"2026-02-02T17:13:26.680568+08:00","created_by":"Milky2018"}]}
1212
{"id":"moon_cpal-da4.2","title":"Audit upstream core API surface vs MoonBit","description":"From pinned commit in cpal-reference, list which pure-core items are already ported and which are missing (types, methods, constants). Output as a short checklist in a tracked doc (e.g. CORE_PARITY.md) with links to upstream paths/lines.","notes":"Added CORE_PARITY.md checklist (ported/missing/out-of-scope) against pinned upstream commit.","status":"closed","priority":2,"issue_type":"chore","owner":"842376130@qq.com","created_at":"2026-02-02T17:12:38.670291+08:00","created_by":"Milky2018","updated_at":"2026-02-02T17:21:55.085799+08:00","closed_at":"2026-02-02T17:21:55.085799+08:00","close_reason":"Closed","dependencies":[{"issue_id":"moon_cpal-da4.2","depends_on_id":"moon_cpal-da4","type":"parent-child","created_at":"2026-02-02T17:12:38.670947+08:00","created_by":"Milky2018"},{"issue_id":"moon_cpal-da4.2","depends_on_id":"moon_cpal-c8w.3","type":"blocks","created_at":"2026-02-02T17:13:17.218371+08:00","created_by":"Milky2018"}]}
1313
{"id":"moon_cpal-da4.3","title":"Timestamp callback info types","description":"Port cpal core timestamp structs from upstream lib.rs:\\n- InputStreamTimestamp / OutputStreamTimestamp (capture callback/stream instants)\\n- InputCallbackInfo / OutputCallbackInfo wrappers\\n\\nKeep them pure-data + deterministic. Add tests for basic constructors/accessors and StreamInstant interactions.","status":"closed","priority":2,"issue_type":"feature","owner":"842376130@qq.com","created_at":"2026-02-02T17:12:38.844548+08:00","created_by":"Milky2018","updated_at":"2026-02-02T17:25:31.88416+08:00","closed_at":"2026-02-02T17:25:31.88416+08:00","close_reason":"Closed","dependencies":[{"issue_id":"moon_cpal-da4.3","depends_on_id":"moon_cpal-da4","type":"parent-child","created_at":"2026-02-02T17:12:38.845147+08:00","created_by":"Milky2018"},{"issue_id":"moon_cpal-da4.3","depends_on_id":"moon_cpal-c8w.3","type":"blocks","created_at":"2026-02-02T17:13:17.379834+08:00","created_by":"Milky2018"},{"issue_id":"moon_cpal-da4.3","depends_on_id":"moon_cpal-da4.2","type":"blocks","created_at":"2026-02-02T17:13:26.846768+08:00","created_by":"Milky2018"}]}
14-
{"id":"moon_cpal-uao","title":"CPAL upstream parity (native-only)","description":"Track full file-by-file parity with cpal-reference (native-only) including porting upstream unit tests and matching behavior. Use bd tasks for each upstream module/test chunk; ship versions via moon publish.","status":"open","priority":2,"issue_type":"epic","owner":"842376130@qq.com","created_at":"2026-02-02T17:52:33.315241+08:00","created_by":"Milky2018","updated_at":"2026-02-04T21:30:39.516918+08:00"}
14+
{"id":"moon_cpal-uao","title":"CPAL upstream parity (native-only)","description":"Track full file-by-file parity with cpal-reference (native-only) including porting upstream unit tests and matching behavior. Use bd tasks for each upstream module/test chunk; ship versions via moon publish.","status":"open","priority":2,"issue_type":"epic","owner":"842376130@qq.com","created_at":"2026-02-02T17:52:33.315241+08:00","created_by":"Milky2018","updated_at":"2026-02-04T21:30:39.516918+08:00","comments":[{"id":10,"issue_id":"moon_cpal-uao","author":"Milky2018","text":"Maintenance: prepended Apache-2.0 copyright/license header to all .mbt source files (2025 International Digital Economy Academy). Published 0.9.1.","created_at":"2026-02-05T04:35:26Z"}]}
1515
{"id":"moon_cpal-uao.1","title":"Core public API (HostId/DeviceId/traits/errors)","description":"Port the public surface needed for cross-platform code: HostId/DeviceId, error model, and trait-like Host/Device/Stream APIs. Keep deterministic parts fully tested.","status":"closed","priority":2,"issue_type":"epic","owner":"842376130@qq.com","created_at":"2026-02-02T17:52:49.924281+08:00","created_by":"Milky2018","updated_at":"2026-02-03T19:39:13.524686+08:00","closed_at":"2026-02-03T19:39:13.524686+08:00","close_reason":"All child tasks complete: core public API (HostId/DeviceId/errors/platform wrappers) implemented.","dependencies":[{"issue_id":"moon_cpal-uao.1","depends_on_id":"moon_cpal-uao","type":"parent-child","created_at":"2026-02-02T17:52:49.925042+08:00","created_by":"Milky2018"}]}
1616
{"id":"moon_cpal-uao.1.1","title":"Core API spec skeleton","description":"Add spec.mbt with declaration-only stubs for Host/Device/Stream surface to guide incremental implementation. Keep implementation in separate files.","notes":"2026-02-02: Add spec/ package and root helper constructors to avoid read-only suberror constructors across packages.","status":"closed","priority":2,"issue_type":"chore","owner":"842376130@qq.com","created_at":"2026-02-02T17:53:03.479308+08:00","created_by":"Milky2018","updated_at":"2026-02-02T18:39:17.118618+08:00","closed_at":"2026-02-02T18:39:17.118618+08:00","close_reason":"spec/ contract package added; cross-package error constructors fixed; moon test native/wasm green","dependencies":[{"issue_id":"moon_cpal-uao.1.1","depends_on_id":"moon_cpal-uao.1","type":"parent-child","created_at":"2026-02-02T17:53:03.479977+08:00","created_by":"Milky2018"}]}
1717
{"id":"moon_cpal-uao.1.2","title":"DeviceId + parsing","description":"Port DeviceId (HostId + String) with Display/FromStr-like helpers, and DeviceIdError. Add tests for parsing, formatting, and error cases.","notes":"Implemented DeviceId + DeviceIdError + parsing/formatting tests.","status":"closed","priority":2,"issue_type":"feature","owner":"842376130@qq.com","created_at":"2026-02-02T17:53:03.662985+08:00","created_by":"Milky2018","updated_at":"2026-02-02T18:04:14.679822+08:00","closed_at":"2026-02-02T18:04:14.679822+08:00","close_reason":"Closed","dependencies":[{"issue_id":"moon_cpal-uao.1.2","depends_on_id":"moon_cpal-uao.1","type":"parent-child","created_at":"2026-02-02T17:53:03.663659+08:00","created_by":"Milky2018"}]}

alsa/alsa_config_test.mbt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
// Copyright 2025 International Digital Economy Academy
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
115
///|
216
test "alsa default config matches supported configs (best-effort)" {
317
if @core.native_os() != @core.NativeOs::Linux {

alsa/alsa_enumerate_test.mbt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
// Copyright 2025 International Digital Economy Academy
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
115
///|
216
test "alsa: devices includes default (linux-only)" {
317
if @core.native_os() != @core.NativeOs::Linux {

alsa/buffer_fixed_semantics_wbtest.mbt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
// Copyright 2025 International Digital Economy Academy
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
115
///|
216
test "alsa fixed buffer 0 is stream_config_not_supported (best-effort)" {
317
if @core.native_os() != @core.NativeOs::Linux {

alsa/callback_timing_wbtest.mbt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
// Copyright 2025 International Digital Economy Academy
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
115
///|
216
test "alsa callback timestamps + format tags" {
317
let want_cb = @core.StreamInstant::new(1, 2)

alsa/error_mapping_wbtest.mbt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
// Copyright 2025 International Digital Economy Academy
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
115
///|
216
test "alsa errno mapping (unit)" {
317
if @core.native_os() != @core.NativeOs::Linux {

alsa/ffi_native.mbt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
// Copyright 2025 International Digital Economy Academy
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
115
///|
216
/// Native FFI hooks for ALSA.
317
///

alsa/host.mbt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
// Copyright 2025 International Digital Economy Academy
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
115
///|
216
/// ALSA backend (Linux).
317
///

alsa/stream_callback_bridge.mbt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
// Copyright 2025 International Digital Economy Academy
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
115
///|
216
/// Trampolines used to bridge native ALSA stream worker threads (C) to MoonBit closures.
317

alsa/stream_lifecycle_test.mbt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
// Copyright 2025 International Digital Economy Academy
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
115
///|
216
extern "C" fn sleep_ms(ms : Int) -> Unit = "moon_cpal_sleep_ms"
317

0 commit comments

Comments
 (0)