Just Playlists 2.2.0—Skip Missing Tracks Preference, Small Fixes and Improvements

March 26th, 2010

I haven’t finished gesture-based control yet, but in the meantime I’ve fixed or improved a few things and added one new feature.

The new feature is a “Skip missing tracks” preference.  It’s off by default, which is how the program has behaved in the past.  That is, if there is a track listed in a playlist that doesn’t exist on the microSD card, Just Playlists will stop play and display an error message when it encounters the track.  The nice thing about this is that it tells you which track is the problem so that you can fix it.  The downside is that you have to manually advance to the next track to restart play of the playlist.  This isn’t good if you’re doing something where you can’t easily get to your phone.  For instance, I use Just Playlists when I run and have the phone in a belt case.  If playback stops, it’s a real nuisance to get at the phone.  In this case, I’d rather that the bad track is skipped.  That’s what the new preference setting does.  When you load a playlist, it is scanned to make sure each track can be found on your microSD card.  If it can’t be found, it isn’t included in the playlist as loaded.  The downside here is that you could have a bunch of misspelled tracks in your playlist that will never get played.  Also, if you’re loading a really long playlist with hundreds or thousands of tracks, the load will take noticeably longer, since Just Playlists has to do the extra checking.  So, I’d suggest only enabling “Skip missing tracks” when you load a new playlist likely to have errors and you don’t want playback to stop.  This should never be a problem with playlists you create using the program, since you can’t add a bad track name.

Note that the program is only checking for missing tracks.  I originally also verified that the tracks were playable.  This worked but was unacceptably slow.  So a corrupted or unplayable track will still stop playback with an error message.  If I come up with a way of speeding up verification, I’ll add it in the future.

The other small improvement I made is in the “Show database” functionality.  If you display your database and delete an entry, the entry listing no longer refreshes to the top of the list.  It will remain at the position where you deleted the entry.  This makes it a lot easier to clean up old entries.

As to fixes, there was a case where the name of a previously-loaded playlist could have been displayed on the main screen after returning from the preferences screen.  This no longer happens.  Also, if you had used the playlist chooser or playlist creator screens to go into a directory that you then deleted from outside the program—such as using a file explorer program—going back to the chooser or creator would have shown a blank screen that you’d have been unable to navigate away from.  I’ve fixed this, such that you’ll end up at a reasonable location on your microSD card.

I’ll be working on the gesture-based controls and hopefully have this ready for the next release.  I’ve also found the need for something I hope to add in a future release.  This is a filtering capability for the “Now playing” screen, so a string can be entered and only matching tracks in the currently-loaded playlist will show.  That way, you can find a specific track in a playlist without having to manually scroll through the entire list.

Just Playlists 2.1.0—Filename Color Coding, Playlist Creation Ordering Options

March 19th, 2010

I’ve added a few small things to the program that are fairly helpful.  The most obvious is color coding for filename types.  Playlist files are now colored a shade of magenta in the playlist chooser and music files are colored blue in the playlist creation screens.  This helps to distinguish them from directories if they are mixed in with them, such as if you are saving playlists to the top-level of your microSD card.  I’ve also changed the color of selected directories and tracks to gold in the playlist creation screens, since this is more consistent with Android highlight colors and stands out better, especially with the blue music file coloring.

There is a new preference category under “Preferences” titled “Playlist creation options.”  The only option there now is “Sort alphabetically,” which is the default.  That is, unless you uncheck this option, when you create a playlist, all tracks will be sorted in ascending alphabetical order of filename in the resulting playlist.  In this case, I’m using “filename” to mean the complete filename with path.  Thus, the track with the name of “/sdcard/artist/album 01/01 – trackname.mp3” will come before “/sdcard/artist/album 02/01 – trackname.mp3”.  Now, if you uncheck the “Sort alphabetically” option, tracks will be listed in your new playlist in the order you selected them.  Thus, if you selected the second example track above before the first one, they would be ordered with the second track coming before the first in the resulting playlist.  This is handy if you want to explicitly order your music tracks in a playlist.

Things aren’t quite as obvious if you are selecting entire directories of tracks by long-pressing on album directories and choosing the “Select contents” item from the pop-up menu.  The results are what I think you’d expect.  If you select a bunch of single tracks from different albums and then select all the tracks for another album with a long-press on its directory, the album’s tracks will come after those selected before, with the album tracks ordered alphabetically.  I’m expecting that most people are naming their music files with track numbers as the first thing in the names, so alphabetical ordering will result in tracks ordered properly for albums.

Just to beat this into the ground, when ordering as selected is in effect and you long-press on an artist directory to select multiple albums, the albums will occur in alphabetical order in your playlist.  If you selected other tracks from other albums beforehand and select more after, they will come before and after the artist’s albums, respectively.

