Tap Tempo - Playing with Dashboard
I finally upgraded my laptop to Tiger right before WWDC, since I was helping with the student Sunday sessions and I figured I should at least _look_ at CoreData before people asked me questions about it. I spent most of my time helping people in the "Intro to Cocoa" session, so it didn't matter that much in the end...
Before installing I'd been looking forward to using Spotlight the most, but I've been pleasantly surprised by Dashboard. I haven't used the standard-Dashboard-demo widgets too much, but here are a few that I've used quite a bit:
- Air Traffic Control - for finding wireless networks. More for fun than anything else...
- iTunesLyrics - a great example of something that accesses the web, but that is more than just a cover to a search site. It gets the lyrics for the current song playing in iTunes (yeah, I know, you probably figured that out from the name already)
- Package Tracker - shows off another feature of dashboard - allowing you to have multiple copies, tracking different packages. I used to track this in my RSS aggregator, but this is a much better solution.
So a few days later I finally have something that works. It has buttons, preferences, does the fancy flip, background image, etc. Well, it has the background image from the widget sample code :) And... the button is the icon from the sample code :) But hey, it works right? Hopefully I can convince Lisa to draw up something pretty so I can stop hanging my head in shame.
Here's an image for you - I'll get the real thing posted once I clean up the UI some more:
Ohhhhh soooo cheesy :)
I've been getting by with Javascript examples from an old 'jack-of-all-trades' web book and searching on google when necessary. I've been building up more links on my del.icio.us page if you ever need to find some. It's been kinda frustrating figuring out the language works (and how it interacts with html/css, etc) - I realized that I've been spoiled working in Objective-C for the past 5 years. But I really miss the development environment the most (never thought I'd say that :). Debugging using alert() to substitute for gdb or even NSLog()s is no fun - it throws a modal alert onscreen whenever you want to see something, which was recommended by one site (is there a 'print to console' equivalent?). And I miss having a compiler to warn me that I forgot a semicolon, assigned a value instead of testing for equality in an if statement, or that I typed 'val' instead of 'var', so it thinks I'm using some class instead of creating a variable - yes, all of these happened :(. I also managed to forget to add 'break' lines to cases in a switch statement, which is only interesting to me since I did the same thing 10 years ago when I was first learning C.
All in all, not the greatest week for my programming skills, but I know more about the languages now, and like I said - it works :)
But it's still ugly. For now.
5 Comments:
At 8:53 AM, June 24, 2005, Anonymous said…
You probably don't want to here this, but there's already a widget that will do this:
http://www.apple.com/downloads/dashboard/music/bpmwidget.html
At 8:53 AM, June 24, 2005, Anonymous said…
Sorry, that comment was from Greg.
At 9:34 AM, June 24, 2005, cflake said…
NOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO!
Heh. :)
I guess it would have been nice to find that before I started, but it's still been good to get some experience with Javascript.
Also, it seems to take almost 20 clicks to get the correct tempo from that widget, and I don't always have that long to figure it out. One of the (non-pictured) features of mine is that the preferences allow you to average the tempo from 2-8 clicks; 2 is probably too small for most people, since clicking the mouse is pretty inaccurate, but you can choose what you want. Setting the iTunes tempo is an interesting idea that I wouldn't have thought of though. And the other one is prettier :)
At 7:40 PM, July 01, 2005, Paul said…
in safari/webkit, you can do window.console.log() instead of alert.
At 11:55 PM, July 11, 2005, cflake said…
but if you try to use that call in the actual dashboard, it will stop the rest of the method from proceeding (that took me a while to figure out, so hopefully somebody finds it useful :). Useful for debugging in the browser though - just remember to take them out later...
Post a Comment
<< Home