Skip to content

Commit

Permalink
Add the CoreAudioKit framework
Browse files Browse the repository at this point in the history
  • Loading branch information
madsmtm committed Feb 23, 2025
1 parent 9993914 commit cf6c39c
Show file tree
Hide file tree
Showing 12 changed files with 239 additions and 12 deletions.
22 changes: 11 additions & 11 deletions .github/workflows/ci.yml

Large diffs are not rendered by default.

14 changes: 14 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions crates/objc2/src/topics/about_generated/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- `SystemConfiguration` / `objc2-system-configuration`.
* Added new framework crates:
- `Cinematic` / `objc2-cinematic`.
- `CoreAudioKit` / `objc2-audio-kit`.
- `CoreSpotlight` / `objc2-core-spotlight`.
- `CoreHaptics` / `objc2-core-haptics`.
- `CoreTelephony` / `objc2-core-telephony`.
Expand Down
1 change: 1 addition & 0 deletions crates/objc2/src/topics/about_generated/list_data.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
| `Contacts` | [![`objc2-contacts`](https://badgen.net/crates/v/objc2-contacts)](https://crates.io/crates/objc2-contacts) | [![docs.rs](https://docs.rs/objc2-contacts/badge.svg)](https://docs.rs/objc2-contacts/) |
| `ContactsUI` | [![`objc2-contacts-ui`](https://badgen.net/crates/v/objc2-contacts-ui)](https://crates.io/crates/objc2-contacts-ui) | [![docs.rs](https://docs.rs/objc2-contacts-ui/badge.svg)](https://docs.rs/objc2-contacts-ui/) |
| `CoreAudio` | [![`objc2-core-audio`](https://badgen.net/crates/v/objc2-core-audio)](https://crates.io/crates/objc2-core-audio) | [![docs.rs](https://docs.rs/objc2-core-audio/badge.svg)](https://docs.rs/objc2-core-audio/) |
| `CoreAudioKit` | [![`objc2-core-audio-kit`](https://badgen.net/crates/v/objc2-core-audio-kit)](https://crates.io/crates/objc2-core-audio-kit) | [![docs.rs](https://docs.rs/objc2-core-audio-kit/badge.svg)](https://docs.rs/objc2-core-audio-kit/) |
| `CoreAudioTypes` | [![`objc2-core-audio-types`](https://badgen.net/crates/v/objc2-core-audio-types)](https://crates.io/crates/objc2-core-audio-types) | [![docs.rs](https://docs.rs/objc2-core-audio-types/badge.svg)](https://docs.rs/objc2-core-audio-types/) |
| `CoreBluetooth` | [![`objc2-core-bluetooth`](https://badgen.net/crates/v/objc2-core-bluetooth)](https://crates.io/crates/objc2-core-bluetooth) | [![docs.rs](https://docs.rs/objc2-core-bluetooth/badge.svg)](https://docs.rs/objc2-core-bluetooth/) |
| `CoreData` | [![`objc2-core-data`](https://badgen.net/crates/v/objc2-core-data)](https://crates.io/crates/objc2-core-data) | [![docs.rs](https://docs.rs/objc2-core-data/badge.svg)](https://docs.rs/objc2-core-data/) |
Expand Down
3 changes: 3 additions & 0 deletions crates/test-frameworks/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ test-frameworks = [
"objc2-contacts",
"objc2-contacts-ui",
"objc2-core-audio",
"objc2-core-audio-kit",
"objc2-core-audio-types",
"objc2-core-bluetooth",
"objc2-core-data",
Expand Down Expand Up @@ -267,6 +268,7 @@ objc2-shazam-kit = ["dep:objc2-shazam-kit"]
objc2-safety-kit = ["dep:objc2-safety-kit"]
objc2-core-telephony = ["dep:objc2-core-telephony"]
objc2-core-haptics = ["dep:objc2-core-haptics"]
objc2-core-audio-kit = ["dep:objc2-core-audio-kit"]

[dependencies]
block2 = { path = "../block2" }
Expand Down Expand Up @@ -326,6 +328,7 @@ objc2-automatic-assessment-configuration = { path = "../../framework-crates/objc
objc2-background-assets = { path = "../../framework-crates/objc2-background-assets", optional = true }
objc2-class-kit = { path = "../../framework-crates/objc2-class-kit", optional = true }
objc2-contacts-ui = { path = "../../framework-crates/objc2-contacts-ui", optional = true }
objc2-core-audio-kit = { path = "../../framework-crates/objc2-core-audio-kit", optional = true }
objc2-core-spotlight = { path = "../../framework-crates/objc2-core-spotlight", optional = true }
objc2-file-provider = { path = "../../framework-crates/objc2-file-provider", optional = true }
objc2-file-provider-ui = { path = "../../framework-crates/objc2-file-provider-ui", optional = true }
Expand Down
131 changes: 131 additions & 0 deletions framework-crates/objc2-core-audio-kit/Cargo.toml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions framework-crates/objc2-core-audio-kit/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions framework-crates/objc2-core-audio-kit/src/generated

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 24 additions & 0 deletions framework-crates/objc2-core-audio-kit/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
//! # Bindings to the `CoreAudioKit` framework
//!
//! See [Apple's docs][apple-doc] and [the general docs on framework crates][framework-crates] for more information.
//!
//! [apple-doc]: https://developer.apple.com/documentation/coreaudiokit/
//! [framework-crates]: https://docs.rs/objc2/latest/objc2/topics/about_generated/index.html
#![no_std]
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
// Update in Cargo.toml as well.
#![doc(html_root_url = "https://docs.rs/objc2-core-audio-kit/0.3.0")]

#[cfg(feature = "alloc")]
extern crate alloc;

#[cfg(feature = "std")]
extern crate std;

mod generated;
#[allow(unused_imports, unreachable_pub)]
pub use self::generated::*;

mod view_controller;
#[allow(unused_imports, unreachable_pub)]
pub use self::view_controller::*;
25 changes: 25 additions & 0 deletions framework-crates/objc2-core-audio-kit/src/view_controller.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#![allow(unused_imports)]

use objc2::extern_class;
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
use objc2_app_kit::{NSResponder, NSViewController};
use objc2_foundation::NSObject;

extern_class!(
/// [Apple's documentation](https://developer.apple.com/documentation/coreaudiokit/augenericviewcontroller?language=objc)
#[unsafe(super(NSViewController, NSResponder, NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
pub struct AUGenericViewController;
);

extern_class!(
/// [Apple's documentation](https://developer.apple.com/documentation/coreaudiokit/auviewcontroller?language=objc)
#[unsafe(super(NSViewController, NSResponder, NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
pub struct AUViewController;
);
13 changes: 13 additions & 0 deletions framework-crates/objc2-core-audio-kit/translation-config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
framework = "CoreAudioKit"
crate = "objc2-core-audio-kit"
required-crates = ["objc2", "objc2-foundation"]
custom-lib-rs = true
macos = "10.4"
maccatalyst = "13.0"
ios = "8.0"
visionos = "1.0"

# The original superclass typedef is a bit difficult to extract from the
# superclass name, so let's do it manually.
class.AUViewController.definition-skipped = true
class.AUGenericViewController.definition-skipped = true

0 comments on commit cf6c39c

Please sign in to comment.