If the above is confusing, go ahead and give it a try and you’ll figure out how it works.  The reason I first decided to add the new option is that I was creating a playlist for an artist with several albums and wanted the albums ordered as they were released, from oldest to most recent.  Since the names of the albums didn’t happen to be alphabetized this way, I couldn’t make it work.  With this new option, it’s just a matter of selecting the albums from oldest to newest.

Finally, I added track tag info to the context (pop-up) menu headers for music files in the playlist creation screens.  This is just like what you see when long-pressing on a track name in the “Now playing” screen.

Rather than work next on the playlist editor, I’m going to be adding gesture-based control to the program.  That is, I want to be able to tap the artwork screen area to toggle playback and swipe there for next and previous track.  I tend to have problems hitting the right play control button when I have the phone hooked up to my car’s sound system and sitting on the dashboard, so I want a bigger target to aim my finger at!

Just Playlists 2.0.5—Playlist Creation, Screen Position Memory, Bug Fixes

March 15th, 2010

I’ve finally finished adding the ability to create M3U playlist files from within Just Playlists.  The item “Create Playlist” can be found in the main screen’s menu.  You will be presented with a directory listing of your microSD card—the /sdcard/Music folder if you have one or /sdcard if you don’t.  Here, you can select music tracks that you want to save in a new playlist.  You can tap on any directory to dive into it or, with a long press, you can choose to select the contents of the directory.  This will tell the program to probe all the sub-directories down the tree under this directory and select all music tracks found.  When music tracks are selected, they are colored light purple, as are all directories containing selected tracks.  You can also go into directories that have tracks and select them individually by tapping them or long-pressing and choosing the appropriate pop-up menu item.  Tapping a selected track a second time will unselect it.  You can also unselect all tracks in a directory by long-pressing it and selecting the corresponding item from its pop-up menu.

Once you’ve selected all the music you want to put in your new playlist, use the “Menu” button on your phone to bring up the menu at the bottom of your screen.  You can clear all your selections by tapping “Clear selections” or save your selections by tapping “Save to playlist”.  Doing this will bring up a dialog box into which you can enter the name of your new playlist.  If you try to save a playlist with the same name as an existing one, you’ll be told this and given the choice to either overwrite the existing playlist or cancel the save.  The name you use for your playlist will end up being the name of the M3U playlist file that is saved to your microSD card.  The entire name will include the .m3u extension.  Just Playlists will save the playlist file to the last directory from which you loaded a playlist file or the /sdcard top-level directory, if you’ve never opened a playlist file.  Once you’ve saved a playlist, to load it, just use the playlist load button on the main screen to list the contents of your microSD card and browse to where it was saved.

Saving your selections to a playlist file doesn’t clear your selections.  The idea here is that you can save a playlist, go back and change the selections, and then save a slightly different playlist without re-selecting everything.  If you don’t want to do this, just make sure to use the “Clear selections” menu item before selecting files for your next playlist.

If you want to delete an existing playlist, you can either overwrite it as described above or go to the playlist loading screen, long-press the filename, and choose the pop-up “Delete file” item.

Along with the ability to create playlists, I also gave the program the ability to keep track of where you last were in any directory, in both the playlist creator and playlist loader screens.  This keeps you from having to scroll around as much.  Another help with reducing scrolling is the added ability to go up one level by tapping on the current directory name at the bottom of the screen.  It will briefly flash blue as it takes you up to the next directory above the one you’re in.  Thus, you don’t need to scroll to the top of the screen and tap the “..”, which will also pop you up by one level as it has done in the past.

Those are the major changes to the program.  I fixed a few bugs that could have resulted in the spontaneous reloading of playlists, as well as having tweaked display line widths, menu capitalizations, etc.

For the next version of the program, I’d like to pretty up the interface a bit.  I’m also considering adding the ability to edit existing playlist files.  First priority will be any bugs found, as always.

Just Playlists 1.6.6—Bug Fix: Rotation While Loading a Playlist Sometimes Reset Last Playlist

February 26th, 2010

I found and fixed a fairly nasty bug in Just Playlists, so I’m releasing a new version, even though the last one hasn’t been out long.

If you were on the playlist chooser screen, clicked on a playlist, and then happened to rotate your phone during the load, the save data for the last playlist you were using could have been corrupted, so that the next time you loaded it, it would have forgotten where you were and would ask if you wanted to shuffle it.  Also, if you exited and re-ran the program, it may have started without a playlist loaded, just like the first time you ran the program after installing it.  I’ve corrected both problems.

While I was at it, I also added a clickable link to this blog in the “About…” dialog box.

Just Playlists 1.6.5—Faster Track Information Display Transitions, Text Crawls, Bug Fixes

February 23rd, 2010

