Journal of a Maker

Icon

a blog by Warren C. Moore

iPhone SDK: Making Your AudioSession Routes Play Nicely with the Vibrate Switch

So, you’re writing an awesome multimedia application for the iPhone. Everything’s going swimmingly, and you even have some nice animation effects for when the iPhone is plugged into an external accessory, just like the iPod app:

- (void)toggleVolumeDisplay: (BOOL)show
{
	BOOL isShowing = (volumeSlider.alpha > 0.0);
	if( isShowing && !show )
	{
		// Animate volume slider down and out, while animating play controls to center of view
	}
	else if( !isShowing && show )
	{
		// Animate volume slider in, while animating play controls up to the top of the view
	}
}

Or something like that. That’s purely to illustrate what you might be doing in response to a run-of-the-mill hardware route change (headphones plugged in, connected to speaker dock, etc.), which of course you’re detecting like this:

	// When the view is loaded
	AudioSessionAddPropertyListener( kAudioSessionProperty_AudioRouteChange, RouteChangeListener, (void *)self);

	// Called later as part of your listener callback
	CFStringRef state = nil;
	UInt32 propertySize = sizeof(CFStringRef);
	OSStatus result = AudioSessionGetProperty( kAudioSessionProperty_AudioRoute, &propertySize, &state);
	if( result == kAudioSessionNoError)
	{
		if( CFStringGetLength(state) > 0)
		{
			if ([(NSString *)state compare:@"LineOut"] == NSOrderedSame) // only special case we care about
				shouldShowVolumeControl = NO;
		}
		else
			; // vibrate switch engaged
	}
	else
	{
		if (result == kAudioSessionUnsupportedPropertyError)
			shouldShowVolumeControl = NO; // probably simulator
		else
			; // error encountered
	}

This has been documented in plenty of places.
Read the rest of this entry »

Push

For the past year, I’ve been employed by 352 Media Group, based first in Gainesville, FL and then in Atlanta GA.

Recently, I decided that the time had come for me to try to make it as a freelancer. I’m not the kind of person who thinks everyone should follow the path of self-employment. On the other hand, there comes a point in some of our lives where the idea of working for someone else is so distasteful that the inevitable pain and isolation that comes from going it alone is actually attractive. Read the rest of this entry »

Make Terminal Follow Aliases Like Symlinks

Okay, so you’re spelunking around in Mac OS using Terminal. You try to ‘cd’ into a directory only to be told that what you’re trying to get to “is not a directory.” Then you remember that the target directory is actually a shortcut that you created with Finder. It looks just link a symlink in Finder, so shouldn’t it act like one in Terminal?

Unfortunately, in OS X, aliases are treated differently by the command line than symlinks. In particular, they won’t be followed by the “cd” command, leading to your present frustration. Fortunately, with a little elbow grease, you can patch up your shell and be on your merry way. Read the rest of this entry »

Creating Value at Starbucks

A recent article by Tom Davenport on the Harvard Business Publishing metablog has me thinking. Entitled “Is Web 2.0 Living on Thin Air?,” the post asks whether all us hipster Starbucks jet-setting metrosapiens are really creating value, or just participating in a “fluffy” game of social media-powered self-delusion. I think it’s the wrong question to ask, but because Davenport implicitly answers another question, this present post is vindicated and the fundamental issue at hand is revealed as both beginning and end. </Helmut “The Architect” Bakaitis>

Concordantly, allow me to ask the question that Davenport really wants to ask: Regardless of the degree of engagement in often frivolous social networking activities (i.e., poke wars, media tagging, and adding edges to the social graph just for the sake of increasing your friend count), who is creating value and in what is that value based?

Speaking as an aspiring coffee shop hipster creative, I can tell you that when I’m sitting down with a Grande Pike Place drip brew, I’m not going to be spending much time on facebook; I’m going to be spending time slicing .PSDs, writing CSS, and scripting PHP and jQuery, or my language du jour.

I remember reading a much more conservative piece by an individual I could only imagine being the type of neo-maxi-zoom-dweebie who could make a career of doling out largely vapid and condescending advice. Substantial Googling and Snopesing turned up Charles J. Sykes and the relevant quotation: “Television is not real life. In real life people actually have to leave the coffee shop and go to jobs.” Surely enough, he’s at it again. Suffice to say, this kind of polemic fails to inspire me. I guess my necktie is a little too loose for me to get the point.

It turns out that it’s possible to create value darn-near anywhere these days. I’m not saying every job is implicitly mobile; vanishingly few are. But for those of us knowledge workers who produce the technology that makes everyone elses’ lives richer and easier, a favorite coffee shop can, as in the vision for Starbucks envisioned by Howard Shultz, provide a comfortable “other place,” a sacred venue away from the distractions of home where, on the best days, everything but the workpiece fades into the background and we’re cruising along in the zone of maximum productivity.

In short, the value we produce takes the form of applications and systems that make it easier for people to do whatever it is they do. So indeed, getting overly engaged in social networking can be a big drain on personal productivity. But we shouldn’t confuse such value-sapping minutiae with the value-creating work of producing sites that encourage engagement, including, yes, the creation of social media sites.

Blog Action Day 08: Moving Slowly on Poverty

In the last hour or so of the day (on the West Coast, at least), and even though this site is still under very active construction, I wanted to drop a quick post for Blog Action Day ‘08. The topic of the year is poverty.

As I am a white Anglo-Saxon male who grew up, if not in, at least adjacent to, the suburbs, most people would assume that my experience with poverty is minimal. They would be correct. I have never known clawing hunger for days on end; have never lacked a roof, four walls and a carpeted floor; have never been the subject of an exposé on wretched conditions in the inner city nor a child with baleful eyes who could get by with a mere 75 cents a day.

No, being in the first world, I like to imagine that I can get by, due to my place of privilege in Maslow’s hierarchy, on just my principles. One of my friends recently posted on facebook a quotation by Protestant minister William J. H. Boetcker, from which I take the following excerpts: “You cannot strengthen the weak by weakening the strong[...]” and “[You] cannot help men permanently by doing for them what they can and should do for themselves.” As much as this sentiment reeks of the hackneyed arguments people make for trickle-down effects between classes, there is something to be taken from it, and it has everything to do with urgency. Read the rest of this entry »

Twitter Feed

Previous Entries

February 2010
S M T W T F S
« Jan    
 123456
78910111213
14151617181920
21222324252627
28  

A Brief Note

Journal of a Maker is an eclectic collection of thoughts by Warren Moore, an Atlanta web professional. Some content may be highly flammable. And also nerdy.

Page Index