Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
General
GeneralPortable MacsHardwareNetworking
Applications
Mac ApplicationsEudoraFirefox / MozillaInternet ExplorerOutlook ExpressMS OfficeEntourageExcelPowerPointWordVirtual PCMedia PlayerOther MS Products
Programming
Mac ProgrammingCodeWarriorPerl
Country Specific
Australian Mac GroupUK Mac Group

Mac Forum / Programming / Mac Programming / October 2005



Tip: Looking for answers? Try searching our database.

Carbon in Cocoa

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
paul - 20 Oct 2005 11:57 GMT
Hi,

I've been messing around with Cocoa trying to convert an old project from
Carbon to Cocoa and needed to record audio. I managed to put an ObjC wrapper
around my old Carbon code and it works fine in Cocoa - just not sure if this
a good idea.

It runs OK as a universal binary which is the reason I wanted to go with
Cocoa - too much deprecated stuff in Carbon. The idea is to change the
recording code to Cocoa when I work out how to do it but that may take years
for me.

Really just wondering if I should deploy my app with this mixture. Any help
appreciated, thanks.

Paul
Michael Ash - 20 Oct 2005 13:52 GMT
> Hi,
>
[quoted text clipped - 10 lines]
> Really just wondering if I should deploy my app with this mixture. Any help
> appreciated, thanks.

Carbon and Cocoa are just libraries, and you can generally mix them with
impunity. Indeed, Carbon and Cocoa both use pieces of the other, so you
are forced to at least have them mixed behind the scenes, no matter what
you do.

There are gotchas, and they generally come in when you're not only using
them in the same program, but when you're using things from both whose
capabilities overlap. For example, previous to 10.2, it wasn't possible to
have automatic dispatching of both Cocoa and Carbon events in the same
app, so you couldn't install a Carbon event handler in a Cocoa app without
a lot of pain. Things have gotten a lot better since then. As of
10.3/10.4, what won't work is mostly limited to mixing view hierarchies
(trying to put Carbon views in Cocoa windows or vice versa), and some
weirdo stuff like attempting to use both the Carbon and Cocoa color
pickers. For sound recording code, you should be just fine.

Signature

Michael Ash
Rogue Amoeba Software

Eric Albert - 21 Oct 2005 07:57 GMT
> I've been messing around with Cocoa trying to convert an old project from
> Carbon to Cocoa and needed to record audio. I managed to put an ObjC wrapper
[quoted text clipped - 5 lines]
> recording code to Cocoa when I work out how to do it but that may take years
> for me.

Why not just switch to the non-deprecated bits of Carbon?  That'll be
easier and it'll work fine.

As for audio recording, switch to Core Audio.  It works a lot better
than the Carbon Sound Manager.

-Eric

Signature

Eric Albert         ejalbert@cs.stanford.edu
http://outofcheese.org/

paul - 21 Oct 2005 11:01 GMT
Hi,

The problem with CoreAudio is that I don't know where to start. All the
Apple sample code examples build some complicated esoteric sh.t - all I want
is simple record to a buffer and play the buffer.

Regards,

paul

>> I've been messing around with Cocoa trying to convert an old project from
>> Carbon to Cocoa and needed to record audio. I managed to put an ObjC
[quoted text clipped - 16 lines]
>
> -Eric
Eric Albert - 22 Oct 2005 10:18 GMT
> The problem with CoreAudio is that I don't know where to start. All the
> Apple sample code examples build some complicated esoteric sh.t - all I want
> is simple record to a buffer and play the buffer.

That sounds like a good question for Apple's coreaudio-api mailing list.

-Eric

Signature

Eric Albert         ejalbert@cs.stanford.edu
http://outofcheese.org/

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.