Dr. Dobb's is part of the Informa Tech Division of Informa PLC

This site is operated by a business or businesses owned by Informa PLC and all copyright resides with them. Informa PLC's registered office is 5 Howick Place, London SW1P 1WG. Registered in England and Wales. Number 8860726.

Channels ▼


Your Own MP3 Duration Calculator: Part 2

Gigi Sayfan specializes in cross-platform object-oriented programming in C/C++/ C#/Python/Java with emphasis on large-scale distributed systems. He is currently trying to build intelligent machines inspired by the brain at Numenta (www.numenta.com).

In Your Own MP3 Duration Calculator: Part 1, I presented a program called "MP3 Duration Calculator" (MDC) that I wrote for my wife Liat who recently completed certification as a spinning instructor. Spinning instructors need to create CDs with music for each class that matches the class content and MDC allows Liat to quickly select different song ands see the total duration of all the songs.

Liat was excited and started browsing her music collection and selecting songs for her first ever spinning class. She was marginally pleased with the interface but complained that the total duration text box is a little obscure. Then something terrible happend! Liat had already selected a bunch of songs and by accident clicked without holding control on another songs. Her entire selection was gone and replaced with the single last song. That was pretty late (about 2:00 a.m.) and her class was scheduled for 8:00 a.m. Liat was upset and re-selected all the songs again. Finally, all the songs were there and it was time to burn the CD. That's when we discovered that we ran out of blank CDs. Alas, Liat brought several commercial CDs to her first spinning class and swapped them manually.

So, it wasn't the best software debut ever. The good thing is that there was a lot of room for improvement. Liat ran into a few other issues. When selecting songs, she sometimes didn't recognize the song's name or just wanted to listen to it to make sure it's appropriate. She had to go to Windows Explorer, find the song, and click on it to being up the Windows Media Player. This process was tedious and broke the flow of selecting songs. After selecting all the songs, she had to manually select them again in Windows Explorer to burn them. Finally, Liat also wanted to print a list of all the songs and their duration. Obviously it was time for Version 2.0.

New Requirements

Before launching into full-blown development, we sat down and compiled the following list of requirements for MDC 2.0:

  • Make total duration more prominent
  • Check boxes for selection (one song toggle)
  • Show # of selected songs
  • Play songs from within MDC
  • Copy selected songs to a new folder
  • Export song list to a CSV file
  • Remember last folder

One of the main features of MDC 1.0 was its interactivity. Collecting the track information can take a while for folders with tens or hundreds of songs. MDC was never blocked. You could always do the all the selection operations you wanted on the available subset of songs and MDC displayed the total duration. I wanted to preserve this capability for MDC 2.0 where the user will be able to select and also play songs while more tracks are collected.

Related Reading

More Insights

Currently we allow the following HTML tags in comments:

Single tags

These tags can be used alone and don't need an ending tag.

<br> Defines a single line break

<hr> Defines a horizontal line

Matching tags

These require an ending tag - e.g. <i>italic text</i>

<a> Defines an anchor

<b> Defines bold text

<big> Defines big text

<blockquote> Defines a long quotation

<caption> Defines a table caption

<cite> Defines a citation

<code> Defines computer code text

<em> Defines emphasized text

<fieldset> Defines a border around elements in a form

<h1> This is heading 1

<h2> This is heading 2

<h3> This is heading 3

<h4> This is heading 4

<h5> This is heading 5

<h6> This is heading 6

<i> Defines italic text

<p> Defines a paragraph

<pre> Defines preformatted text

<q> Defines a short quotation

<samp> Defines sample computer code text

<small> Defines small text

<span> Defines a section in a document

<s> Defines strikethrough text

<strike> Defines strikethrough text

<strong> Defines strong text

<sub> Defines subscripted text

<sup> Defines superscripted text

<u> Defines underlined text

Dr. Dobb's encourages readers to engage in spirited, healthy debate, including taking us to task. However, Dr. Dobb's moderates all comments posted to our site, and reserves the right to modify or remove any content that it determines to be derogatory, offensive, inflammatory, vulgar, irrelevant/off-topic, racist or obvious marketing or spam. Dr. Dobb's further reserves the right to disable the profile of any commenter participating in said activities.

Disqus Tips To upload an avatar photo, first complete your Disqus profile. | View the list of supported HTML tags you can use to style comments. | Please read our commenting policy.