LFScrobbler.framework
=====================
LFScrobbler.framework is designed to make it easier for you to interface with the
Last.fm service. First, you need to add the framework to your project. Once you've
accomplished that, you can work the simple LFScrobbler interface into your code.

Adding the Framework to Your Project
------------------------------------
1) Open your project in Xcode, and expand the disclosure triangle next to
	"External Frameworks and Libraries", and then the triangle next to "Linked
	Frameworks".

2) From the Finder, drag LFScrobbler.framework under the "Linked Frameworks" heading.
	When the dialog appears, make sure you check the box that says "Copy items into
	destination group's folder (if needed)", and you choose to "Recursively create
	groups for any added folders".

3) Expand the disclosure triangle next to "Targets", and select your main target.
	Then, from the Project menu, choose New Build Phase -> New Copy Files Build
	Phase. When the dialog appears, change the Destination to "Frameworks".
	Close the dialog.

4) From within the Groups & Files pane (where you've been working all along), drag
	LFScrobbler.framework into your new Copy Files build phase. This ensures that the
	framework will be copied into your application bundle.


Using the Framework
-------------------
All of the communication is performed through an LFScrobbler object. You'll need
to add a reference to the header file for LFScrobbler into one of your header files
like so:

	#import <LFScrobbler/LFScrobbler.h>

Then, where appropriate (usually your controller's -init method), create a scrobbler
object, set the delegate (if desired), and set your client ID (obtained from Last.fm, if
at all possible):

	scrobbler = [[LFScrobbler alloc] init];
	[scrobbler setDelegate:self];
	[scrobbler setClientID:@"myapp" version:@"1.0"];
	// If no client ID has been received, omit the above line
	// DO NOT make one up

Finally, when possible (ie, you have the necessary information from your user), you'll
want to log-in to the service.

	[scrobbler loginWithUsername:@"myUsername" password:@"myPassword"];

When your app is finished/about to be quit, call the endSession method of the scrobbler
object, which performs a synchronous (blocking) scrobble of any recent changes, and
closes server communications.

	[scrobbler endSession];

From there on, use is easy-- refer to the LFScrobbler.h header file for more info
on which methods to use when (and also for delegate methods you can respond to).
The basics look something like this:

	//----------------------------------------------------------
	// When a new track begins playing:
	NSDictionary *track = [NSDictionary dictionaryWithObjectsAndKeys:
		@"A Beautiful Song", @"name",
		@"A Talented Artist", @"artist",
		@"A Great Album", @"album",
		[NSNumber numberWithInt:300], @"length",
		nil];
	// Optional parameters include mbID (MusicBrainz ID, if you have it) and
	// number, the track's position on the album
	
	[scrobbler playTrack:track];
	
	//----------------------------------------------------------
	// When the music player completely stops/the track has
	// ended; note you do not need to send both a stop and a
	// playTrack: method when the song changes.
	[scrobbler stop];
	
	//----------------------------------------------------------
	// When the music player is paused
	[scrobbler pause];
	
	//----------------------------------------------------------
	// When the music player resumes from being paused
	[scrobbler resume];

That's all there is to it. Enjoy!

Matt Patenaude
Developer