iTunes Remote for Windows Phone 7
This is a demo project I'm putting together for a talk I'm giving on June 23, 2011 at the Boulder Silverlight Users Group.
The talk is to illustrate several topics:
- Embedding simple web servers in Windows services and applications (in this case using Nancy)
- Creating simple REST services that can be hosted in a simple web server for communicating with applications or services
- Creating a Silverlight applications for Windows Phone 7 that can talk to these services (in this case, for automating iTunes running on your home theater PC, but ultimately for whatever interesting purposes you can conjure up).
- Making the asynchronous communications on WP7 easier and more robust using the Reactive Extensions.
The agent program for controlling iTunes and hosting the REST service just requires a Windows 7 or Vista PC running iTunes (it might work on XP, I haven't tried it yet).
The control application requires a Windows Phone 7 device (or the emulator). This app probably won't be going up on the market (other iTunes remotes for WP7 already exist; this is just for teaching purposes), so you'll need to have an unlocked device to deploy it.
For the agent, build and run the setup project on the machine with iTunes. If you're on Windows Vista or Windows 7, once you've installed the application, you'll need to reserve a URL for it. In the installation folder you should find a file called 'setupurl.bat'; simply modify that file to use the correct IP address and machine name, then run it (you'll likely need to run it as administrator). For the WP7 application, you'll need to deploy to your phone using Visual Studio 2010.
This is project for demonstration purposes for the talk. Use of this code is at your own risk. If this thing somehow erases your iTunes library or sets your phone on fire, you were warned.