Big Mouth Billy Bass automation library

Dependents:   BillyBass_with_SD

Revision:
3:6c91a6232c4a
Parent:
2:eaba75af0f0d
Child:
4:f009306756b3
--- a/song.hpp	Tue Jun 18 06:12:48 2013 +0000
+++ b/song.hpp	Tue Jun 18 13:11:07 2013 +0000
@@ -21,7 +21,11 @@
         fullname[0] = 0;
         actions.reserve(MAX_ACTIONS_PER_SONG);
     }
-
+    ~Song() {
+        actions.clear();
+    }
+    
+    BillyBass * myFish() { return BillyBass::bassNumber(whichFish); }
     bool isValid() const {
         return basename != 0 && whichFish != NO_FISH;
     }
@@ -48,11 +52,11 @@
         return actions;
     }
 
-    void print(Serial &pc) {
-        pc.printf("%s fish=%u seq=%u\r\n", getSampleFileName(), whichFish, sequenceNumber);
+    void print(FILE *f) {
+        fprintf(f, "%s fish=%u seq=%u\r\n", getSampleFileName(), whichFish, sequenceNumber);
         for (actions_t::const_iterator action_it = actions.begin(); action_it != actions.end(); action_it++) {
             Action const &action = *action_it;
-            pc.printf("%0.02f %s %d\r\n", action.actionTime, action.outputName, action.desiredState ? 1 : 0);
+            fprintf(f, "%0.02f %s %d\r\n", action.actionTime, action.outputName, action.desiredState ? 1 : 0);
         }
     }