         }
     }
 
-    var savedMessages: [SMMessage] {
-        return history.savedMessages
+}
+
+extension Document {
+
+    // MARK: Window controllers
+
+    override func makeWindowControllers() {
+        addWindowController(MonitorWindowController())
     }
 
     var monitorWindowController: MonitorWindowController? {

import Cocoa

class Document: NSDocument {

    // TODO Reorganize, make things private, etc.

    private let midiMonitorFileType = "com.snoize.midimonitor"
    private let midiMonitorErrorDomain = "com.snoize.midimonitor"

    private(set) var windowSettings: [String: Any]?

    // MIDI processing
    private let stream = CombinationInputStream()
    private let messageFilter = SMMessageFilter()
    private let history = SMMessageHistory()

    // Transient data
    private var isSysExUpdateQueued = false

    override class var autosavesInPlace: Bool {
        return true
    }

    override init() {
        super.init()

        filterMask = SMMessageType(rawValue: newMask)
    }

    var isShowingAllChannels: Bool {
        return messageFilter.channelMask == SMChannelMaskAll
    }
