Monday, August 21, 2006

Found this nice article.

Creating MMC Snapin using C# (Part I)

Requires a the MMC .Net library over at sourceforge.

http://sourceforge.net/projects/mmclibrary/

Monday, August 21, 2006 8:46:32 AM (GMT Standard Time, UTC+00:00)  #    Comments [0]  | 
 Sunday, April 02, 2006

Thanks to all of you who have used this and given me good feedback. I've made an update based on all the comments recieved so far.

1. File copy bug fixed. Now corrects Album names with invalid characters in them, so the copy process does not crash.

2. Now copies AAC files too. Thanks to Martin for letting me know what the w800i supports AAC (.m4a files).  This does not support protected AAC (.m4p) files such as tracks purchased from the iTunes Music Store.

3. Added a Quick Launch icon.

Please download the latest version and keep the comments coming in.

Instructions:
1. Install all of the requirements.
2. Download the setup and install.
3. Start iTunes, if it is not started the program will start it for you, but be patient.
4. Select the playlist you want to synch with the phone. It is better to create a new playlist like "W800i List" and add your tracks to this.
5. Click on the Synch button to start synchronising.
6. This takes a while. You can speed up the copy process by using a Memory Stick reader, which is faster than going through the USB data cable. Take the memory stick out of the phone, put it in the reader, plug the reader in and synch.

Disclaimer: Use the program at your own risk. This program is un-supported and I will not be held for any damages, liabilities, warranties, natural disasters and if your dog eats it. However, feel free to report bugs and features.

Requirements:

.Net 2.0 Framework
iTunes 6.0 and above

 

Sunday, April 02, 2006 10:12:58 AM (GMT Standard Time, UTC+00:00)  #    Comments [1]  | 
 Sunday, January 01, 2006

The problem with Sony MP3 players is that the software is not intuitive and buggy. The Disc2Phone application included with my Sony Ericsson W800i fails to copy audio tracks to the phone properly. I was looking for a way to use Winamp or iTunes to manage the MP3s on the phone. As it turned out, I was able to do it with iTunes. 

I was able to wrap it all up in a small C# program. Download it from here . Update : this now also deletes files on the phone that are not in the play list, keeping it completely in sync. It only deletes files inside the MP3 directory, so dont put anything else in there :)

Instructions:
1. Install all of the requirements.
2. Download the setup and install.
3. Start iTunes, if it is not started the program will start it for you, but be patient.
4. Select the playlist you want to synch with the phone. It is better to create a new playlist like "W800i List" and add your tracks to this.
5. Click on the Synch button to start synchronising.
6. This takes a while. You can speed up the copy process by using a Memory Stick reader, which is faster than going through the USB data cable. Take the memory stick out of the phone, put it in the reader, plug the reader in and synch.

Disclaimer: Use the program at your own risk. This program is un-supported and I will not be held for any damages, liabilities, warranties, natural disasters and if your dog eats it. However, feel free to report bugs and features.

Requirements:

.Net 2.0 Framework
iTunes 6.0

How it all works

When plugged in to the computer,the phone is bacially a Mass Storage Device just like any other USB flash drive. The Memory Stick on the phone contains a directory "MP3". All that needs to be done is to copy the MP3s to this folder. Use the System.IO.DriveInfo.GetDrives() method of the DriveInfo class in .Net 2.0  to get an array of DriveInfo objects representing all the drives on the computer. Iterate through this array to check for removable drives using the DriveInfo.DriveType property and then check for drives that have a "MP3" directory in the root. Use the DriveInfo.IsReady to check if the removable disc is ready.

The next step is to copy only the MP3s in a specific iTunes playlist. iTunes has an exellent COM interface. To program against this in C#, add a COM reference to the "iTunes 1.6 Type Library". iTunes is started by;

itunesApp = new iTunesAppClass();

Use the iTunesAppClass to get the collection of playlists;

playlistCollection = itunesApp.LibrarySource.Playlists;

You can then get a specific playlist, like the playlist you want to synch the phone with;

playListToSynch = playlistCollection.get_ItemByName("W800i");

The playlist will have a collection of IITFileOrCDTrack objects. Each IITFileOrCDTrack object has  Artist,Album and Location properties. The Location property gives the physical location of the audio track on the computer. This is used to copy the track to the phone. Iterate through the tracks in the playlist and copy the files to the phone. Thats all there is to it. With this technique it is possible to use iTunes with other USB type devices that play MP3's.

The next step is to improve the synch functionality, right now it is just a one way copy process. Update : This functionality is now included. 

 

Sunday, January 01, 2006 10:51:49 AM (GMT Standard Time, UTC+00:00)  #    Comments [8]  | 
 Wednesday, December 28, 2005

While working with the System.Timers.Timer class last week, I found that the timer_elapsed method is not synchronized, i.e the event is fired without waiting for the completion of the previous invocation.

Say for example you have a method that pulls up the latest records from a table and do some processing. The timer event can fire while you are doing this processing and have still not marked the records as processed. The safe way is to wrap the code in the timer_elapsed event inside a lock statement.

Wednesday, December 28, 2005 10:36:32 PM (GMT Standard Time, UTC+00:00)  #    Comments [0]  | 
 Sunday, December 04, 2005

I was reading a blog post on blogs.msdn.com about why each version of VS is tied to a version of the runtime, and the reasons why multiple versions of the runtime are not supported. Anyways I can't find the link :).

For VS 2005, an add-in is under development to build under 1.1.  Targetting the latest version of  .Net is viable for server side projects (ASP .Net etc..). However, for client applications this is not always possible.  The majority of Windows computers will now have the 1.1 Framework, so applications can be deployed without worrying too much about distributing a 20 MB runtime. It will probably take about 6 months to a year for the same thing to happen to the 2.0 Framework. Untill then, those developing for 1.1 are still stuck with an IDE that rewrites code, makes controls disappear and other magical stuff that makes one tear their hair out.

On the same topic, where can I find statistics on what percentage of Windows machines have what version of the runtime. Internet Explorer sends the .Net version on the UA string, so it might be possible to measure the usage of 2.0 versus 1.1 This should be easy for MS to pull up from their web server logs and publish the stats :)..

 

Sunday, December 04, 2005 10:57:55 AM (GMT Standard Time, UTC+00:00)  #    Comments [0]  | 
 Wednesday, June 01, 2005

http://www.divil.co.uk/net/controls/

This is one nice collection of controls. These are what MS didn't include in their control library and what other vendors charge a hell of a lot. I've used the toolbars and menus for some applications. The licensing is quite resonable. The free version can be used to try out the control. This should be in every Winforms developers toolbox.

Wednesday, June 01, 2005 8:42:09 AM (GMT Standard Time, UTC+00:00)  #    Comments [0]  | 
 Thursday, March 31, 2005
Thursday, March 31, 2005 4:18:56 PM (GMT Standard Time, UTC+00:00)  #    Comments [0]  |