                         // Adding performance to clouad
                         appDelegate.performanceStore.addNew(performance: performance)
                         // Reset view controller
-                        self.newRecordingView()
+                        newRecordingView()
 
                         // TODO: Maybe it is best to delete the view controller to save memory?
 

                print("JAMVC: Save button segue!")

                if mode == ChirpJamModes.composing {

                    // TODO: Store composing performances
                    print("Need implementation for storing compositions...")

                    while let perf = self.performanceViews.popLast() {
                        perf.removeFromSuperview()
                    }

                    self.newRecordingView()

                    return
                }


class ChirpJamViewController: UIViewController, UIDocumentInteractionControllerDelegate, BrowseControllerDelegate {
    /// Maximum allowed recording time.
    
    var state = ChirpJamModes.idle // Tells us if the app is playing, recording or idle
    var mode = ChirpJamModes.new // Tells us which mode the chirp jam is in: new, composing, loaded
    
    var newPerformance : Bool = true
    var jamming : Bool = false
    var progress = 0.0
