« Short article on OS X Developer Tools | Main | OpenGL -> Quicktime »
February 26, 2005
RubyCocoa slides
The talk on Thursday night went well! I went through the slides and gave an overview of RubyCocoa, and then we spent an hour hacking on the sample apps I wrote. The AudioGrapher app is pretty simple, it opens an audio file and graphs out its samples in two views. The top view shows the original samples, and the bottom view graphs transformations made to the original sample set. It has a slider to move around the audio file since the sample window is much smaller than the size of an average audio file.
It graphed the samples as dark gray lines on a light gray background in an interleaved format. One of the first changes we made was to draw left channel samples with red bars, and right channel samples with blue bars. This was interesting, but we were loading stereo audio files and wanted to see the fade graphically. I changed the app to render the left/right channel values on top of each, using 50% alpha blending on each channel to give a nice layered effect. We made a few other cosmetic changes to the view and changed its background color, the nice was that every change took at most a few minutes to make.
One neat non-gui feature we added was a check inside the ruby view class to detect changes to its source code. This let us edit the source while the app was running, and the app then automatically picked up the changes. Even though the build/startup time with RubyCocoa is pretty quick (~15 seconds), this reduces it to 0. Heh, heh.
I'm getting together with some of the seattle.rb hackers on Thursday night, we're going to clean up the changes I made to RubyCocoa to enable self-contained apps, and will be looking at ways to bundle third-party ruby code easily with RubyCocoa apps, and options for code obfuscation.
I've posted the slides from my talk online.
Posted by djb at February 26, 2005 03:51 PM