Wednesday, December 30, 2009

Version 0.8.2 released

You can check the change log for details or ask iTunesDSM to check for a new version for details, but essentially numerous fixes have been made.  If you install it in Windows, it will ask to uninstall the previous version first.

Sunday, December 27, 2009

This weeks' plans

First off, I had 57 downloads today!  I'm quite impressed.  Please remember though, I have put a lot of time into this.  If you find iTunesDSM useful please consider donating to the project.

For this week, I plan on finishing testing 0.8.2 which improves the iTunes communication.  It seems 0.8.1 has trouble starting the folder watching.  It should start with essentially an add new tracks task and then check for start monitoring for new folders, but the first add task doesn't seem to work consistently and it jumps straight to the folder watching.  The next version should have the fix for this.

There are a few other major updates I've talked about before, namely, adding new tracks to iTunes when files are copied to iTunes will be less likely to create duplicates.  Also tracks are added directly to the library and the process of adding is monitored with iTunes to make sure the process is completed.  Lastly, I plan on creating a playlist at the end of the add tracks process just to see the new tracks added.

I hope everyone is having a good holiday.

Brian

Thursday, December 24, 2009

A few more updates

Not much to say today, except that new tracks are now added directly to iTunes instead of through a playlist.  iTunesDSM will now wait until itunes is explicitally finished adding tracks using the ITOperationStatus object.

I spent a lot of time trying to rewrite some iTunes controller objects to make them more reliable but it was a lesson in huge frustration and I have since added to the iTunes controller that I had been using.

The next version will probably be available after Christmas.  Hope everyone has a great holiday.

Brian

Wednesday, December 23, 2009

Jacob can't co-create object exception

This exception comes up every now and then.  It sucks because you don't see it right away too.  Anyway a preliminary fix I have come up with is to make the object that utilizes Jacob a global variable.  That way the Jacob threads are only created once and the communication to the COM object is only instantiated once.  It seems to work for my purposes.  I'm sure something else will come up later...lol.

Tuesday, December 22, 2009

How to setup iTunes Folder Watching

As of version 0.8.0, iTunes Duplicate Song Manager can watch a folder for new files to add to iTunes automatically.  The folder, or music directory, is the same directory you have been using to search for duplicated files or files you want to add to iTunes manually.

So how does it work?  To get started.
  1. Select your options, the music directory, the file types you would like to filter(or add automatically in this case), and be sure the iTunes XML file was found successfully.  If not, you will have seen a warning.
  2. Enable background monitoring by checking "Monitor the music directory for new tracks and add them to iTunes in the background."
  3. Determine how often you would like to check for new tracks.  As of now, you can scan as often as every hour, or up to once every 6 hours.
  4. Press the "Start" button.
  5. That's it!  iTunesDSM with Folder Watch will run in the background and periodically check for changed folders.  If a folder has been changed, then that folder will be scanner for new tracks and if found will add them automagically to iTunes.

More fixes added today

Just a quick rundown of the fixes added today:
  1. iTunesDSM removes old playlists from adding tracks.
  2. Installer will remove old startup shortcuts.
  3. The FileChoosers all now show the iTunesDSM icon.
  4. Installer removes old version before new install
I'm still testing version 0.8.2 but will probably release it later this week.

Monday, December 21, 2009

Copying files and hard drive space

Due to the new anti-duplicating code, iTunesDSM must create a copy of the file before readding it to iTunes if conditions are right. This can get pretty spacey, so I've added a check to make sure the file space is available. Should have probably been there in the beginning but eh.

41 Downloads yesterday

