xamarin / xamarin-macios

.NET for iOS, Mac Catalyst, macOS, and tvOS provide open-source bindings of the Apple SDKs for use with .NET managed languages such as C#
Other
2.45k stars 511 forks source link

Improve the AudioToolbox API #6411

Open rolfbjarne opened 5 years ago

rolfbjarne commented 5 years ago

Our AudioToolbox API is not very well written.

One example is that there are plain IntPtrs everywhere, and customers are expected to figure out what they mean. One example of a struggling customers: https://github.com/xamarin/xamarin-macios/issues/6410.

Example: https://github.com/xamarin/xamarin-macios/blob/82a1f814b388c49943cfdaf1eb30c00eafb8958c/src/AudioToolbox/AudioQueue.cs#L497

We should go through the entire framework and come up with something much better.

User idea: add Span APIs: https://github.com/xamarin/xamarin-macios/issues/3590#issuecomment-505265409

jwosty commented 5 years ago

I am extremely interested in this. This would seriously be amazing. It's extremely difficult to get your first audio program working, because of all the pointer stuff that's so easy to get subtly wrong. And C# of course does not help in this regard.

Maybe it's a good idea to make new versions of stuff that would be opt-in, kind of like System.Collections vs System.Collections.Generic. That way you could have the chance to really get it right this time.

I'd be interested in helping making this happen. Perhaps I'll fork to explore some approaches if I have the time to

rolfbjarne commented 5 years ago

@jwosty contributions are always welcome :) Especially since due to Xcode 11 and all the new API we have to bind (like every summer), it will likely take a while until we have time to look at this.

Hint: the best way to start is usually writing a sample app that exercises the API you want to consume/create (a sample app would also most likely be a requirement for us to be able to accept any contributions).

Also have in mind that we're very strict on backwards compatibility in the API: the existing API must not be modified, you can only build upon it (if you look at the source code you'll see a lot of conditional XAMCORE_4_0 statements: this is our way of marking places where we would break backwards compatibility if we ever could, but there's no guarantee that will ever happen).

Msoblivious7 commented 5 years ago

I’m having an issue with people being able to see everything I do on my phone can you help me write something that disables their access? PLEASE