Revised Design - Essential Widget List (Sep. 25, 2006) (work in progress as of 5:13PM!)
Visual Widgets
ListBox widget
Actions: refresh(no params), show(no params)
Emits:
Receives: listSorted
FileBrowser widget
Actions: refresh(no params), show(no params)
Emits:
Receives:
Non-Visual Widgets
MP3Sorter widget
Container that encapsulates the entire MP3 Sorter application widget.
Actions:
Emits:
Receives:
MainWindow widget
Container that encapsulates all visual widget components of the main window.
Actions:
Emits:
Receives:
CategorizerDialogWindow widget
Container that encapsulates all visual widget components of the Categorizer dialog window.
Actions:
Emits:
Receives:
ID3Reader widget
Delegates to an 3rd party ID3 reader library.
Actions: getID3Info(path to file, list of fields to fetch?)
Emits: gotID3Info - a DataEvent that contains the fetched ID3 info
Receives:
Database widget
Manages the DBMS.
Actions: populate(list of paths from the FileBrowser widget) - creates a new set of records in the DB for the requested list of files obtained from FileBrowser
Emits: databasePopulated
Receives: gotID3Info
CategorySort widget
Uses the strategy pattern to employ a number of different sorting algorithms.
Actions: sort(list of MP3s in some representation, ID3 field by which to sort)
Emits: listSorted
Receives:
SortingAlgorithm widget
Widgets that implement this type would delegate to a particular sorting algorithm such as qsort, heap sort, radix sort, which the CategorySort widget could employ to accomplish its task depending on the size of its input list.
Actions: sort(list of MP3s in some representation, ID3 field by which to sort)
Emits:
Receives:
Preliminary Discussion

Our design is fairly straightforward - the main interface consists of a parent window with a listbox widget, and a button to show a file finder dialog, and a button to refresh the list. Some central points:
For the filefinder (visual) widget, there is a treeview, which is piped to the textbox just above it, so that the textbox will always reflect what is selected in the treeview, but can also be used alone to manually enter a path. There is also the possibility for including a tab-autocompletion widget to work with it. Once "OK" is pressed, the selected directory will be sent out to the "Recurser" widget as its root to begin its recursive search of mp3's. The Recurser widget should be designed as a general tool for filesystem search, thus we will be passing the "if ends with .mp3" argument as its search condition.
As the Recurser finds files matching its criteria, it will interface with the DB widget to have them added to the database with blank ID3 information.After all files are added, the DB will then go through all its entries and populate their Artist/Genre/etc. fields via interface with the ID3 Reader Widget, which will be a wrapper for some freely available library.
For a database backend, we are tentatively going for Apache Derby (tentatively because we really know jack about database engine features). Each DB entry will contain a filename, as well as artist, album, genre, year, etc. from the ID3 tag (if present). This will allow quick and easy sorting into the gui display for browsing. The general goal (from my perspective) is to enable a utility similar to Windows Media Player or Amarok to be realized using Fluency. This means that after scanning the directory tree, no more interaction will occur with the filesystem-- instead resorting to the database for all file information.
Our sorting is controlled by a master sorting widget which employs the strategy pattern to switch between different sorting algorithms, based on which is appropriate for the size of the user's music collection. The sorting algorithms are of course encapsulated by their own widgets. The master sorting widget in addition knows about ID3 information on which the user might like to sort - for instance, the user might click a tab in the list box indicating that the user would like to sort the files based on this ID3 property (genre, length, bitrate, etc.) The list box would then fire an event to the master sorting widget to execute the proper sorting.
All of the individual widgets are registered with a master container widget that represents the MP3 Sorter, which handles some of the overarching logic.
Comments (2)
Sep 26, 2006
Micah Linnemeier says:
Why are the database widget and the master sorting widget mp3/id3 specific? Mayb...Why are the database widget and the master sorting widget mp3/id3 specific?
Maybe it would be better to have a generic database widget, and have the more specific widgets sit on the outside of the database.
How do the actions and events specifically act to create all the effects you specify? In particular, I'm wondering about the overarching logic part.
How would you modify your design to allow the creation and deletion of arbitrary tags/labels/groupings of mp3s?
Sep 26, 2006
Micah Linnemeier says:
This is Team PI, btw.This is Team -PI, btw.