Checking up on the sourceforge stats, there were 41 downloads yesterday (the highest it's been in one day)! That's a lot of de-duplicating! The program has been on sourceforge for about a month now and it's gotten close to 1000 downloads, which I think is pretty cool!

A couple fixes planned for the next version:
  1. Code has been added that helps prevent creating duplicates when auto adding tracks, though this now requires the user specifically enable iTunes keeping the directory organized.
  2. The installer/uninstaller needs to remove any startup shortcuts that may be present.
  3. Sometimes the xml parsing would fail if the iTunes music directory was a network drive on boot up. This has been fixed.
Brian

Saturday, December 19, 2009

Version 0.8.1 out

Fixes a minor issue in creating a startup shortcut in windows 32bit.

Version 0.8.0 Released - Automatic Background Folder Watching

I just uploaded the newest version : 0.8.0 with automatic folder watching/background monitoring.

I'm excited for this release because it allows the user to set and forget iTunesDSM to check a folder for new music and automatically add it to iTunes! Something my family surely needs with 4 of us adding music all the time, it's hard to keep our iTunes in sync.

Windows users - there is a new installer for you.
Mac users - it's the same as before - run the jar file.

I've uploaded some new screenshots and updated the release notes.

Brian

Friday, December 18, 2009

It's funny...

How you think you're done and then nope. You find something else.


A few fixes today. The iTunes XML files is still found automatically but the algorithm is much better. It searches through the entire user directory, if it finds one file - golden. If it finds more than one file, it will ask for the correct one. Hopefully this doesn't happen to the average user though. It only makes sense if someone is maintaining more than one library.

Up next is the usual Netbeans can't create a preview. It turns out my "global" logger objects passed around like usual objects was causing Netbeans to not be able to initialize gui builder previews. That one took a while to figure out.

Lastly, is a much improved Installer for windows. It performs an automatic check for Java using the JREDyna plugin for NSIS. Super cool!

Brian

Thursday, December 17, 2009

Switched to SysTray as the top level class

Only really for the techy people but I saw that iTunesDSM was taking a lot of memory, and so I switched the top level class to the system tray icon. I'm still testing it now.

Wednesday, December 16, 2009

Javadoc updated

I updated the javadoc today. It took forever, but it's part of releasing the code since it is open source. Version 0.8.0 is close to being ready. I've been using it on a regular basis on my system and its stable.

Tuesday, December 15, 2009

Creating an Exe file from java updated

Just a minor update for the previous post here. It looks like the NullSoftInstaller program works well for Installers...go figure. But creating a simple EXE file from a Java jar is better served through Launch4J. It's a simple program that can either create an exe file that runs the jar file. Or it can wrap the Jar file and create a standalone exe file. I've been choosing the wrap Jar file option to create a simpler exe file for users. This has the added benefit of seeing a real exe file in the Windows Task Monitor rather than another javaw.exe file. Either way, it definitely makes things better for users.

A few other UI updates on iTunesDSM as well. The system tray will only report new tracks that have been added if there truly were tracks added. It used to say tracks added based on a changed folder, even if no new tracks were added. Seems logical anyway.

Also checking for a new version will now report what the new version's big features are.

Finally, a few support options have been added to both the blog and to the program.

Lastly, got my final grades today. Straight A's for the last term. My final GPA was 3.67! Hope all is well.

Brian

Troubleshooting and FAQ

1. “iTunesDSM can find duplicate files but when I click the Clean iTunes button nothing happens.”

This can happen if you try to run iTunesDSM from within the zipped folder (.zip) you downloaded. Extract the zip folder and try running iTunesDSM again.

2. “Sometimes when I click the Add Tracks to iTunes button, nothing happens.”
This appears to be an issue with iTunes and possibly something called JACOB. Unfortunately, this issue is intermittent, and the only way to fix it is to close iTunesDSM and run it again.

3. "iTunesDSM is not finding any duplicated files, but I know they are there."
iTunesDSM relies on iTunes keeping your music files organized. The setting is in Edit > Preferences > Keep iTunes Media Folder organized. If this option is not enabled then iTunesDSM will not find any duplicate files.

4. "Can I search for duplicate files in other directories?"
Yes, just change the music directory for each search you want to perform and then rerun the Find Duplicates and/or Add New Tracks searches.

5. "What are exclusions?"
iTunesDSM has to keep a list of files that have already been added to iTunes from outside of the iTunes directory because adding tracks to iTunes programmatically can produce duplicated files. In other words, you can add files inside iTunes' music directory without incident, but adding songs outside of the directory can cause duplicate files to occur. It's all maintained automatically so you shouldn't need to worry about it.

6. “What happened to Mac support?”
iTunesDSM is written in Java so yes it does work on Mac, but iTunesDSM relies on COM’s to read information from the iTunes libraries. COM’s are not available on Mac so a lot of the iTunesDSM functionality is lost. I have looked into Apple Scripts, but since I don’t have a Mac, I can’t test them.
Be sure your Mac is set to use JRE 1.6 to run iTunesDSM. You can find this option in Java Preferences, search for it in your applications.

7. “What are orphaned files or orphaned tracks?”
Orphaned tracks are those tracks in your iTunes library that have the exclamation mark next to them. The exclamation mark means that the file that iTunes used to use to play that song no longer exists. iTunesDSM can automatically remove these orphaned tracks in the Remove Duplicates tab, while keeping the rest of your library intact.

8. Still having problems? Try the support forum.

Sunday, December 13, 2009

I graduated!!! And updates on 0.8.0

Background monitoring is still on the schedule. It's taken longer than I first imagined it would to square everything away. I've been switching over a lot of the code to use a Status interface class to make the classes more versatile should another developer decide to use them. It's also made it far easier to move everything to one status bar at the bottom of the program. The program still looks the same, so their is no need to post a new screenshot.

In other news, I had my commencement yesterday, so I am now a graduate degree owner!!! It was also my birthday and I am now 24. So, in quick successions, I graduated with a Mathematics degree in December of 2008 and now a Software Engineering Masters degree in December 2009 all right at 24 years of age! Now I need a job and health insurance : )

So if anyone knows of a job opening by all means let me know.

Thank you everyone who is reading and/or keeping up with the development of iTunesDSM and I plan on continuing development for as long as iTunes has issues.

Brian

Wednesday, December 9, 2009

Create an exe file with a Java application

Searching for this myself I see this comes up quite a bit and it can be expensive. I may have posted before on how to do this but I now use something called NullSoft Scriptable Installer. Basically, you write out some easy code, and if you reading this you probably understand how to code, and then NullSoft creates an Installer for you.

