Re: Thunderbolt port audio programmability
> On Mar 12, 2020, at 11:13 AM, Jens Alfke wrote: > > >> On Mar 12, 2020, at 10:27 AM, Carl Hoefs via Cocoa-dev >> mailto:cocoa-dev@lists.apple.com>> wrote: >> >> I'm looking at creating an iPhone/iPad app that acts as a dual-channel >> waveform generator. >> >> I see two options for the output signal medium: >> (a) using the audio jack (on suitable devices), or >> (b) using the Thunderbolt port > > Wait … you mean Lightning, right? That's the dock connector on iOS devices. > Thunderbolt is a super-high-speed data connection on Macs. > > On devices without a headphone jack, you can use the $10 dongle that plugs > into the Lightning connector and has a headphone jack on the other end. [Yes, I meant Lightning. But since it's a serial digital bus, it won't be able to issue the generated waveform signals directly, so the audio port would seem to be the way to go.] In iOS, what is the current way to generate precise audio tones? AVFoundation? CoreAudio? AudioUnits? -Carl ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Can't delete file on external disk
> > Are you using startAccessingSecurityScopedResource? Sorry I forgot to mention: yes, I do startAccessingSecurityScopedResource. Also, reading the files works just fine. (Haven't tried writing on them, because that is of no concern in my app. Just reading or deleting.) Best regards, Gabriel ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Thunderbolt port audio programmability
> On Mar 12, 2020, at 10:27 AM, Carl Hoefs via Cocoa-dev > wrote: > > I'm looking at creating an iPhone/iPad app that acts as a dual-channel > waveform generator. > > I see two options for the output signal medium: > (a) using the audio jack (on suitable devices), or > (b) using the Thunderbolt port Wait … you mean Lightning, right? That's the dock connector on iOS devices. Thunderbolt is a super-high-speed data connection on Macs. On devices without a headphone jack, you can use the $10 dongle that plugs into the Lightning connector and has a headphone jack on the other end. —Jens ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Can't delete file on external disk
On 3/12/20 9:55 AM, Gabriel Zachmann via Cocoa-dev wrote: In my app, I collect lists of files that reside on an external disk. When the user opens the directory of the files, I create a security-scoped bookmark like this: directoryBookmark_ = [dir bookmarkDataWithOptions: NSURLBookmarkCreationWithSecurityScope includingResourceValuesForKeys: nil relativeToURL: nil error: &systemError]; Next time, the app runs, I resolve the bookmark like this: directoryLocation_ = [NSURL URLByResolvingBookmarkData: directoryBookmark_ options: NSURLBookmarkResolutionWithSecurityScope relativeToURL: nil bookmarkDataIsStale: & isStale error: & error]; At some later point, my app wants to delete one of the files in that directory (or sub-directory), like this: NSString * abs_path = [self absolutePathFor: filename_]; BOOL success = [self deleteFile: abs_path ]; This does not work. In the log, I get the error message: Failed to delete /Volumes/.../image.jpg: “image.jpg” couldn’t be moved to the trash because you don’t have permission to access it.! I then try to get more info about the problem using this code: NSURL * imgurl = [NSURL fileURLWithPath: abs_path isDirectory: NO]; NSError * error; NSFileHandle * fileHandle = [NSFileHandle fileHandleForUpdatingURL: imgurl error: & error]; But it always returns a valid fileHandle, i.e., there is no error. I selected "Read/Write" in the "User Selected File" entitlement. Of course, everything works fine when the files reside on my local disk (even across multiple invocations of the app). The external disk is just a hard disk connected via USB to my laptop. Deleting the files manually on the external hard disk works, of course. Does anyone have an idea what mistake I might be making? Or is there a way to get the necessary permission? Are you using startAccessingSecurityScopedResource? ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Thunderbolt port audio programmability
I'm looking at creating an iPhone/iPad app that acts as a dual-channel waveform generator. I see two options for the output signal medium: (a) using the audio jack (on suitable devices), or (b) using the Thunderbolt port Q: Is there a Cocoa framework for programming the Thunderbolt port? Can it output raw frequencies or does it function as a serial data port only? Q: Is there a Cocoa framework for generating sine/square/triangle waves at precise frequencies and output currents (0.1-1000Hz, 50-500ua)? Thx! -Carl ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Can't delete file on external disk
In my app, I collect lists of files that reside on an external disk. When the user opens the directory of the files, I create a security-scoped bookmark like this: directoryBookmark_ = [dir bookmarkDataWithOptions: NSURLBookmarkCreationWithSecurityScope includingResourceValuesForKeys: nil relativeToURL: nil error: &systemError]; Next time, the app runs, I resolve the bookmark like this: directoryLocation_ = [NSURL URLByResolvingBookmarkData: directoryBookmark_ options: NSURLBookmarkResolutionWithSecurityScope relativeToURL: nil bookmarkDataIsStale: & isStale error: & error]; At some later point, my app wants to delete one of the files in that directory (or sub-directory), like this: NSString * abs_path = [self absolutePathFor: filename_]; BOOL success = [self deleteFile: abs_path ]; This does not work. In the log, I get the error message: Failed to delete /Volumes/.../image.jpg: “image.jpg” couldn’t be moved to the trash because you don’t have permission to access it.! I then try to get more info about the problem using this code: NSURL * imgurl = [NSURL fileURLWithPath: abs_path isDirectory: NO]; NSError * error; NSFileHandle * fileHandle = [NSFileHandle fileHandleForUpdatingURL: imgurl error: & error]; But it always returns a valid fileHandle, i.e., there is no error. I selected "Read/Write" in the "User Selected File" entitlement. Of course, everything works fine when the files reside on my local disk (even across multiple invocations of the app). The external disk is just a hard disk connected via USB to my laptop. Deleting the files manually on the external hard disk works, of course. Does anyone have an idea what mistake I might be making? Or is there a way to get the necessary permission? Thanks a lot in advance! Best regards, Gabriel ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com