I’ve managed to shorten the time it takes to load the artwork and tag information as tracks change during continuous playback.  Most of the time, the track starts to play at almost the same time as the information loads on the screen and the seekbar resets to 0.  If you’re running other things on your phone or memory is short, it could affect the time things take to happen.  But, overall, it should work a lot better.

I also found a good way to enable long text lines to crawl across the screen, rather than just using ellipses to indicate some of the text has run off the screen.  I’ve implemented this wherever I could that made sense to me.

Beyond this, I found a few more bugs that could cause crashes or strange program behavior.  My favorite one was when my phone crashed and, after it restarted, Just Playlists thought that my playlist files had changed and started offering me the option to shuffle them.  As it turns out, sometimes the version of Android I have running on my phone seems to get confused about the time zone and sets file modification dates improperly.  Thus, Just Playlists sees the file as changed because of the new timestamp and offers to reload them from scratch.  To avoid this, I now store the playlist files’ MD5 checksums and only consider a file to have been changed if this changes.  Thus, the actual content of the file must change and not just its last modified timestamp.

As I stated in a previous post, the next enhancement to the program will be a playlist creator/editor.  This will probably be a bit of work, so the next update might not be for a while, unless I find or hear about a major bug in the current version.  I hope I can also roll out the playlist editor in increments, adding features over time.

Just Playlists 1.5.2—Show Database, Notification Preference Setting

February 14th, 2010

Time for a new version of Just Playlists.  In this version, the “Show Database” option menu item is active.  It shows the contents of the program’s database, which is where information is saved about each playlist you’ve used.  There is one entry per playlist, with a variety of data saved that allows the program to start playing a playlist from where you left off the last time you used it.  You can delete an entry by long-clicking on it.  The only entry you can’t delete is the top one—which is the currently-loaded playlist.  Entries are sorted in descending order by the date they were last loaded.  The currently-loaded playlist’s entry is the first and the playlist you haven’t loaded in the longest time is at the bottom.  Deleting a playlist entry doesn’t delete the playlist file from your microSD card.  Thus, deleting any entry for a playlist is pretty much the same as setting it up to reload from scratch—after deleting the entry, the next time you load the playlist, you’ll be asked if you want to shuffle it or not and a new database entry will be created.

The only time may want to delete a playlist entry is if you have deleted the playlist M3U file from your microSD card.  Once you’ve done this, you’ll see that the database entry for that playlist will say “File not found” in yellow text for the “File mod time” database field of the entry.  There is no modification time because the file no longer exists.  Leaving the database entry in the database doesn’t hurt anything, but it’s nice not to have unused stuff cluttering up the database.  If you have a huge number of unused entries, it could slow down the program a bit, so this is another reason you may want to delete “orphaned” entries.

The new preference I’ve added allows you to tell the program not to display its icon in the notification bar when it isn’t actively playing a song.  This is how the default Android music player works.  I prefer having the notification icon showing whenever the program is running—just so I can get back to it from any screen.  If it bugs you to have it showing, unchecking the option in the “Preferences” screen will take care of it.

For the next version of the program, I’m going to see if I can speed up the load time of the album artwork and track information when the next track starts playing during a regular playback session.  Right now, it can take a second or more for the info to load after the new track starts playing.  After that, I’ll take a look at creating a built-in playlist creator/editor for the program.  I haven’t considered this a high priority, since it seems to me creating complex playlists is going to be cumbersome on the phone compared to doing it on a computer and then uploading.  But for quick, small playlists, it could be handy.

Just Playlists 1.4.2—Minor Improvements and Bug Fixes

February 7th, 2010

Though I don’t have the “Show Database” feature ready yet, I improved a couple things and fixed some bugs that make a release worth it.  The bugs may have caused crashes when you rapidly changed between playlists or used the “Show Playlist” menu item.  As to the improvements, first, if you use the “Show Playlist” menu item to see the contents of the current playlist, the current track will be highlighted in green text.  In 1.4.1, the track won’t be updated if you have the playlist screen open when the next song begins to play.  In 1.4.2, it will.  If you leave the playlist screen open, the currently-playing track will always be in green and at the top of the screen.

The other improvement is sort of a bug fix.  It’s actually more of a workaround for a problem with Android’s Java implementation.  When using Just Playlists, you may have had the track’s artwork not show up even though you have artwork embedded in the file.  This shouldn’t happen any longer—unless the artwork really isn’t there.

For the curious, here are the gory details.  I use Java’s getCanonicalPath() method to turn the track name read in from an M3U playlist file into a fully-qualified file path with all relative references resolved.  This is used as a lookup key for ID3 tag information in Android’s database of scanned media information.  But, there seems to be a bug in Android’s Java implementation such that every so often, the method will throw a NoSuchElementException.  This isn’t supposed to happen.  According to Google’s issue tracker, this is a known problem in Android 2.0 and will be fixed in a future release.  So, it may not be happening any longer in Android 2.0.1 and 2.1.  I’ve also seen it in version 1.6.  I’ve added a try/catch block that handles this exception and uses the un-resolved track name from the M3U file if need be.  The key derived from this isn’t guaranteed to be unique in the media database, but it most likely will be and so will retrieve the proper ID3 tag info—including the artwork for the track.

