Objective-C and libsigc++

I’ve started working on a secret MacOSX project. I decided to use Apple’s Cocoa framework, so that means I have to use Objective-C. The backend I’m basing my project on is in C++ and uses the libsigc++ callback library as an important component of its interface with the frontend. So how do you setup ObjC methods to be called back?

Use my glue header. It will create glue functions at compile time for calling objc_msgSend() with the appropriate arguments.

Example:

SignalActivated.connect (sigc::bind(sigc::ptr_fun(objcsigcglue), self, @selector(CatchSignal:)));

This will call [self CatchSignal:boolValue]. Pretty neat, right? For the majority of callbacks that don’t accept arguments, a mere function pointer cast is needed:

BoringSignal.connect (sigc::bind(sigc::ptr_fun((msgFtn)objc_msgSend), self, @selector(boringSignalCatch:)));

Update: I fixed objcsigcglue.h to work with references that are passed to the callback. It should be much more flexible with other types I haven’t anticipated too.

Aug 31 2006 02:04 pm | Programming | 1 Comment »

first banjo demo

I’ve recorded my first banjo song. Happy Banjo.

Jul 22 2006 07:06 pm | Banjo and Music | No Comments »

The Mother of All Dubbers

From Harrison’s marketing materials:

The recording software behind the X-Dubber is an open-source, highly scalable program called Ardour. The stable, full-featured Ardour workstation has the capabilities you would expect from a state of theart workstation. By focusing on the specific needs of thepost-production community, Harrison has packaged the Ardour workstationinto a robust, streamlined re-recording product that meets the needs ofour world-class customers.

Pretty awesome. Go Team Ardour.

Jul 17 2006 06:06 pm | Capitalism and Music and Programming and Software | 1 Comment »

Nuclear glow over LA

This is a photo from the 1940s of the glow of an above ground nuclear bomb test as seen from Los Angeles. Apparently, it lit up the horizon as bright as day.  Found on boingboing.

00034822.jpg

Jul 10 2006 03:40 pm | Photos | No Comments »

broken

I’ve switched my blogging software from Drupal back to Wordpress.  This is because I kept falling behind with Drupal’s bug and security fixes and just couldn’t keep up.  Wordpress is better for blogging anyways.  I still love Drupal, but it’s really geared at community sites.

I’m just warning that links will probably be broken for a little while.  On the other hand, I hope to unveil my new creepysmiles site soon.

Jul 07 2006 04:01 pm | Site News | No Comments »

Blogging from TextMate

This is being posted from the wonderful TextMate text editor. It’s like emacs, only without the lisp and MacOSX native. It’s very popular in the Ruby on Rails community. I even registered for it. I have a fairly short list of shareware I’ve deemed important enough to buy.

Jun 20 2006 01:00 am | Software | No Comments »

Beatles Critic

“Hi, I’m an asshole music critic.”

What sort of person writes an essay like that? What must it be like to live knowing that you’re that sort of person, everyday?

Jun 18 2006 01:24 pm | Music | 1 Comment »

mottos are emo

Naama says it’s emo, but I don’t care. It’s my motto and I’m sticking to it.

Now available for purchase.

Jun 18 2006 03:33 am | Capitalism | No Comments »

musical taste signature

My musical taste signature, courtesy of the iTunes Signature Maker.

Jun 18 2006 01:13 am | Music | No Comments »

Flock

I’m posting this from the new Flock browser. It seems pretty cool. I’m not the biggest flickr user, but I appreciate the intergrated del.icio.us bookmarks. Still trying to get into that. The fonts aren’t as nice as the ones in Safari, but it’s usable.

I appreciate the built in clipboard at the bottom where you can drag in images and text for later use. Pretty cool!

It’ll be nice if they add support for Gallery2 in addition to Flickr and Photobucket. I mean, what about those of us who host our own photos?

Jun 15 2006 04:43 pm | Software | No Comments »
« Previous PageNext Page »