Music Example

In this example we describe a music player as if we were operating it. We will see two kinds of tables in use, action and row. The action tables list things actions to be performed, step-by-step, one row at a time. Some actions will involve searching for music. We will check to be sure we've found the right music using a second kind of table, a row table. In the row table we will simply list each song, one per row, with columns showing different attributes of each song. We'll use these fixtures.

We'll write the remainder of this page as if it were describing stories for the music library/player. We'll use italics when we want to point out features of the framework. You might as well run the example now before you continue reading.

This is our most realistic example short of the Sample Applications. See the MusicExampleObjectModel to understand all of the objects in play here.


Browsing Music

The music browser starts up looking at the whole library of songs. We specify the library (an advanced feature) so that we know what we are talking about in this document.

fit.ActionFixture
start Music.Browser  
enter library Music.txt
check total songs 37

This is a the file that library reads. It is tab separated text. Try downloading it and looking at it with a spreadsheet (Music.txt).

We can pick songs and see details of our selection as we go.

fit.ActionFixture
enter select 1
check title Akila
check artist Toure Kunda
enter select 2
check title American Tango
check artist Weather Report
check album Mysterious Traveller
check year 1974
check time 3.70
check genre Jazz
check size 4446151
enter select 7
check title Cellohachi Part 3
check artist Gideon Freudmann
check track 6 of 9

ActionFixture interprets the words in the first column. The actions operate on fields and buttons on the Browser screen we started in the first table. The Browser (or what ever other Fixtures we start) interprets the names in the second column. Each name maps to a method of the Browser. The third column provides data that are pass as arguments to Browser methods or compared with Browser method results.


The selected songs are displayed in a table.

Music.Display
title artist album year time() track()
Scarlet Woman Weather Report Mysterious Traveller 1974 5.72 6 of 7
American Tango Weather Report Mysterious Traveller 1974 3.70 2 of 7


fit.Summary

This document implements Ward Cunningham's FIT examples