Team Meow Mix Sorter Action
Needed Widgets: These are the widgets we feel are needed to author an mp3 sorter in Fluency.

Import Design
The import functionality allows the user to open an old mp3 database (XML file), add to the database, and create a new database. When a user clicks the import button, two things happen: the FileNameReaderWidget reads in a list of files, and the XMLReaderWidget reads in an XML file (if one exists). Both widgets send a list of filenames to the DiffWidget. The DiffWidget takes the filenames from the FileNameReaderWidget that are not in the XMLReaderWidget, and sends those filenames to the MP3Widget. The MP3Widget finds the mp3 data from the files' ID3 data (or from the names of the files, if no ID3 data exists). This MP3 data is then sent to the XMLWriter, where it is saved to an xml file. Once that is done, the new xml file is read by the XMLReaderWidget, and the data is sent to the Table to be displayed.

Export Design
The export functionality will allow a user of the mp3 sorter to save the changes that they have made to the stored mp3 database (an XML file). It is envoked by a button press, presumably a button labeled export. This button press in turn sends an ExportEvent to the Table Widget. The Table Widget has access to the Swing table which is responsible for displaying mp3 information. Upon receiving the ExportEvent, the Table Widget takes this mp3 information, which will reflect the changes made by the user, and sends it to the XML Writer Widget. Finally, the XML Writer Widget makes the appropriate changes to the mp3 database.

XML Database File
The sorted information for MP3s will be stored in an XML file. Each MP3 will be identified individually by its filename. MP3 attributes, such as artist, song name, and genre, will be in the DOM tree for each MP3 file. The XML database will be generated upon the export event and will grab its information from the TableWidget, which is editable by the user. An example XML file might look like as follows.
<mp3s> <mp3 filename="DaftPunk-DigitalLove.mp3"> <artist>Daft Punk</artist> <title>Digital Love</title> <album>Discovery</album> <genre>Electronic</genre> <year>2001</year> </mp3> <mp3 filename="TranceControl-TheWayHome.mp3"> <artist>t r a n c e [] c o n t r o l</artist> <title>The Way Home</title> <album>Beyond 2001: The Resurrection</album> <genre>Trance</genre> <year>2000</year> </mp3> </mp3s>






















Comments (6)
Sep 18, 2006
Adam Hinz says:
The MC Hammer widget continually checks that you have enough groovable music in ...The MC Hammer widget continually checks that you have enough groovable music in your library.
Sep 18, 2006
whoknows says:
gosh, and i didn't even know it was Hammer Time. gjer.gosh, and i didn't even know it was Hammer Time.
Sep 26, 2006
Micah Linnemeier says:
Do the XMLWriter and XMLReader know about MP3s? If not, what sort of data struct...Do the XMLWriter and XMLReader know about MP3s? If not, what sort of data structure do they receive/emit? Does the generic table widget know how to interpret this XML-like data? Or maybe the table is not meant to be generic?
How would you modify your design to allow for adding, deleting, and organizing mp3s in arbitrary categories? It seems like your design reads in the mp3s, turns them into XML, displays their data, and saves the XML, but never adds or manipulates anything.
Sep 27, 2006
Jaliya Ekanayake says:
DiffWidget is something we all need. Good concept. Team 2DiffWidget is something we all need. Good concept.
-Team 2
Sep 27, 2006
whoknows says:
i agree. this is a nice highlevel widget that will have a lot of uses. also: jus...i agree. this is a nice highlevel widget that will have a lot of uses.
also: just a sidenote on a related issue: a long time ago someone added ForLoopWidget. i never liked the idea, and perhaps for that reason it never gained traction inside fluency. it smacks way too much of an imperative programmer thinking too much like an imperative programmer and thus forcing the author to think too much about implementation. while DiffWidget might also be imperative it doesn't force the author to think at all about implementation. from the author's pov, how it's done is irrelevant, and that's always good.
-gjer
Sep 27, 2006
Russell Duhon says:
Yes, a diff widget is quite useful. I'll be posting a way to use the diffwidget ...Yes, a diff widget is quite useful. I'll be posting a way to use the diffwidget in my team's (Team -PI's) design to keep the application mp3 listing in synch with the filesystem's mp3s later today.
I don't even think a diffwidget is particularly imperative; diffing functions exist in purely functional languages, and the notion of a diff is rooted in set theory, not any particular programming implementation.
All hail the diff widget