I know what you are thinking....I don't want to install it....or maybe you do....or maybe you need both like I did...I wanted both an installer and an exe file. It's possible with NullSoft and it's free.

The details are on their sourceforge page here. Hope this helps.

Brian

System Tray and More Background Monitoring...

I realized it's been a few days since I've updated the blog but the screenshots should make some of the improvements apparent.

Up first is the system tray. For background monitoring it's important that iTunesDSM be running but also not be intrucive and hence the system tray is used. The right click options are basic, a simple open and exit command.


Next is folder watching. Essentially what happens is a thread checks for modified folders within the music directory on a timed interval. An event listener is added to the BackgroundMonitor object which retrieves the top level folder that was modified. This folder is then run through the AddTracksTask. There is one issue that can occur; however, and that is the gap in folder's between program executions. For instance, a list of the folders is recognized when the program is running. iTunesDSM then shuts down and new tracks are added to the shared music folder. iTunesDSM would not recognize the new tracks in between executions. So, a couple of methods were added to the FolderWatcher class that stores all watched folders and their last modified times. If a last modified time is changed between folder executions then iTunesDSM will notice that and add tracks.

Next is the status bar. I felt a common status bar is more useful than seperate progress bars and status labels for each panel. It's a little neater I think, basically the screen shot shows how it works.

Finally, I've added a donation button to iTunesDSM. Again, I hate to be pushy but it's nice to see your work is appreciated and donations always help.

Sunday, December 6, 2009

Folder watching update

I worked on quite a few things today. Namely, I changed the options panel for folder watching. I didn't like the JSlider I had on there before, and also checking new files in terms of minutes isn't really necessary. You can now select a 1-6 hour period in which iTunesDSM will check for new tracks.

Secondly, I've figured out how to add System tray icons. This is necessary for background running again as no one wants to see iTunesDSM in the taskbar if it is in fact running in the background. Therefore, if background watching is enabled and the user closes the window, it is minimized to the task tray. Unfortunately, background monitoring is Windows only since it depends on the AddTracksTask class that is also Windows only.

With the Task tray icon, I've also added display notifications that display out of the tray. It's the usual balloon tips, but it's useful for quick notifications.

Finally, background monitoring also requires a common status bar. Therefore, the new status bar is a common jpanel object that displays current running processes as well as a dedicated background status label and a progress bar.

I would have posted a screenshot, but eh...tomorrow. It's not quite ready.

More to follow tomorrow.

Brian

First donation today!

A little excitement today, I can't help but post it here. I got a donation through paypal last night! I hate to be a pusher but if you find iTunesDSM useful please consider donating, its nice to see your work is appreciated.

Thanks
Brian

Saturday, December 5, 2009

Background Folder Watching screenshot




Here's a screenshot of what the options panel looks like with background monitoring. It's coming along, and it mostly seems to work. I'm sure there are still kinks to work out and only time figures those out. Otherwise there are still a few other major things to do, namely, I need to figure out to minimize iTunesDSM to the system tray, that way when it's backgrounding it, it won't be on the start menu. Enjoy the screenshot and your saturday.

Brian

Friday, December 4, 2009

Writing your own events not eventlisteners in Java


So I've never had to do this before and it certainly isn't taught in any Java classes. They never even approach writing your own events in java. I think they barely scratch the surface of using listeners, but I wanted to write my own Events that could occur and not event listeners. Well it's not as bad as you think. These two resources explain it pretty well.

http://72.5.124.102/thread.jspa?threadID=5185967&messageID=9725297 - Java forums thread
http://www.exampledepot.com/egs/java.util/CustEvent.html - The first example depot example I came across.

The java forums thread actually tells you how to receive events when a directory or file changes and a little modification made it easy to actually get the directory that was changed.

Essentially the trick is to create three classes, a class that extends the EventObject class, an interface that extends the EventListener class, and your own class that actually performs whatever you want to watch events for. The screenshot above shows a watched directory changed using the code based on the links above. The returned directory here has had a New Folder folder added and hence the aerosmith directory has changed.

Basically one step closer to automated folder watching.

Brian

Wednesday, December 2, 2009

Folder Watching

I've gone back to the folder watching idea. File notification still isn't built into java, that's the next release, but I've seen some online forum postings about monitoring the last modified property of a file so I've decided to go that route. My basic plan of attack is to keep a listing of all folders in a directory and their last modified long number. On a certain interval, the thread will scan all folders again and if a folder has been changed then get that folder and do whatever with it. 'Tis a bold plan.

Brian

I'm Done with classes!!!

I've turned in all of my assignments, I'm about to graduate!!!

Tuesday, December 1, 2009

Turned in the powerpoint

I've finished the project power point today and turned it in. With a lingering sinus infection, I'm sure I sound like little miss piggy, but I'm glad that's done. Lastly, I have to turn in the paper and the source code. After that, and once everything is ok'd I'll turn the code over to sourceforge and fully open source it. I have a couple ideas for folder watching that I want to try out, but I'm not going to add any new code this week, only after I turn it in.