Just Playlists 1.4.1—Show Current Playlist, Choose Any Track to Play

January 31st, 2010

It’s time for another upgrade to the program.  Besides a few more small tweaks and fixes here and there, I’ve added a “Show Playlist” menu item to the main screen options menu (the one that appears when you press the “Menu” button”).  This will show the contents of the current playlist, in the current play order.  That is, if you chose to shuffle the list, it will be shown shuffled, with the currently playing track highlighted in green text.  The tracks are numbered in the order they’ll be played.  You can touch any track to start playing it.  And, if you touch and hold a track, a pop-up context menu will appear, with the ID3 tag information as the menu header.  The track information displayed in the list isn’t from the ID3 tags of the track files.  It’s taken from the playlist filename itself, with the track file’s name sans extension shown first, the directory it is in next, and the next directory level up shown after that.  I use this info instead of the tag info because it loads faster.  It’s also nice to be able to see the file names if you’re like me and name in “artist/album/tracknumber – trackname” fashion.  If you need to see the tag info for a track, just touch and hold for the pop-up info.

You’ll also notice a “Show Database” menu item.  Right now, it doesn’t do anything but display a “Coming Soon” informational message.  For the next release, this item will bring up a display of all the saved information for each playlist you’ve played.  It will also allow you to delete any of the saved entries.  This is particularly handy for cleaning out old entries for which there are no longer playlist files on your microSD card.  The entries don’t take much space in the program’s internal database, so if you never use this feature, it’s not a big deal and won’t affect Just Playlist’s performance.  But this gives you control of a previously-hidden part of the program, which is almost always a good thing.

Just Playlists 1.3.1—Pop-up Menus When Choosing Playlists, Minor Tweaks

January 21st, 2010

I’ve added a couple things to Just Playlists.  I debated holding off on releasing them until I get some more substantial work done on the program, but these are fairly useful additions.

First, I renamed the “Touch” item in the options menu to “Reload”.  Now, rather than just updating the current playlist for later reloading, you can choose to reload the playlist immediately.  For Just Playlists, a “reload” means reading the playlist in from the microSD card as if this is the first time the program has seen it.  You will be given the option to shuffle the playlist, and the saved track position will be deleted.  Also, the idea of touching a file is a Unix-y thing that may confuse a lot of people.

The second addition is context menus in the playlist load screen.  This means you can press and hold on a playlist name and see a pop-up menu.  This menu allows you to choose to either load the playlist to where you left off last time you used it, or you can choose to reload the playlist from scratch, without using the saved position information from the last time you used the playlist.  The load option is identical to simply touching the playlist name, which works the same as previously.

One last change was made due to feedback from a program user (thanks Eric!).  The music file names in your playlist files can now use either forward slashes or back slashes between each element in the filename’s path.  In the past, you could only use forward slashes.  This may be helpful if you export M3U playlists out of Windows Media Player, which uses back slashes.

Just Playlists 1.2.0—Bluetooth Headset Controls

January 16th, 2010

I’ve upgraded Just Playlists—up to version 1.2.0 now.  I did some behind-the-scenes stuff to make it behave better, but the major thing is the addition of the ability to enable control of the player via your Bluetooth headset’s music control buttons.  The technical parlance for this is that you can now take advantage of Bluetooth’s AVRCP (Audio/Video Remote Control Profile).  If you have a Bluetooth headset that allows you to listen to music, it probably also has buttons for play/pause, next track, and previous track.  If you go into the preferences for Just Playlists, you can choose to enable these controls for use with the program.  The default is disabled.

It’s important to understand a little bit more about how Android handles Bluetooth headset buttons.  If you don’t have any other music player on your phone, the default Android music player program will receive headset button pushes, starting up if you push the play button and so on.  Other music playing programs that you download from the Market that can use Bluetooth headset controls should have a preference setting to enable/disable their ability to receive these button pushes.  Thus, if you enable another program to receive them, the default music program should no longer respond when you push a headset music control button.  If you enable more than one program to use the controls, you may have the wrong program respond to a button push.  Thus, I’d recommend only enabling one program at a time to receive these button pushes—and disable all of them if you want the default music player to respond.

If you enable Just Playlists to respond to button pushes, it won’t start playing when you push a button unless it is already running.  I decided I don’t like a music program starting up on its own if I accidently hit one of the control buttons.  Once you’ve explicitly started Just Playlists, it will respond.

Once again, my only Android hardware is a G1, so if you use the Bluetooth control stuff on another type of phone and it doesn’t work as described, let me know.